From fa80356e3b7ae751dfe55b51d07deccbd3086b13 Mon Sep 17 00:00:00 2001 From: "astha.jain" Date: Mon, 27 Sep 2021 15:40:17 -0400 Subject: [PATCH 1/2] feat(release): Update SDK to use API version 2021-09-21 --- .travis.yml | 2 +- ibm_vpc/vpc_v1.py | 4494 +++++++++++++++++++++++++-------- requirements.txt | 2 +- test/integration/test_gen2.py | 62 +- test/unit/test_vpc_v1.py | 1879 +++++++++++--- 5 files changed, 4984 insertions(+), 1455 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4575943..3e67d84 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,7 +27,7 @@ script: tox before_deploy: - pip install bump2version -- nvm install 12 +- nvm install v14.17.0 - npm install @semantic-release/changelog - npm install @semantic-release/exec - npm install @semantic-release/git diff --git a/ibm_vpc/vpc_v1.py b/ibm_vpc/vpc_v1.py index 8d64f33..157c97a 100644 --- a/ibm_vpc/vpc_v1.py +++ b/ibm_vpc/vpc_v1.py @@ -48,7 +48,7 @@ class VpcV1(BaseService): @classmethod def new_instance(cls, - version: str = '2021-06-29', + version: str = '2021-09-21', service_name: str = DEFAULT_SERVICE_NAME, generation: int = 2, ) -> 'VpcV1': @@ -73,7 +73,7 @@ def new_instance(cls, return service def __init__(self, - version: str = '2021-06-29', + version: str = '2021-09-21', authenticator: Authenticator = None, generation: int = 2, ) -> None: @@ -125,10 +125,8 @@ def list_vpcs(self, :param str resource_group_id: (optional) Filters the collection to resources within one of the resource groups identified in a comma-separated list of resource group identifiers. - :param bool classic_access: (optional) The `classic_access` parameter - filters the returned collection by the supplied field. If the supplied - field is `true`, only Classic Access VPCs will be returned. If the supplied - field is `false`, only VPCs without Classic Access will be returned. + :param bool classic_access: (optional) Filters the collection to VPCs with + the specified `classic_access` 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 `VPCCollection` object @@ -2445,11 +2443,10 @@ def list_subnet_reserved_ips(self, 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 - field name in ascending order. A `-` may be prepended to the field name to - sort in descending order. For example, the value - `-created_at` sorts the collection by the `created_at` field in descending - order, and the value `name` sorts it by the `name` field in ascending - order. + 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 `ReservedIPCollection` object @@ -3151,8 +3148,10 @@ def create_key(self, information necessary to create the new key. The public key value must be provided. - :param str public_key: A unique public SSH key to import, encoded in PEM - format. The key (prior to encoding) must be either 2048 or 4096 bits long. + :param str public_key: A unique public SSH key to import, in OpenSSH format + (consisting of three space-separated fields: the algorithm name, + base64-encoded key, and a comment). The algorithm and comment fields may be + omitted, as only the key field is imported. :param str name: (optional) The unique user-defined name for this key. If unspecified, the name will be a hyphenated list of randomly-selected words. :param ResourceGroupIdentity resource_group: (optional) The resource group @@ -3483,7 +3482,12 @@ def create_instance_template(self, """ Create an instance template. - This request creates a new instance template. + This request creates a new instance template. The prototype object is structured + in the same way as a retrieved instance template, and contains the information + necessary to provision a new instance from the template. + If a `source_template` is specified in the prototype object, its contents are + copied into the new template prior to copying any other properties provided in the + prototype object. :param InstanceTemplatePrototype instance_template_prototype: The instance template prototype object. @@ -3686,6 +3690,9 @@ def list_instances(self, 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, **kwargs ) -> DetailedResponse: """ @@ -3713,6 +3720,12 @@ def list_instances(self, instances on the dedicated host with the specified CRN. :param str dedicated_host_name: (optional) Filters the collection to instances on the dedicated host with the specified name. + :param str placement_group_id: (optional) Filters the collection to + instances in the placement group with the specified identifier. + :param str placement_group_crn: (optional) Filters the collection to + instances in the placement group with the specified CRN. + :param str placement_group_name: (optional) Filters the collection to + instances in the placement group with the specified name. :param dict headers: 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 @@ -3736,7 +3749,10 @@ def list_instances(self, 'vpc.name': vpc_name, 'dedicated_host.id': dedicated_host_id, 'dedicated_host.crn': dedicated_host_crn, - 'dedicated_host.name': dedicated_host_name + 'dedicated_host.name': dedicated_host_name, + 'placement_group.id': placement_group_id, + 'placement_group.crn': placement_group_crn, + 'placement_group.name': placement_group_name } if 'headers' in kwargs: @@ -5149,8 +5165,8 @@ def create_instance_group(self, This request creates a new instance group. - :param InstanceTemplateIdentity instance_template: Instance template to use - when creating new instances. + :param InstanceTemplateIdentity instance_template: Identifies an instance + template by a unique property. :param List[SubnetIdentity] subnets: The subnets to use when creating new instances. :param int application_port: (optional) Required if specifying a load @@ -7327,6 +7343,276 @@ def update_dedicated_host(self, response = self.send(request) return response + ######################### + # Placement groups + ######################### + + + def list_placement_groups(self, + *, + start: str = None, + limit: int = None, + **kwargs + ) -> DetailedResponse: + """ + List all placement groups. + + This request lists all placement groups in the region. + + :param str start: (optional) A server-supplied token determining what + resource to start the page on. + :param int limit: (optional) The number of resources to return on a page. + :param dict headers: A `dict` containing the request headers + :return: A `DetailedResponse` containing the result, headers and HTTP status code. + :rtype: DetailedResponse with `dict` result representing a `PlacementGroupCollection` object + """ + + headers = {} + sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='list_placement_groups') + headers.update(sdk_headers) + + params = { + 'version': self.version, + 'generation': self.generation, + 'start': start, + 'limit': limit + } + + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + headers['Accept'] = 'application/json' + + url = '/placement_groups' + request = self.prepare_request(method='GET', + url=url, + headers=headers, + params=params) + + response = self.send(request) + return response + + + def create_placement_group(self, + strategy: str, + *, + name: str = None, + resource_group: 'ResourceGroupIdentity' = None, + **kwargs + ) -> DetailedResponse: + """ + Create a placement group. + + This request creates a new placement group. + + :param str strategy: The strategy for this placement group + - `host_spread`: place on different compute hosts + - `power_spread`: place on compute hosts that use different power sources + The enumerated values for this property may expand in the future. When + processing this property, check for and log unknown values. Optionally halt + processing and surface the error, or bypass the placement group on which + the unexpected strategy was encountered. + :param str name: (optional) The unique user-defined name for this placement + group. If unspecified, the name will be a hyphenated list of + randomly-selected words. + :param ResourceGroupIdentity resource_group: (optional) The resource group + to use. If unspecified, the account's [default resource + group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is + used. + :param dict headers: A `dict` containing the request headers + :return: A `DetailedResponse` containing the result, headers and HTTP status code. + :rtype: DetailedResponse with `dict` result representing a `PlacementGroup` object + """ + + if strategy is None: + raise ValueError('strategy 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_placement_group') + headers.update(sdk_headers) + + params = { + 'version': self.version, + 'generation': self.generation + } + + data = { + 'strategy': strategy, + 'name': name, + 'resource_group': resource_group + } + data = {k: v for (k, v) in data.items() if v is not None} + data = json.dumps(data) + headers['content-type'] = 'application/json' + + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + headers['Accept'] = 'application/json' + + url = '/placement_groups' + request = self.prepare_request(method='POST', + url=url, + headers=headers, + params=params, + data=data) + + response = self.send(request) + return response + + + def delete_placement_group(self, + id: str, + **kwargs + ) -> DetailedResponse: + """ + Delete a placement group. + + This request deletes a placement group. This operation cannot be reversed. For + this request to succeed, the placement group must not be associated with an + instance. + + :param str id: The placement group identifier. + :param dict headers: A `dict` containing the request headers + :return: A `DetailedResponse` containing the result, headers and HTTP status code. + :rtype: DetailedResponse + """ + + if id is None: + raise ValueError('id must be provided') + headers = {} + sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='delete_placement_group') + headers.update(sdk_headers) + + params = { + 'version': self.version, + 'generation': self.generation + } + + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + + path_param_keys = ['id'] + path_param_values = self.encode_path_vars(id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/placement_groups/{id}'.format(**path_param_dict) + request = self.prepare_request(method='DELETE', + url=url, + headers=headers, + params=params) + + response = self.send(request) + return response + + + def get_placement_group(self, + id: str, + **kwargs + ) -> DetailedResponse: + """ + Retrieve a placement group. + + This request retrieves a single placement group specified by identifier in the + URL. + + :param str id: The placement 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 `PlacementGroup` object + """ + + if id is None: + raise ValueError('id must be provided') + headers = {} + sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='get_placement_group') + headers.update(sdk_headers) + + params = { + 'version': self.version, + 'generation': self.generation + } + + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + headers['Accept'] = 'application/json' + + path_param_keys = ['id'] + path_param_values = self.encode_path_vars(id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/placement_groups/{id}'.format(**path_param_dict) + request = self.prepare_request(method='GET', + url=url, + headers=headers, + params=params) + + response = self.send(request) + return response + + + def update_placement_group(self, + id: str, + placement_group_patch: 'PlacementGroupPatch', + **kwargs + ) -> DetailedResponse: + """ + Update a placement group. + + This request updates a placement group with the information provided placement + group patch. The placement group patch object is structured in the same way as a + retrieved placement group and contains only the information to be updated. + + :param str id: The placement group identifier. + :param PlacementGroupPatch placement_group_patch: The placement 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 `PlacementGroup` object + """ + + if id is None: + raise ValueError('id must be provided') + if placement_group_patch is None: + raise ValueError('placement_group_patch must be provided') + if isinstance(placement_group_patch, PlacementGroupPatch): + placement_group_patch = convert_model(placement_group_patch) + headers = {} + sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='update_placement_group') + headers.update(sdk_headers) + + params = { + 'version': self.version, + 'generation': self.generation + } + + data = json.dumps(placement_group_patch) + headers['content-type'] = 'application/merge-patch+json' + + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + headers['Accept'] = 'application/json' + + path_param_keys = ['id'] + path_param_values = self.encode_path_vars(id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/placement_groups/{id}'.format(**path_param_dict) + request = self.prepare_request(method='PATCH', + url=url, + headers=headers, + params=params, + data=data) + + response = self.send(request) + return response + ######################### # Volumes ######################### @@ -7765,11 +8051,10 @@ def list_snapshots(self, the collection to resources which have no source image or any existent source image, respectively. :param str sort: (optional) Sorts the returned collection by the specified - field name in ascending order. A `-` may be prepended to the field name to - sort in descending order. For example, the value - `-created_at` sorts the collection by the `created_at` field in descending - order, and the value `name` sorts it by the `name` field in ascending - order. + property name in ascending order. A `-` may be prepended to the name to + sort in descending order. For example, the value `-created_at` sorts the + collection by the `created_at` property in descending order, and the value + `name` sorts it by the `name` property in ascending order. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `SnapshotCollection` object @@ -12353,6 +12638,7 @@ def create_load_balancer_listener(self, certificate_instance: 'CertificateInstanceIdentity' = None, connection_limit: int = None, default_pool: 'LoadBalancerPoolIdentity' = None, + https_redirect: 'LoadBalancerListenerHTTPSRedirectPrototype' = None, policies: List['LoadBalancerListenerPolicyPrototype'] = None, **kwargs ) -> DetailedResponse: @@ -12365,13 +12651,26 @@ def create_load_balancer_listener(self, :param int port: The listener port number. Each listener in the load balancer must have a unique `port` and `protocol` combination. - :param str protocol: The listener protocol. Load balancers in the `network` - family support `tcp`. Load balancers in the `application` family support - `tcp`, `http`, and `https`. Each listener in the load balancer must have a - unique `port` and `protocol` combination. + :param str protocol: The listener protocol. Each listener in the load + balancer must have a unique `port` and `protocol` combination. Additional + restrictions: + - If this load balancer is in the `network` family, the protocol must be + `tcp`. + - If this listener has `https_redirect` specified, the protocol must be + `http`. + - If this listener is a listener's `https_redirect` target, the protocol + must be `https`. :param bool accept_proxy_protocol: (optional) If set to `true`, this listener will accept and forward PROXY protocol information. Supported by load balancers in the `application` family (otherwise always `false`). + Additional restrictions: + - If this listener has `https_redirect` specified, its + `accept_proxy_protocol` value must + match the `accept_proxy_protocol` value of the `https_redirect` listener. + - If this listener is the target of another listener's `https_redirect`, + its + `accept_proxy_protocol` value must match that listener's + `accept_proxy_protocol` value. :param CertificateInstanceIdentity certificate_instance: (optional) The certificate instance used for SSL termination. It is applicable only to `https` @@ -12383,6 +12682,11 @@ def create_load_balancer_listener(self, - Belong to this load balancer - Have the same `protocol` as this listener - Not already be the default pool for another listener. + :param LoadBalancerListenerHTTPSRedirectPrototype https_redirect: + (optional) The target listener that requests will be redirected to. This + listener must have a + `protocol` of `http`, and the target listener must have a `protocol` of + `https`. :param List[LoadBalancerListenerPolicyPrototype] policies: (optional) The policy prototype objects for this listener. :param dict headers: A `dict` containing the request headers @@ -12400,6 +12704,8 @@ def create_load_balancer_listener(self, 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 = {} @@ -12420,6 +12726,7 @@ def create_load_balancer_listener(self, 'certificate_instance': certificate_instance, 'connection_limit': connection_limit, 'default_pool': default_pool, + 'https_redirect': https_redirect, 'policies': policies } data = {k: v for (k, v) in data.items() if v is not None} @@ -12453,6 +12760,8 @@ def delete_load_balancer_listener(self, Delete a load balancer listener. 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 id: The listener identifier. @@ -12670,20 +12979,22 @@ def create_load_balancer_listener_policy(self, :param str load_balancer_id: The load balancer identifier. :param str listener_id: The listener identifier. :param str action: The policy action. + The enumerated values for this property are expected to expand in the + future. When processing this property, check for and log unknown values. + Optionally halt processing and surface the error, or bypass the policy on + which the unexpected property value was encountered. :param int priority: Priority of the policy. Lower value indicates higher priority. :param str name: (optional) The user-defined name for this policy. Names must be unique within the load balancer listener the policy resides in. :param List[LoadBalancerListenerPolicyRulePrototype] rules: (optional) The rule prototype objects for this policy. - :param LoadBalancerListenerPolicyTargetPrototype target: (optional) When - `action` is `forward`, `LoadBalancerPoolIdentity` is required to specify - which - pool the load balancer forwards the traffic to. When `action` is - `redirect`, - `LoadBalancerListenerPolicyRedirectURLPrototype` is required to specify the - url and - http status code used in the redirect response. + :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 `LoadBalancerListenerPolicy` object @@ -12991,7 +13302,7 @@ def create_load_balancer_listener_policy_rule(self, 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 field is required. + 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. @@ -14055,11 +14366,10 @@ def list_endpoint_gateway_ips(self, 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 - field name in ascending order. A `-` may be prepended to the field name to - sort in descending order. For example, the value - `-created_at` sorts the collection by the `created_at` field in descending - order, and the value `name` sorts it by the `name` field in ascending - order. + property name in ascending order. A `-` may be prepended to the name to + sort in descending order. For example, the value `-created_at` sorts the + collection by the `created_at` property in descending order, and the value + `name` sorts it by the `name` property in ascending order. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `ReservedIPCollectionEndpointGatewayContext` object @@ -14724,11 +15034,11 @@ class ListSubnetReservedIpsEnums: class Sort(str, Enum): """ - Sorts the returned collection by the specified field name in ascending order. A - `-` may be prepended to the field name to sort in descending order. For example, - the value - `-created_at` sorts the collection by the `created_at` field in descending order, - and the value `name` sorts it by the `name` field in ascending order. + 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' @@ -14755,11 +15065,11 @@ class ListSnapshotsEnums: class Sort(str, Enum): """ - Sorts the returned collection by the specified field name in ascending order. A - `-` may be prepended to the field name to sort in descending order. For example, - the value - `-created_at` sorts the collection by the `created_at` field in descending order, - and the value `name` sorts it by the `name` field in ascending order. + 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' @@ -14798,11 +15108,11 @@ class ListEndpointGatewayIpsEnums: class Sort(str, Enum): """ - Sorts the returned collection by the specified field name in ascending order. A - `-` may be prepended to the field name to sort in descending order. For example, - the value - `-created_at` sorts the collection by the `created_at` field in descending order, - and the value `name` sorts it by the `name` field in ascending order. + 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' @@ -15417,7 +15727,7 @@ class DedicatedHost(): 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 resource. + :attr str lifecycle_state: The lifecycle state of the dedicated host. :attr int memory: The total amount of memory in gibibytes for this host. :attr str name: The unique user-defined name for this dedicated host. If unspecified, the name will be a hyphenated list of randomly-selected words. @@ -15482,8 +15792,7 @@ def __init__(self, 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 - resource. + :param str lifecycle_state: The lifecycle state of the dedicated host. :param int memory: The total amount of memory in gibibytes for this host. :param str name: The unique user-defined name for this dedicated host. If unspecified, the name will be a hyphenated list of randomly-selected words. @@ -15696,7 +16005,7 @@ def __ne__(self, other: 'DedicatedHost') -> bool: class LifecycleStateEnum(str, Enum): """ - The lifecycle state of the dedicated host resource. + The lifecycle state of the dedicated host. """ DELETING = 'deleting' FAILED = 'failed' @@ -21610,11 +21919,11 @@ class IP(): """ IP. - :attr str address: The IP address. This property may add support for IPv6 - addresses in the future. When processing a value in this property, verify that - the address is in an expected format. If it is not, log an error. Optionally - halt processing and surface the error, or bypass the resource on which the - unexpected IP address format was encountered. + :attr str 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, @@ -21622,11 +21931,12 @@ def __init__(self, """ Initialize a IP 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 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.address = address @@ -23461,7 +23771,7 @@ class Instance(): Instance. :attr int bandwidth: The total bandwidth (in megabits per second) shared across - the virtual server instance's network interfaces. + the virtual server instance's network interfaces and storage volumes. :attr VolumeAttachmentReferenceInstanceContext boot_volume_attachment: Boot volume attachment. :attr datetime created_at: The date and time that the virtual server instance @@ -23497,6 +23807,12 @@ class Instance(): When 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 @@ -23522,6 +23838,8 @@ def __init__(self, startable: bool, status: str, status_reasons: List['InstanceStatusReason'], + total_network_bandwidth: int, + total_volume_bandwidth: int, vcpu: 'InstanceVCPU', volume_attachments: List['VolumeAttachmentReferenceInstanceContext'], vpc: 'VPCReference', @@ -23534,7 +23852,8 @@ def __init__(self, Initialize a Instance object. :param int bandwidth: The total bandwidth (in megabits per second) shared - across the virtual server instance's network interfaces. + across the virtual server instance's network interfaces and storage + volumes. :param VolumeAttachmentReferenceInstanceContext boot_volume_attachment: Boot volume attachment. :param datetime created_at: The date and time that the virtual server @@ -23565,6 +23884,12 @@ def __init__(self, future. When processing this property, check for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected 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 @@ -23598,6 +23923,8 @@ def __init__(self, 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 @@ -23677,6 +24004,14 @@ def from_dict(cls, _dict: Dict) -> 'Instance': args['status_reasons'] = [InstanceStatusReason.from_dict(x) for x in _dict.get('status_reasons')] else: raise ValueError('Required property \'status_reasons\' not present in Instance JSON') + if 'total_network_bandwidth' in _dict: + args['total_network_bandwidth'] = _dict.get('total_network_bandwidth') + else: + raise ValueError('Required property \'total_network_bandwidth\' not present in Instance JSON') + if 'total_volume_bandwidth' in _dict: + args['total_volume_bandwidth'] = _dict.get('total_volume_bandwidth') + else: + raise ValueError('Required property \'total_volume_bandwidth\' not present in Instance JSON') if 'vcpu' in _dict: args['vcpu'] = InstanceVCPU.from_dict(_dict.get('vcpu')) else: @@ -23744,6 +24079,10 @@ def to_dict(self) -> Dict: _dict['status'] = self.status if hasattr(self, 'status_reasons') and self.status_reasons is not None: _dict['status_reasons'] = [x.to_dict() for x in self.status_reasons] + if hasattr(self, 'total_network_bandwidth') and self.total_network_bandwidth is not None: + _dict['total_network_bandwidth'] = self.total_network_bandwidth + if hasattr(self, 'total_volume_bandwidth') and self.total_volume_bandwidth is not None: + _dict['total_volume_bandwidth'] = self.total_volume_bandwidth if hasattr(self, 'vcpu') and self.vcpu is not None: _dict['vcpu'] = self.vcpu.to_dict() if hasattr(self, 'volume_attachments') and self.volume_attachments is not None: @@ -27622,8 +27961,8 @@ class InstanceGroupPatch(): :attr int application_port: (optional) Required if specifying a load balancer pool only. Used by the instance group when scaling up instances to supply the port for the load balancer pool member. - :attr InstanceTemplateIdentity instance_template: (optional) Instance template - to use when creating new instances. + :attr InstanceTemplateIdentity instance_template: (optional) Identifies an + instance template by a unique property. :attr LoadBalancerIdentity load_balancer: (optional) The load balancer that the load balancer pool used by this group is in. Must be supplied when using a load balancer pool. @@ -27654,8 +27993,8 @@ def __init__(self, :param int application_port: (optional) Required if specifying a load balancer pool only. Used by the instance group when scaling up instances to supply the port for the load balancer pool member. - :param InstanceTemplateIdentity instance_template: (optional) Instance - template to use when creating new instances. + :param InstanceTemplateIdentity instance_template: (optional) Identifies an + instance template by a unique property. :param LoadBalancerIdentity load_balancer: (optional) The load balancer that the load balancer pool used by this group is in. Must be supplied when using a load balancer pool. @@ -27915,20 +28254,20 @@ class InstanceInitialization(): """ InstanceInitialization. - :attr List[KeyReferenceInstanceInitializationContext] keys: The public SSH keys - used at instance initialization. + :attr List[KeyReference] keys: The public SSH keys used at instance + initialization. :attr InstanceInitializationPassword password: (optional) """ def __init__(self, - keys: List['KeyReferenceInstanceInitializationContext'], + keys: List['KeyReference'], *, password: 'InstanceInitializationPassword' = None) -> None: """ Initialize a InstanceInitialization object. - :param List[KeyReferenceInstanceInitializationContext] keys: The public SSH - keys used at instance initialization. + :param List[KeyReference] keys: The public SSH keys used at instance + initialization. :param InstanceInitializationPassword password: (optional) """ self.keys = keys @@ -27939,7 +28278,7 @@ def from_dict(cls, _dict: Dict) -> 'InstanceInitialization': """Initialize a InstanceInitialization object from a json dictionary.""" args = {} if 'keys' in _dict: - args['keys'] = _dict.get('keys') + args['keys'] = [KeyReference.from_dict(x) for x in _dict.get('keys')] else: raise ValueError('Required property \'keys\' not present in InstanceInitialization JSON') if 'password' in _dict: @@ -27955,13 +28294,7 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'keys') and self.keys is not None: - keys_list = [] - for x in self.keys: - if isinstance(x, dict): - keys_list.append(x) - else: - keys_list.append(x.to_dict()) - _dict['keys'] = keys_list + _dict['keys'] = [x.to_dict() for x in self.keys] if hasattr(self, 'password') and self.password is not None: _dict['password'] = self.password.to_dict() return _dict @@ -27990,21 +28323,21 @@ class InstanceInitializationPassword(): :attr bytes encrypted_password: The administrator password at initialization, encrypted using `encryption_key`, and returned base64-encoded. - :attr KeyReferenceInstanceInitializationContext encryption_key: The public SSH - key used to encrypt the administrator password. + :attr KeyIdentityByFingerprint encryption_key: The public SSH key used to + encrypt the administrator password. """ def __init__(self, encrypted_password: bytes, - encryption_key: 'KeyReferenceInstanceInitializationContext') -> None: + encryption_key: 'KeyIdentityByFingerprint') -> None: """ Initialize a InstanceInitializationPassword object. :param bytes encrypted_password: The administrator password at initialization, encrypted using `encryption_key`, and returned base64-encoded. - :param KeyReferenceInstanceInitializationContext encryption_key: The public - SSH key used to encrypt the administrator password. + :param KeyIdentityByFingerprint encryption_key: The public SSH key used to + encrypt the administrator password. """ self.encrypted_password = encrypted_password self.encryption_key = encryption_key @@ -28018,7 +28351,7 @@ def from_dict(cls, _dict: Dict) -> 'InstanceInitializationPassword': else: raise ValueError('Required property \'encrypted_password\' not present in InstanceInitializationPassword JSON') if 'encryption_key' in _dict: - args['encryption_key'] = _dict.get('encryption_key') + args['encryption_key'] = KeyIdentityByFingerprint.from_dict(_dict.get('encryption_key')) else: raise ValueError('Required property \'encryption_key\' not present in InstanceInitializationPassword JSON') return cls(**args) @@ -28034,10 +28367,7 @@ def to_dict(self) -> Dict: if hasattr(self, 'encrypted_password') and self.encrypted_password is not None: _dict['encrypted_password'] = str(base64.b64encode(self.encrypted_password), 'utf-8') if hasattr(self, 'encryption_key') and self.encryption_key is not None: - if isinstance(self.encryption_key, dict): - _dict['encryption_key'] = self.encryption_key - else: - _dict['encryption_key'] = self.encryption_key.to_dict() + _dict['encryption_key'] = self.encryption_key.to_dict() return _dict def _to_dict(self): @@ -28069,19 +28399,24 @@ class InstancePatch(): the instance `status` must be `stopping` or `stopped`. In addition, the requested profile must: - - Match the current profile's instance disk support. (Note: If the current + - Have matching instance disk support. Any disks associated with the current profile - supports instance storage disks, the requested profile can have a different - instance storage disk configuration.) + will be deleted, and any disks associated with the requested profile will be + created. - Be compatible with any `placement_target` constraints. For example, if the instance is placed on a dedicated host, the requested profile `family` must be the same as the dedicated host `family`. + :attr int total_volume_bandwidth: (optional) The amount of bandwidth (in + megabits per second) allocated exclusively to instance storage volumes. An + increase in this value will result in a corresponding decrease to + `total_network_bandwidth`. """ def __init__(self, *, name: str = None, - profile: 'InstancePatchProfile' = None) -> None: + profile: 'InstancePatchProfile' = None, + total_volume_bandwidth: int = None) -> None: """ Initialize a InstancePatch object. @@ -28092,19 +28427,24 @@ def __init__(self, the instance `status` must be `stopping` or `stopped`. In addition, the requested profile must: - - Match the current profile's instance disk support. (Note: If the current - profile - supports instance storage disks, the requested profile can have a - different - instance storage disk configuration.) + - Have matching instance disk support. Any disks associated with the + current profile + will be deleted, and any disks associated with the requested profile will + be + created. - Be compatible with any `placement_target` constraints. For example, if the instance is placed on a dedicated host, the requested profile `family` must be the same as the dedicated host `family`. + :param int total_volume_bandwidth: (optional) The amount of bandwidth (in + megabits per second) allocated exclusively to instance storage volumes. An + increase in this value will result in a corresponding decrease to + `total_network_bandwidth`. """ self.name = name self.profile = profile + self.total_volume_bandwidth = total_volume_bandwidth @classmethod def from_dict(cls, _dict: Dict) -> 'InstancePatch': @@ -28114,6 +28454,8 @@ def from_dict(cls, _dict: Dict) -> 'InstancePatch': args['name'] = _dict.get('name') if 'profile' in _dict: args['profile'] = _dict.get('profile') + if 'total_volume_bandwidth' in _dict: + args['total_volume_bandwidth'] = _dict.get('total_volume_bandwidth') return cls(**args) @classmethod @@ -28131,6 +28473,8 @@ def to_dict(self) -> Dict: _dict['profile'] = self.profile else: _dict['profile'] = self.profile.to_dict() + if hasattr(self, 'total_volume_bandwidth') and self.total_volume_bandwidth is not None: + _dict['total_volume_bandwidth'] = self.total_volume_bandwidth return _dict def _to_dict(self): @@ -28156,9 +28500,9 @@ class InstancePatchProfile(): The profile to use for this virtual server instance. For the profile to be changed, the instance `status` must be `stopping` or `stopped`. In addition, the requested profile must: - - Match the current profile's instance disk support. (Note: If the current profile - supports instance storage disks, the requested profile can have a different - instance storage disk configuration.) + - 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`. @@ -28186,7 +28530,7 @@ def __init__(self) -> None: """ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['InstancePlacementTargetDedicatedHostGroupReference', 'InstancePlacementTargetDedicatedHostReference'])) + ", ".join(['InstancePlacementTargetDedicatedHostGroupReference', 'InstancePlacementTargetDedicatedHostReference', 'InstancePlacementTargetPlacementGroupReference'])) raise Exception(msg) class InstancePlacementTargetPrototype(): @@ -28201,7 +28545,7 @@ def __init__(self) -> None: """ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['InstancePlacementTargetPrototypeDedicatedHostIdentity', 'InstancePlacementTargetPrototypeDedicatedHostGroupIdentity'])) + ", ".join(['InstancePlacementTargetPrototypeDedicatedHostIdentity', 'InstancePlacementTargetPrototypeDedicatedHostGroupIdentity', 'InstancePlacementTargetPrototypePlacementGroupIdentity'])) raise Exception(msg) class InstanceProfile(): @@ -28219,6 +28563,7 @@ class InstanceProfile(): profile. :attr InstanceProfileOSArchitecture os_architecture: :attr InstanceProfilePortSpeed port_speed: + :attr InstanceProfileVolumeBandwidth total_volume_bandwidth: :attr InstanceProfileVCPUArchitecture vcpu_architecture: :attr InstanceProfileVCPU vcpu_count: """ @@ -28231,6 +28576,7 @@ def __init__(self, name: str, os_architecture: 'InstanceProfileOSArchitecture', port_speed: 'InstanceProfilePortSpeed', + total_volume_bandwidth: 'InstanceProfileVolumeBandwidth', vcpu_architecture: 'InstanceProfileVCPUArchitecture', vcpu_count: 'InstanceProfileVCPU', *, @@ -28247,6 +28593,7 @@ def __init__(self, profile. :param InstanceProfileOSArchitecture os_architecture: :param InstanceProfilePortSpeed port_speed: + :param InstanceProfileVolumeBandwidth total_volume_bandwidth: :param InstanceProfileVCPUArchitecture vcpu_architecture: :param InstanceProfileVCPU vcpu_count: :param str family: (optional) The product family this virtual server @@ -28260,6 +28607,7 @@ def __init__(self, self.name = name self.os_architecture = os_architecture self.port_speed = port_speed + self.total_volume_bandwidth = total_volume_bandwidth self.vcpu_architecture = vcpu_architecture self.vcpu_count = vcpu_count @@ -28297,6 +28645,10 @@ def from_dict(cls, _dict: Dict) -> 'InstanceProfile': args['port_speed'] = _dict.get('port_speed') else: raise ValueError('Required property \'port_speed\' not present in InstanceProfile JSON') + if 'total_volume_bandwidth' in _dict: + args['total_volume_bandwidth'] = _dict.get('total_volume_bandwidth') + else: + raise ValueError('Required property \'total_volume_bandwidth\' not present in InstanceProfile JSON') if 'vcpu_architecture' in _dict: args['vcpu_architecture'] = InstanceProfileVCPUArchitecture.from_dict(_dict.get('vcpu_architecture')) else: @@ -28340,6 +28692,11 @@ def to_dict(self) -> Dict: _dict['port_speed'] = self.port_speed else: _dict['port_speed'] = self.port_speed.to_dict() + if hasattr(self, 'total_volume_bandwidth') and self.total_volume_bandwidth is not None: + if isinstance(self.total_volume_bandwidth, dict): + _dict['total_volume_bandwidth'] = self.total_volume_bandwidth + else: + _dict['total_volume_bandwidth'] = self.total_volume_bandwidth.to_dict() if hasattr(self, 'vcpu_architecture') and self.vcpu_architecture is not None: _dict['vcpu_architecture'] = self.vcpu_architecture.to_dict() if hasattr(self, 'vcpu_count') and self.vcpu_count is not None: @@ -28968,18 +29325,35 @@ class TypeEnum(str, Enum): FIXED = 'fixed' +class InstanceProfileVolumeBandwidth(): + """ + InstanceProfileVolumeBandwidth. + + """ + + def __init__(self) -> None: + """ + Initialize a InstanceProfileVolumeBandwidth object. + + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['InstanceProfileVolumeBandwidthFixed', 'InstanceProfileVolumeBandwidthRange', 'InstanceProfileVolumeBandwidthEnum', 'InstanceProfileVolumeBandwidthDependent'])) + raise Exception(msg) + class InstancePrototype(): """ InstancePrototype. :attr List[KeyIdentity] keys: (optional) The public SSH keys for the - administrative user of the virtual server instance. Up to 10 keys may be - provided; if no keys are provided the instance will be inaccessible unless the - image used provides another means of access. For Windows instances, one of the - keys will be used to encrypt the administrator password. - 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. + administrative user of the virtual server instance. Keys will be made available + to the virtual server instance as cloud-init vendor data. For cloud-init enabled + images, these keys will also be added as SSH authorized keys for the + administrative user. + For Windows images, at least one key must be specified, and one will be chosen + to encrypt [the administrator + password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys + are optional for other images, but if no keys are specified, the instance will + be inaccessible unless the specified image provides another means of access. :attr str name: (optional) The unique user-defined name for this virtual server instance (and default system hostname). If unspecified, the name will be a hyphenated list of randomly-selected words. @@ -28992,6 +29366,10 @@ class InstancePrototype(): :attr ResourceGroupIdentity resource_group: (optional) The resource group to use. If unspecified, the account's [default resource group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. + :attr int total_volume_bandwidth: (optional) The amount of bandwidth (in + megabits per second) allocated exclusively to instance storage volumes. An + increase in this value will result in a corresponding decrease to + `total_network_bandwidth`. :attr str user_data: (optional) User data to be made available when setting up the virtual server instance. :attr List[VolumeAttachmentPrototypeInstanceContext] volume_attachments: @@ -29009,6 +29387,7 @@ def __init__(self, placement_target: 'InstancePlacementTargetPrototype' = None, profile: 'InstanceProfileIdentity' = None, resource_group: 'ResourceGroupIdentity' = None, + total_volume_bandwidth: int = None, user_data: str = None, volume_attachments: List['VolumeAttachmentPrototypeInstanceContext'] = None, vpc: 'VPCIdentity' = None) -> None: @@ -29016,13 +29395,16 @@ def __init__(self, Initialize a InstancePrototype object. :param List[KeyIdentity] keys: (optional) The public SSH keys for the - administrative user of the virtual server instance. Up to 10 keys may be - provided; if no keys are provided the instance will be inaccessible unless - the image used provides another means of access. For Windows instances, one - of the keys will be used to encrypt the administrator password. - 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. + administrative user of the virtual server instance. Keys will be made + available to the virtual server instance as cloud-init vendor data. For + cloud-init enabled images, these keys will also be added as SSH authorized + keys for the administrative user. + For Windows images, at least one key must be specified, and one will be + chosen to encrypt [the administrator + password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). + Keys are optional for other images, but if no keys are specified, the + instance will be inaccessible unless the specified image provides another + means of access. :param str name: (optional) The unique user-defined name for this virtual server instance (and default system hostname). If unspecified, the name will be a hyphenated list of randomly-selected words. @@ -29036,6 +29418,10 @@ def __init__(self, to use. If unspecified, the account's [default resource group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. + :param int total_volume_bandwidth: (optional) The amount of bandwidth (in + megabits per second) allocated exclusively to instance storage volumes. An + increase in this value will result in a corresponding decrease to + `total_network_bandwidth`. :param str user_data: (optional) User data to be made available when setting up the virtual server instance. :param List[VolumeAttachmentPrototypeInstanceContext] volume_attachments: @@ -29307,13 +29693,15 @@ class InstanceTemplate(): :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. Up to 10 keys may be - provided; if no keys are provided the instance will be inaccessible unless the - image used provides another means of access. For Windows instances, one of the - keys will be used to encrypt the administrator password. - 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. + administrative user of the virtual server instance. Keys will be made available + to the virtual server instance as cloud-init vendor data. For cloud-init enabled + images, these keys will also be added as SSH authorized keys for the + administrative user. + For Windows images, at least one key must be specified, and one will be chosen + to encrypt [the administrator + password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys + are optional for other images, but if no keys are specified, the instance will + be inaccessible unless the specified image provides another means of access. :attr str name: The unique user-defined name for this instance template. :attr List[NetworkInterfacePrototype] network_interfaces: (optional) The additional network interfaces to create for the virtual server instance. @@ -29323,6 +29711,10 @@ class InstanceTemplate(): virtual server instance. :attr ResourceGroupReference resource_group: The resource group for this instance template. + :attr int total_volume_bandwidth: (optional) The amount of bandwidth (in + megabits per second) allocated exclusively to instance storage volumes. An + increase in this value will result in a corresponding decrease to + `total_network_bandwidth`. :attr str user_data: (optional) User data to be made available when setting up the virtual server instance. :attr List[VolumeAttachmentPrototypeInstanceContext] volume_attachments: @@ -29344,6 +29736,7 @@ def __init__(self, network_interfaces: List['NetworkInterfacePrototype'] = None, placement_target: 'InstancePlacementTargetPrototype' = None, profile: 'InstanceProfileIdentity' = None, + total_volume_bandwidth: int = None, user_data: str = None, volume_attachments: List['VolumeAttachmentPrototypeInstanceContext'] = None, vpc: 'VPCIdentity' = None) -> None: @@ -29359,19 +29752,26 @@ def __init__(self, :param ResourceGroupReference resource_group: The resource group for this instance template. :param List[KeyIdentity] keys: (optional) The public SSH keys for the - administrative user of the virtual server instance. Up to 10 keys may be - provided; if no keys are provided the instance will be inaccessible unless - the image used provides another means of access. For Windows instances, one - of the keys will be used to encrypt the administrator password. - 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. + administrative user of the virtual server instance. Keys will be made + available to the virtual server instance as cloud-init vendor data. For + cloud-init enabled images, these keys will also be added as SSH authorized + keys for the administrative user. + For Windows images, at least one key must be specified, and one will be + chosen to encrypt [the administrator + password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). + Keys are optional for other images, but if no keys are specified, the + instance will be inaccessible unless the specified image provides another + means of access. :param List[NetworkInterfacePrototype] network_interfaces: (optional) The additional network interfaces to create for the virtual server instance. :param InstancePlacementTargetPrototype placement_target: (optional) The placement restrictions to use for the virtual server instance. :param InstanceProfileIdentity profile: (optional) The profile to use for this virtual server instance. + :param int total_volume_bandwidth: (optional) The amount of bandwidth (in + megabits per second) allocated exclusively to instance storage volumes. An + increase in this value will result in a corresponding decrease to + `total_network_bandwidth`. :param str user_data: (optional) User data to be made available when setting up the virtual server instance. :param List[VolumeAttachmentPrototypeInstanceContext] volume_attachments: @@ -29381,7 +29781,7 @@ def __init__(self, VPC tied to the subnets of the instance's network interfaces. """ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['InstanceTemplateInstanceByImage', 'InstanceTemplateInstanceByVolume', 'InstanceTemplateInstanceBySourceTemplate'])) + ", ".join(['InstanceTemplateInstanceByImage', 'InstanceTemplateInstanceByVolume'])) raise Exception(msg) class InstanceTemplateCollection(): @@ -29683,13 +30083,15 @@ class InstanceTemplatePrototype(): InstanceTemplatePrototype. :attr List[KeyIdentity] keys: (optional) The public SSH keys for the - administrative user of the virtual server instance. Up to 10 keys may be - provided; if no keys are provided the instance will be inaccessible unless the - image used provides another means of access. For Windows instances, one of the - keys will be used to encrypt the administrator password. - 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. + administrative user of the virtual server instance. Keys will be made available + to the virtual server instance as cloud-init vendor data. For cloud-init enabled + images, these keys will also be added as SSH authorized keys for the + administrative user. + For Windows images, at least one key must be specified, and one will be chosen + to encrypt [the administrator + password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys + are optional for other images, but if no keys are specified, the instance will + be inaccessible unless the specified image provides another means of access. :attr str name: (optional) The unique user-defined name for this virtual server instance (and default system hostname). If unspecified, the name will be a hyphenated list of randomly-selected words. @@ -29702,6 +30104,10 @@ class InstanceTemplatePrototype(): :attr ResourceGroupIdentity resource_group: (optional) The resource group to use. If unspecified, the account's [default resource group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. + :attr int total_volume_bandwidth: (optional) The amount of bandwidth (in + megabits per second) allocated exclusively to instance storage volumes. An + increase in this value will result in a corresponding decrease to + `total_network_bandwidth`. :attr str user_data: (optional) User data to be made available when setting up the virtual server instance. :attr List[VolumeAttachmentPrototypeInstanceContext] volume_attachments: @@ -29719,6 +30125,7 @@ def __init__(self, placement_target: 'InstancePlacementTargetPrototype' = None, profile: 'InstanceProfileIdentity' = None, resource_group: 'ResourceGroupIdentity' = None, + total_volume_bandwidth: int = None, user_data: str = None, volume_attachments: List['VolumeAttachmentPrototypeInstanceContext'] = None, vpc: 'VPCIdentity' = None) -> None: @@ -29726,13 +30133,16 @@ def __init__(self, Initialize a InstanceTemplatePrototype object. :param List[KeyIdentity] keys: (optional) The public SSH keys for the - administrative user of the virtual server instance. Up to 10 keys may be - provided; if no keys are provided the instance will be inaccessible unless - the image used provides another means of access. For Windows instances, one - of the keys will be used to encrypt the administrator password. - 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. + administrative user of the virtual server instance. Keys will be made + available to the virtual server instance as cloud-init vendor data. For + cloud-init enabled images, these keys will also be added as SSH authorized + keys for the administrative user. + For Windows images, at least one key must be specified, and one will be + chosen to encrypt [the administrator + password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). + Keys are optional for other images, but if no keys are specified, the + instance will be inaccessible unless the specified image provides another + means of access. :param str name: (optional) The unique user-defined name for this virtual server instance (and default system hostname). If unspecified, the name will be a hyphenated list of randomly-selected words. @@ -29746,6 +30156,10 @@ def __init__(self, to use. If unspecified, the account's [default resource group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. + :param int total_volume_bandwidth: (optional) The amount of bandwidth (in + megabits per second) allocated exclusively to instance storage volumes. An + increase in this value will result in a corresponding decrease to + `total_network_bandwidth`. :param str user_data: (optional) User data to be made available when setting up the virtual server instance. :param List[VolumeAttachmentPrototypeInstanceContext] volume_attachments: @@ -29994,7 +30408,8 @@ class Key(): :attr int length: The length of this key (in bits). :attr str name: The unique user-defined name for this key. If unspecified, the name will be a hyphenated list of randomly-selected words. - :attr str public_key: The public SSH key. + :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. """ @@ -30023,7 +30438,8 @@ def __init__(self, :param int length: The length of this key (in bits). :param str name: The unique user-defined name for this key. If unspecified, the name will be a hyphenated list of randomly-selected words. - :param str public_key: The public SSH key. + :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. @@ -30144,7 +30560,7 @@ class KeyCollection(): """ KeyCollection. - :attr PageLink first: A link to the first page of resources. + :attr KeyCollectionFirst first: A link to the first page of resources. :attr List[Key] keys: Collection of keys. :attr int limit: The maximum number of resources that can be returned by the request. @@ -30155,7 +30571,7 @@ class KeyCollection(): """ def __init__(self, - first: 'PageLink', + first: 'KeyCollectionFirst', keys: List['Key'], limit: int, total_count: int, @@ -30164,7 +30580,7 @@ def __init__(self, """ Initialize a KeyCollection object. - :param PageLink first: A link to the first page of resources. + :param KeyCollectionFirst first: A link to the first page of resources. :param List[Key] keys: Collection of keys. :param int limit: The maximum number of resources that can be returned by the request. @@ -30184,7 +30600,7 @@ def from_dict(cls, _dict: Dict) -> 'KeyCollection': """Initialize a KeyCollection object from a json dictionary.""" args = {} if 'first' in _dict: - args['first'] = PageLink.from_dict(_dict.get('first')) + args['first'] = KeyCollectionFirst.from_dict(_dict.get('first')) else: raise ValueError('Required property \'first\' not present in KeyCollection JSON') if 'keys' in _dict: @@ -30241,6 +30657,62 @@ def __ne__(self, other: 'KeyCollection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other +class KeyCollectionFirst(): + """ + A link to the first page of resources. + + :attr str href: The URL for a page of resources. + """ + + def __init__(self, + href: str) -> None: + """ + Initialize a KeyCollectionFirst object. + + :param str href: The URL for a page of resources. + """ + self.href = href + + @classmethod + def from_dict(cls, _dict: Dict) -> 'KeyCollectionFirst': + """Initialize a KeyCollectionFirst object from a json dictionary.""" + args = {} + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in KeyCollectionFirst JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """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, '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 KeyCollectionFirst object.""" + return json.dumps(self.to_dict(), indent=2) + + 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: 'KeyCollectionFirst') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + class KeyCollectionNext(): """ A link to the next page of resources. This property is present for all pages except @@ -30310,7 +30782,7 @@ def __init__(self) -> None: """ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['KeyIdentityById', 'KeyIdentityByCRN', 'KeyIdentityByHref', 'KeyIdentityKeyIdentityByFingerprint'])) + ", ".join(['KeyIdentityById', 'KeyIdentityByCRN', 'KeyIdentityByHref', 'KeyIdentityByFingerprint'])) raise Exception(msg) class KeyPatch(): @@ -30368,6 +30840,118 @@ def __ne__(self, other: 'KeyPatch') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other +class KeyReference(): + """ + KeyReference. + + :attr str crn: The CRN for this key. + :attr KeyReferenceDeleted deleted: (optional) If present, this property + indicates the referenced resource has been deleted and provides + some supplementary information. + :attr str fingerprint: The fingerprint for this key. The value is returned + base64-encoded and prefixed with the hash algorithm (always `SHA256`). + :attr str href: The URL for this key. + :attr str id: The unique identifier for this key. + :attr str name: The user-defined name for this key. + """ + + def __init__(self, + crn: str, + fingerprint: str, + href: str, + id: str, + name: str, + *, + deleted: 'KeyReferenceDeleted' = None) -> None: + """ + Initialize a KeyReference object. + + :param str crn: The CRN for this key. + :param str fingerprint: The fingerprint for this key. The value is + returned base64-encoded and prefixed with the hash algorithm (always + `SHA256`). + :param str href: The URL for this key. + :param str id: The unique identifier for this key. + :param str name: The user-defined name for this key. + :param KeyReferenceDeleted deleted: (optional) If present, this property + indicates the referenced resource has been deleted and provides + some supplementary information. + """ + 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) -> 'KeyReference': + """Initialize a KeyReference object from a json dictionary.""" + args = {} + if 'crn' in _dict: + args['crn'] = _dict.get('crn') + else: + raise ValueError('Required property \'crn\' not present in KeyReference JSON') + if 'deleted' in _dict: + args['deleted'] = KeyReferenceDeleted.from_dict(_dict.get('deleted')) + if 'fingerprint' in _dict: + args['fingerprint'] = _dict.get('fingerprint') + else: + raise ValueError('Required property \'fingerprint\' not present in KeyReference JSON') + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in KeyReference JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in KeyReference JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError('Required property \'name\' not present in KeyReference JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """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: + _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 + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this KeyReference object.""" + return json.dumps(self.to_dict(), indent=2) + + 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: 'KeyReference') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + class KeyReferenceDeleted(): """ If present, this property indicates the referenced resource has been deleted and @@ -30425,21 +31009,6 @@ def __ne__(self, other: 'KeyReferenceDeleted') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class KeyReferenceInstanceInitializationContext(): - """ - KeyReferenceInstanceInitializationContext. - - """ - - def __init__(self) -> None: - """ - Initialize a KeyReferenceInstanceInitializationContext object. - - """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['KeyReferenceInstanceInitializationContextKeyReference', 'KeyReferenceInstanceInitializationContextKeyIdentityByFingerprint'])) - raise Exception(msg) - class LoadBalancer(): """ LoadBalancer. @@ -30958,7 +31527,13 @@ class LoadBalancerListener(): :attr bool accept_proxy_protocol: If set to `true`, this listener will accept and forward PROXY protocol information. Supported by load balancers in the - `application` family (otherwise always `false`). + `application` family (otherwise always `false`). Additional restrictions: + - If this listener has `https_redirect` specified, its `accept_proxy_protocol` + value must + match the `accept_proxy_protocol` value of the `https_redirect` listener. + - If this listener is the target of another listener's `https_redirect`, its + `accept_proxy_protocol` value must match that listener's + `accept_proxy_protocol` value. :attr CertificateInstanceReference certificate_instance: (optional) The certificate instance used for SSL termination. It is applicable only to `https` protocol. @@ -30967,6 +31542,8 @@ class LoadBalancerListener(): :attr LoadBalancerPoolReference default_pool: (optional) The default pool associated with the listener. :attr str href: The listener's canonical URL. + :attr LoadBalancerListenerHTTPSRedirect https_redirect: (optional) If provided, + the target listener that requests are redirected to. :attr str id: The unique identifier for this load balancer listener. :attr List[LoadBalancerListenerPolicyReference] policies: (optional) The policies for this listener. @@ -30992,13 +31569,22 @@ def __init__(self, certificate_instance: 'CertificateInstanceReference' = None, connection_limit: int = None, default_pool: 'LoadBalancerPoolReference' = None, + https_redirect: 'LoadBalancerListenerHTTPSRedirect' = None, policies: List['LoadBalancerListenerPolicyReference'] = None) -> None: """ Initialize a LoadBalancerListener 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`). + 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. @@ -31019,6 +31605,8 @@ def __init__(self, listener. :param LoadBalancerPoolReference default_pool: (optional) The default pool associated with the listener. + :param LoadBalancerListenerHTTPSRedirect https_redirect: (optional) If + provided, the target listener that requests are redirected to. :param List[LoadBalancerListenerPolicyReference] policies: (optional) The policies for this listener. """ @@ -31028,6 +31616,7 @@ def __init__(self, self.created_at = created_at self.default_pool = default_pool self.href = href + self.https_redirect = https_redirect self.id = id self.policies = policies self.port = port @@ -31056,6 +31645,8 @@ def from_dict(cls, _dict: Dict) -> 'LoadBalancerListener': 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: @@ -31096,6 +31687,8 @@ def to_dict(self) -> Dict: _dict['default_pool'] = self.default_pool.to_dict() if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href + if hasattr(self, 'https_redirect') and self.https_redirect is not None: + _dict['https_redirect'] = self.https_redirect.to_dict() if hasattr(self, 'id') and self.id is not None: _dict['id'] = self.id if hasattr(self, 'policies') and self.policies is not None: @@ -31206,13 +31799,266 @@ def __ne__(self, other: 'LoadBalancerListenerCollection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other +class LoadBalancerListenerHTTPSRedirect(): + """ + LoadBalancerListenerHTTPSRedirect. + + :attr int http_status_code: The HTTP status code for this redirect. + :attr LoadBalancerListenerReference listener: + :attr str uri: (optional) The redirect relative target URI. + """ + + def __init__(self, + http_status_code: int, + listener: 'LoadBalancerListenerReference', + *, + uri: str = None) -> None: + """ + Initialize a LoadBalancerListenerHTTPSRedirect 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. + """ + self.http_status_code = http_status_code + self.listener = listener + self.uri = uri + + @classmethod + def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerHTTPSRedirect': + """Initialize a LoadBalancerListenerHTTPSRedirect 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')) + else: + raise ValueError('Required property \'listener\' not present in LoadBalancerListenerHTTPSRedirect JSON') + if 'uri' in _dict: + args['uri'] = _dict.get('uri') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a 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, 'http_status_code') and self.http_status_code is not None: + _dict['http_status_code'] = self.http_status_code + if hasattr(self, 'listener') and self.listener is not None: + _dict['listener'] = self.listener.to_dict() + if hasattr(self, 'uri') and self.uri is not None: + _dict['uri'] = self.uri + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this LoadBalancerListenerHTTPSRedirect object.""" + return json.dumps(self.to_dict(), indent=2) + + 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: 'LoadBalancerListenerHTTPSRedirect') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + +class LoadBalancerListenerHTTPSRedirectPatch(): + """ + LoadBalancerListenerHTTPSRedirectPatch. + + :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, + *, + http_status_code: int = None, + listener: 'LoadBalancerListenerIdentity' = None, + uri: str = None) -> None: + """ + Initialize a LoadBalancerListenerHTTPSRedirectPatch 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. + """ + self.http_status_code = http_status_code + self.listener = listener + self.uri = uri + + @classmethod + def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerHTTPSRedirectPatch': + """Initialize a LoadBalancerListenerHTTPSRedirectPatch object from a json dictionary.""" + args = {} + if 'http_status_code' in _dict: + args['http_status_code'] = _dict.get('http_status_code') + if 'listener' in _dict: + args['listener'] = _dict.get('listener') + if 'uri' in _dict: + args['uri'] = _dict.get('uri') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a 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, '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 LoadBalancerListenerHTTPSRedirectPatch object.""" + return json.dumps(self.to_dict(), indent=2) + + 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: 'LoadBalancerListenerHTTPSRedirectPatch') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + +class LoadBalancerListenerHTTPSRedirectPrototype(): + """ + LoadBalancerListenerHTTPSRedirectPrototype. + + :attr int http_status_code: The HTTP status code for this redirect. + :attr LoadBalancerListenerIdentity listener: Identifies a load balancer listener + by a unique property. + :attr str uri: (optional) The redirect relative target URI. + """ + + def __init__(self, + http_status_code: int, + listener: 'LoadBalancerListenerIdentity', + *, + uri: str = None) -> None: + """ + Initialize a LoadBalancerListenerHTTPSRedirectPrototype object. + + :param int http_status_code: The HTTP status code for this redirect. + :param LoadBalancerListenerIdentity listener: Identifies a load balancer + listener by a unique property. + :param str uri: (optional) The redirect relative target URI. + """ + self.http_status_code = http_status_code + self.listener = listener + self.uri = uri + + @classmethod + def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerHTTPSRedirectPrototype': + """Initialize a LoadBalancerListenerHTTPSRedirectPrototype object from a json dictionary.""" + args = {} + if 'http_status_code' in _dict: + args['http_status_code'] = _dict.get('http_status_code') + else: + raise ValueError('Required property \'http_status_code\' not present in LoadBalancerListenerHTTPSRedirectPrototype JSON') + if 'listener' in _dict: + args['listener'] = _dict.get('listener') + else: + raise ValueError('Required property \'listener\' not present in LoadBalancerListenerHTTPSRedirectPrototype JSON') + if 'uri' in _dict: + args['uri'] = _dict.get('uri') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """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, '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 LoadBalancerListenerHTTPSRedirectPrototype object.""" + return json.dumps(self.to_dict(), indent=2) + + 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: 'LoadBalancerListenerHTTPSRedirectPrototype') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + +class LoadBalancerListenerIdentity(): + """ + Identifies a load balancer listener by a unique property. + + """ + + def __init__(self) -> None: + """ + Initialize a LoadBalancerListenerIdentity object. + + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['LoadBalancerListenerIdentityById', 'LoadBalancerListenerIdentityByHref'])) + raise Exception(msg) + class LoadBalancerListenerPatch(): """ LoadBalancerListenerPatch. :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`). + in the `application` family (otherwise always `false`). Additional restrictions: + - If this listener has `https_redirect` specified, its `accept_proxy_protocol` + value must + match the `accept_proxy_protocol` value of the `https_redirect` listener. + - If this listener is the target of another listener's `https_redirect`, its + `accept_proxy_protocol` value must match that listener's + `accept_proxy_protocol` value. :attr CertificateInstanceIdentity certificate_instance: (optional) The certificate instance used for SSL termination. It is applicable only to `https` protocol. @@ -31222,13 +32068,20 @@ class LoadBalancerListenerPatch(): - Belong to this load balancer - Have the same `protocol` as this listener - Not already be the default pool for another listener. + :attr LoadBalancerListenerHTTPSRedirectPatch https_redirect: (optional) The + target listener that requests will be redirected to. This listener must have a + `protocol` of `http`, and the target listener must have a `protocol` of `https`. + Specify `null` to remove any existing https redirect. :attr int port: (optional) The listener port number. Each listener in the load balancer must have a unique `port` and `protocol` combination. - :attr str protocol: (optional) The listener protocol. Load balancers in the - `network` family support `tcp`. Load balancers in the `application` family - support `tcp`, `http`, and `https`. Each listener in the load balancer must have - a unique `port` and `protocol` combination. + :attr str protocol: (optional) The listener protocol. Each listener in the load + balancer must have a unique `port` and `protocol` combination. Additional + restrictions: + - If this load balancer is in the `network` family, the protocol must be `tcp`. + - If this listener has `https_redirect` specified, the protocol must be `http`. + - If this listener is a listener's `https_redirect` target, the protocol must be + `https`. """ def __init__(self, @@ -31237,6 +32090,7 @@ def __init__(self, certificate_instance: 'CertificateInstanceIdentity' = None, connection_limit: int = None, default_pool: 'LoadBalancerPoolIdentity' = None, + https_redirect: 'LoadBalancerListenerHTTPSRedirectPatch' = None, port: int = None, protocol: str = None) -> None: """ @@ -31245,6 +32099,14 @@ def __init__(self, :param bool accept_proxy_protocol: (optional) If set to `true`, this listener will accept and forward PROXY protocol information. Supported by load balancers in the `application` family (otherwise always `false`). + Additional restrictions: + - If this listener has `https_redirect` specified, its + `accept_proxy_protocol` value must + match the `accept_proxy_protocol` value of the `https_redirect` listener. + - If this listener is the target of another listener's `https_redirect`, + its + `accept_proxy_protocol` value must match that listener's + `accept_proxy_protocol` value. :param CertificateInstanceIdentity certificate_instance: (optional) The certificate instance used for SSL termination. It is applicable only to `https` @@ -31256,18 +32118,30 @@ def __init__(self, - Belong to this load balancer - Have the same `protocol` as this listener - Not already be the default pool for another listener. + :param LoadBalancerListenerHTTPSRedirectPatch https_redirect: (optional) + The target listener that requests will be redirected to. This listener must + have a + `protocol` of `http`, and the target listener must have a `protocol` of + `https`. + Specify `null` to remove any existing https redirect. :param int port: (optional) The listener port number. Each listener in the load balancer must have a unique `port` and `protocol` combination. - :param str protocol: (optional) The listener protocol. Load balancers in - the `network` family support `tcp`. Load balancers in the `application` - family support `tcp`, `http`, and `https`. Each listener in the load - balancer must have a unique `port` and `protocol` combination. + :param str protocol: (optional) The listener protocol. Each listener in the + load balancer must have a unique `port` and `protocol` combination. + Additional restrictions: + - If this load balancer is in the `network` family, the protocol must be + `tcp`. + - If this listener has `https_redirect` specified, the protocol must be + `http`. + - If this listener is a listener's `https_redirect` target, the protocol + must be `https`. """ self.accept_proxy_protocol = accept_proxy_protocol self.certificate_instance = certificate_instance self.connection_limit = connection_limit self.default_pool = default_pool + self.https_redirect = https_redirect self.port = port self.protocol = protocol @@ -31283,6 +32157,8 @@ def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPatch': args['connection_limit'] = _dict.get('connection_limit') if 'default_pool' in _dict: args['default_pool'] = _dict.get('default_pool') + if 'https_redirect' in _dict: + args['https_redirect'] = LoadBalancerListenerHTTPSRedirectPatch.from_dict(_dict.get('https_redirect')) if 'port' in _dict: args['port'] = _dict.get('port') if 'protocol' in _dict: @@ -31311,6 +32187,8 @@ def to_dict(self) -> Dict: _dict['default_pool'] = self.default_pool else: _dict['default_pool'] = self.default_pool.to_dict() + if hasattr(self, 'https_redirect') and self.https_redirect is not None: + _dict['https_redirect'] = self.https_redirect.to_dict() if hasattr(self, 'port') and self.port is not None: _dict['port'] = self.port if hasattr(self, 'protocol') and self.protocol is not None: @@ -31337,10 +32215,12 @@ def __ne__(self, other: 'LoadBalancerListenerPatch') -> bool: class ProtocolEnum(str, Enum): """ - The listener protocol. Load balancers in the `network` family support `tcp`. Load - balancers in the `application` family support `tcp`, `http`, and `https`. Each - listener in the load balancer must have a unique `port` and `protocol` - combination. + The listener protocol. Each listener in the load balancer must have a unique + `port` and `protocol` combination. Additional restrictions: + - If this load balancer is in the `network` family, the protocol must be `tcp`. + - If this listener has `https_redirect` specified, the protocol must be `http`. + - If this listener is a listener's `https_redirect` target, the protocol must be + `https`. """ HTTP = 'http' HTTPS = 'https' @@ -31352,6 +32232,10 @@ class LoadBalancerListenerPolicy(): LoadBalancerListenerPolicy. :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. @@ -31361,10 +32245,12 @@ class LoadBalancerListenerPolicy(): :attr str provisioning_status: The provisioning status of this policy. :attr List[LoadBalancerListenerPolicyRuleReference] rules: The rules for this policy. - :attr LoadBalancerListenerPolicyTarget target: (optional) - `LoadBalancerPoolReference` is in the response if `action` is `forward`. - `LoadBalancerListenerPolicyRedirectURL` is in the response if `action` is - `redirect`. + :attr LoadBalancerListenerPolicyTarget target: (optional) - If `action` is + `forward`, the response is a `LoadBalancerPoolReference` + - If `action` is `redirect`, the response is a + `LoadBalancerListenerPolicyRedirectURL` + - If `action` is `https_redirect`, the response is a + `LoadBalancerListenerHTTPSRedirect`. """ def __init__(self, @@ -31382,6 +32268,10 @@ def __init__(self, Initialize a LoadBalancerListenerPolicy 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. @@ -31391,10 +32281,12 @@ def __init__(self, :param str provisioning_status: The provisioning status of this policy. :param List[LoadBalancerListenerPolicyRuleReference] rules: The rules for this policy. - :param LoadBalancerListenerPolicyTarget target: (optional) - `LoadBalancerPoolReference` is in the response if `action` is `forward`. - `LoadBalancerListenerPolicyRedirectURL` is in the response if `action` is - `redirect`. + :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.action = action self.created_at = created_at @@ -31498,10 +32390,15 @@ def __ne__(self, other: 'LoadBalancerListenerPolicy') -> bool: 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' REDIRECT = 'redirect' REJECT = 'reject' + HTTPS_REDIRECT = 'https_redirect' class ProvisioningStatusEnum(str, Enum): @@ -31580,11 +32477,12 @@ class LoadBalancerListenerPolicyPatch(): unique within the load balancer listener the policy resides in. :attr int priority: (optional) Priority of the policy. Lower value indicates higher priority. - :attr LoadBalancerListenerPolicyTargetPatch target: (optional) When `action` is - `forward`, `LoadBalancerPoolIdentity` specifies which pool the load - balancer forwards the traffic to. When `action` is `redirect`, - `LoadBalancerListenerPolicyRedirectURLPatch` specifies the url and http - status code used in the redirect response. + :attr LoadBalancerListenerPolicyTargetPatch target: (optional) - If `action` is + `forward`, specify a `LoadBalancerPoolIdentity`. + - If `action` is `redirect`, specify a + `LoadBalancerListenerPolicyRedirectURLPatch`. + - If `action` is `https_redirect`, specify a + `LoadBalancerListenerPolicyHTTPSRedirectPatch`. """ def __init__(self, @@ -31599,12 +32497,12 @@ def __init__(self, must be unique within the load balancer listener the policy resides in. :param int priority: (optional) Priority of the policy. Lower value indicates higher priority. - :param LoadBalancerListenerPolicyTargetPatch target: (optional) When - `action` is `forward`, `LoadBalancerPoolIdentity` specifies which pool the - load - balancer forwards the traffic to. When `action` is `redirect`, - `LoadBalancerListenerPolicyRedirectURLPatch` specifies the url and http - status code used in the redirect response. + :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.name = name self.priority = priority @@ -31664,18 +32562,22 @@ class LoadBalancerListenerPolicyPrototype(): LoadBalancerListenerPolicyPrototype. :attr str action: The policy action. + The enumerated values for this property are expected to expand in the future. + When processing this property, check for and log unknown values. Optionally halt + processing and surface the error, or bypass the policy on which the unexpected + property value was encountered. :attr str name: (optional) The user-defined name for this policy. Names must be unique within the load balancer listener the policy resides in. :attr int priority: Priority of the policy. Lower value indicates higher priority. :attr List[LoadBalancerListenerPolicyRulePrototype] rules: (optional) The rule prototype objects for this policy. - :attr LoadBalancerListenerPolicyTargetPrototype target: (optional) When `action` - is `forward`, `LoadBalancerPoolIdentity` is required to specify which - pool the load balancer forwards the traffic to. When `action` is `redirect`, - `LoadBalancerListenerPolicyRedirectURLPrototype` is required to specify the url - and - http status code used in the redirect response. + :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, @@ -31689,20 +32591,22 @@ def __init__(self, Initialize a LoadBalancerListenerPolicyPrototype object. :param str action: The policy action. + The enumerated values for this property are expected to expand in the + future. When processing this property, check for and log unknown values. + Optionally halt processing and surface the error, or bypass the policy on + which the unexpected property value was encountered. :param int priority: Priority of the policy. Lower value indicates higher priority. :param str name: (optional) The user-defined name for this policy. Names must be unique within the load balancer listener the policy resides in. :param List[LoadBalancerListenerPolicyRulePrototype] rules: (optional) The rule prototype objects for this policy. - :param LoadBalancerListenerPolicyTargetPrototype target: (optional) When - `action` is `forward`, `LoadBalancerPoolIdentity` is required to specify - which - pool the load balancer forwards the traffic to. When `action` is - `redirect`, - `LoadBalancerListenerPolicyRedirectURLPrototype` is required to specify the - url and - http status code used in the redirect response. + :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.action = action self.name = name @@ -31774,10 +32678,15 @@ def __ne__(self, other: 'LoadBalancerListenerPolicyPrototype') -> bool: 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' REDIRECT = 'redirect' REJECT = 'reject' + HTTPS_REDIRECT = 'https_redirect' class LoadBalancerListenerPolicyReference(): @@ -31925,7 +32834,7 @@ class LoadBalancerListenerPolicyRule(): :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 field is required. + 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. @@ -31967,7 +32876,7 @@ def __init__(self, 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 field is required. + 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. @@ -32159,7 +33068,7 @@ class LoadBalancerListenerPolicyRulePatch(): :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 field is required. + 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. @@ -32184,7 +33093,7 @@ def __init__(self, :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 field is required. + 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. @@ -32280,7 +33189,7 @@ class LoadBalancerListenerPolicyRulePrototype(): :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 field is required. + 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. @@ -32311,7 +33220,7 @@ def __init__(self, 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 field is required. + 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. @@ -32540,8 +33449,10 @@ def __ne__(self, other: 'LoadBalancerListenerPolicyRuleReferenceDeleted') -> boo class LoadBalancerListenerPolicyTarget(): """ - `LoadBalancerPoolReference` is in the response if `action` is `forward`. - `LoadBalancerListenerPolicyRedirectURL` is in the response if `action` is `redirect`. + - 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`. """ @@ -32551,15 +33462,15 @@ def __init__(self) -> None: """ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['LoadBalancerListenerPolicyTargetLoadBalancerPoolReference', 'LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL'])) + ", ".join(['LoadBalancerListenerPolicyTargetLoadBalancerPoolReference', 'LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL', 'LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect'])) raise Exception(msg) class LoadBalancerListenerPolicyTargetPatch(): """ - When `action` is `forward`, `LoadBalancerPoolIdentity` specifies which pool the load - balancer forwards the traffic to. When `action` is `redirect`, - `LoadBalancerListenerPolicyRedirectURLPatch` specifies the url and http status code - used in the redirect response. + - If `action` is `forward`, specify a `LoadBalancerPoolIdentity`. + - If `action` is `redirect`, specify a `LoadBalancerListenerPolicyRedirectURLPatch`. + - If `action` is `https_redirect`, specify a + `LoadBalancerListenerPolicyHTTPSRedirectPatch`. """ @@ -32569,15 +33480,16 @@ def __init__(self) -> None: """ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentity', 'LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch'])) + ", ".join(['LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentity', 'LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch', 'LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch'])) raise Exception(msg) class LoadBalancerListenerPolicyTargetPrototype(): """ - When `action` is `forward`, `LoadBalancerPoolIdentity` is required to specify which - pool the load balancer forwards the traffic to. When `action` is `redirect`, - `LoadBalancerListenerPolicyRedirectURLPrototype` is required to specify the url and - http status code used in the redirect response. + - If `action` is `forward`, specify a `LoadBalancerPoolIdentity`. + - If `action` is `redirect`, specify a + `LoadBalancerListenerPolicyRedirectURLPrototype`. + - If `action` is `https_redirect`, specify a + `LoadBalancerListenerPolicyHTTPSRedirectPrototype`. """ @@ -32587,7 +33499,7 @@ def __init__(self) -> None: """ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentity', 'LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype'])) + ", ".join(['LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentity', 'LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype', 'LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype'])) raise Exception(msg) class LoadBalancerListenerPrototypeLoadBalancerContext(): @@ -32596,7 +33508,13 @@ class LoadBalancerListenerPrototypeLoadBalancerContext(): :attr bool accept_proxy_protocol: (optional) If set to `true`, this listener will accept and forward PROXY protocol information. Supported by load balancers - in the `application` family (otherwise always `false`). + in the `application` family (otherwise always `false`). Additional restrictions: + - If this listener has `https_redirect` specified, its `accept_proxy_protocol` + value must + match the `accept_proxy_protocol` value of the `https_redirect` listener. + - If this listener is the target of another listener's `https_redirect`, its + `accept_proxy_protocol` value must match that listener's + `accept_proxy_protocol` value. :attr int connection_limit: (optional) The connection limit of the listener. :attr LoadBalancerPoolIdentityByName default_pool: (optional) The default pool associated with the listener. @@ -32629,6 +33547,14 @@ def __init__(self, :param bool accept_proxy_protocol: (optional) If set to `true`, this listener will accept and forward PROXY protocol information. Supported by load balancers in the `application` family (otherwise always `false`). + Additional restrictions: + - If this listener has `https_redirect` specified, its + `accept_proxy_protocol` value must + match the `accept_proxy_protocol` value of the `https_redirect` listener. + - If this listener is the target of another listener's `https_redirect`, + its + `accept_proxy_protocol` value must match that listener's + `accept_proxy_protocol` value. :param int connection_limit: (optional) The connection limit of the listener. :param LoadBalancerPoolIdentityByName default_pool: (optional) The default @@ -37367,6 +38293,7 @@ class NetworkInterface(): :attr str name: The user-defined name for this network interface. :attr int port_speed: The network interface port speed in Mbps. :attr str primary_ipv4_address: The primary IPv4 address. + If the address has not yet been selected, the value will be `0.0.0.0`. :attr str resource_type: The resource type. :attr List[SecurityGroupReference] security_groups: Collection of security groups. @@ -37403,6 +38330,7 @@ def __init__(self, :param str name: The user-defined name for this network interface. :param int port_speed: The network interface port speed in Mbps. :param str primary_ipv4_address: The primary IPv4 address. + If the address has not yet been selected, the value will be `0.0.0.0`. :param str resource_type: The resource type. :param List[SecurityGroupReference] security_groups: Collection of security groups. @@ -37792,6 +38720,7 @@ class NetworkInterfaceInstanceContextReference(): :attr str id: The unique identifier for this network interface. :attr str name: The user-defined name for this network interface. :attr str primary_ipv4_address: The primary IPv4 address. + If the address has not yet been selected, the value will be `0.0.0.0`. :attr str resource_type: The resource type. :attr SubnetReference subnet: The associated subnet. """ @@ -37812,6 +38741,7 @@ def __init__(self, :param str id: The unique identifier for this network interface. :param str name: The user-defined name for this network interface. :param str primary_ipv4_address: The primary IPv4 address. + If the address has not yet been selected, the value will be `0.0.0.0`. :param str resource_type: The resource type. :param SubnetReference subnet: The associated subnet. :param NetworkInterfaceInstanceContextReferenceDeleted deleted: (optional) @@ -38158,6 +39088,7 @@ class NetworkInterfaceReference(): :attr str id: The unique identifier for this network interface. :attr str name: The user-defined name for this network interface. :attr str primary_ipv4_address: The primary IPv4 address. + If the address has not yet been selected, the value will be `0.0.0.0`. :attr str resource_type: The resource type. """ @@ -38176,6 +39107,7 @@ def __init__(self, :param str id: The unique identifier for this network interface. :param str name: The user-defined name for this network interface. :param str primary_ipv4_address: The primary IPv4 address. + If the address has not yet been selected, the value will be `0.0.0.0`. :param str resource_type: The resource type. :param NetworkInterfaceReferenceDeleted deleted: (optional) If present, this property indicates the referenced resource has been deleted and @@ -38856,9 +39788,356 @@ def __ne__(self, other: 'OperatingSystemReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class PageLink(): +class PlacementGroup(): + """ + PlacementGroup. + + :attr datetime created_at: The date and time that the placement group was + created. + :attr str crn: The CRN for this placement group. + :attr str href: The URL for this placement group. + :attr str id: The unique identifier for this placement group. + :attr str lifecycle_state: The lifecycle state of the placement group. + :attr str name: The user-defined name for this placement group. + :attr ResourceGroupReference resource_group: The resource group for this + placement group. + :attr str resource_type: The resource type. + :attr str strategy: The strategy for this placement group + - `host_spread`: place on different compute hosts + - `power_spread`: place on compute hosts that use different power sources + The enumerated values for this property may expand in the future. When + processing this property, check for and log unknown values. Optionally halt + processing and surface the error, or bypass the placement group on which the + unexpected strategy was encountered. """ - PageLink. + + 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 user-defined name for this placement group. + :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: + _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' + UPDATING = 'updating' + WAITING = 'waiting' + SUSPENDED = 'suspended' + + + 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(): + """ + PlacementGroupCollection. + + :attr PlacementGroupCollectionFirst first: A link to the first page of + resources. + :attr int limit: The maximum number of resources that can be returned by the + request. + :attr PlacementGroupCollectionNext next: (optional) A link to the next page of + resources. This property is present for all pages + except the last page. + :attr List[PlacementGroup] placement_groups: Collection of placement groups. + :attr int total_count: The total number of resources across all pages. + """ + + def __init__(self, + first: 'PlacementGroupCollectionFirst', + limit: int, + placement_groups: List['PlacementGroup'], + total_count: int, + *, + next: 'PlacementGroupCollectionNext' = None) -> None: + """ + Initialize a PlacementGroupCollection object. + + :param PlacementGroupCollectionFirst first: A link to the first page of + resources. + :param int limit: The maximum number of resources that can be returned by + the request. + :param List[PlacementGroup] placement_groups: Collection of placement + groups. + :param int total_count: The total number of resources across all pages. + :param PlacementGroupCollectionNext next: (optional) A link to the next + page of resources. This property is present for all pages + except the last page. + """ + self.first = first + self.limit = limit + self.next = next + self.placement_groups = placement_groups + self.total_count = total_count + + @classmethod + def from_dict(cls, _dict: Dict) -> 'PlacementGroupCollection': + """Initialize a PlacementGroupCollection object from a json dictionary.""" + args = {} + if 'first' in _dict: + args['first'] = PlacementGroupCollectionFirst.from_dict(_dict.get('first')) + else: + raise ValueError('Required property \'first\' not present in PlacementGroupCollection JSON') + if 'limit' in _dict: + args['limit'] = _dict.get('limit') + else: + raise ValueError('Required property \'limit\' not present in PlacementGroupCollection JSON') + if 'next' in _dict: + args['next'] = PlacementGroupCollectionNext.from_dict(_dict.get('next')) + if 'placement_groups' in _dict: + args['placement_groups'] = [PlacementGroup.from_dict(x) for x in _dict.get('placement_groups')] + else: + raise ValueError('Required property \'placement_groups\' not present in PlacementGroupCollection JSON') + if 'total_count' in _dict: + args['total_count'] = _dict.get('total_count') + else: + raise ValueError('Required property \'total_count\' not present in PlacementGroupCollection JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a PlacementGroupCollection object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'first') and self.first is not None: + _dict['first'] = self.first.to_dict() + if hasattr(self, 'limit') and self.limit is not None: + _dict['limit'] = self.limit + if hasattr(self, 'next') and self.next is not None: + _dict['next'] = self.next.to_dict() + if hasattr(self, 'placement_groups') and self.placement_groups is not None: + _dict['placement_groups'] = [x.to_dict() for x in self.placement_groups] + if hasattr(self, 'total_count') and self.total_count is not None: + _dict['total_count'] = self.total_count + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this PlacementGroupCollection object.""" + return json.dumps(self.to_dict(), indent=2) + + 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: 'PlacementGroupCollection') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + +class PlacementGroupCollectionFirst(): + """ + A link to the first page of resources. + + :attr str href: The URL for a page of resources. + """ + + def __init__(self, + href: str) -> None: + """ + Initialize a PlacementGroupCollectionFirst 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.""" + args = {} + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in PlacementGroupCollectionFirst JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a PlacementGroupCollectionFirst object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, '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 PlacementGroupCollectionFirst object.""" + return json.dumps(self.to_dict(), indent=2) + + 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: 'PlacementGroupCollectionFirst') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + +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. """ @@ -38866,25 +40145,25 @@ class PageLink(): def __init__(self, href: str) -> None: """ - Initialize a PageLink 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) -> 'PageLink': - """Initialize a PageLink 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') else: - raise ValueError('Required property \'href\' not present in PageLink JSON') + raise ValueError('Required property \'href\' not present in PlacementGroupCollectionNext JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a PageLink object from a json dictionary.""" + """Initialize a PlacementGroupCollectionNext object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -38899,16 +40178,128 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this PageLink object.""" + """Return a `str` version of this PlacementGroupCollectionNext object.""" + return json.dumps(self.to_dict(), indent=2) + + 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: 'PlacementGroupCollectionNext') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + +class PlacementGroupPatch(): + """ + PlacementGroupPatch. + + :attr str name: (optional) The user-defined name for this placement group. + """ + + def __init__(self, + *, + name: str = None) -> None: + """ + Initialize a PlacementGroupPatch object. + + :param str name: (optional) The user-defined name for this placement group. + """ + self.name = name + + @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) + + @classmethod + def _from_dict(cls, _dict): + """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, '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 PlacementGroupPatch object.""" + return json.dumps(self.to_dict(), indent=2) + + 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 PlacementGroupReferenceDeleted(): + """ + 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 PlacementGroupReferenceDeleted object. + + :param str more_info: Link to documentation about deleted resources. + """ + self.more_info = more_info + + @classmethod + def from_dict(cls, _dict: Dict) -> 'PlacementGroupReferenceDeleted': + """Initialize a PlacementGroupReferenceDeleted object from a json dictionary.""" + 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') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """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, '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 PlacementGroupReferenceDeleted object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'PageLink') -> 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: 'PageLink') -> bool: + def __ne__(self, other: 'PlacementGroupReferenceDeleted') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other @@ -39895,11 +41286,12 @@ class ReservedIP(): """ ReservedIP. - :attr str address: The IP address. This property may add support for IPv6 - addresses in the future. When processing a value in this property, verify that - the address is in an expected format. If it is not, log an error. Optionally - halt processing and surface the error, or bypass the resource on which the - unexpected IP address format was encountered. + :attr str 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: If set to `true`, this reserved IP will be automatically deleted when the target is deleted or when the reserved IP is unbound. :attr datetime created_at: The date and time that the reserved IP was created. @@ -39926,11 +41318,13 @@ def __init__(self, """ Initialize a ReservedIP 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 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: If set to `true`, this reserved IP will be automatically deleted when the target is deleted or when the reserved IP is unbound. @@ -40570,11 +41964,12 @@ class ReservedIPReference(): """ ReservedIPReference. - :attr str address: The IP address. This property may add support for IPv6 - addresses in the future. When processing a value in this property, verify that - the address is in an expected format. If it is not, log an error. Optionally - halt processing and surface the error, or bypass the resource on which the - unexpected IP address format was encountered. + :attr str 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. @@ -40595,11 +41990,13 @@ def __init__(self, """ Initialize a ReservedIPReference 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 address: The IP address. + If the address has not yet been selected, the value will be `0.0.0.0`. + This property may add support for IPv6 addresses in the future. When + processing a value in this property, verify that the address is in an + expected format. If it is not, log an error. Optionally halt processing and + surface the error, or bypass the resource on which the unexpected IP + address format was encountered. :param str href: The URL for this reserved IP. :param str id: The unique identifier for this reserved IP. :param str name: The user-defined or system-provided name for this reserved @@ -40874,6 +42271,13 @@ class Route(): """ Route. + :attr str action: The action to perform with a packet matching the route: + - `delegate`: delegate to the system's built-in routes + - `delegate_vpc`: delegate to the system's built-in routes, ignoring + Internet-bound + routes + - `deliver`: deliver the packet to the specified `next_hop` + - `drop`: drop the packet. :attr datetime created_at: The date and time that the route was created. :attr str destination: The destination of the route. :attr str href: The URL for this route. @@ -40889,6 +42293,7 @@ class Route(): """ def __init__(self, + action: str, created_at: datetime, destination: str, href: str, @@ -40900,6 +42305,13 @@ def __init__(self, """ Initialize a Route object. + :param str action: The action to perform with a packet matching the route: + - `delegate`: delegate to the system's built-in routes + - `delegate_vpc`: delegate to the system's built-in routes, ignoring + Internet-bound + routes + - `deliver`: deliver the packet to the specified `next_hop` + - `drop`: drop the packet. :param datetime created_at: The date and time that the route was created. :param str destination: The destination of the route. :param str href: The URL for this route. @@ -40913,6 +42325,7 @@ def __init__(self, subnets in this zone will be subject to this route.). """ + self.action = action self.created_at = created_at self.destination = destination self.href = href @@ -40926,6 +42339,10 @@ def __init__(self, def from_dict(cls, _dict: Dict) -> 'Route': """Initialize a Route 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')) else: @@ -40968,6 +42385,8 @@ def _from_dict(cls, _dict): def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} + if hasattr(self, 'action') and self.action is not None: + _dict['action'] = self.action if hasattr(self, 'created_at') and self.created_at is not None: _dict['created_at'] = datetime_to_string(self.created_at) if hasattr(self, 'destination') and self.destination is not None: @@ -41007,6 +42426,22 @@ 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 the system's built-in routes + - `delegate_vpc`: delegate to the system's built-in routes, ignoring + Internet-bound + routes + - `deliver`: deliver the packet to the specified `next_hop` + - `drop`: drop the packet. + """ + DELEGATE = 'delegate' + DELEGATE_VPC = 'delegate_vpc' + DELIVER = 'deliver' + DROP = 'drop' + + class LifecycleStateEnum(str, Enum): """ The lifecycle state of the route. @@ -43013,9 +44448,9 @@ class SecurityGroupRule(): :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: (optional) The IP version to enforce. The format of - `remote.address` or `remote.cidr_block` must match this field, 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 + `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: (optional) The protocol to enforce. :attr SecurityGroupRuleRemote remote: The IP addresses or security groups from @@ -43050,8 +44485,8 @@ def __init__(self, any source, for outbound rules). :param str ip_version: (optional) The IP version to enforce. The format of - `remote.address` or `remote.cidr_block` must match this field, if they are - used. Alternatively, if `remote` references a security group, then this + `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: (optional) The protocol to enforce. @@ -43106,8 +44541,8 @@ class DirectionEnum(str, Enum): class IpVersionEnum(str, Enum): """ The IP version to enforce. The format of `remote.address` or `remote.cidr_block` - must match this field, if they are used. Alternatively, if `remote` references a - security group, then this rule only applies to IP addresses (network interfaces) + 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' @@ -43178,9 +44613,9 @@ class SecurityGroupRulePatch(): :attr str direction: (optional) The direction of traffic to enforce, either `inbound` or `outbound`. :attr str ip_version: (optional) The IP version to enforce. The format of - `remote.address` or `remote.cidr_block` must match this field, 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 + `remote.address` or `remote.cidr_block` must match this property, if they are + used. Alternatively, if `remote` references a security group, then this rule + only applies to IP addresses (network interfaces) in that group matching this IP version. :attr int port_max: (optional) The inclusive upper bound of the protocol port range. Specify `null` to clear an existing upper bound. If a lower bound has @@ -43216,8 +44651,8 @@ def __init__(self, :param str direction: (optional) The direction of traffic to enforce, either `inbound` or `outbound`. :param str ip_version: (optional) The IP version to enforce. The format of - `remote.address` or `remote.cidr_block` must match this field, if they are - used. Alternatively, if `remote` references a security group, then this + `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 @@ -43322,8 +44757,8 @@ class DirectionEnum(str, Enum): class IpVersionEnum(str, Enum): """ The IP version to enforce. The format of `remote.address` or `remote.cidr_block` - must match this field, if they are used. Alternatively, if `remote` references a - security group, then this rule only applies to IP addresses (network interfaces) + 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' @@ -43336,11 +44771,11 @@ class SecurityGroupRulePrototype(): :attr str direction: The direction of traffic to enforce, either `inbound` or `outbound`. :attr str ip_version: (optional) The IP version to enforce. The format of - `remote.address` or `remote.cidr_block` must match this field, 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 + `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: (optional) The protocol to enforce. + :attr str protocol: The protocol to enforce. :attr SecurityGroupRuleRemotePrototype remote: (optional) The IP addresses or security groups from which this rule will allow traffic (or to which, for outbound rules). Can be specified as an IP address, a CIDR block, or @@ -43352,21 +44787,21 @@ class SecurityGroupRulePrototype(): def __init__(self, direction: str, + protocol: str, *, ip_version: str = None, - protocol: str = None, remote: 'SecurityGroupRuleRemotePrototype' = None) -> None: """ Initialize a SecurityGroupRulePrototype object. :param str direction: The direction of traffic to enforce, either `inbound` or `outbound`. + :param str protocol: The protocol to enforce. :param str ip_version: (optional) The IP version to enforce. The format of - `remote.address` or `remote.cidr_block` must match this field, if they are - used. Alternatively, if `remote` references a security group, then this + `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: (optional) The protocol to enforce. :param SecurityGroupRuleRemotePrototype remote: (optional) The IP addresses or security groups from which this rule will allow traffic (or to which, for outbound rules). Can be specified as an IP address, a CIDR @@ -43425,8 +44860,8 @@ class DirectionEnum(str, Enum): class IpVersionEnum(str, Enum): """ The IP version to enforce. The format of `remote.address` or `remote.cidr_block` - must match this field, if they are used. Alternatively, if `remote` references a - security group, then this rule only applies to IP addresses (network interfaces) + 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' @@ -47291,12 +48726,14 @@ class Volume(): :attr bool active: Indicates whether a running virtual server instance has an attachment to this volume. + :attr int bandwidth: The maximum bandwidth (in megabits per second) for the + volume. :attr bool busy: Indicates whether this volume is performing an operation that must be serialized. If an operation specifies that it requires serialization, the operation will fail unless this property is `false`. - :attr int capacity: The capacity of the volume in gigabytes. The specified - minimum and maximum capacity values for creating or updating volumes may expand - in the future. + :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. @@ -47306,7 +48743,7 @@ class Volume(): `user_managed`. :attr str href: The URL for this volume. :attr str id: The unique identifier for this volume. - :attr int iops: The bandwidth for the volume. + :attr int iops: The maximum I/O operations per second (IOPS) for the volume. :attr str name: The unique user-defined name for this volume. :attr OperatingSystemReference operating_system: (optional) The operating system associated with this volume. If absent, this volume was not @@ -47337,6 +48774,7 @@ class Volume(): def __init__(self, active: bool, + bandwidth: int, busy: bool, capacity: int, created_at: datetime, @@ -47362,18 +48800,21 @@ def __init__(self, :param bool active: Indicates whether a running virtual server instance has an attachment to this volume. + :param int bandwidth: The maximum bandwidth (in megabits per second) for + the volume. :param bool busy: Indicates whether this volume is performing an operation that must be serialized. If an operation specifies that it requires serialization, the operation will fail unless this property is `false`. - :param int capacity: The capacity of the volume in gigabytes. The specified - minimum and maximum capacity values for creating or updating volumes may - expand in the future. + :param int capacity: The capacity to use for the volume (in gigabytes). The + specified minimum and maximum capacity values for creating or updating + volumes may expand in the future. :param datetime created_at: The date and time that the volume was created. :param str crn: The CRN for this volume. :param str encryption: The type of encryption used on the volume. :param str href: The URL for this volume. :param str id: The unique identifier for this volume. - :param int iops: The bandwidth for the volume. + :param int iops: The maximum I/O operations per second (IOPS) for the + volume. :param str name: The unique user-defined name for this volume. :param VolumeProfileReference profile: The profile this volume uses. :param ResourceGroupReference resource_group: The resource group for this @@ -47407,6 +48848,7 @@ def __init__(self, which this volume was cloned. """ self.active = active + self.bandwidth = bandwidth self.busy = busy self.capacity = capacity self.created_at = created_at @@ -47435,6 +48877,10 @@ def from_dict(cls, _dict: Dict) -> 'Volume': args['active'] = _dict.get('active') else: raise ValueError('Required property \'active\' not present in Volume JSON') + if 'bandwidth' in _dict: + args['bandwidth'] = _dict.get('bandwidth') + else: + raise ValueError('Required property \'bandwidth\' not present in Volume JSON') if 'busy' in _dict: args['busy'] = _dict.get('busy') else: @@ -47515,6 +48961,8 @@ def to_dict(self) -> Dict: _dict = {} if hasattr(self, 'active') and self.active is not None: _dict['active'] = self.active + if hasattr(self, 'bandwidth') and self.bandwidth is not None: + _dict['bandwidth'] = self.bandwidth if hasattr(self, 'busy') and self.busy is not None: _dict['busy'] = self.busy if hasattr(self, 'capacity') and self.capacity is not None: @@ -47600,6 +49048,9 @@ class VolumeAttachment(): """ VolumeAttachment. + :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: (optional) If set to true, when deleting the instance the volume will also be deleted. @@ -47616,6 +49067,7 @@ class VolumeAttachment(): """ def __init__(self, + bandwidth: int, created_at: datetime, href: str, id: str, @@ -47629,6 +49081,9 @@ def __init__(self, """ Initialize a VolumeAttachment 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 str href: The URL for this volume attachment. :param str id: The unique identifier for this volume attachment. @@ -47643,6 +49098,7 @@ def __init__(self, This property may be absent if the volume attachment's `status` is not `attached`. """ + self.bandwidth = bandwidth self.created_at = created_at self.delete_volume_on_instance_delete = delete_volume_on_instance_delete self.device = device @@ -47657,6 +49113,10 @@ def __init__(self, def from_dict(cls, _dict: Dict) -> 'VolumeAttachment': """Initialize a VolumeAttachment object from a json dictionary.""" args = {} + if 'bandwidth' in _dict: + args['bandwidth'] = _dict.get('bandwidth') + else: + raise ValueError('Required property \'bandwidth\' not present in VolumeAttachment JSON') if 'created_at' in _dict: args['created_at'] = string_to_datetime(_dict.get('created_at')) else: @@ -47699,6 +49159,8 @@ def _from_dict(cls, _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: @@ -48819,25 +50281,66 @@ class VolumePatch(): """ VolumePatch. + :attr int capacity: (optional) The capacity to use for the volume (in + gigabytes). The volume must be attached as a data volume to a virtual server + instance, and the specified value must not be less than the current capacity. + The minimum and maximum capacity limits for creating or updating volumes may + expand in the future. + :attr int iops: (optional) The maximum I/O operations per second (IOPS) to use + for the volume. Applicable only to volumes using a profile `family` of `custom`. + The volume must be attached as a data volume to a running virtual server + instance. :attr str name: (optional) The unique user-defined name for this volume. + :attr VolumeProfileIdentity profile: (optional) The profile to use for this + volume. The requested profile must be in the same + `family` as the current profile. The volume must be attached as a data volume + to a + running virtual server instance. """ def __init__(self, *, - name: str = None) -> None: + capacity: int = None, + iops: int = None, + name: str = None, + profile: 'VolumeProfileIdentity' = None) -> None: """ Initialize a VolumePatch object. + :param int capacity: (optional) The capacity to use for the volume (in + gigabytes). The volume must be attached as a data volume to a virtual + server instance, and the specified value must not be less than the current + capacity. + The minimum and maximum capacity limits for creating or updating volumes + may expand in the future. + :param int iops: (optional) The maximum I/O operations per second (IOPS) to + use for the volume. Applicable only to volumes using a profile `family` of + `custom`. The volume must be attached as a data volume to a running virtual + server instance. :param str name: (optional) The unique user-defined name for this volume. + :param VolumeProfileIdentity profile: (optional) The profile to use for + this volume. The requested profile must be in the same + `family` as the current profile. The volume must be attached as a data + volume to a + running virtual server instance. """ + self.capacity = capacity + self.iops = iops self.name = name + self.profile = profile @classmethod def from_dict(cls, _dict: Dict) -> 'VolumePatch': """Initialize a VolumePatch object from a json dictionary.""" args = {} + if 'capacity' in _dict: + args['capacity'] = _dict.get('capacity') + if 'iops' in _dict: + args['iops'] = _dict.get('iops') if 'name' in _dict: args['name'] = _dict.get('name') + if 'profile' in _dict: + args['profile'] = _dict.get('profile') return cls(**args) @classmethod @@ -48848,8 +50351,17 @@ def _from_dict(cls, _dict): def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} + if hasattr(self, 'capacity') and self.capacity is not None: + _dict['capacity'] = self.capacity + if hasattr(self, 'iops') and self.iops is not None: + _dict['iops'] = self.iops if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name + if hasattr(self, 'profile') and self.profile is not None: + if isinstance(self.profile, dict): + _dict['profile'] = self.profile + else: + _dict['profile'] = self.profile.to_dict() return _dict def _to_dict(self): @@ -48874,23 +50386,29 @@ class VolumeProfile(): """ VolumeProfile. - :attr str family: (optional) The product family this volume profile belongs to. + :attr str family: The product family this volume profile belongs to. + The enumerated values for this property will expand in the future. When + processing this property, check for and log unknown values. Optionally halt + processing and surface the error, or bypass the volume profile on which the + unexpected property value was encountered. :attr str href: The URL for this volume profile. :attr str name: The globally unique name for this volume profile. """ def __init__(self, + family: str, href: str, - name: str, - *, - family: str = None) -> None: + name: str) -> None: """ Initialize a VolumeProfile 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 family: (optional) The product family this volume profile - belongs to. """ self.family = family self.href = href @@ -48902,6 +50420,8 @@ def from_dict(cls, _dict: Dict) -> 'VolumeProfile': 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: @@ -48946,6 +50466,18 @@ def __ne__(self, other: 'VolumeProfile') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class FamilyEnum(str, Enum): + """ + The product family this volume profile belongs to. + The enumerated values for this property will expand in the future. When processing + this property, check for and log unknown values. Optionally halt processing and + surface the error, or bypass the volume profile on which the unexpected property + value was encountered. + """ + TIERED = 'tiered' + CUSTOM = 'custom' + + class VolumeProfileCollection(): """ VolumeProfileCollection. @@ -49246,7 +50778,10 @@ class VolumePrototype(): """ VolumePrototype. - :attr int iops: (optional) The bandwidth for the volume. + :attr int iops: (optional) The maximum I/O operations per second (IOPS) to use + for the volume. Applicable only to volumes using a profile `family` of `custom`. + The volume must be attached as a data volume to a running virtual server + instance. :attr str name: (optional) The unique user-defined name for this volume. :attr VolumeProfileIdentity profile: The profile to use for this volume. :attr ResourceGroupIdentity resource_group: (optional) The resource group to @@ -49267,7 +50802,10 @@ def __init__(self, :param VolumeProfileIdentity profile: The profile to use for this volume. :param ZoneIdentity zone: The zone this volume will reside in. - :param int iops: (optional) The bandwidth for the volume. + :param int iops: (optional) The maximum I/O operations per second (IOPS) to + use for the volume. Applicable only to volumes using a profile `family` of + `custom`. The volume must be attached as a data volume to a running virtual + server instance. :param str name: (optional) The unique user-defined name for this volume. :param ResourceGroupIdentity resource_group: (optional) The resource group to use. If unspecified, the account's [default resource @@ -49282,15 +50820,17 @@ class VolumePrototypeInstanceByImageContext(): """ VolumePrototypeInstanceByImageContext. - :attr int capacity: (optional) The capacity of the volume in gigabytes. The - specified minimum and maximum capacity values for creating or updating volumes - may expand in the future. + :attr int capacity: (optional) The capacity to use for the volume (in + gigabytes). The only allowed value is the image's `minimum_provisioned_size`, + but the allowed values are expected to expand in the future. + If unspecified, the capacity will be the image's `minimum_provisioned_size`. :attr EncryptionKeyIdentity encryption_key: (optional) The root key to use to wrap the data encryption key for the volume. If this property is not provided but the image is encrypted, the image's `encryption_key` will be used. Otherwise, the `encryption` type for the volume will be `provider_managed`. - :attr int iops: (optional) The bandwidth for the volume. + :attr int iops: (optional) The maximum I/O operations per second (IOPS) for the + volume. :attr str name: (optional) The unique user-defined name for this volume. :attr VolumeProfileIdentity profile: The profile to use for this volume. """ @@ -49306,15 +50846,19 @@ def __init__(self, Initialize a VolumePrototypeInstanceByImageContext object. :param VolumeProfileIdentity profile: The profile to use for this volume. - :param int capacity: (optional) The capacity of the volume in gigabytes. - The specified minimum and maximum capacity values for creating or updating - volumes may expand in the future. + :param int capacity: (optional) The capacity to use for the volume (in + gigabytes). The only allowed value is the image's + `minimum_provisioned_size`, but the allowed values are expected to expand + in the future. + If unspecified, the capacity will be the image's + `minimum_provisioned_size`. :param EncryptionKeyIdentity encryption_key: (optional) The root key to use to wrap the data encryption key for the volume. If this property is not provided but the image is encrypted, the image's `encryption_key` will be used. Otherwise, the `encryption` type for the volume will be `provider_managed`. - :param int iops: (optional) The bandwidth for the volume. + :param int iops: (optional) The maximum I/O operations per second (IOPS) + for the volume. :param str name: (optional) The unique user-defined name for this volume. """ self.capacity = capacity @@ -52244,6 +53788,7 @@ class FloatingIPTargetNetworkInterfaceReference(FloatingIPTarget): :attr str id: The unique identifier for this network interface. :attr str name: The user-defined name for this network interface. :attr str primary_ipv4_address: The primary IPv4 address. + If the address has not yet been selected, the value will be `0.0.0.0`. :attr str resource_type: The resource type. """ @@ -52262,6 +53807,7 @@ def __init__(self, :param str id: The unique identifier for this network interface. :param str name: The user-defined name for this network interface. :param str primary_ipv4_address: The primary IPv4 address. + If the address has not yet been selected, the value will be `0.0.0.0`. :param str resource_type: The resource type. :param NetworkInterfaceReferenceDeleted deleted: (optional) If present, this property indicates the referenced resource has been deleted and @@ -54842,6 +56388,22 @@ def __init__(self) -> None: ", ".join(['InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById', 'InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN', 'InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref'])) raise Exception(msg) +class InstancePlacementTargetPrototypePlacementGroupIdentity(InstancePlacementTargetPrototype): + """ + Identifies a placement group by a unique property. + + """ + + def __init__(self) -> None: + """ + Initialize a InstancePlacementTargetPrototypePlacementGroupIdentity object. + + """ + # pylint: disable=super-init-not-called + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityById', 'InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN', 'InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref'])) + raise Exception(msg) + class InstancePlacementTargetDedicatedHostGroupReference(InstancePlacementTarget): """ InstancePlacementTargetDedicatedHostGroupReference. @@ -55082,6 +56644,123 @@ class ResourceTypeEnum(str, Enum): DEDICATED_HOST = 'dedicated_host' +class InstancePlacementTargetPlacementGroupReference(InstancePlacementTarget): + """ + InstancePlacementTargetPlacementGroupReference. + + :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 user-defined name for this placement group. + :attr str resource_type: The resource type. + """ + + def __init__(self, + crn: str, + href: str, + id: str, + name: str, + resource_type: str, + *, + deleted: 'PlacementGroupReferenceDeleted' = None) -> None: + """ + Initialize a InstancePlacementTargetPlacementGroupReference 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 user-defined name for this placement group. + :param str resource_type: The resource type. + :param PlacementGroupReferenceDeleted deleted: (optional) If present, this + property indicates the referenced resource has been deleted and provides + 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) -> 'InstancePlacementTargetPlacementGroupReference': + """Initialize a InstancePlacementTargetPlacementGroupReference 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') + else: + raise ValueError('Required property \'resource_type\' not present in InstancePlacementTargetPlacementGroupReference JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """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: + _dict['deleted'] = self.deleted.to_dict() + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href + if hasattr(self, 'id') 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 InstancePlacementTargetPlacementGroupReference object.""" + return json.dumps(self.to_dict(), indent=2) + + 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: 'InstancePlacementTargetPlacementGroupReference') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class ResourceTypeEnum(str, Enum): + """ + The resource type. + """ + PLACEMENT_GROUP = 'placement_group' + + class InstanceProfileBandwidthDependent(InstanceProfileBandwidth): """ The total bandwidth shared across the network interfaces and storage volumes of an @@ -55150,7 +56829,7 @@ class TypeEnum(str, Enum): class InstanceProfileBandwidthEnum(InstanceProfileBandwidth): """ The permitted total bandwidth values (in megabits per second) shared across the - network interfaces of an instance with this profile. + network interfaces and storage volumes of an instance with this profile. :attr int default: The default value for this profile field. :attr str type: The type for this profile field. @@ -56978,18 +58657,350 @@ class TypeEnum(str, Enum): RANGE = 'range' +class InstanceProfileVolumeBandwidthDependent(InstanceProfileVolumeBandwidth): + """ + The storage bandwidth shared across the storage volumes 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 InstanceProfileVolumeBandwidthDependent 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) -> 'InstanceProfileVolumeBandwidthDependent': + """Initialize a InstanceProfileVolumeBandwidthDependent object from a json dictionary.""" + args = {} + if 'type' in _dict: + args['type'] = _dict.get('type') + else: + raise ValueError('Required property \'type\' not present in InstanceProfileVolumeBandwidthDependent JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """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, '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 InstanceProfileVolumeBandwidthDependent object.""" + return json.dumps(self.to_dict(), indent=2) + + 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: '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 InstanceProfileVolumeBandwidthEnum(InstanceProfileVolumeBandwidth): + """ + The permitted storage bandwidth values (in megabits per second) shared across the + storage volumes of an instance with this profile. + + :attr int default: The default value for this profile field. + :attr str type: The type for this profile field. + :attr List[int] values: The permitted values for this profile field. + """ + + def __init__(self, + default: int, + type: str, + values: List[int]) -> None: + """ + Initialize a InstanceProfileVolumeBandwidthEnum 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 + + @classmethod + def from_dict(cls, _dict: Dict) -> 'InstanceProfileVolumeBandwidthEnum': + """Initialize a InstanceProfileVolumeBandwidthEnum object from a json dictionary.""" + args = {} + if 'default' in _dict: + args['default'] = _dict.get('default') + else: + raise ValueError('Required property \'default\' not present in InstanceProfileVolumeBandwidthEnum JSON') + if 'type' in _dict: + args['type'] = _dict.get('type') + else: + raise ValueError('Required property \'type\' not present in InstanceProfileVolumeBandwidthEnum JSON') + if 'values' in _dict: + args['values'] = _dict.get('values') + else: + raise ValueError('Required property \'values\' not present in InstanceProfileVolumeBandwidthEnum JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """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, 'default') and self.default is not None: + _dict['default'] = self.default + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type + if hasattr(self, 'values') and self.values is not None: + _dict['values'] = self.values + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this InstanceProfileVolumeBandwidthEnum object.""" + return json.dumps(self.to_dict(), indent=2) + + 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: 'InstanceProfileVolumeBandwidthEnum') -> 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): + """ + The storage bandwidth (in megabits per second) shared across the storage volumes of an + instance with this profile. + + :attr str type: The type for this profile field. + :attr int value: The value for this profile field. + """ + + def __init__(self, + type: str, + value: int) -> None: + """ + Initialize a InstanceProfileVolumeBandwidthFixed object. + + :param str type: The type for this profile field. + :param int value: The value for this profile field. + """ + # pylint: disable=super-init-not-called + self.type = type + self.value = value + + @classmethod + def from_dict(cls, _dict: Dict) -> 'InstanceProfileVolumeBandwidthFixed': + """Initialize a InstanceProfileVolumeBandwidthFixed object from a json dictionary.""" + args = {} + if 'type' in _dict: + args['type'] = _dict.get('type') + else: + raise ValueError('Required property \'type\' not present in InstanceProfileVolumeBandwidthFixed JSON') + if 'value' in _dict: + args['value'] = _dict.get('value') + else: + raise ValueError('Required property \'value\' not present in InstanceProfileVolumeBandwidthFixed JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a 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, '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 InstanceProfileVolumeBandwidthFixed object.""" + return json.dumps(self.to_dict(), indent=2) + + 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: 'InstanceProfileVolumeBandwidthFixed') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class TypeEnum(str, Enum): + """ + The type for this profile field. + """ + FIXED = 'fixed' + + +class InstanceProfileVolumeBandwidthRange(InstanceProfileVolumeBandwidth): + """ + The permitted storage bandwidth range (in megabits per second) shared across the + storage volumes of an instance with this profile. + + :attr int default: The default value for this profile field. + :attr int max: The maximum value for this profile field. + :attr int min: The minimum value for this profile field. + :attr int step: The increment step value for this profile field. + :attr str type: The type for this profile field. + """ + + def __init__(self, + default: int, + max: int, + min: int, + step: int, + type: str) -> None: + """ + Initialize a InstanceProfileVolumeBandwidthRange object. + + :param int default: The default value for this profile field. + :param int max: The maximum value for this profile field. + :param int min: The minimum value for this profile field. + :param int step: The increment step value for this profile field. + :param str type: The type for this profile field. + """ + # 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) -> 'InstanceProfileVolumeBandwidthRange': + """Initialize a InstanceProfileVolumeBandwidthRange object from a json dictionary.""" + args = {} + if 'default' in _dict: + args['default'] = _dict.get('default') + else: + raise ValueError('Required property \'default\' not present in InstanceProfileVolumeBandwidthRange JSON') + if 'max' in _dict: + args['max'] = _dict.get('max') + else: + raise ValueError('Required property \'max\' not present in InstanceProfileVolumeBandwidthRange JSON') + if 'min' in _dict: + args['min'] = _dict.get('min') + else: + raise ValueError('Required property \'min\' not present in InstanceProfileVolumeBandwidthRange JSON') + if 'step' in _dict: + args['step'] = _dict.get('step') + else: + raise ValueError('Required property \'step\' not present in InstanceProfileVolumeBandwidthRange JSON') + if 'type' in _dict: + args['type'] = _dict.get('type') + else: + raise ValueError('Required property \'type\' not present in InstanceProfileVolumeBandwidthRange JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """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, 'default') and self.default is not None: + _dict['default'] = self.default + if hasattr(self, 'max') and self.max is not None: + _dict['max'] = self.max + if hasattr(self, 'min') and self.min is not None: + _dict['min'] = self.min + if hasattr(self, 'step') and self.step is not None: + _dict['step'] = self.step + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this InstanceProfileVolumeBandwidthRange object.""" + return json.dumps(self.to_dict(), indent=2) + + 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: 'InstanceProfileVolumeBandwidthRange') -> 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 InstancePrototypeInstanceByImage(InstancePrototype): """ InstancePrototypeInstanceByImage. :attr List[KeyIdentity] keys: (optional) The public SSH keys for the - administrative user of the virtual server instance. Up to 10 keys may be - provided; if no keys are provided the instance will be inaccessible unless the - image used provides another means of access. For Windows instances, one of the - keys will be used to encrypt the administrator password. - 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. + administrative user of the virtual server instance. Keys will be made available + to the virtual server instance as cloud-init vendor data. For cloud-init enabled + images, these keys will also be added as SSH authorized keys for the + administrative user. + For Windows images, at least one key must be specified, and one will be chosen + to encrypt [the administrator + password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys + are optional for other images, but if no keys are specified, the instance will + be inaccessible unless the specified image provides another means of access. :attr str name: (optional) The unique user-defined name for this virtual server instance (and default system hostname). If unspecified, the name will be a hyphenated list of randomly-selected words. @@ -57000,6 +59011,10 @@ class InstancePrototypeInstanceByImage(InstancePrototype): :attr InstanceProfileIdentity profile: (optional) The profile to use for this virtual server instance. :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 to be made available when setting up the virtual server instance. :attr List[VolumeAttachmentPrototypeInstanceContext] volume_attachments: @@ -57027,6 +59042,7 @@ def __init__(self, placement_target: 'InstancePlacementTargetPrototype' = None, profile: 'InstanceProfileIdentity' = None, resource_group: 'ResourceGroupIdentity' = None, + total_volume_bandwidth: int = None, user_data: str = None, volume_attachments: List['VolumeAttachmentPrototypeInstanceContext'] = None, vpc: 'VPCIdentity' = None, @@ -57041,13 +59057,16 @@ def __init__(self, :param ZoneIdentity zone: The zone this virtual server instance will reside in. :param List[KeyIdentity] keys: (optional) The public SSH keys for the - administrative user of the virtual server instance. Up to 10 keys may be - provided; if no keys are provided the instance will be inaccessible unless - the image used provides another means of access. For Windows instances, one - of the keys will be used to encrypt the administrator password. - 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. + administrative user of the virtual server instance. Keys will be made + available to the virtual server instance as cloud-init vendor data. For + cloud-init enabled images, these keys will also be added as SSH authorized + keys for the administrative user. + For Windows images, at least one key must be specified, and one will be + chosen to encrypt [the administrator + password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). + Keys are optional for other images, but if no keys are specified, the + instance will be inaccessible unless the specified image provides another + means of access. :param str name: (optional) The unique user-defined name for this virtual server instance (and default system hostname). If unspecified, the name will be a hyphenated list of randomly-selected words. @@ -57058,6 +59077,10 @@ def __init__(self, :param InstanceProfileIdentity profile: (optional) The profile to use for this virtual server instance. :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 to be made available when setting up the virtual server instance. :param List[VolumeAttachmentPrototypeInstanceContext] volume_attachments: @@ -57076,6 +59099,7 @@ def __init__(self, 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 @@ -57100,6 +59124,8 @@ def from_dict(cls, _dict: Dict) -> 'InstancePrototypeInstanceByImage': 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: @@ -57157,6 +59183,8 @@ def to_dict(self) -> 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: @@ -57205,13 +59233,15 @@ class InstancePrototypeInstanceBySourceTemplate(InstancePrototype): InstancePrototypeInstanceBySourceTemplate. :attr List[KeyIdentity] keys: (optional) The public SSH keys for the - administrative user of the virtual server instance. Up to 10 keys may be - provided; if no keys are provided the instance will be inaccessible unless the - image used provides another means of access. For Windows instances, one of the - keys will be used to encrypt the administrator password. - 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. + administrative user of the virtual server instance. Keys will be made available + to the virtual server instance as cloud-init vendor data. For cloud-init enabled + images, these keys will also be added as SSH authorized keys for the + administrative user. + For Windows images, at least one key must be specified, and one will be chosen + to encrypt [the administrator + password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys + are optional for other images, but if no keys are specified, the instance will + be inaccessible unless the specified image provides another means of access. :attr str name: (optional) The unique user-defined name for this virtual server instance (and default system hostname). If unspecified, the name will be a hyphenated list of randomly-selected words. @@ -57222,6 +59252,10 @@ class InstancePrototypeInstanceBySourceTemplate(InstancePrototype): :attr InstanceProfileIdentity profile: (optional) The profile to use for this virtual server instance. :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 to be made available when setting up the virtual server instance. :attr List[VolumeAttachmentPrototypeInstanceContext] volume_attachments: @@ -57235,8 +59269,8 @@ class InstancePrototypeInstanceBySourceTemplate(InstancePrototype): virtual server instance. :attr NetworkInterfacePrototype primary_network_interface: (optional) Primary network interface. - :attr InstanceTemplateIdentity source_template: Identifies an instance template - by a unique property. + :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. """ @@ -57250,6 +59284,7 @@ def __init__(self, placement_target: 'InstancePlacementTargetPrototype' = None, profile: 'InstanceProfileIdentity' = None, resource_group: 'ResourceGroupIdentity' = None, + total_volume_bandwidth: int = None, user_data: str = None, volume_attachments: List['VolumeAttachmentPrototypeInstanceContext'] = None, vpc: 'VPCIdentity' = None, @@ -57260,16 +59295,19 @@ def __init__(self, """ Initialize a InstancePrototypeInstanceBySourceTemplate object. - :param InstanceTemplateIdentity source_template: Identifies an instance - template by a unique property. + :param InstanceTemplateIdentity source_template: The template to create + this virtual server instance from. :param List[KeyIdentity] keys: (optional) The public SSH keys for the - administrative user of the virtual server instance. Up to 10 keys may be - provided; if no keys are provided the instance will be inaccessible unless - the image used provides another means of access. For Windows instances, one - of the keys will be used to encrypt the administrator password. - 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. + administrative user of the virtual server instance. Keys will be made + available to the virtual server instance as cloud-init vendor data. For + cloud-init enabled images, these keys will also be added as SSH authorized + keys for the administrative user. + For Windows images, at least one key must be specified, and one will be + chosen to encrypt [the administrator + password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). + Keys are optional for other images, but if no keys are specified, the + instance will be inaccessible unless the specified image provides another + means of access. :param str name: (optional) The unique user-defined name for this virtual server instance (and default system hostname). If unspecified, the name will be a hyphenated list of randomly-selected words. @@ -57280,6 +59318,10 @@ def __init__(self, :param InstanceProfileIdentity profile: (optional) The profile to use for this virtual server instance. :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 to be made available when setting up the virtual server instance. :param List[VolumeAttachmentPrototypeInstanceContext] volume_attachments: @@ -57304,6 +59346,7 @@ def __init__(self, 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 @@ -57329,6 +59372,8 @@ def from_dict(cls, _dict: Dict) -> 'InstancePrototypeInstanceBySourceTemplate': 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: @@ -57384,6 +59429,8 @@ def to_dict(self) -> 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: @@ -57437,13 +59484,15 @@ class InstancePrototypeInstanceByVolume(InstancePrototype): InstancePrototypeInstanceByVolume. :attr List[KeyIdentity] keys: (optional) The public SSH keys for the - administrative user of the virtual server instance. Up to 10 keys may be - provided; if no keys are provided the instance will be inaccessible unless the - image used provides another means of access. For Windows instances, one of the - keys will be used to encrypt the administrator password. - 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. + administrative user of the virtual server instance. Keys will be made available + to the virtual server instance as cloud-init vendor data. For cloud-init enabled + images, these keys will also be added as SSH authorized keys for the + administrative user. + For Windows images, at least one key must be specified, and one will be chosen + to encrypt [the administrator + password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys + are optional for other images, but if no keys are specified, the instance will + be inaccessible unless the specified image provides another means of access. :attr str name: (optional) The unique user-defined name for this virtual server instance (and default system hostname). If unspecified, the name will be a hyphenated list of randomly-selected words. @@ -57454,6 +59503,10 @@ class InstancePrototypeInstanceByVolume(InstancePrototype): :attr InstanceProfileIdentity profile: (optional) The profile to use for this virtual server instance. :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 to be made available when setting up the virtual server instance. :attr List[VolumeAttachmentPrototypeInstanceContext] volume_attachments: @@ -57479,6 +59532,7 @@ def __init__(self, placement_target: 'InstancePlacementTargetPrototype' = None, profile: 'InstanceProfileIdentity' = None, resource_group: 'ResourceGroupIdentity' = None, + total_volume_bandwidth: int = None, user_data: str = None, volume_attachments: List['VolumeAttachmentPrototypeInstanceContext'] = None, vpc: 'VPCIdentity' = None) -> None: @@ -57493,13 +59547,16 @@ def __init__(self, :param ZoneIdentity zone: The zone this virtual server instance will reside in. :param List[KeyIdentity] keys: (optional) The public SSH keys for the - administrative user of the virtual server instance. Up to 10 keys may be - provided; if no keys are provided the instance will be inaccessible unless - the image used provides another means of access. For Windows instances, one - of the keys will be used to encrypt the administrator password. - 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. + administrative user of the virtual server instance. Keys will be made + available to the virtual server instance as cloud-init vendor data. For + cloud-init enabled images, these keys will also be added as SSH authorized + keys for the administrative user. + For Windows images, at least one key must be specified, and one will be + chosen to encrypt [the administrator + password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). + Keys are optional for other images, but if no keys are specified, the + instance will be inaccessible unless the specified image provides another + means of access. :param str name: (optional) The unique user-defined name for this virtual server instance (and default system hostname). If unspecified, the name will be a hyphenated list of randomly-selected words. @@ -57510,6 +59567,10 @@ def __init__(self, :param InstanceProfileIdentity profile: (optional) The profile to use for this virtual server instance. :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 to be made available when setting up the virtual server instance. :param List[VolumeAttachmentPrototypeInstanceContext] volume_attachments: @@ -57525,6 +59586,7 @@ def __init__(self, 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 @@ -57548,6 +59610,8 @@ def from_dict(cls, _dict: Dict) -> 'InstancePrototypeInstanceByVolume': 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: @@ -57603,6 +59667,8 @@ def to_dict(self) -> 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: @@ -57817,13 +59883,15 @@ class InstanceTemplatePrototypeInstanceByImage(InstanceTemplatePrototype): InstanceTemplatePrototypeInstanceByImage. :attr List[KeyIdentity] keys: (optional) The public SSH keys for the - administrative user of the virtual server instance. Up to 10 keys may be - provided; if no keys are provided the instance will be inaccessible unless the - image used provides another means of access. For Windows instances, one of the - keys will be used to encrypt the administrator password. - 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. + administrative user of the virtual server instance. Keys will be made available + to the virtual server instance as cloud-init vendor data. For cloud-init enabled + images, these keys will also be added as SSH authorized keys for the + administrative user. + For Windows images, at least one key must be specified, and one will be chosen + to encrypt [the administrator + password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys + are optional for other images, but if no keys are specified, the instance will + be inaccessible unless the specified image provides another means of access. :attr str name: (optional) The unique user-defined name for this virtual server instance (and default system hostname). If unspecified, the name will be a hyphenated list of randomly-selected words. @@ -57834,6 +59902,10 @@ class InstanceTemplatePrototypeInstanceByImage(InstanceTemplatePrototype): :attr InstanceProfileIdentity profile: (optional) The profile to use for this virtual server instance. :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 to be made available when setting up the virtual server instance. :attr List[VolumeAttachmentPrototypeInstanceContext] volume_attachments: @@ -57861,6 +59933,7 @@ def __init__(self, placement_target: 'InstancePlacementTargetPrototype' = None, profile: 'InstanceProfileIdentity' = None, resource_group: 'ResourceGroupIdentity' = None, + total_volume_bandwidth: int = None, user_data: str = None, volume_attachments: List['VolumeAttachmentPrototypeInstanceContext'] = None, vpc: 'VPCIdentity' = None, @@ -57875,13 +59948,16 @@ def __init__(self, :param ZoneIdentity zone: The zone this virtual server instance will reside in. :param List[KeyIdentity] keys: (optional) The public SSH keys for the - administrative user of the virtual server instance. Up to 10 keys may be - provided; if no keys are provided the instance will be inaccessible unless - the image used provides another means of access. For Windows instances, one - of the keys will be used to encrypt the administrator password. - 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. + administrative user of the virtual server instance. Keys will be made + available to the virtual server instance as cloud-init vendor data. For + cloud-init enabled images, these keys will also be added as SSH authorized + keys for the administrative user. + For Windows images, at least one key must be specified, and one will be + chosen to encrypt [the administrator + password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). + Keys are optional for other images, but if no keys are specified, the + instance will be inaccessible unless the specified image provides another + means of access. :param str name: (optional) The unique user-defined name for this virtual server instance (and default system hostname). If unspecified, the name will be a hyphenated list of randomly-selected words. @@ -57892,6 +59968,10 @@ def __init__(self, :param InstanceProfileIdentity profile: (optional) The profile to use for this virtual server instance. :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 to be made available when setting up the virtual server instance. :param List[VolumeAttachmentPrototypeInstanceContext] volume_attachments: @@ -57910,6 +59990,7 @@ def __init__(self, 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 @@ -57934,6 +60015,8 @@ def from_dict(cls, _dict: Dict) -> 'InstanceTemplatePrototypeInstanceByImage': 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: @@ -57991,6 +60074,8 @@ def to_dict(self) -> 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: @@ -58039,13 +60124,15 @@ class InstanceTemplatePrototypeInstanceBySourceTemplate(InstanceTemplatePrototyp InstanceTemplatePrototypeInstanceBySourceTemplate. :attr List[KeyIdentity] keys: (optional) The public SSH keys for the - administrative user of the virtual server instance. Up to 10 keys may be - provided; if no keys are provided the instance will be inaccessible unless the - image used provides another means of access. For Windows instances, one of the - keys will be used to encrypt the administrator password. - 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. + administrative user of the virtual server instance. Keys will be made available + to the virtual server instance as cloud-init vendor data. For cloud-init enabled + images, these keys will also be added as SSH authorized keys for the + administrative user. + For Windows images, at least one key must be specified, and one will be chosen + to encrypt [the administrator + password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys + are optional for other images, but if no keys are specified, the instance will + be inaccessible unless the specified image provides another means of access. :attr str name: (optional) The unique user-defined name for this virtual server instance (and default system hostname). If unspecified, the name will be a hyphenated list of randomly-selected words. @@ -58056,6 +60143,10 @@ class InstanceTemplatePrototypeInstanceBySourceTemplate(InstanceTemplatePrototyp :attr InstanceProfileIdentity profile: (optional) The profile to use for this virtual server instance. :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 to be made available when setting up the virtual server instance. :attr List[VolumeAttachmentPrototypeInstanceContext] volume_attachments: @@ -58069,8 +60160,8 @@ class InstanceTemplatePrototypeInstanceBySourceTemplate(InstanceTemplatePrototyp virtual server instance. :attr NetworkInterfacePrototype primary_network_interface: (optional) Primary network interface. - :attr InstanceTemplateIdentity source_template: Identifies an instance template - by a unique property. + :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. """ @@ -58084,6 +60175,7 @@ def __init__(self, placement_target: 'InstancePlacementTargetPrototype' = None, profile: 'InstanceProfileIdentity' = None, resource_group: 'ResourceGroupIdentity' = None, + total_volume_bandwidth: int = None, user_data: str = None, volume_attachments: List['VolumeAttachmentPrototypeInstanceContext'] = None, vpc: 'VPCIdentity' = None, @@ -58094,16 +60186,19 @@ def __init__(self, """ Initialize a InstanceTemplatePrototypeInstanceBySourceTemplate object. - :param InstanceTemplateIdentity source_template: Identifies an instance - template by a unique property. + :param InstanceTemplateIdentity source_template: The template to create + this virtual server instance from. :param List[KeyIdentity] keys: (optional) The public SSH keys for the - administrative user of the virtual server instance. Up to 10 keys may be - provided; if no keys are provided the instance will be inaccessible unless - the image used provides another means of access. For Windows instances, one - of the keys will be used to encrypt the administrator password. - 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. + administrative user of the virtual server instance. Keys will be made + available to the virtual server instance as cloud-init vendor data. For + cloud-init enabled images, these keys will also be added as SSH authorized + keys for the administrative user. + For Windows images, at least one key must be specified, and one will be + chosen to encrypt [the administrator + password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). + Keys are optional for other images, but if no keys are specified, the + instance will be inaccessible unless the specified image provides another + means of access. :param str name: (optional) The unique user-defined name for this virtual server instance (and default system hostname). If unspecified, the name will be a hyphenated list of randomly-selected words. @@ -58114,6 +60209,10 @@ def __init__(self, :param InstanceProfileIdentity profile: (optional) The profile to use for this virtual server instance. :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 to be made available when setting up the virtual server instance. :param List[VolumeAttachmentPrototypeInstanceContext] volume_attachments: @@ -58138,6 +60237,7 @@ def __init__(self, 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 @@ -58163,6 +60263,8 @@ def from_dict(cls, _dict: Dict) -> 'InstanceTemplatePrototypeInstanceBySourceTem 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: @@ -58218,6 +60320,8 @@ def to_dict(self) -> 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: @@ -58271,13 +60375,15 @@ class InstanceTemplatePrototypeInstanceByVolume(InstanceTemplatePrototype): InstanceTemplatePrototypeInstanceByVolume. :attr List[KeyIdentity] keys: (optional) The public SSH keys for the - administrative user of the virtual server instance. Up to 10 keys may be - provided; if no keys are provided the instance will be inaccessible unless the - image used provides another means of access. For Windows instances, one of the - keys will be used to encrypt the administrator password. - 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. + administrative user of the virtual server instance. Keys will be made available + to the virtual server instance as cloud-init vendor data. For cloud-init enabled + images, these keys will also be added as SSH authorized keys for the + administrative user. + For Windows images, at least one key must be specified, and one will be chosen + to encrypt [the administrator + password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys + are optional for other images, but if no keys are specified, the instance will + be inaccessible unless the specified image provides another means of access. :attr str name: (optional) The unique user-defined name for this virtual server instance (and default system hostname). If unspecified, the name will be a hyphenated list of randomly-selected words. @@ -58288,6 +60394,10 @@ class InstanceTemplatePrototypeInstanceByVolume(InstanceTemplatePrototype): :attr InstanceProfileIdentity profile: (optional) The profile to use for this virtual server instance. :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 to be made available when setting up the virtual server instance. :attr List[VolumeAttachmentPrototypeInstanceContext] volume_attachments: @@ -58313,6 +60423,7 @@ def __init__(self, placement_target: 'InstancePlacementTargetPrototype' = None, profile: 'InstanceProfileIdentity' = None, resource_group: 'ResourceGroupIdentity' = None, + total_volume_bandwidth: int = None, user_data: str = None, volume_attachments: List['VolumeAttachmentPrototypeInstanceContext'] = None, vpc: 'VPCIdentity' = None) -> None: @@ -58327,13 +60438,16 @@ def __init__(self, :param ZoneIdentity zone: The zone this virtual server instance will reside in. :param List[KeyIdentity] keys: (optional) The public SSH keys for the - administrative user of the virtual server instance. Up to 10 keys may be - provided; if no keys are provided the instance will be inaccessible unless - the image used provides another means of access. For Windows instances, one - of the keys will be used to encrypt the administrator password. - 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. + administrative user of the virtual server instance. Keys will be made + available to the virtual server instance as cloud-init vendor data. For + cloud-init enabled images, these keys will also be added as SSH authorized + keys for the administrative user. + For Windows images, at least one key must be specified, and one will be + chosen to encrypt [the administrator + password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). + Keys are optional for other images, but if no keys are specified, the + instance will be inaccessible unless the specified image provides another + means of access. :param str name: (optional) The unique user-defined name for this virtual server instance (and default system hostname). If unspecified, the name will be a hyphenated list of randomly-selected words. @@ -58344,6 +60458,10 @@ def __init__(self, :param InstanceProfileIdentity profile: (optional) The profile to use for this virtual server instance. :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 to be made available when setting up the virtual server instance. :param List[VolumeAttachmentPrototypeInstanceContext] volume_attachments: @@ -58359,6 +60477,7 @@ def __init__(self, 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 @@ -58382,6 +60501,8 @@ def from_dict(cls, _dict: Dict) -> 'InstanceTemplatePrototypeInstanceByVolume': 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: @@ -58437,6 +60558,8 @@ def to_dict(self) -> 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: @@ -58485,13 +60608,15 @@ class InstanceTemplateInstanceByImage(InstanceTemplate): :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. Up to 10 keys may be - provided; if no keys are provided the instance will be inaccessible unless the - image used provides another means of access. For Windows instances, one of the - keys will be used to encrypt the administrator password. - 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. + administrative user of the virtual server instance. Keys will be made available + to the virtual server instance as cloud-init vendor data. For cloud-init enabled + images, these keys will also be added as SSH authorized keys for the + administrative user. + For Windows images, at least one key must be specified, and one will be chosen + to encrypt [the administrator + password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys + are optional for other images, but if no keys are specified, the instance will + be inaccessible unless the specified image provides another means of access. :attr str name: The unique user-defined name for this instance template. :attr List[NetworkInterfacePrototype] network_interfaces: (optional) The additional network interfaces to create for the virtual server instance. @@ -58501,6 +60626,10 @@ class InstanceTemplateInstanceByImage(InstanceTemplate): virtual server instance. :attr ResourceGroupReference resource_group: The resource group for this instance template. + :attr int total_volume_bandwidth: (optional) The amount of bandwidth (in + megabits per second) allocated exclusively to instance storage volumes. An + increase in this value will result in a corresponding decrease to + `total_network_bandwidth`. :attr str user_data: (optional) User data to be made available when setting up the virtual server instance. :attr List[VolumeAttachmentPrototypeInstanceContext] volume_attachments: @@ -58532,6 +60661,7 @@ def __init__(self, network_interfaces: List['NetworkInterfacePrototype'] = None, placement_target: 'InstancePlacementTargetPrototype' = None, profile: 'InstanceProfileIdentity' = None, + total_volume_bandwidth: int = None, user_data: str = None, volume_attachments: List['VolumeAttachmentPrototypeInstanceContext'] = None, vpc: 'VPCIdentity' = None, @@ -58554,19 +60684,26 @@ def __init__(self, :param ZoneIdentity zone: The zone this virtual server instance will reside in. :param List[KeyIdentity] keys: (optional) The public SSH keys for the - administrative user of the virtual server instance. Up to 10 keys may be - provided; if no keys are provided the instance will be inaccessible unless - the image used provides another means of access. For Windows instances, one - of the keys will be used to encrypt the administrator password. - 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. + administrative user of the virtual server instance. Keys will be made + available to the virtual server instance as cloud-init vendor data. For + cloud-init enabled images, these keys will also be added as SSH authorized + keys for the administrative user. + For Windows images, at least one key must be specified, and one will be + chosen to encrypt [the administrator + password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). + Keys are optional for other images, but if no keys are specified, the + instance will be inaccessible unless the specified image provides another + means of access. :param List[NetworkInterfacePrototype] network_interfaces: (optional) The additional network interfaces to create for the virtual server instance. :param InstancePlacementTargetPrototype placement_target: (optional) The placement restrictions to use for the virtual server instance. :param InstanceProfileIdentity profile: (optional) The profile to use for this virtual server instance. + :param int total_volume_bandwidth: (optional) The amount of bandwidth (in + megabits per second) allocated exclusively to instance storage volumes. An + increase in this value will result in a corresponding decrease to + `total_network_bandwidth`. :param str user_data: (optional) User data to be made available when setting up the virtual server instance. :param List[VolumeAttachmentPrototypeInstanceContext] volume_attachments: @@ -58589,6 +60726,7 @@ def __init__(self, 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 @@ -58633,6 +60771,8 @@ def from_dict(cls, _dict: Dict) -> 'InstanceTemplateInstanceByImage': args['resource_group'] = ResourceGroupReference.from_dict(_dict.get('resource_group')) else: raise ValueError('Required property \'resource_group\' not present in InstanceTemplateInstanceByImage JSON') + if 'total_volume_bandwidth' in _dict: + args['total_volume_bandwidth'] = _dict.get('total_volume_bandwidth') if 'user_data' in _dict: args['user_data'] = _dict.get('user_data') if 'volume_attachments' in _dict: @@ -58695,6 +60835,8 @@ def to_dict(self) -> Dict: _dict['profile'] = self.profile.to_dict() if hasattr(self, 'resource_group') and self.resource_group is not None: _dict['resource_group'] = self.resource_group.to_dict() + if hasattr(self, 'total_volume_bandwidth') and self.total_volume_bandwidth is not None: + _dict['total_volume_bandwidth'] = self.total_volume_bandwidth if hasattr(self, 'user_data') and self.user_data is not None: _dict['user_data'] = self.user_data if hasattr(self, 'volume_attachments') and self.volume_attachments is not None: @@ -58738,279 +60880,6 @@ def __ne__(self, other: 'InstanceTemplateInstanceByImage') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class InstanceTemplateInstanceBySourceTemplate(InstanceTemplate): - """ - InstanceTemplateInstanceBySourceTemplate. - - :attr datetime created_at: The date and time that the instance template was - created. - :attr str crn: The CRN for this instance template. - :attr str href: The URL for this instance template. - :attr str id: The unique identifier for this instance template. - :attr List[KeyIdentity] keys: (optional) The public SSH keys for the - administrative user of the virtual server instance. Up to 10 keys may be - provided; if no keys are provided the instance will be inaccessible unless the - image used provides another means of access. For Windows instances, one of the - keys will be used to encrypt the administrator password. - 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. - :attr str name: The unique user-defined name for this instance template. - :attr List[NetworkInterfacePrototype] network_interfaces: (optional) The - additional network interfaces to create for the virtual server instance. - :attr InstancePlacementTargetPrototype placement_target: (optional) The - placement restrictions to use for the virtual server instance. - :attr InstanceProfileIdentity profile: (optional) The profile to use for this - virtual server instance. - :attr ResourceGroupReference resource_group: The resource group for this - instance template. - :attr str user_data: (optional) User data to be made available when setting up - the virtual server instance. - :attr List[VolumeAttachmentPrototypeInstanceContext] volume_attachments: - (optional) The volume attachments for this virtual server instance. - :attr VPCIdentity vpc: (optional) The VPC the virtual server instance is to be a - part of. If provided, must match the VPC tied to the subnets of the instance's - network interfaces. - :attr VolumeAttachmentPrototypeInstanceByImageContext boot_volume_attachment: - (optional) The boot volume attachment for the virtual server instance. - :attr ImageIdentity image: (optional) The image to use when provisioning the - virtual server instance. - :attr NetworkInterfacePrototype primary_network_interface: (optional) Primary - network interface. - :attr InstanceTemplateIdentity source_template: Identifies an instance template - by a unique property. - :attr ZoneIdentity zone: (optional) 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', - source_template: 'InstanceTemplateIdentity', - *, - keys: List['KeyIdentity'] = None, - network_interfaces: List['NetworkInterfacePrototype'] = None, - placement_target: 'InstancePlacementTargetPrototype' = None, - profile: 'InstanceProfileIdentity' = None, - user_data: str = None, - volume_attachments: List['VolumeAttachmentPrototypeInstanceContext'] = None, - vpc: 'VPCIdentity' = None, - boot_volume_attachment: 'VolumeAttachmentPrototypeInstanceByImageContext' = None, - image: 'ImageIdentity' = None, - primary_network_interface: 'NetworkInterfacePrototype' = None, - zone: 'ZoneIdentity' = None) -> None: - """ - Initialize a InstanceTemplateInstanceBySourceTemplate object. - - :param datetime created_at: The date and time that the instance template - was created. - :param str crn: The CRN for this instance template. - :param str href: The URL for this instance template. - :param str id: The unique identifier for this instance template. - :param str name: The unique user-defined name for this instance template. - :param ResourceGroupReference resource_group: The resource group for this - instance template. - :param InstanceTemplateIdentity source_template: Identifies an instance - template by a unique property. - :param List[KeyIdentity] keys: (optional) The public SSH keys for the - administrative user of the virtual server instance. Up to 10 keys may be - provided; if no keys are provided the instance will be inaccessible unless - the image used provides another means of access. For Windows instances, one - of the keys will be used to encrypt the administrator password. - 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. - :param List[NetworkInterfacePrototype] network_interfaces: (optional) The - additional network interfaces to create for the virtual server instance. - :param InstancePlacementTargetPrototype placement_target: (optional) The - placement restrictions to use for the virtual server instance. - :param InstanceProfileIdentity profile: (optional) The profile to use for - this virtual server instance. - :param str user_data: (optional) User data to be made available when - setting up the virtual server instance. - :param List[VolumeAttachmentPrototypeInstanceContext] volume_attachments: - (optional) The volume attachments for this virtual server instance. - :param VPCIdentity vpc: (optional) The VPC the virtual server instance is - to be a part of. If provided, must match the VPC tied to the subnets of the - instance's network interfaces. - :param VolumeAttachmentPrototypeInstanceByImageContext - boot_volume_attachment: (optional) The boot volume attachment for the - virtual server instance. - :param ImageIdentity image: (optional) The image to use when provisioning - the virtual server instance. - :param NetworkInterfacePrototype primary_network_interface: (optional) - Primary network interface. - :param ZoneIdentity zone: (optional) The zone this virtual server instance - will reside in. - """ - # pylint: disable=super-init-not-called - self.created_at = created_at - self.crn = crn - self.href = href - self.id = id - self.keys = keys - self.name = name - self.network_interfaces = network_interfaces - self.placement_target = placement_target - self.profile = profile - self.resource_group = resource_group - self.user_data = user_data - self.volume_attachments = volume_attachments - self.vpc = vpc - self.boot_volume_attachment = boot_volume_attachment - self.image = image - self.primary_network_interface = primary_network_interface - self.source_template = source_template - self.zone = zone - - @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceTemplateInstanceBySourceTemplate': - """Initialize a InstanceTemplateInstanceBySourceTemplate 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 InstanceTemplateInstanceBySourceTemplate JSON') - if 'crn' in _dict: - args['crn'] = _dict.get('crn') - else: - raise ValueError('Required property \'crn\' not present in InstanceTemplateInstanceBySourceTemplate JSON') - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in InstanceTemplateInstanceBySourceTemplate JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') - else: - raise ValueError('Required property \'id\' not present in InstanceTemplateInstanceBySourceTemplate JSON') - if 'keys' in _dict: - args['keys'] = _dict.get('keys') - if 'name' in _dict: - args['name'] = _dict.get('name') - else: - raise ValueError('Required property \'name\' not present in InstanceTemplateInstanceBySourceTemplate JSON') - if 'network_interfaces' in _dict: - args['network_interfaces'] = [NetworkInterfacePrototype.from_dict(x) for x in _dict.get('network_interfaces')] - if 'placement_target' in _dict: - args['placement_target'] = _dict.get('placement_target') - if 'profile' in _dict: - args['profile'] = _dict.get('profile') - if 'resource_group' in _dict: - args['resource_group'] = ResourceGroupReference.from_dict(_dict.get('resource_group')) - else: - raise ValueError('Required property \'resource_group\' not present in InstanceTemplateInstanceBySourceTemplate JSON') - if 'user_data' in _dict: - args['user_data'] = _dict.get('user_data') - if 'volume_attachments' in _dict: - args['volume_attachments'] = [VolumeAttachmentPrototypeInstanceContext.from_dict(x) for x in _dict.get('volume_attachments')] - if 'vpc' in _dict: - args['vpc'] = _dict.get('vpc') - if 'boot_volume_attachment' in _dict: - args['boot_volume_attachment'] = VolumeAttachmentPrototypeInstanceByImageContext.from_dict(_dict.get('boot_volume_attachment')) - if 'image' in _dict: - args['image'] = _dict.get('image') - if 'primary_network_interface' in _dict: - args['primary_network_interface'] = NetworkInterfacePrototype.from_dict(_dict.get('primary_network_interface')) - if 'source_template' in _dict: - args['source_template'] = _dict.get('source_template') - else: - raise ValueError('Required property \'source_template\' not present in InstanceTemplateInstanceBySourceTemplate JSON') - if 'zone' in _dict: - args['zone'] = _dict.get('zone') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a InstanceTemplateInstanceBySourceTemplate object from 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, 'keys') and self.keys is not None: - keys_list = [] - for x in self.keys: - if isinstance(x, dict): - keys_list.append(x) - else: - keys_list.append(x.to_dict()) - _dict['keys'] = keys_list - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'network_interfaces') and self.network_interfaces is not None: - _dict['network_interfaces'] = [x.to_dict() for x in self.network_interfaces] - if hasattr(self, 'placement_target') and self.placement_target is not None: - if isinstance(self.placement_target, dict): - _dict['placement_target'] = self.placement_target - else: - _dict['placement_target'] = self.placement_target.to_dict() - if hasattr(self, 'profile') and self.profile is not None: - if isinstance(self.profile, dict): - _dict['profile'] = self.profile - else: - _dict['profile'] = self.profile.to_dict() - if hasattr(self, 'resource_group') and self.resource_group is not None: - _dict['resource_group'] = self.resource_group.to_dict() - if hasattr(self, 'user_data') and self.user_data is not None: - _dict['user_data'] = self.user_data - if hasattr(self, 'volume_attachments') and self.volume_attachments is not None: - _dict['volume_attachments'] = [x.to_dict() for x in self.volume_attachments] - if hasattr(self, 'vpc') and self.vpc is not None: - if isinstance(self.vpc, dict): - _dict['vpc'] = self.vpc - else: - _dict['vpc'] = self.vpc.to_dict() - if hasattr(self, 'boot_volume_attachment') and self.boot_volume_attachment is not None: - _dict['boot_volume_attachment'] = self.boot_volume_attachment.to_dict() - if hasattr(self, 'image') and self.image is not None: - if isinstance(self.image, dict): - _dict['image'] = self.image - else: - _dict['image'] = self.image.to_dict() - if hasattr(self, 'primary_network_interface') and self.primary_network_interface is not None: - _dict['primary_network_interface'] = self.primary_network_interface.to_dict() - if 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 InstanceTemplateInstanceBySourceTemplate object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'InstanceTemplateInstanceBySourceTemplate') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ - - def __ne__(self, other: 'InstanceTemplateInstanceBySourceTemplate') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - class InstanceTemplateInstanceByVolume(InstanceTemplate): """ InstanceTemplateInstanceByVolume. @@ -59021,13 +60890,15 @@ class InstanceTemplateInstanceByVolume(InstanceTemplate): :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. Up to 10 keys may be - provided; if no keys are provided the instance will be inaccessible unless the - image used provides another means of access. For Windows instances, one of the - keys will be used to encrypt the administrator password. - 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. + administrative user of the virtual server instance. Keys will be made available + to the virtual server instance as cloud-init vendor data. For cloud-init enabled + images, these keys will also be added as SSH authorized keys for the + administrative user. + For Windows images, at least one key must be specified, and one will be chosen + to encrypt [the administrator + password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys + are optional for other images, but if no keys are specified, the instance will + be inaccessible unless the specified image provides another means of access. :attr str name: The unique user-defined name for this instance template. :attr List[NetworkInterfacePrototype] network_interfaces: (optional) The additional network interfaces to create for the virtual server instance. @@ -59037,6 +60908,10 @@ class InstanceTemplateInstanceByVolume(InstanceTemplate): virtual server instance. :attr ResourceGroupReference resource_group: The resource group for this instance template. + :attr int total_volume_bandwidth: (optional) The amount of bandwidth (in + megabits per second) allocated exclusively to instance storage volumes. An + increase in this value will result in a corresponding decrease to + `total_network_bandwidth`. :attr str user_data: (optional) User data to be made available when setting up the virtual server instance. :attr List[VolumeAttachmentPrototypeInstanceContext] volume_attachments: @@ -59066,6 +60941,7 @@ def __init__(self, network_interfaces: List['NetworkInterfacePrototype'] = None, placement_target: 'InstancePlacementTargetPrototype' = None, profile: 'InstanceProfileIdentity' = None, + total_volume_bandwidth: int = None, user_data: str = None, volume_attachments: List['VolumeAttachmentPrototypeInstanceContext'] = None, vpc: 'VPCIdentity' = None) -> None: @@ -59088,19 +60964,26 @@ def __init__(self, :param ZoneIdentity zone: The zone this virtual server instance will reside in. :param List[KeyIdentity] keys: (optional) The public SSH keys for the - administrative user of the virtual server instance. Up to 10 keys may be - provided; if no keys are provided the instance will be inaccessible unless - the image used provides another means of access. For Windows instances, one - of the keys will be used to encrypt the administrator password. - 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. + administrative user of the virtual server instance. Keys will be made + available to the virtual server instance as cloud-init vendor data. For + cloud-init enabled images, these keys will also be added as SSH authorized + keys for the administrative user. + For Windows images, at least one key must be specified, and one will be + chosen to encrypt [the administrator + password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). + Keys are optional for other images, but if no keys are specified, the + instance will be inaccessible unless the specified image provides another + means of access. :param List[NetworkInterfacePrototype] network_interfaces: (optional) The additional network interfaces to create for the virtual server instance. :param InstancePlacementTargetPrototype placement_target: (optional) The placement restrictions to use for the virtual server instance. :param InstanceProfileIdentity profile: (optional) The profile to use for this virtual server instance. + :param int total_volume_bandwidth: (optional) The amount of bandwidth (in + megabits per second) allocated exclusively to instance storage volumes. An + increase in this value will result in a corresponding decrease to + `total_network_bandwidth`. :param str user_data: (optional) User data to be made available when setting up the virtual server instance. :param List[VolumeAttachmentPrototypeInstanceContext] volume_attachments: @@ -59120,6 +61003,7 @@ def __init__(self, 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 @@ -59163,6 +61047,8 @@ def from_dict(cls, _dict: Dict) -> 'InstanceTemplateInstanceByVolume': args['resource_group'] = ResourceGroupReference.from_dict(_dict.get('resource_group')) else: raise ValueError('Required property \'resource_group\' not present in InstanceTemplateInstanceByVolume 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: @@ -59223,6 +61109,8 @@ def to_dict(self) -> Dict: _dict['profile'] = self.profile.to_dict() if hasattr(self, 'resource_group') and self.resource_group is not None: _dict['resource_group'] = self.resource_group.to_dict() + if hasattr(self, 'total_volume_bandwidth') and self.total_volume_bandwidth is not None: + _dict['total_volume_bandwidth'] = self.total_volume_bandwidth if hasattr(self, 'user_data') and self.user_data is not None: _dict['user_data'] = self.user_data if hasattr(self, 'volume_attachments') and self.volume_attachments is not None: @@ -59318,6 +61206,66 @@ def __ne__(self, other: 'KeyIdentityByCRN') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other +class KeyIdentityByFingerprint(KeyIdentity): + """ + KeyIdentityByFingerprint. + + :attr str fingerprint: The fingerprint for this key. The value is returned + base64-encoded and prefixed with the hash algorithm (always `SHA256`). + """ + + def __init__(self, + fingerprint: str) -> None: + """ + Initialize a KeyIdentityByFingerprint object. + + :param str fingerprint: The fingerprint for this key. The value is + returned base64-encoded and prefixed with the hash algorithm (always + `SHA256`). + """ + # pylint: disable=super-init-not-called + self.fingerprint = fingerprint + + @classmethod + def from_dict(cls, _dict: Dict) -> 'KeyIdentityByFingerprint': + """Initialize a KeyIdentityByFingerprint object from a json dictionary.""" + args = {} + if 'fingerprint' in _dict: + args['fingerprint'] = _dict.get('fingerprint') + else: + raise ValueError('Required property \'fingerprint\' not present in KeyIdentityByFingerprint JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a KeyIdentityByFingerprint object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'fingerprint') and self.fingerprint is not None: + _dict['fingerprint'] = self.fingerprint + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this KeyIdentityByFingerprint object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'KeyIdentityByFingerprint') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'KeyIdentityByFingerprint') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + class KeyIdentityByHref(KeyIdentity): """ KeyIdentityByHref. @@ -59432,46 +61380,43 @@ def __ne__(self, other: 'KeyIdentityById') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class KeyIdentityKeyIdentityByFingerprint(KeyIdentity): +class LoadBalancerIdentityByCRN(LoadBalancerIdentity): """ - KeyIdentityKeyIdentityByFingerprint. + LoadBalancerIdentityByCRN. - :attr str fingerprint: The fingerprint for this key. The value is returned - base64-encoded and prefixed with the hash algorithm (always `SHA256`). + :attr str crn: The load balancer's CRN. """ def __init__(self, - fingerprint: str) -> None: + crn: str) -> None: """ - Initialize a KeyIdentityKeyIdentityByFingerprint object. + Initialize a LoadBalancerIdentityByCRN 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 load balancer's CRN. """ # pylint: disable=super-init-not-called - self.fingerprint = fingerprint + self.crn = crn @classmethod - def from_dict(cls, _dict: Dict) -> 'KeyIdentityKeyIdentityByFingerprint': - """Initialize a KeyIdentityKeyIdentityByFingerprint object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LoadBalancerIdentityByCRN': + """Initialize a LoadBalancerIdentityByCRN object from a json dictionary.""" args = {} - if 'fingerprint' in _dict: - args['fingerprint'] = _dict.get('fingerprint') + if 'crn' in _dict: + args['crn'] = _dict.get('crn') else: - raise ValueError('Required property \'fingerprint\' not present in KeyIdentityKeyIdentityByFingerprint JSON') + raise ValueError('Required property \'crn\' not present in LoadBalancerIdentityByCRN JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a KeyIdentityKeyIdentityByFingerprint object from a json dictionary.""" + """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, '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): @@ -59479,59 +61424,56 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this KeyIdentityKeyIdentityByFingerprint object.""" + """Return a `str` version of this LoadBalancerIdentityByCRN object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'KeyIdentityKeyIdentityByFingerprint') -> bool: + def __eq__(self, other: 'LoadBalancerIdentityByCRN') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'KeyIdentityKeyIdentityByFingerprint') -> bool: + def __ne__(self, other: 'LoadBalancerIdentityByCRN') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class KeyReferenceInstanceInitializationContextKeyIdentityByFingerprint(KeyReferenceInstanceInitializationContext): +class LoadBalancerIdentityByHref(LoadBalancerIdentity): """ - KeyReferenceInstanceInitializationContextKeyIdentityByFingerprint. + LoadBalancerIdentityByHref. - :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 load balancer's canonical URL. """ def __init__(self, - fingerprint: str) -> None: + href: str) -> None: """ - Initialize a KeyReferenceInstanceInitializationContextKeyIdentityByFingerprint object. + Initialize a LoadBalancerIdentityByHref 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 href: The load balancer's canonical URL. """ # pylint: disable=super-init-not-called - self.fingerprint = fingerprint + self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'KeyReferenceInstanceInitializationContextKeyIdentityByFingerprint': - """Initialize a KeyReferenceInstanceInitializationContextKeyIdentityByFingerprint object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LoadBalancerIdentityByHref': + """Initialize a LoadBalancerIdentityByHref object from a json dictionary.""" args = {} - if 'fingerprint' in _dict: - args['fingerprint'] = _dict.get('fingerprint') + if 'href' in _dict: + args['href'] = _dict.get('href') else: - raise ValueError('Required property \'fingerprint\' not present in KeyReferenceInstanceInitializationContextKeyIdentityByFingerprint JSON') + raise ValueError('Required property \'href\' not present in LoadBalancerIdentityByHref JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a KeyReferenceInstanceInitializationContextKeyIdentityByFingerprint object from a json dictionary.""" + """Initialize a LoadBalancerIdentityByHref object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, '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 return _dict def _to_dict(self): @@ -59539,112 +61481,56 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this KeyReferenceInstanceInitializationContextKeyIdentityByFingerprint object.""" + """Return a `str` version of this LoadBalancerIdentityByHref object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'KeyReferenceInstanceInitializationContextKeyIdentityByFingerprint') -> bool: + def __eq__(self, other: 'LoadBalancerIdentityByHref') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'KeyReferenceInstanceInitializationContextKeyIdentityByFingerprint') -> bool: + def __ne__(self, other: 'LoadBalancerIdentityByHref') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class KeyReferenceInstanceInitializationContextKeyReference(KeyReferenceInstanceInitializationContext): +class LoadBalancerIdentityById(LoadBalancerIdentity): """ - KeyReferenceInstanceInitializationContextKeyReference. + LoadBalancerIdentityById. - :attr str crn: The CRN for this key. - :attr KeyReferenceDeleted deleted: (optional) If present, this property - indicates the referenced resource has been deleted and provides - some supplementary information. - :attr str fingerprint: The fingerprint for this key. The value is returned - base64-encoded and prefixed with the hash algorithm (always `SHA256`). - :attr str href: The URL for this key. - :attr str id: The unique identifier for this key. - :attr str name: The user-defined name for this key. + :attr str id: The unique identifier for this load balancer. """ def __init__(self, - crn: str, - fingerprint: str, - href: str, - id: str, - name: str, - *, - deleted: 'KeyReferenceDeleted' = None) -> None: + id: str) -> None: """ - Initialize a KeyReferenceInstanceInitializationContextKeyReference object. + Initialize a LoadBalancerIdentityById object. - :param str crn: The CRN for this key. - :param str fingerprint: The fingerprint for this key. The value is - returned base64-encoded and prefixed with the hash algorithm (always - `SHA256`). - :param str href: The URL for this key. - :param str id: The unique identifier for this key. - :param str name: The user-defined name for this key. - :param KeyReferenceDeleted deleted: (optional) If present, this property - indicates the referenced resource has been deleted and provides - some supplementary information. + :param str id: The unique identifier for this load balancer. """ # pylint: disable=super-init-not-called - 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) -> 'KeyReferenceInstanceInitializationContextKeyReference': - """Initialize a KeyReferenceInstanceInitializationContextKeyReference object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LoadBalancerIdentityById': + """Initialize a LoadBalancerIdentityById object from a json dictionary.""" args = {} - if 'crn' in _dict: - args['crn'] = _dict.get('crn') - else: - raise ValueError('Required property \'crn\' not present in KeyReferenceInstanceInitializationContextKeyReference JSON') - if 'deleted' in _dict: - args['deleted'] = KeyReferenceDeleted.from_dict(_dict.get('deleted')) - if 'fingerprint' in _dict: - args['fingerprint'] = _dict.get('fingerprint') - else: - raise ValueError('Required property \'fingerprint\' not present in KeyReferenceInstanceInitializationContextKeyReference JSON') - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in KeyReferenceInstanceInitializationContextKeyReference JSON') if 'id' in _dict: args['id'] = _dict.get('id') else: - raise ValueError('Required property \'id\' not present in KeyReferenceInstanceInitializationContextKeyReference JSON') - if 'name' in _dict: - args['name'] = _dict.get('name') - else: - raise ValueError('Required property \'name\' not present in KeyReferenceInstanceInitializationContextKeyReference JSON') + raise ValueError('Required property \'id\' not present in LoadBalancerIdentityById JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a KeyReferenceInstanceInitializationContextKeyReference object from a json dictionary.""" + """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, 'crn') and self.crn is not None: - _dict['crn'] = self.crn - if hasattr(self, 'deleted') and self.deleted is not None: - _dict['deleted'] = self.deleted.to_dict() - if hasattr(self, 'fingerprint') and self.fingerprint is not None: - _dict['fingerprint'] = self.fingerprint - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href if hasattr(self, 'id') and self.id is not None: _dict['id'] = self.id - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name return _dict def _to_dict(self): @@ -59652,56 +61538,56 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this KeyReferenceInstanceInitializationContextKeyReference object.""" + """Return a `str` version of this LoadBalancerIdentityById object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'KeyReferenceInstanceInitializationContextKeyReference') -> bool: + 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: 'KeyReferenceInstanceInitializationContextKeyReference') -> bool: + def __ne__(self, other: 'LoadBalancerIdentityById') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class LoadBalancerIdentityByCRN(LoadBalancerIdentity): +class LoadBalancerListenerIdentityByHref(LoadBalancerListenerIdentity): """ - LoadBalancerIdentityByCRN. + LoadBalancerListenerIdentityByHref. - :attr str crn: The load balancer's CRN. + :attr str href: The listener's canonical URL. """ def __init__(self, - crn: str) -> None: + href: str) -> None: """ - Initialize a LoadBalancerIdentityByCRN object. + Initialize a LoadBalancerListenerIdentityByHref object. - :param str crn: The load balancer's CRN. + :param str href: The listener's canonical URL. """ # pylint: disable=super-init-not-called - self.crn = crn + self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerIdentityByCRN': - """Initialize a LoadBalancerIdentityByCRN object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerIdentityByHref': + """Initialize a LoadBalancerListenerIdentityByHref object from a json dictionary.""" args = {} - if 'crn' in _dict: - args['crn'] = _dict.get('crn') + if 'href' in _dict: + args['href'] = _dict.get('href') else: - raise ValueError('Required property \'crn\' not present in LoadBalancerIdentityByCRN JSON') + raise ValueError('Required property \'href\' not present in LoadBalancerListenerIdentityByHref JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a LoadBalancerIdentityByCRN object from a json dictionary.""" + """Initialize a LoadBalancerListenerIdentityByHref object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, '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): @@ -59709,56 +61595,56 @@ 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 LoadBalancerListenerIdentityByHref object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LoadBalancerIdentityByCRN') -> bool: + def __eq__(self, other: 'LoadBalancerListenerIdentityByHref') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'LoadBalancerIdentityByCRN') -> bool: + def __ne__(self, other: 'LoadBalancerListenerIdentityByHref') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class LoadBalancerIdentityByHref(LoadBalancerIdentity): +class LoadBalancerListenerIdentityById(LoadBalancerListenerIdentity): """ - LoadBalancerIdentityByHref. + LoadBalancerListenerIdentityById. - :attr str href: The load balancer's canonical URL. + :attr str id: The unique identifier for this load balancer listener. """ def __init__(self, - href: str) -> None: + id: str) -> None: """ - Initialize a LoadBalancerIdentityByHref object. + Initialize a LoadBalancerListenerIdentityById object. - :param str href: The load balancer's canonical URL. + :param str id: The unique identifier for this load balancer listener. """ # pylint: disable=super-init-not-called - self.href = href + self.id = id @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerIdentityByHref': - """Initialize a LoadBalancerIdentityByHref object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerIdentityById': + """Initialize a LoadBalancerListenerIdentityById object from a json dictionary.""" args = {} - if 'href' in _dict: - args['href'] = _dict.get('href') + if 'id' in _dict: + args['id'] = _dict.get('id') else: - raise ValueError('Required property \'href\' not present in LoadBalancerIdentityByHref JSON') + raise ValueError('Required property \'id\' not present in LoadBalancerListenerIdentityById JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a LoadBalancerIdentityByHref object from a json dictionary.""" + """Initialize a LoadBalancerListenerIdentityById object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'href') 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): @@ -59766,56 +61652,77 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this LoadBalancerIdentityByHref object.""" + """Return a `str` version of this LoadBalancerListenerIdentityById object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LoadBalancerIdentityByHref') -> bool: + def __eq__(self, other: 'LoadBalancerListenerIdentityById') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'LoadBalancerIdentityByHref') -> bool: + def __ne__(self, other: 'LoadBalancerListenerIdentityById') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class LoadBalancerIdentityById(LoadBalancerIdentity): +class LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch(LoadBalancerListenerPolicyTargetPatch): """ - LoadBalancerIdentityById. + LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch. - :attr str id: The unique identifier for this load balancer. + :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, - id: str) -> None: + *, + http_status_code: int = None, + listener: 'LoadBalancerListenerIdentity' = None, + uri: str = None) -> None: """ - Initialize a LoadBalancerIdentityById object. + Initialize a LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch object. - :param str id: The unique identifier 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. """ # pylint: disable=super-init-not-called - self.id = id + self.http_status_code = http_status_code + self.listener = listener + self.uri = uri @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerIdentityById': - """Initialize a LoadBalancerIdentityById object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch': + """Initialize a LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch object from a json dictionary.""" args = {} - if 'id' in _dict: - args['id'] = _dict.get('id') - else: - raise ValueError('Required property \'id\' not present in LoadBalancerIdentityById JSON') + if 'http_status_code' in _dict: + args['http_status_code'] = _dict.get('http_status_code') + if 'listener' in _dict: + args['listener'] = _dict.get('listener') + if 'uri' in _dict: + args['uri'] = _dict.get('uri') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a LoadBalancerIdentityById object from a json dictionary.""" + """Initialize a LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id + if hasattr(self, 'http_status_code') and self.http_status_code is not None: + _dict['http_status_code'] = self.http_status_code + if hasattr(self, '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): @@ -59823,16 +61730,16 @@ 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 LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LoadBalancerIdentityById') -> bool: + def __eq__(self, other: 'LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'LoadBalancerIdentityById') -> bool: + def __ne__(self, other: 'LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other @@ -59840,8 +61747,7 @@ class LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURL """ LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch. - :attr int http_status_code: (optional) The http status code in the redirect - response. + :attr int http_status_code: (optional) The HTTP status code for this redirect. :attr str url: (optional) The redirect target URL. """ @@ -59852,8 +61758,8 @@ def __init__(self, """ Initialize a LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch object. - :param int http_status_code: (optional) The http status code in the - redirect response. + :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 @@ -59918,11 +61824,92 @@ def __init__(self) -> None: ", ".join(['LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityById', 'LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref'])) raise Exception(msg) +class LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype(LoadBalancerListenerPolicyTargetPrototype): + """ + LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype. + + :attr int http_status_code: The HTTP status code for this redirect. + :attr LoadBalancerListenerIdentity listener: Identifies a load balancer listener + by a unique property. + :attr str uri: (optional) The redirect relative target URI. + """ + + def __init__(self, + http_status_code: int, + listener: 'LoadBalancerListenerIdentity', + *, + uri: str = None) -> None: + """ + Initialize a LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype object. + + :param int http_status_code: The HTTP status code for this redirect. + :param LoadBalancerListenerIdentity listener: Identifies a load balancer + listener by a unique property. + :param str uri: (optional) The redirect relative target URI. + """ + # pylint: disable=super-init-not-called + self.http_status_code = http_status_code + self.listener = listener + self.uri = uri + + @classmethod + def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype': + """Initialize a LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype object from a json dictionary.""" + args = {} + if 'http_status_code' in _dict: + args['http_status_code'] = _dict.get('http_status_code') + else: + raise ValueError('Required property \'http_status_code\' not present in LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype JSON') + if 'listener' in _dict: + args['listener'] = _dict.get('listener') + else: + raise ValueError('Required property \'listener\' not present in LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype JSON') + if 'uri' in _dict: + args['uri'] = _dict.get('uri') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a 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. - :attr int http_status_code: The http status code in the redirect response. + :attr int http_status_code: The HTTP status code for this redirect. :attr str url: The redirect target URL. """ @@ -59932,7 +61919,7 @@ def __init__(self, """ Initialize a LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype object. - :param int http_status_code: The http status code in the redirect response. + :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 @@ -60001,11 +61988,87 @@ def __init__(self) -> None: ", ".join(['LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityById', 'LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref'])) raise Exception(msg) +class LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect(LoadBalancerListenerPolicyTarget): + """ + LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect. + + :attr int http_status_code: The HTTP status code for this redirect. + :attr LoadBalancerListenerReference listener: + :attr str uri: (optional) The redirect relative target URI. + """ + + def __init__(self, + http_status_code: int, + listener: 'LoadBalancerListenerReference', + *, + uri: 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' in _dict: + args['http_status_code'] = _dict.get('http_status_code') + 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')) + else: + raise ValueError('Required property \'listener\' not present in LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect JSON') + if 'uri' in _dict: + args['uri'] = _dict.get('uri') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a 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: + _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. - :attr int http_status_code: The http status code in the redirect response. + :attr int http_status_code: The HTTP status code for this redirect. :attr str url: The redirect target URL. """ @@ -60015,7 +62078,7 @@ def __init__(self, """ Initialize a LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL object. - :param int http_status_code: The http status code in the redirect response. + :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 @@ -60277,11 +62340,11 @@ class LoadBalancerPoolMemberTargetPrototypeIP(LoadBalancerPoolMemberTargetProtot """ LoadBalancerPoolMemberTargetPrototypeIP. - :attr str address: The IP address. This property may add support for IPv6 - addresses in the future. When processing a value in this property, verify that - the address is in an expected format. If it is not, log an error. Optionally - halt processing and surface the error, or bypass the resource on which the - unexpected IP address format was encountered. + :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, @@ -60289,11 +62352,12 @@ def __init__(self, """ 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. + :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 @@ -60358,11 +62422,11 @@ class LoadBalancerPoolMemberTargetIP(LoadBalancerPoolMemberTarget): """ LoadBalancerPoolMemberTargetIP. - :attr str address: The IP address. This property may add support for IPv6 - addresses in the future. When processing a value in this property, verify that - the address is in an expected format. If it is not, log an error. Optionally - halt processing and surface the error, or bypass the resource on which the - unexpected IP address format was encountered. + :attr str 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, @@ -60370,11 +62434,12 @@ def __init__(self, """ 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. + :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 @@ -64253,11 +66318,11 @@ class RouteNextHopIP(RouteNextHop): """ RouteNextHopIP. - :attr str address: The IP address. This property may add support for IPv6 - addresses in the future. When processing a value in this property, verify that - the address is in an expected format. If it is not, log an error. Optionally - halt processing and surface the error, or bypass the resource on which the - unexpected IP address format was encountered. + :attr str 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, @@ -64265,11 +66330,12 @@ def __init__(self, """ 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. + :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 @@ -64318,11 +66384,11 @@ class RouteNextHopPrototypeRouteNextHopIP(RouteNextHopPrototype): """ The IP address of the next hop to which to route packets. - :attr str address: The IP address. This property may add support for IPv6 - addresses in the future. When processing a value in this property, verify that - the address is in an expected format. If it is not, log an error. Optionally - halt processing and surface the error, or bypass the resource on which the - unexpected IP address format was encountered. + :attr str 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, @@ -64330,11 +66396,12 @@ def __init__(self, """ Initialize a RouteNextHopPrototypeRouteNextHopIP 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 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 @@ -64797,12 +66864,18 @@ class SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll(SecurityGroupRulePr :attr str direction: The direction of traffic to enforce, either `inbound` or `outbound`. :attr str ip_version: (optional) The IP version to enforce. The format of - `remote.address` or `remote.cidr_block` must match this field, 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 + `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 SecurityGroupRuleRemotePrototype remote: (optional) :attr str protocol: The protocol to enforce. + :attr SecurityGroupRuleRemotePrototype remote: (optional) The IP addresses or + security groups from which this rule will allow traffic (or to + which, for outbound rules). Can be specified as an IP address, a CIDR block, or + a + security group. If omitted, a CIDR block of `0.0.0.0/0` will be used to allow + traffic + from any source (or to any source, for outbound rules). """ def __init__(self, @@ -64818,17 +66891,23 @@ def __init__(self, or `outbound`. :param str protocol: The protocol to enforce. :param str ip_version: (optional) The IP version to enforce. The format of - `remote.address` or `remote.cidr_block` must match this field, if they are - used. Alternatively, if `remote` references a security group, then this + `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) + :param SecurityGroupRuleRemotePrototype remote: (optional) The IP addresses + or security groups from which this rule will allow traffic (or to + which, for outbound rules). Can be specified as an IP address, a CIDR + block, or a + security group. If omitted, a CIDR block of `0.0.0.0/0` will be used to + allow traffic + from any source (or to any source, for outbound rules). """ # pylint: disable=super-init-not-called self.direction = direction self.ip_version = ip_version - self.remote = remote self.protocol = protocol + self.remote = remote @classmethod def from_dict(cls, _dict: Dict) -> 'SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll': @@ -64840,12 +66919,12 @@ def from_dict(cls, _dict: Dict) -> 'SecurityGroupRulePrototypeSecurityGroupRuleP raise ValueError('Required property \'direction\' not present in SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll JSON') if 'ip_version' in _dict: args['ip_version'] = _dict.get('ip_version') - if 'remote' in _dict: - args['remote'] = _dict.get('remote') if 'protocol' in _dict: args['protocol'] = _dict.get('protocol') else: raise ValueError('Required property \'protocol\' not present in SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll JSON') + if 'remote' in _dict: + args['remote'] = _dict.get('remote') return cls(**args) @classmethod @@ -64860,13 +66939,13 @@ def to_dict(self) -> Dict: _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, 'protocol') and self.protocol is not None: - _dict['protocol'] = self.protocol return _dict def _to_dict(self): @@ -64898,8 +66977,8 @@ class DirectionEnum(str, Enum): class IpVersionEnum(str, Enum): """ The IP version to enforce. The format of `remote.address` or `remote.cidr_block` - must match this field, if they are used. Alternatively, if `remote` references a - security group, then this rule only applies to IP addresses (network interfaces) + 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' @@ -64914,22 +66993,27 @@ class ProtocolEnum(str, Enum): class SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP(SecurityGroupRulePrototype): """ - When `protocol` is `icmp`, then the rule may also contain fields to specify an ICMP - `type` and `code`. Field `code` may only be specified if `type` is also specified. If - type is not specified, then traffic is allowed for all types and codes. If type is - specified and code is not specified, then traffic is allowed with the specified type - for all codes. + When `protocol` is `icmp`, the `type` property may optionally be specified. If + specified, then ICMP traffic is allowed only for the specified ICMP type. Further, if + `type` is specified, the `code` property may optionally be specified to allow traffic + only for the specified ICMP code. + :attr int code: (optional) The ICMP traffic code to allow. :attr str direction: The direction of traffic to enforce, either `inbound` or `outbound`. :attr str ip_version: (optional) The IP version to enforce. The format of - `remote.address` or `remote.cidr_block` must match this field, 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 + `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 SecurityGroupRuleRemotePrototype remote: (optional) - :attr int code: (optional) The ICMP traffic code to allow. :attr str protocol: The protocol to enforce. + :attr SecurityGroupRuleRemotePrototype remote: (optional) The IP addresses or + security groups from which this rule will allow traffic (or to + which, for outbound rules). Can be specified as an IP address, a CIDR block, or + a + security group. If omitted, a CIDR block of `0.0.0.0/0` will be used to allow + traffic + from any source (or to any source, for outbound rules). :attr int type: (optional) The ICMP traffic type to allow. """ @@ -64937,9 +67021,9 @@ def __init__(self, direction: str, protocol: str, *, + code: int = None, ip_version: str = None, remote: 'SecurityGroupRuleRemotePrototype' = None, - code: int = None, type: int = None) -> None: """ Initialize a SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP object. @@ -64947,41 +67031,47 @@ def __init__(self, :param str direction: The direction of traffic to enforce, either `inbound` or `outbound`. :param str protocol: The protocol to enforce. + :param int code: (optional) The ICMP traffic code to allow. :param str ip_version: (optional) The IP version to enforce. The format of - `remote.address` or `remote.cidr_block` must match this field, if they are - used. Alternatively, if `remote` references a security group, then this + `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) - :param int code: (optional) The ICMP traffic code to allow. + :param SecurityGroupRuleRemotePrototype remote: (optional) The IP addresses + or security groups from which this rule will allow traffic (or to + which, for outbound rules). Can be specified as an IP address, a CIDR + block, or a + security group. If omitted, a CIDR block of `0.0.0.0/0` will be used to + allow traffic + from any source (or to any source, for outbound rules). :param int type: (optional) The ICMP traffic type to allow. """ # pylint: disable=super-init-not-called + self.code = code self.direction = direction self.ip_version = ip_version - self.remote = remote - self.code = code 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' in _dict: + args['code'] = _dict.get('code') if 'direction' in _dict: args['direction'] = _dict.get('direction') else: raise ValueError('Required property \'direction\' not present in SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP JSON') if 'ip_version' in _dict: args['ip_version'] = _dict.get('ip_version') - if 'remote' in _dict: - args['remote'] = _dict.get('remote') - if 'code' in _dict: - args['code'] = _dict.get('code') if 'protocol' in _dict: args['protocol'] = _dict.get('protocol') else: raise ValueError('Required property \'protocol\' not present in SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP JSON') + if 'remote' in _dict: + args['remote'] = _dict.get('remote') if 'type' in _dict: args['type'] = _dict.get('type') return cls(**args) @@ -64994,19 +67084,19 @@ def _from_dict(cls, _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, '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 @@ -65040,8 +67130,8 @@ class DirectionEnum(str, Enum): class IpVersionEnum(str, Enum): """ The IP version to enforce. The format of `remote.address` or `remote.cidr_block` - must match this field, if they are used. Alternatively, if `remote` references a - security group, then this rule only applies to IP addresses (network interfaces) + 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' @@ -65063,14 +67153,20 @@ class SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP(SecurityGroupRul :attr str direction: The direction of traffic to enforce, either `inbound` or `outbound`. :attr str ip_version: (optional) The IP version to enforce. The format of - `remote.address` or `remote.cidr_block` must match this field, 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 + `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 SecurityGroupRuleRemotePrototype remote: (optional) :attr int port_max: (optional) The inclusive upper bound of TCP/UDP port range. :attr int port_min: (optional) The inclusive lower bound of TCP/UDP port range. :attr str protocol: The protocol to enforce. + :attr SecurityGroupRuleRemotePrototype remote: (optional) The IP addresses or + security groups from which this rule will allow traffic (or to + which, for outbound rules). Can be specified as an IP address, a CIDR block, or + a + security group. If omitted, a CIDR block of `0.0.0.0/0` will be used to allow + traffic + from any source (or to any source, for outbound rules). """ def __init__(self, @@ -65078,9 +67174,9 @@ def __init__(self, protocol: str, *, ip_version: str = None, - remote: 'SecurityGroupRuleRemotePrototype' = None, port_max: int = None, - port_min: int = None) -> None: + port_min: int = None, + remote: 'SecurityGroupRuleRemotePrototype' = None) -> None: """ Initialize a SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP object. @@ -65088,23 +67184,29 @@ def __init__(self, or `outbound`. :param str protocol: The protocol to enforce. :param str ip_version: (optional) The IP version to enforce. The format of - `remote.address` or `remote.cidr_block` must match this field, if they are - used. Alternatively, if `remote` references a security group, then this + `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) :param int port_max: (optional) The inclusive upper bound of TCP/UDP port range. :param int port_min: (optional) The inclusive lower bound of TCP/UDP port range. + :param SecurityGroupRuleRemotePrototype remote: (optional) The IP addresses + or security groups from which this rule will allow traffic (or to + which, for outbound rules). Can be specified as an IP address, a CIDR + block, or a + security group. If omitted, a CIDR block of `0.0.0.0/0` will be used to + allow traffic + from any source (or to any source, for outbound rules). """ # pylint: disable=super-init-not-called self.direction = direction self.ip_version = ip_version - self.remote = remote self.port_max = port_max self.port_min = port_min self.protocol = protocol + self.remote = remote @classmethod def from_dict(cls, _dict: Dict) -> 'SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP': @@ -65116,8 +67218,6 @@ def from_dict(cls, _dict: Dict) -> 'SecurityGroupRulePrototypeSecurityGroupRuleP raise ValueError('Required property \'direction\' not present in SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP JSON') if 'ip_version' in _dict: args['ip_version'] = _dict.get('ip_version') - if 'remote' in _dict: - args['remote'] = _dict.get('remote') if 'port_max' in _dict: args['port_max'] = _dict.get('port_max') if 'port_min' in _dict: @@ -65126,6 +67226,8 @@ def from_dict(cls, _dict: Dict) -> 'SecurityGroupRulePrototypeSecurityGroupRuleP args['protocol'] = _dict.get('protocol') else: raise ValueError('Required property \'protocol\' not present in SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP JSON') + if 'remote' in _dict: + args['remote'] = _dict.get('remote') return cls(**args) @classmethod @@ -65140,17 +67242,17 @@ def to_dict(self) -> Dict: _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, 'remote') and self.remote is not None: - if isinstance(self.remote, dict): - _dict['remote'] = self.remote - else: - _dict['remote'] = self.remote.to_dict() if hasattr(self, 'port_max') and self.port_max is not None: _dict['port_max'] = self.port_max if hasattr(self, 'port_min') and self.port_min is not None: _dict['port_min'] = self.port_min if hasattr(self, 'protocol') and self.protocol is not None: _dict['protocol'] = self.protocol + if hasattr(self, '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): @@ -65182,8 +67284,8 @@ class DirectionEnum(str, Enum): class IpVersionEnum(str, Enum): """ The IP version to enforce. The format of `remote.address` or `remote.cidr_block` - must match this field, if they are used. Alternatively, if `remote` references a - security group, then this rule only applies to IP addresses (network interfaces) + 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' @@ -65266,11 +67368,11 @@ class SecurityGroupRuleRemotePatchIP(SecurityGroupRuleRemotePatch): """ SecurityGroupRuleRemotePatchIP. - :attr str address: The IP address. This property may add support for IPv6 - addresses in the future. When processing a value in this property, verify that - the address is in an expected format. If it is not, log an error. Optionally - halt processing and surface the error, or bypass the resource on which the - unexpected IP address format was encountered. + :attr str 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, @@ -65278,11 +67380,12 @@ def __init__(self, """ 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. + :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 @@ -65412,11 +67515,11 @@ class SecurityGroupRuleRemotePrototypeIP(SecurityGroupRuleRemotePrototype): """ SecurityGroupRuleRemotePrototypeIP. - :attr str address: The IP address. This property may add support for IPv6 - addresses in the future. When processing a value in this property, verify that - the address is in an expected format. If it is not, log an error. Optionally - halt processing and surface the error, or bypass the resource on which the - unexpected IP address format was encountered. + :attr str 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, @@ -65424,11 +67527,12 @@ def __init__(self, """ 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. + :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 @@ -65558,11 +67662,11 @@ class SecurityGroupRuleRemoteIP(SecurityGroupRuleRemote): """ SecurityGroupRuleRemoteIP. - :attr str address: The IP address. This property may add support for IPv6 - addresses in the future. When processing a value in this property, verify that - the address is in an expected format. If it is not, log an error. Optionally - halt processing and surface the error, or bypass the resource on which the - unexpected IP address format was encountered. + :attr str 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, @@ -65570,11 +67674,12 @@ def __init__(self, """ 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. + :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 @@ -65732,9 +67837,9 @@ class SecurityGroupRuleSecurityGroupRuleProtocolAll(SecurityGroupRule): :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: (optional) The IP version to enforce. The format of - `remote.address` or `remote.cidr_block` must match this field, 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 + `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. @@ -65758,8 +67863,8 @@ def __init__(self, :param SecurityGroupRuleRemote remote: :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 field, if they are - used. Alternatively, if `remote` references a security group, then this + `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. """ @@ -65853,8 +67958,8 @@ class DirectionEnum(str, Enum): class IpVersionEnum(str, Enum): """ The IP version to enforce. The format of `remote.address` or `remote.cidr_block` - must match this field, if they are used. Alternatively, if `remote` references a - security group, then this rule only applies to IP addresses (network interfaces) + 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' @@ -65869,20 +67974,19 @@ class ProtocolEnum(str, Enum): class SecurityGroupRuleSecurityGroupRuleProtocolICMP(SecurityGroupRule): """ - When `protocol` is `icmp`, then the rule may also contain fields to specify an ICMP - `type` and `code`. Field `code` may only be specified if `type` is also specified. If - type is not specified, then traffic is allowed for all types and codes. If type is - specified and code is not specified, then traffic is allowed with the specified type - for all codes. + When `protocol` is `icmp`, the `type` property may optionally be specified. If + specified, then ICMP traffic is allowed only for the specified ICMP type. Further, if + `type` is specified, the `code` property may optionally be specified to allow traffic + only for the specified ICMP code. :attr str direction: The direction of traffic to enforce, either `inbound` or `outbound`. :attr str href: The URL for this security group rule. :attr str id: The unique identifier for this security group rule. :attr str ip_version: (optional) The IP version to enforce. The format of - `remote.address` or `remote.cidr_block` must match this field, 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 + `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. @@ -65910,8 +68014,8 @@ def __init__(self, :param SecurityGroupRuleRemote remote: :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 field, if they are - used. Alternatively, if `remote` references a security group, then this + `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 code: (optional) The ICMP traffic code to allow. @@ -66017,8 +68121,8 @@ class DirectionEnum(str, Enum): class IpVersionEnum(str, Enum): """ The IP version to enforce. The format of `remote.address` or `remote.cidr_block` - must match this field, if they are used. Alternatively, if `remote` references a - security group, then this rule only applies to IP addresses (network interfaces) + 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' @@ -66042,9 +68146,9 @@ class SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP(SecurityGroupRule): :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: (optional) The IP version to enforce. The format of - `remote.address` or `remote.cidr_block` must match this field, 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 + `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 port range. @@ -66072,8 +68176,8 @@ def __init__(self, :param SecurityGroupRuleRemote remote: :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 field, if they are - used. Alternatively, if `remote` references a security group, then this + `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 port @@ -66181,8 +68285,8 @@ class DirectionEnum(str, Enum): class IpVersionEnum(str, Enum): """ The IP version to enforce. The format of `remote.address` or `remote.cidr_block` - must match this field, if they are used. Alternatively, if `remote` references a - security group, then this rule only applies to IP addresses (network interfaces) + 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' @@ -68788,7 +70892,8 @@ class VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContext(VolumeAttach """ VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContext. - :attr int iops: (optional) The bandwidth for the volume. + :attr int iops: (optional) The maximum I/O operations per second (IOPS) for the + volume. :attr str name: (optional) The unique user-defined name for this volume. :attr VolumeProfileIdentity profile: The profile to use for this volume. """ @@ -68802,7 +70907,8 @@ def __init__(self, Initialize a VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContext object. :param VolumeProfileIdentity profile: The profile to use for this volume. - :param int iops: (optional) The bandwidth for the volume. + :param int iops: (optional) The maximum I/O operations per second (IOPS) + for the volume. :param str name: (optional) The unique user-defined name for this volume. """ # pylint: disable=super-init-not-called @@ -68814,14 +70920,15 @@ class VolumeAttachmentVolumePrototypeInstanceByVolumeContextVolumePrototypeInsta """ VolumeAttachmentVolumePrototypeInstanceByVolumeContextVolumePrototypeInstanceByVolumeContext. - :attr int capacity: (optional) The capacity of the volume in gigabytes. The only - allowed value is the source snapshot's `minimum_capacity`, but the allowed - values are expected to expand in the future. + :attr int capacity: (optional) The capacity to use for the volume (in + gigabytes). The only allowed value is the source snapshot's `minimum_capacity`, + but the allowed values are expected to expand 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 this property is not provided, the snapshot's `encryption_key` will be used. - :attr int iops: (optional) The bandwidth for the volume. + :attr int iops: (optional) The maximum I/O operations per second (IOPS) for the + volume. :attr str name: (optional) The unique user-defined name for this volume. :attr VolumeProfileIdentity profile: The profile to use for this volume. :attr SnapshotIdentity source_snapshot: The snapshot from which to clone the @@ -68842,16 +70949,18 @@ def __init__(self, :param VolumeProfileIdentity profile: The profile to use for this volume. :param SnapshotIdentity source_snapshot: The snapshot from which to clone the volume. - :param int capacity: (optional) The capacity of the volume in gigabytes. - The only allowed value is the source snapshot's `minimum_capacity`, but the - allowed values are expected to expand in the future. + :param int capacity: (optional) The capacity to use for the volume (in + gigabytes). The only allowed value is the source snapshot's + `minimum_capacity`, but the allowed values are expected to expand 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 this property is not provided, the snapshot's `encryption_key` will be used. - :param int iops: (optional) The bandwidth for the volume. + :param int iops: (optional) The maximum I/O operations per second (IOPS) + for the volume. :param str name: (optional) The unique user-defined name for this volume. """ # pylint: disable=super-init-not-called @@ -68953,7 +71062,8 @@ class VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceConte """ VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContext. - :attr int iops: (optional) The bandwidth for the volume. + :attr int iops: (optional) The maximum I/O operations per second (IOPS) for the + volume. :attr str name: (optional) The unique user-defined name for this volume. :attr VolumeProfileIdentity profile: The profile to use for this volume. """ @@ -68967,7 +71077,8 @@ def __init__(self, Initialize a VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContext object. :param VolumeProfileIdentity profile: The profile to use for this volume. - :param int iops: (optional) The bandwidth for the volume. + :param int iops: (optional) The maximum I/O operations per second (IOPS) + for the volume. :param str name: (optional) The unique user-defined name for this volume. """ # pylint: disable=super-init-not-called @@ -69264,14 +71375,17 @@ class VolumePrototypeVolumeByCapacity(VolumePrototype): """ VolumePrototypeVolumeByCapacity. - :attr int iops: (optional) The bandwidth for the volume. + :attr int iops: (optional) The maximum I/O operations per second (IOPS) to use + for the volume. Applicable only to volumes using a profile `family` of `custom`. + The volume must be attached as a data volume to a running virtual server + instance. :attr str name: (optional) The unique user-defined name for this volume. :attr VolumeProfileIdentity profile: The profile to use for this volume. :attr ResourceGroupIdentity resource_group: (optional) :attr ZoneIdentity zone: The zone this volume will reside in. - :attr int capacity: The capacity of the volume in gigabytes. The specified - minimum and maximum capacity values for creating or updating volumes may expand - in the future. + :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 this property is not provided, the `encryption` type for the volume will be @@ -69292,10 +71406,13 @@ def __init__(self, :param VolumeProfileIdentity profile: The profile to use for this volume. :param ZoneIdentity zone: The zone this volume will reside in. - :param int capacity: The capacity of 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 bandwidth for the volume. + :param int capacity: The capacity to use for the volume (in gigabytes). The + specified minimum and maximum capacity values for creating or updating + volumes may expand in the future. + :param int iops: (optional) The maximum I/O operations per second (IOPS) to + use for the volume. Applicable only to volumes using a profile `family` of + `custom`. The volume must be attached as a data volume to a running virtual + server instance. :param str name: (optional) The unique user-defined name for this volume. :param ResourceGroupIdentity resource_group: (optional) :param EncryptionKeyIdentity encryption_key: (optional) The root key to use @@ -71452,6 +73569,177 @@ def __ne__(self, other: 'InstancePlacementTargetPrototypeDedicatedHostIdentityDe """Return `true` when self and other are not equal, false otherwise.""" return not self == other +class InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN(InstancePlacementTargetPrototypePlacementGroupIdentity): + """ + InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN. + + :attr str crn: The CRN for this placement group. + """ + + def __init__(self, + crn: str) -> None: + """ + Initialize a InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN object. + + :param str crn: The CRN for this placement group. + """ + # pylint: disable=super-init-not-called + self.crn = crn + + @classmethod + def from_dict(cls, _dict: Dict) -> 'InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN': + """Initialize a InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN object from a json dictionary.""" + args = {} + if 'crn' in _dict: + args['crn'] = _dict.get('crn') + else: + raise ValueError('Required property \'crn\' not present in InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """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, '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 InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN object.""" + return json.dumps(self.to_dict(), indent=2) + + 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: 'InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + +class InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref(InstancePlacementTargetPrototypePlacementGroupIdentity): + """ + InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref. + + :attr str href: The URL for this placement group. + """ + + def __init__(self, + href: str) -> None: + """ + Initialize a InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref object. + + :param str href: The URL for this placement group. + """ + # pylint: disable=super-init-not-called + self.href = href + + @classmethod + def from_dict(cls, _dict: Dict) -> 'InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref': + """Initialize a InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref object from a json dictionary.""" + args = {} + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """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, '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 InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref object.""" + return json.dumps(self.to_dict(), indent=2) + + 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: 'InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + +class InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityById(InstancePlacementTargetPrototypePlacementGroupIdentity): + """ + InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityById. + + :attr str id: The unique identifier for this placement group. + """ + + def __init__(self, + id: str) -> None: + """ + Initialize a InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityById object. + + :param str id: The unique identifier for this placement group. + """ + # pylint: disable=super-init-not-called + self.id = id + + @classmethod + def from_dict(cls, _dict: Dict) -> 'InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityById': + """Initialize a InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityById object from a json dictionary.""" + args = {} + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityById JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """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, '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 InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityById object.""" + return json.dumps(self.to_dict(), indent=2) + + 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: 'InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityById') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + class LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref(LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentity): """ LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref. @@ -72881,12 +75169,13 @@ class VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototy """ VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity. - :attr int iops: (optional) The bandwidth for the volume. + :attr int iops: (optional) The maximum I/O operations per second (IOPS) for the + volume. :attr str name: (optional) The unique user-defined name for this volume. :attr VolumeProfileIdentity profile: The profile to use for this volume. - :attr int capacity: The capacity of the volume in gigabytes. The specified - minimum and maximum capacity values for creating or updating volumes may expand - in the future. + :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 this property is not provided, the `encryption` type for the volume will be @@ -72904,10 +75193,11 @@ def __init__(self, Initialize a VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity object. :param VolumeProfileIdentity profile: The profile to use for this volume. - :param int capacity: The capacity of 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 bandwidth for the volume. + :param int capacity: The capacity to use for the volume (in gigabytes). The + specified minimum and maximum capacity values for creating or updating + volumes may expand in the future. + :param int iops: (optional) The maximum I/O operations per second (IOPS) + for the volume. :param str name: (optional) The unique user-defined name for this volume. :param EncryptionKeyIdentity encryption_key: (optional) The root key to use to wrap the data encryption key for the volume. @@ -72990,11 +75280,13 @@ class VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototy """ VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot. - :attr int iops: (optional) The bandwidth for the volume. + :attr int iops: (optional) The maximum I/O operations per second (IOPS) for the + volume. :attr str name: (optional) The unique user-defined name for this volume. :attr VolumeProfileIdentity profile: The profile to use for this volume. - :attr int capacity: (optional) The capacity of the volume in gigabytes. The - allowed values are expected to expand in the future. + :attr int capacity: (optional) The capacity to use for the volume (in + gigabytes). The only allowed value is the source snapshot's `minimum_capacity`, + but the allowed values are expected to expand 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. @@ -73017,10 +75309,13 @@ def __init__(self, :param VolumeProfileIdentity profile: The profile to use for this volume. :param SnapshotIdentity source_snapshot: The snapshot from which to clone the volume. - :param int iops: (optional) The bandwidth for the volume. + :param int iops: (optional) The maximum I/O operations per second (IOPS) + for the volume. :param str name: (optional) The unique user-defined name for this volume. - :param int capacity: (optional) The capacity of the volume in gigabytes. - The allowed values are expected to expand in the future. + :param int capacity: (optional) The capacity to use for the volume (in + gigabytes). The only allowed value is the source snapshot's + `minimum_capacity`, but the allowed values are expected to expand 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 @@ -73282,12 +75577,13 @@ class VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceConte """ VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity. - :attr int iops: (optional) The bandwidth for the volume. + :attr int iops: (optional) The maximum I/O operations per second (IOPS) for the + volume. :attr str name: (optional) The unique user-defined name for this volume. :attr VolumeProfileIdentity profile: The profile to use for this volume. - :attr int capacity: The capacity of the volume in gigabytes. The specified - minimum and maximum capacity values for creating or updating volumes may expand - in the future. + :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 this property is not provided, the `encryption` type for the volume will be @@ -73305,10 +75601,11 @@ def __init__(self, Initialize a VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity object. :param VolumeProfileIdentity profile: The profile to use for this volume. - :param int capacity: The capacity of 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 bandwidth for the volume. + :param int capacity: The capacity to use for the volume (in gigabytes). The + specified minimum and maximum capacity values for creating or updating + volumes may expand in the future. + :param int iops: (optional) The maximum I/O operations per second (IOPS) + for the volume. :param str name: (optional) The unique user-defined name for this volume. :param EncryptionKeyIdentity encryption_key: (optional) The root key to use to wrap the data encryption key for the volume. @@ -73391,11 +75688,13 @@ class VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceConte """ VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot. - :attr int iops: (optional) The bandwidth for the volume. + :attr int iops: (optional) The maximum I/O operations per second (IOPS) for the + volume. :attr str name: (optional) The unique user-defined name for this volume. :attr VolumeProfileIdentity profile: The profile to use for this volume. - :attr int capacity: (optional) The capacity of the volume in gigabytes. The - allowed values are expected to expand in the future. + :attr int capacity: (optional) The capacity to use for the volume (in + gigabytes). The only allowed value is the source snapshot's `minimum_capacity`, + but the allowed values are expected to expand 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. @@ -73418,10 +75717,13 @@ def __init__(self, :param VolumeProfileIdentity profile: The profile to use for this volume. :param SnapshotIdentity source_snapshot: The snapshot from which to clone the volume. - :param int iops: (optional) The bandwidth for the volume. + :param int iops: (optional) The maximum I/O operations per second (IOPS) + for the volume. :param str name: (optional) The unique user-defined name for this volume. - :param int capacity: (optional) The capacity of the volume in gigabytes. - The allowed values are expected to expand in the future. + :param int capacity: (optional) The capacity to use for the volume (in + gigabytes). The only allowed value is the source snapshot's + `minimum_capacity`, but the allowed values are expected to expand 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 diff --git a/requirements.txt b/requirements.txt index 24848f0..a7968ed 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,2 @@ python_dateutil>=2.5.3,<3.0.0 -ibm_cloud_sdk_core>=3.10.0 \ No newline at end of file +ibm_cloud_sdk_core>=3.11.3 \ No newline at end of file diff --git a/test/integration/test_gen2.py b/test/integration/test_gen2.py index ad62916..1101da9 100644 --- a/test/integration/test_gen2.py +++ b/test/integration/test_gen2.py @@ -1027,6 +1027,30 @@ def test_delete_load_balancer(self, createGen2Service): createGen2Service, store['created_load_balancer']) assertDeleteResponse(load_balancer) +class TestPlacementGroup(): + def test_create_placement_group(self, createGen2Service): + name = 'my-placement-group' + pg = create_placement_group(createGen2Service, name) + assertCreateResponse(pg) + store['created_placement_group'] = pg.get_result()['id'] + + def test_list_placement_groups(self, createGen2Service): + pgc = list_placement_groups(createGen2Service) + assertListResponse(pgc, 'placement_groups') + + def test_get_placement_group(self, createGen2Service): + pg = get_placement_group(createGen2Service, store['created_placement_group']) + assert pg.status_code == 200 + assert pg.get_result() is not None + + def test_update_placement_group(self, createGen2Service): + pg = update_placement_group( + createGen2Service, store['created_placement_group'], 'my-placement-group1') + assertGetPatchResponse(pg) + + def test_delete_placement_group(self, createGen2Service): + pg = delete_placement_group(createGen2Service, store['created_placement_group']) + assertDeleteResponse(pg) class TestVPCFlowLogs(): def test_create_flow_log_collector(self, createGen2Service): @@ -1255,7 +1279,7 @@ def test_delete_vpn_gateway_connection(self, createGen2Service): def test_delete_vpn_gateway(self, createGen2Service): vpn_gateway = delete_vpn_gateway( createGen2Service, store['created_vpn_gateway_id']) - assertDeleteResponse(vpn_gateway) + assert vpn_gateway.status_code == 202 def test_delete_floating_ip(self, createGen2Service): fip = delete_floating_ip(createGen2Service, store['created_fip_id']) @@ -4270,6 +4294,42 @@ def delete_dedicated_host(service, id): delete_dedicated_host_response = service.delete_dedicated_host(id) return delete_dedicated_host_response +# -------------------------------------------------------- +# placement groups +# -------------------------------------------------------- + + +def create_placement_group(service, name): + placement_group = service.create_placement_group( + strategy='host_spread', + name=name, + ) + return placement_group + +def list_placement_groups(service): + placement_group_collection = service.list_placement_groups() + return placement_group_collection + +def get_placement_group(service, pgid): + placement_group = service.get_placement_group(pgid) + return placement_group + +def update_placement_group(service, pgid, name): + placement_group_patch_model = { + 'name': name + } + + placement_group = service.update_placement_group( + pgid, + placement_group_patch=placement_group_patch_model + ) + return placement_group + +def delete_placement_group(service, pgid): + response = service.delete_placement_group(pgid) + return response + + # -------------------------------------------------------- # Utils # -------------------------------------------------------- diff --git a/test/unit/test_vpc_v1.py b/test/unit/test_vpc_v1.py index d947518..1b2ec22 100644 --- a/test/unit/test_vpc_v1.py +++ b/test/unit/test_vpc_v1.py @@ -1141,7 +1141,7 @@ def test_list_vpc_routes_all_params(self): """ # Set up mock url = self.preprocess_url(_base_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": [{"created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}' + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/1a15dca5-7e33-45e1-b7c5-bc690e569531/routes?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/1a15dca5-7e33-45e1-b7c5-bc690e569531/routes?start=a5e812a2-62c0-4555-86a5-907106760c56&limit=20"}, "routes": [{"action": "delegate", "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}' responses.add(responses.GET, url, body=mock_response, @@ -1181,7 +1181,7 @@ def test_list_vpc_routes_required_params(self): """ # Set up mock url = self.preprocess_url(_base_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": [{"created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}' + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/1a15dca5-7e33-45e1-b7c5-bc690e569531/routes?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/1a15dca5-7e33-45e1-b7c5-bc690e569531/routes?start=a5e812a2-62c0-4555-86a5-907106760c56&limit=20"}, "routes": [{"action": "delegate", "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}' responses.add(responses.GET, url, body=mock_response, @@ -1209,7 +1209,7 @@ def test_list_vpc_routes_value_error(self): """ # Set up mock url = self.preprocess_url(_base_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": [{"created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}' + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/1a15dca5-7e33-45e1-b7c5-bc690e569531/routes?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/1a15dca5-7e33-45e1-b7c5-bc690e569531/routes?start=a5e812a2-62c0-4555-86a5-907106760c56&limit=20"}, "routes": [{"action": "delegate", "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}' responses.add(responses.GET, url, body=mock_response, @@ -1251,7 +1251,7 @@ def test_create_vpc_route_all_params(self): """ # Set up mock url = self.preprocess_url(_base_url + '/vpcs/testString/routes') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"action": "delegate", "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.POST, url, body=mock_response, @@ -1304,7 +1304,7 @@ def test_create_vpc_route_value_error(self): """ # Set up mock url = self.preprocess_url(_base_url + '/vpcs/testString/routes') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"action": "delegate", "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.POST, url, body=mock_response, @@ -1429,7 +1429,7 @@ def test_get_vpc_route_all_params(self): """ # Set up mock url = self.preprocess_url(_base_url + '/vpcs/testString/routes/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"action": "delegate", "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.GET, url, body=mock_response, @@ -1459,7 +1459,7 @@ def test_get_vpc_route_value_error(self): """ # Set up mock url = self.preprocess_url(_base_url + '/vpcs/testString/routes/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"action": "delegate", "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.GET, url, body=mock_response, @@ -1503,7 +1503,7 @@ def test_update_vpc_route_all_params(self): """ # Set up mock url = self.preprocess_url(_base_url + '/vpcs/testString/routes/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"action": "delegate", "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.PATCH, url, body=mock_response, @@ -1542,7 +1542,7 @@ def test_update_vpc_route_value_error(self): """ # Set up mock url = self.preprocess_url(_base_url + '/vpcs/testString/routes/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"action": "delegate", "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.PATCH, url, body=mock_response, @@ -2063,7 +2063,7 @@ def test_list_vpc_routing_table_routes_all_params(self): """ # Set up mock url = self.preprocess_url(_base_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": [{"created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}' + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/1a15dca5-7e33-45e1-b7c5-bc690e569531/routes?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/1a15dca5-7e33-45e1-b7c5-bc690e569531/routes?start=a5e812a2-62c0-4555-86a5-907106760c56&limit=20"}, "routes": [{"action": "delegate", "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}' responses.add(responses.GET, url, body=mock_response, @@ -2102,7 +2102,7 @@ def test_list_vpc_routing_table_routes_required_params(self): """ # Set up mock url = self.preprocess_url(_base_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": [{"created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}' + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/1a15dca5-7e33-45e1-b7c5-bc690e569531/routes?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/1a15dca5-7e33-45e1-b7c5-bc690e569531/routes?start=a5e812a2-62c0-4555-86a5-907106760c56&limit=20"}, "routes": [{"action": "delegate", "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}' responses.add(responses.GET, url, body=mock_response, @@ -2132,7 +2132,7 @@ def test_list_vpc_routing_table_routes_value_error(self): """ # Set up mock url = self.preprocess_url(_base_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": [{"created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}' + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/1a15dca5-7e33-45e1-b7c5-bc690e569531/routes?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/1a15dca5-7e33-45e1-b7c5-bc690e569531/routes?start=a5e812a2-62c0-4555-86a5-907106760c56&limit=20"}, "routes": [{"action": "delegate", "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}' responses.add(responses.GET, url, body=mock_response, @@ -2176,7 +2176,7 @@ def test_create_vpc_routing_table_route_all_params(self): """ # Set up mock url = self.preprocess_url(_base_url + '/vpcs/testString/routing_tables/testString/routes') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"action": "delegate", "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.POST, url, body=mock_response, @@ -2231,7 +2231,7 @@ def test_create_vpc_routing_table_route_value_error(self): """ # Set up mock url = self.preprocess_url(_base_url + '/vpcs/testString/routing_tables/testString/routes') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"action": "delegate", "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.POST, url, body=mock_response, @@ -2362,7 +2362,7 @@ def test_get_vpc_routing_table_route_all_params(self): """ # Set up mock url = self.preprocess_url(_base_url + '/vpcs/testString/routing_tables/testString/routes/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"action": "delegate", "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.GET, url, body=mock_response, @@ -2394,7 +2394,7 @@ def test_get_vpc_routing_table_route_value_error(self): """ # Set up mock url = self.preprocess_url(_base_url + '/vpcs/testString/routing_tables/testString/routes/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"action": "delegate", "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.GET, url, body=mock_response, @@ -2440,7 +2440,7 @@ def test_update_vpc_routing_table_route_all_params(self): """ # Set up mock url = self.preprocess_url(_base_url + '/vpcs/testString/routing_tables/testString/routes/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"action": "delegate", "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.PATCH, url, body=mock_response, @@ -2481,7 +2481,7 @@ def test_update_vpc_routing_table_route_value_error(self): """ # Set up mock url = self.preprocess_url(_base_url + '/vpcs/testString/routing_tables/testString/routes/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"action": "delegate", "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.PATCH, url, body=mock_response, @@ -4639,7 +4639,7 @@ def test_list_keys_all_params(self): """ # Set up mock url = self.preprocess_url(_base_url + '/keys') - mock_response = '{"first": {"href": "href"}, "keys": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803", "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "length": 2048, "name": "my-key", "public_key": "AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "type": "rsa"}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/keys?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/keys?limit=20"}, "keys": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803", "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "length": 2048, "name": "my-key", "public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "type": "rsa"}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/keys?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' responses.add(responses.GET, url, body=mock_response, @@ -4677,7 +4677,7 @@ def test_list_keys_required_params(self): """ # Set up mock url = self.preprocess_url(_base_url + '/keys') - mock_response = '{"first": {"href": "href"}, "keys": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803", "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "length": 2048, "name": "my-key", "public_key": "AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "type": "rsa"}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/keys?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/keys?limit=20"}, "keys": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803", "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "length": 2048, "name": "my-key", "public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "type": "rsa"}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/keys?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' responses.add(responses.GET, url, body=mock_response, @@ -4700,7 +4700,7 @@ def test_list_keys_value_error(self): """ # Set up mock url = self.preprocess_url(_base_url + '/keys') - mock_response = '{"first": {"href": "href"}, "keys": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803", "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "length": 2048, "name": "my-key", "public_key": "AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "type": "rsa"}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/keys?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/keys?limit=20"}, "keys": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803", "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "length": 2048, "name": "my-key", "public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "type": "rsa"}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/keys?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' responses.add(responses.GET, url, body=mock_response, @@ -4738,7 +4738,7 @@ def test_create_key_all_params(self): """ # Set up mock url = self.preprocess_url(_base_url + '/keys') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803", "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "length": 2048, "name": "my-key", "public_key": "AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "type": "rsa"}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803", "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "length": 2048, "name": "my-key", "public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "type": "rsa"}' responses.add(responses.POST, url, body=mock_response, @@ -4750,7 +4750,7 @@ def test_create_key_all_params(self): resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' # Set up parameter values - public_key = 'AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En' + public_key = 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En' name = 'my-key' resource_group = resource_group_identity_model type = 'rsa' @@ -4769,7 +4769,7 @@ def test_create_key_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['public_key'] == 'AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En' + assert req_body['public_key'] == 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En' assert req_body['name'] == 'my-key' assert req_body['resource_group'] == resource_group_identity_model assert req_body['type'] == 'rsa' @@ -4782,7 +4782,7 @@ def test_create_key_value_error(self): """ # Set up mock url = self.preprocess_url(_base_url + '/keys') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803", "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "length": 2048, "name": "my-key", "public_key": "AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "type": "rsa"}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803", "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "length": 2048, "name": "my-key", "public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "type": "rsa"}' responses.add(responses.POST, url, body=mock_response, @@ -4794,7 +4794,7 @@ def test_create_key_value_error(self): resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' # Set up parameter values - public_key = 'AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En' + public_key = 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En' name = 'my-key' resource_group = resource_group_identity_model type = 'rsa' @@ -4895,7 +4895,7 @@ def test_get_key_all_params(self): """ # Set up mock url = self.preprocess_url(_base_url + '/keys/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803", "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "length": 2048, "name": "my-key", "public_key": "AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "type": "rsa"}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803", "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "length": 2048, "name": "my-key", "public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "type": "rsa"}' responses.add(responses.GET, url, body=mock_response, @@ -4923,7 +4923,7 @@ def test_get_key_value_error(self): """ # Set up mock url = self.preprocess_url(_base_url + '/keys/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803", "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "length": 2048, "name": "my-key", "public_key": "AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "type": "rsa"}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803", "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "length": 2048, "name": "my-key", "public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "type": "rsa"}' responses.add(responses.GET, url, body=mock_response, @@ -4965,7 +4965,7 @@ def test_update_key_all_params(self): """ # Set up mock url = self.preprocess_url(_base_url + '/keys/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803", "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "length": 2048, "name": "my-key", "public_key": "AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "type": "rsa"}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803", "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "length": 2048, "name": "my-key", "public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "type": "rsa"}' responses.add(responses.PATCH, url, body=mock_response, @@ -5002,7 +5002,7 @@ def test_update_key_value_error(self): """ # Set up mock url = self.preprocess_url(_base_url + '/keys/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803", "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "length": 2048, "name": "my-key", "public_key": "AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "type": "rsa"}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803", "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "length": 2048, "name": "my-key", "public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "type": "rsa"}' responses.add(responses.PATCH, url, body=mock_response, @@ -5060,7 +5060,7 @@ def test_list_instance_profiles_all_params(self): """ # Set up mock url = self.preprocess_url(_base_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": "virtio_blk", "type": "enum", "values": ["virtio_blk"]}}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "memory": {"type": "fixed", "value": 16}, "name": "bc1-4x16", "os_architecture": {"default": "default", "type": "enum", "values": ["amd64"]}, "port_speed": {"type": "fixed", "value": 1000}, "vcpu_architecture": {"default": "default", "type": "fixed", "value": "amd64"}, "vcpu_count": {"type": "fixed", "value": 16}}]}' + mock_response = '{"profiles": [{"bandwidth": {"type": "fixed", "value": 20000}, "disks": [{"quantity": {"type": "fixed", "value": 4}, "size": {"type": "fixed", "value": 100}, "supported_interface_types": {"default": "virtio_blk", "type": "enum", "values": ["virtio_blk"]}}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "memory": {"type": "fixed", "value": 16}, "name": "bc1-4x16", "os_architecture": {"default": "default", "type": "enum", "values": ["amd64"]}, "port_speed": {"type": "fixed", "value": 1000}, "total_volume_bandwidth": {"type": "fixed", "value": 20000}, "vcpu_architecture": {"default": "default", "type": "fixed", "value": "amd64"}, "vcpu_count": {"type": "fixed", "value": 16}}]}' responses.add(responses.GET, url, body=mock_response, @@ -5083,7 +5083,7 @@ def test_list_instance_profiles_value_error(self): """ # Set up mock url = self.preprocess_url(_base_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": "virtio_blk", "type": "enum", "values": ["virtio_blk"]}}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "memory": {"type": "fixed", "value": 16}, "name": "bc1-4x16", "os_architecture": {"default": "default", "type": "enum", "values": ["amd64"]}, "port_speed": {"type": "fixed", "value": 1000}, "vcpu_architecture": {"default": "default", "type": "fixed", "value": "amd64"}, "vcpu_count": {"type": "fixed", "value": 16}}]}' + mock_response = '{"profiles": [{"bandwidth": {"type": "fixed", "value": 20000}, "disks": [{"quantity": {"type": "fixed", "value": 4}, "size": {"type": "fixed", "value": 100}, "supported_interface_types": {"default": "virtio_blk", "type": "enum", "values": ["virtio_blk"]}}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "memory": {"type": "fixed", "value": 16}, "name": "bc1-4x16", "os_architecture": {"default": "default", "type": "enum", "values": ["amd64"]}, "port_speed": {"type": "fixed", "value": 1000}, "total_volume_bandwidth": {"type": "fixed", "value": 20000}, "vcpu_architecture": {"default": "default", "type": "fixed", "value": "amd64"}, "vcpu_count": {"type": "fixed", "value": 16}}]}' responses.add(responses.GET, url, body=mock_response, @@ -5121,7 +5121,7 @@ def test_get_instance_profile_all_params(self): """ # Set up mock url = self.preprocess_url(_base_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": "virtio_blk", "type": "enum", "values": ["virtio_blk"]}}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "memory": {"type": "fixed", "value": 16}, "name": "bc1-4x16", "os_architecture": {"default": "default", "type": "enum", "values": ["amd64"]}, "port_speed": {"type": "fixed", "value": 1000}, "vcpu_architecture": {"default": "default", "type": "fixed", "value": "amd64"}, "vcpu_count": {"type": "fixed", "value": 16}}' + mock_response = '{"bandwidth": {"type": "fixed", "value": 20000}, "disks": [{"quantity": {"type": "fixed", "value": 4}, "size": {"type": "fixed", "value": 100}, "supported_interface_types": {"default": "virtio_blk", "type": "enum", "values": ["virtio_blk"]}}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "memory": {"type": "fixed", "value": 16}, "name": "bc1-4x16", "os_architecture": {"default": "default", "type": "enum", "values": ["amd64"]}, "port_speed": {"type": "fixed", "value": 1000}, "total_volume_bandwidth": {"type": "fixed", "value": 20000}, "vcpu_architecture": {"default": "default", "type": "fixed", "value": "amd64"}, "vcpu_count": {"type": "fixed", "value": 16}}' responses.add(responses.GET, url, body=mock_response, @@ -5149,7 +5149,7 @@ def test_get_instance_profile_value_error(self): """ # Set up mock url = self.preprocess_url(_base_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": "virtio_blk", "type": "enum", "values": ["virtio_blk"]}}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "memory": {"type": "fixed", "value": 16}, "name": "bc1-4x16", "os_architecture": {"default": "default", "type": "enum", "values": ["amd64"]}, "port_speed": {"type": "fixed", "value": 1000}, "vcpu_architecture": {"default": "default", "type": "fixed", "value": "amd64"}, "vcpu_count": {"type": "fixed", "value": 16}}' + mock_response = '{"bandwidth": {"type": "fixed", "value": 20000}, "disks": [{"quantity": {"type": "fixed", "value": 4}, "size": {"type": "fixed", "value": 100}, "supported_interface_types": {"default": "virtio_blk", "type": "enum", "values": ["virtio_blk"]}}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "memory": {"type": "fixed", "value": 16}, "name": "bc1-4x16", "os_architecture": {"default": "default", "type": "enum", "values": ["amd64"]}, "port_speed": {"type": "fixed", "value": 1000}, "total_volume_bandwidth": {"type": "fixed", "value": 20000}, "vcpu_architecture": {"default": "default", "type": "fixed", "value": "amd64"}, "vcpu_count": {"type": "fixed", "value": 16}}' responses.add(responses.GET, url, body=mock_response, @@ -5191,7 +5191,7 @@ def test_list_instance_templates_all_params(self): """ # Set up mock url = self.preprocess_url(_base_url + '/instance/templates') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "templates": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "keys": [{"id": "a6b1a881-2ce8-41a3-80fc-36316a73f803"}], "name": "my-instance-template", "network_interfaces": [{"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}], "placement_target": {"id": "1e09281b-f177-46fb-baf1-bc152b2e391a"}, "profile": {"name": "bc1-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "user_data": "user_data", "volume_attachments": [{"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "vpc": {"id": "4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"capacity": 100, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}}}, "image": {"id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "primary_network_interface": {"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}, "zone": {"name": "us-south-1"}}], "total_count": 132}' + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "templates": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "keys": [{"id": "a6b1a881-2ce8-41a3-80fc-36316a73f803"}], "name": "my-instance-template", "network_interfaces": [{"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}], "placement_target": {"id": "1e09281b-f177-46fb-baf1-bc152b2e391a"}, "profile": {"name": "bc1-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "total_volume_bandwidth": 500, "user_data": "user_data", "volume_attachments": [{"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "vpc": {"id": "4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"capacity": 8, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}}}, "image": {"id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "primary_network_interface": {"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}, "zone": {"name": "us-south-1"}}], "total_count": 132}' responses.add(responses.GET, url, body=mock_response, @@ -5214,7 +5214,7 @@ def test_list_instance_templates_value_error(self): """ # Set up mock url = self.preprocess_url(_base_url + '/instance/templates') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "templates": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "keys": [{"id": "a6b1a881-2ce8-41a3-80fc-36316a73f803"}], "name": "my-instance-template", "network_interfaces": [{"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}], "placement_target": {"id": "1e09281b-f177-46fb-baf1-bc152b2e391a"}, "profile": {"name": "bc1-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "user_data": "user_data", "volume_attachments": [{"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "vpc": {"id": "4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"capacity": 100, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}}}, "image": {"id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "primary_network_interface": {"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}, "zone": {"name": "us-south-1"}}], "total_count": 132}' + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "templates": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "keys": [{"id": "a6b1a881-2ce8-41a3-80fc-36316a73f803"}], "name": "my-instance-template", "network_interfaces": [{"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}], "placement_target": {"id": "1e09281b-f177-46fb-baf1-bc152b2e391a"}, "profile": {"name": "bc1-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "total_volume_bandwidth": 500, "user_data": "user_data", "volume_attachments": [{"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "vpc": {"id": "4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"capacity": 8, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}}}, "image": {"id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "primary_network_interface": {"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}, "zone": {"name": "us-south-1"}}], "total_count": 132}' responses.add(responses.GET, url, body=mock_response, @@ -5252,7 +5252,7 @@ def test_create_instance_template_all_params(self): """ # Set up mock url = self.preprocess_url(_base_url + '/instance/templates') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "keys": [{"id": "a6b1a881-2ce8-41a3-80fc-36316a73f803"}], "name": "my-instance-template", "network_interfaces": [{"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}], "placement_target": {"id": "1e09281b-f177-46fb-baf1-bc152b2e391a"}, "profile": {"name": "bc1-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "user_data": "user_data", "volume_attachments": [{"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "vpc": {"id": "4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"capacity": 100, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}}}, "image": {"id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "primary_network_interface": {"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}, "zone": {"name": "us-south-1"}}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "keys": [{"id": "a6b1a881-2ce8-41a3-80fc-36316a73f803"}], "name": "my-instance-template", "network_interfaces": [{"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}], "placement_target": {"id": "1e09281b-f177-46fb-baf1-bc152b2e391a"}, "profile": {"name": "bc1-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "total_volume_bandwidth": 500, "user_data": "user_data", "volume_attachments": [{"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "vpc": {"id": "4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"capacity": 8, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}}}, "image": {"id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "primary_network_interface": {"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}, "zone": {"name": "us-south-1"}}' responses.add(responses.POST, url, body=mock_response, @@ -5315,7 +5315,7 @@ def test_create_instance_template_all_params(self): # 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['capacity'] = 38 volume_prototype_instance_by_image_context_model['encryption_key'] = encryption_key_identity_model volume_prototype_instance_by_image_context_model['iops'] = 10000 volume_prototype_instance_by_image_context_model['name'] = 'my-volume' @@ -5343,6 +5343,7 @@ def test_create_instance_template_all_params(self): instance_template_prototype_model['placement_target'] = instance_placement_target_prototype_model instance_template_prototype_model['profile'] = instance_profile_identity_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_instance_context_model] instance_template_prototype_model['vpc'] = vpc_identity_model @@ -5375,7 +5376,7 @@ def test_create_instance_template_value_error(self): """ # Set up mock url = self.preprocess_url(_base_url + '/instance/templates') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "keys": [{"id": "a6b1a881-2ce8-41a3-80fc-36316a73f803"}], "name": "my-instance-template", "network_interfaces": [{"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}], "placement_target": {"id": "1e09281b-f177-46fb-baf1-bc152b2e391a"}, "profile": {"name": "bc1-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "user_data": "user_data", "volume_attachments": [{"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "vpc": {"id": "4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"capacity": 100, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}}}, "image": {"id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "primary_network_interface": {"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}, "zone": {"name": "us-south-1"}}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "keys": [{"id": "a6b1a881-2ce8-41a3-80fc-36316a73f803"}], "name": "my-instance-template", "network_interfaces": [{"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}], "placement_target": {"id": "1e09281b-f177-46fb-baf1-bc152b2e391a"}, "profile": {"name": "bc1-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "total_volume_bandwidth": 500, "user_data": "user_data", "volume_attachments": [{"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "vpc": {"id": "4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"capacity": 8, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}}}, "image": {"id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "primary_network_interface": {"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}, "zone": {"name": "us-south-1"}}' responses.add(responses.POST, url, body=mock_response, @@ -5438,7 +5439,7 @@ def test_create_instance_template_value_error(self): # 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['capacity'] = 38 volume_prototype_instance_by_image_context_model['encryption_key'] = encryption_key_identity_model volume_prototype_instance_by_image_context_model['iops'] = 10000 volume_prototype_instance_by_image_context_model['name'] = 'my-volume' @@ -5466,6 +5467,7 @@ def test_create_instance_template_value_error(self): instance_template_prototype_model['placement_target'] = instance_placement_target_prototype_model instance_template_prototype_model['profile'] = instance_profile_identity_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_instance_context_model] instance_template_prototype_model['vpc'] = vpc_identity_model @@ -5573,7 +5575,7 @@ def test_get_instance_template_all_params(self): """ # Set up mock url = self.preprocess_url(_base_url + '/instance/templates/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "keys": [{"id": "a6b1a881-2ce8-41a3-80fc-36316a73f803"}], "name": "my-instance-template", "network_interfaces": [{"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}], "placement_target": {"id": "1e09281b-f177-46fb-baf1-bc152b2e391a"}, "profile": {"name": "bc1-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "user_data": "user_data", "volume_attachments": [{"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "vpc": {"id": "4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"capacity": 100, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}}}, "image": {"id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "primary_network_interface": {"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}, "zone": {"name": "us-south-1"}}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "keys": [{"id": "a6b1a881-2ce8-41a3-80fc-36316a73f803"}], "name": "my-instance-template", "network_interfaces": [{"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}], "placement_target": {"id": "1e09281b-f177-46fb-baf1-bc152b2e391a"}, "profile": {"name": "bc1-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "total_volume_bandwidth": 500, "user_data": "user_data", "volume_attachments": [{"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "vpc": {"id": "4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"capacity": 8, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}}}, "image": {"id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "primary_network_interface": {"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}, "zone": {"name": "us-south-1"}}' responses.add(responses.GET, url, body=mock_response, @@ -5601,7 +5603,7 @@ def test_get_instance_template_value_error(self): """ # Set up mock url = self.preprocess_url(_base_url + '/instance/templates/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "keys": [{"id": "a6b1a881-2ce8-41a3-80fc-36316a73f803"}], "name": "my-instance-template", "network_interfaces": [{"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}], "placement_target": {"id": "1e09281b-f177-46fb-baf1-bc152b2e391a"}, "profile": {"name": "bc1-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "user_data": "user_data", "volume_attachments": [{"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "vpc": {"id": "4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"capacity": 100, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}}}, "image": {"id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "primary_network_interface": {"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}, "zone": {"name": "us-south-1"}}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "keys": [{"id": "a6b1a881-2ce8-41a3-80fc-36316a73f803"}], "name": "my-instance-template", "network_interfaces": [{"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}], "placement_target": {"id": "1e09281b-f177-46fb-baf1-bc152b2e391a"}, "profile": {"name": "bc1-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "total_volume_bandwidth": 500, "user_data": "user_data", "volume_attachments": [{"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "vpc": {"id": "4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"capacity": 8, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}}}, "image": {"id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "primary_network_interface": {"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}, "zone": {"name": "us-south-1"}}' responses.add(responses.GET, url, body=mock_response, @@ -5643,7 +5645,7 @@ def test_update_instance_template_all_params(self): """ # Set up mock url = self.preprocess_url(_base_url + '/instance/templates/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "keys": [{"id": "a6b1a881-2ce8-41a3-80fc-36316a73f803"}], "name": "my-instance-template", "network_interfaces": [{"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}], "placement_target": {"id": "1e09281b-f177-46fb-baf1-bc152b2e391a"}, "profile": {"name": "bc1-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "user_data": "user_data", "volume_attachments": [{"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "vpc": {"id": "4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"capacity": 100, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}}}, "image": {"id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "primary_network_interface": {"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}, "zone": {"name": "us-south-1"}}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "keys": [{"id": "a6b1a881-2ce8-41a3-80fc-36316a73f803"}], "name": "my-instance-template", "network_interfaces": [{"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}], "placement_target": {"id": "1e09281b-f177-46fb-baf1-bc152b2e391a"}, "profile": {"name": "bc1-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "total_volume_bandwidth": 500, "user_data": "user_data", "volume_attachments": [{"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "vpc": {"id": "4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"capacity": 8, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}}}, "image": {"id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "primary_network_interface": {"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}, "zone": {"name": "us-south-1"}}' responses.add(responses.PATCH, url, body=mock_response, @@ -5680,7 +5682,7 @@ def test_update_instance_template_value_error(self): """ # Set up mock url = self.preprocess_url(_base_url + '/instance/templates/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "keys": [{"id": "a6b1a881-2ce8-41a3-80fc-36316a73f803"}], "name": "my-instance-template", "network_interfaces": [{"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}], "placement_target": {"id": "1e09281b-f177-46fb-baf1-bc152b2e391a"}, "profile": {"name": "bc1-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "user_data": "user_data", "volume_attachments": [{"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "vpc": {"id": "4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"capacity": 100, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}}}, "image": {"id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "primary_network_interface": {"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}, "zone": {"name": "us-south-1"}}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "keys": [{"id": "a6b1a881-2ce8-41a3-80fc-36316a73f803"}], "name": "my-instance-template", "network_interfaces": [{"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}], "placement_target": {"id": "1e09281b-f177-46fb-baf1-bc152b2e391a"}, "profile": {"name": "bc1-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "total_volume_bandwidth": 500, "user_data": "user_data", "volume_attachments": [{"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "vpc": {"id": "4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"capacity": 8, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}}}, "image": {"id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "primary_network_interface": {"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}, "zone": {"name": "us-south-1"}}' responses.add(responses.PATCH, url, body=mock_response, @@ -5728,7 +5730,7 @@ def test_list_instances_all_params(self): """ # Set up mock url = self.preprocess_url(_base_url + '/instances') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances?limit=20"}, "instances": [{"bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "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": "virtio_blk", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "memory": 8, "name": "my-instance", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}], "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "vcpu": {"architecture": "amd64", "count": 4}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances?limit=20"}, "instances": [{"bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "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": "virtio_blk", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "memory": 8, "name": "my-instance", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}], "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' responses.add(responses.GET, url, body=mock_response, @@ -5746,6 +5748,9 @@ def test_list_instances_all_params(self): dedicated_host_id = 'testString' dedicated_host_crn = 'testString' dedicated_host_name = 'testString' + placement_group_id = 'testString' + placement_group_crn = 'testString' + placement_group_name = 'testString' # Invoke method response = _service.list_instances( @@ -5759,6 +5764,9 @@ def test_list_instances_all_params(self): dedicated_host_id=dedicated_host_id, dedicated_host_crn=dedicated_host_crn, dedicated_host_name=dedicated_host_name, + placement_group_id=placement_group_id, + placement_group_crn=placement_group_crn, + placement_group_name=placement_group_name, headers={} ) @@ -5778,6 +5786,9 @@ def test_list_instances_all_params(self): assert 'dedicated_host.id={}'.format(dedicated_host_id) in query_string assert 'dedicated_host.crn={}'.format(dedicated_host_crn) in query_string assert 'dedicated_host.name={}'.format(dedicated_host_name) in query_string + 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 @responses.activate @@ -5787,7 +5798,7 @@ def test_list_instances_required_params(self): """ # Set up mock url = self.preprocess_url(_base_url + '/instances') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances?limit=20"}, "instances": [{"bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "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": "virtio_blk", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "memory": 8, "name": "my-instance", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}], "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "vcpu": {"architecture": "amd64", "count": 4}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances?limit=20"}, "instances": [{"bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "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": "virtio_blk", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "memory": 8, "name": "my-instance", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}], "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' responses.add(responses.GET, url, body=mock_response, @@ -5810,7 +5821,7 @@ def test_list_instances_value_error(self): """ # Set up mock url = self.preprocess_url(_base_url + '/instances') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances?limit=20"}, "instances": [{"bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "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": "virtio_blk", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "memory": 8, "name": "my-instance", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}], "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "vcpu": {"architecture": "amd64", "count": 4}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances?limit=20"}, "instances": [{"bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "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": "virtio_blk", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "memory": 8, "name": "my-instance", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}], "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' responses.add(responses.GET, url, body=mock_response, @@ -5848,7 +5859,7 @@ def test_create_instance_all_params(self): """ # Set up mock url = self.preprocess_url(_base_url + '/instances') - mock_response = '{"bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "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": "virtio_blk", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "memory": 8, "name": "my-instance", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}], "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "vcpu": {"architecture": "amd64", "count": 4}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "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": "virtio_blk", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "memory": 8, "name": "my-instance", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}], "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.POST, url, body=mock_response, @@ -5915,7 +5926,7 @@ def test_create_instance_all_params(self): # 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['capacity'] = 38 volume_prototype_instance_by_image_context_model['encryption_key'] = encryption_key_identity_model volume_prototype_instance_by_image_context_model['iops'] = 10000 volume_prototype_instance_by_image_context_model['name'] = 'my-boot-volume' @@ -5943,6 +5954,7 @@ def test_create_instance_all_params(self): 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_instance_context_model] instance_prototype_model['vpc'] = vpc_identity_model @@ -5975,7 +5987,7 @@ def test_create_instance_value_error(self): """ # Set up mock url = self.preprocess_url(_base_url + '/instances') - mock_response = '{"bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "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": "virtio_blk", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "memory": 8, "name": "my-instance", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}], "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "vcpu": {"architecture": "amd64", "count": 4}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "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": "virtio_blk", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "memory": 8, "name": "my-instance", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}], "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.POST, url, body=mock_response, @@ -6042,7 +6054,7 @@ def test_create_instance_value_error(self): # 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['capacity'] = 38 volume_prototype_instance_by_image_context_model['encryption_key'] = encryption_key_identity_model volume_prototype_instance_by_image_context_model['iops'] = 10000 volume_prototype_instance_by_image_context_model['name'] = 'my-boot-volume' @@ -6070,6 +6082,7 @@ def test_create_instance_value_error(self): 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_instance_context_model] instance_prototype_model['vpc'] = vpc_identity_model @@ -6177,7 +6190,7 @@ def test_get_instance_all_params(self): """ # Set up mock url = self.preprocess_url(_base_url + '/instances/testString') - mock_response = '{"bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "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": "virtio_blk", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "memory": 8, "name": "my-instance", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}], "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "vcpu": {"architecture": "amd64", "count": 4}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "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": "virtio_blk", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "memory": 8, "name": "my-instance", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}], "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.GET, url, body=mock_response, @@ -6205,7 +6218,7 @@ def test_get_instance_value_error(self): """ # Set up mock url = self.preprocess_url(_base_url + '/instances/testString') - mock_response = '{"bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "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": "virtio_blk", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "memory": 8, "name": "my-instance", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}], "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "vcpu": {"architecture": "amd64", "count": 4}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "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": "virtio_blk", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "memory": 8, "name": "my-instance", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}], "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.GET, url, body=mock_response, @@ -6247,7 +6260,7 @@ def test_update_instance_all_params(self): """ # Set up mock url = self.preprocess_url(_base_url + '/instances/testString') - mock_response = '{"bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "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": "virtio_blk", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "memory": 8, "name": "my-instance", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}], "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "vcpu": {"architecture": "amd64", "count": 4}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "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": "virtio_blk", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "memory": 8, "name": "my-instance", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}], "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.PATCH, url, body=mock_response, @@ -6262,6 +6275,7 @@ def test_update_instance_all_params(self): instance_patch_model = {} instance_patch_model['name'] = 'my-instance' instance_patch_model['profile'] = instance_patch_profile_model + instance_patch_model['total_volume_bandwidth'] = 500 # Set up parameter values id = 'testString' @@ -6289,7 +6303,7 @@ def test_update_instance_value_error(self): """ # Set up mock url = self.preprocess_url(_base_url + '/instances/testString') - mock_response = '{"bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "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": "virtio_blk", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "memory": 8, "name": "my-instance", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}], "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "vcpu": {"architecture": "amd64", "count": 4}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "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": "virtio_blk", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "memory": 8, "name": "my-instance", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}], "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.PATCH, url, body=mock_response, @@ -6304,6 +6318,7 @@ def test_update_instance_value_error(self): instance_patch_model = {} instance_patch_model['name'] = 'my-instance' instance_patch_model['profile'] = instance_patch_profile_model + instance_patch_model['total_volume_bandwidth'] = 500 # Set up parameter values id = 'testString' @@ -6342,7 +6357,7 @@ def test_get_instance_initialization_all_params(self): """ # Set up mock url = self.preprocess_url(_base_url + '/instances/testString/initialization') - mock_response = '{"keys": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-key"}], "password": {"encrypted_password": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "encryption_key": {"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"}}}' + mock_response = '{"keys": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-key"}], "password": {"encrypted_password": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "encryption_key": {"fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY"}}}' responses.add(responses.GET, url, body=mock_response, @@ -6370,7 +6385,7 @@ def test_get_instance_initialization_value_error(self): """ # Set up mock url = self.preprocess_url(_base_url + '/instances/testString/initialization') - mock_response = '{"keys": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-key"}], "password": {"encrypted_password": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "encryption_key": {"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"}}}' + mock_response = '{"keys": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-key"}], "password": {"encrypted_password": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "encryption_key": {"fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY"}}}' responses.add(responses.GET, url, body=mock_response, @@ -7521,7 +7536,7 @@ def test_list_instance_volume_attachments_all_params(self): """ # Set up mock url = self.preprocess_url(_base_url + '/instances/testString/volume_attachments') - mock_response = '{"volume_attachments": [{"created_at": "2019-01-01T12:00:00.000Z", "delete_volume_on_instance_delete": true, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "status": "attached", "type": "boot", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}]}' + mock_response = '{"volume_attachments": [{"bandwidth": 250, "created_at": "2019-01-01T12:00:00.000Z", "delete_volume_on_instance_delete": true, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "status": "attached", "type": "boot", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}]}' responses.add(responses.GET, url, body=mock_response, @@ -7549,7 +7564,7 @@ def test_list_instance_volume_attachments_value_error(self): """ # Set up mock url = self.preprocess_url(_base_url + '/instances/testString/volume_attachments') - mock_response = '{"volume_attachments": [{"created_at": "2019-01-01T12:00:00.000Z", "delete_volume_on_instance_delete": true, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "status": "attached", "type": "boot", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}]}' + mock_response = '{"volume_attachments": [{"bandwidth": 250, "created_at": "2019-01-01T12:00:00.000Z", "delete_volume_on_instance_delete": true, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "status": "attached", "type": "boot", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}]}' responses.add(responses.GET, url, body=mock_response, @@ -7591,7 +7606,7 @@ def test_create_instance_volume_attachment_all_params(self): """ # Set up mock url = self.preprocess_url(_base_url + '/instances/testString/volume_attachments') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "delete_volume_on_instance_delete": true, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "status": "attached", "type": "boot", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}' + mock_response = '{"bandwidth": 250, "created_at": "2019-01-01T12:00:00.000Z", "delete_volume_on_instance_delete": true, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "status": "attached", "type": "boot", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}' responses.add(responses.POST, url, body=mock_response, @@ -7634,7 +7649,7 @@ def test_create_instance_volume_attachment_value_error(self): """ # Set up mock url = self.preprocess_url(_base_url + '/instances/testString/volume_attachments') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "delete_volume_on_instance_delete": true, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "status": "attached", "type": "boot", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}' + mock_response = '{"bandwidth": 250, "created_at": "2019-01-01T12:00:00.000Z", "delete_volume_on_instance_delete": true, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "status": "attached", "type": "boot", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}' responses.add(responses.POST, url, body=mock_response, @@ -7752,7 +7767,7 @@ def test_get_instance_volume_attachment_all_params(self): """ # Set up mock url = self.preprocess_url(_base_url + '/instances/testString/volume_attachments/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "delete_volume_on_instance_delete": true, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "status": "attached", "type": "boot", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}' + mock_response = '{"bandwidth": 250, "created_at": "2019-01-01T12:00:00.000Z", "delete_volume_on_instance_delete": true, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "status": "attached", "type": "boot", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}' responses.add(responses.GET, url, body=mock_response, @@ -7782,7 +7797,7 @@ def test_get_instance_volume_attachment_value_error(self): """ # Set up mock url = self.preprocess_url(_base_url + '/instances/testString/volume_attachments/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "delete_volume_on_instance_delete": true, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "status": "attached", "type": "boot", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}' + mock_response = '{"bandwidth": 250, "created_at": "2019-01-01T12:00:00.000Z", "delete_volume_on_instance_delete": true, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "status": "attached", "type": "boot", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}' responses.add(responses.GET, url, body=mock_response, @@ -7826,7 +7841,7 @@ def test_update_instance_volume_attachment_all_params(self): """ # Set up mock url = self.preprocess_url(_base_url + '/instances/testString/volume_attachments/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "delete_volume_on_instance_delete": true, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "status": "attached", "type": "boot", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}' + mock_response = '{"bandwidth": 250, "created_at": "2019-01-01T12:00:00.000Z", "delete_volume_on_instance_delete": true, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "status": "attached", "type": "boot", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}' responses.add(responses.PATCH, url, body=mock_response, @@ -7866,7 +7881,7 @@ def test_update_instance_volume_attachment_value_error(self): """ # Set up mock url = self.preprocess_url(_base_url + '/instances/testString/volume_attachments/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "delete_volume_on_instance_delete": true, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "status": "attached", "type": "boot", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}' + mock_response = '{"bandwidth": 250, "created_at": "2019-01-01T12:00:00.000Z", "delete_volume_on_instance_delete": true, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "status": "attached", "type": "boot", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}' responses.add(responses.PATCH, url, body=mock_response, @@ -11542,6 +11557,420 @@ def test_update_dedicated_host_value_error(self): # End of Service: DedicatedHosts ############################################################################## +############################################################################## +# Start of Service: PlacementGroups +############################################################################## +# region + +class TestListPlacementGroups(): + """ + Test Class for list_placement_groups + """ + + def preprocess_url(self, request_url: str): + """ + Preprocess the request URL to ensure the mock response will be found. + """ + if re.fullmatch('.*/+', request_url) is None: + return request_url + else: + return re.compile(request_url.rstrip('/') + '/+') + + @responses.activate + def test_list_placement_groups_all_params(self): + """ + list_placement_groups() + """ + # Set up mock + url = self.preprocess_url(_base_url + '/placement_groups') + 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) + + # Set up parameter values + start = 'testString' + limit = 1 + + # Invoke method + response = _service.list_placement_groups( + 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 + + + @responses.activate + def test_list_placement_groups_required_params(self): + """ + test_list_placement_groups_required_params() + """ + # Set up mock + url = self.preprocess_url(_base_url + '/placement_groups') + 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) + + # Invoke method + response = _service.list_placement_groups() + + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + + + @responses.activate + def test_list_placement_groups_value_error(self): + """ + test_list_placement_groups_value_error() + """ + # Set up mock + url = self.preprocess_url(_base_url + '/placement_groups') + 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) + + # 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_placement_groups(**req_copy) + + + +class TestCreatePlacementGroup(): + """ + Test Class for create_placement_group + """ + + def preprocess_url(self, request_url: str): + """ + Preprocess the request URL to ensure the mock response will be found. + """ + if re.fullmatch('.*/+', request_url) is None: + return request_url + else: + return re.compile(request_url.rstrip('/') + '/+') + + @responses.activate + def test_create_placement_group_all_params(self): + """ + create_placement_group() + """ + # Set up mock + url = self.preprocess_url(_base_url + '/placement_groups') + 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, + 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 + + # Invoke method + response = _service.create_placement_group( + strategy, + 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['strategy'] == 'host_spread' + assert req_body['name'] == 'my-placement-group' + assert req_body['resource_group'] == resource_group_identity_model + + + @responses.activate + def test_create_placement_group_value_error(self): + """ + test_create_placement_group_value_error() + """ + # Set up mock + url = self.preprocess_url(_base_url + '/placement_groups') + 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, + 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) + + + +class TestDeletePlacementGroup(): + """ + Test Class for delete_placement_group + """ + + def preprocess_url(self, request_url: str): + """ + Preprocess the request URL to ensure the mock response will be found. + """ + if re.fullmatch('.*/+', request_url) is None: + return request_url + else: + return re.compile(request_url.rstrip('/') + '/+') + + @responses.activate + def test_delete_placement_group_all_params(self): + """ + delete_placement_group() + """ + # Set up mock + url = self.preprocess_url(_base_url + '/placement_groups/testString') + responses.add(responses.DELETE, + url, + status=202) + + # Set up parameter values + id = 'testString' + + # Invoke method + response = _service.delete_placement_group( + id, + headers={} + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 202 + + + @responses.activate + def test_delete_placement_group_value_error(self): + """ + test_delete_placement_group_value_error() + """ + # Set up mock + url = self.preprocess_url(_base_url + '/placement_groups/testString') + responses.add(responses.DELETE, + url, + status=202) + + # Set up parameter values + id = 'testString' + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "id": id, + } + for param in req_param_dict.keys(): + req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} + with pytest.raises(ValueError): + _service.delete_placement_group(**req_copy) + + + +class TestGetPlacementGroup(): + """ + Test Class for get_placement_group + """ + + def preprocess_url(self, request_url: str): + """ + Preprocess the request URL to ensure the mock response will be found. + """ + if re.fullmatch('.*/+', request_url) is None: + return request_url + else: + return re.compile(request_url.rstrip('/') + '/+') + + @responses.activate + def test_get_placement_group_all_params(self): + """ + get_placement_group() + """ + # Set up mock + url = self.preprocess_url(_base_url + '/placement_groups/testString') + 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, + body=mock_response, + content_type='application/json', + status=200) + + # Set up parameter values + id = 'testString' + + # Invoke method + response = _service.get_placement_group( + id, + headers={} + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + + + @responses.activate + def test_get_placement_group_value_error(self): + """ + test_get_placement_group_value_error() + """ + # Set up mock + url = self.preprocess_url(_base_url + '/placement_groups/testString') + 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, + 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_placement_group(**req_copy) + + + +class TestUpdatePlacementGroup(): + """ + Test Class for update_placement_group + """ + + def preprocess_url(self, request_url: str): + """ + Preprocess the request URL to ensure the mock response will be found. + """ + if re.fullmatch('.*/+', request_url) is None: + return request_url + else: + return re.compile(request_url.rstrip('/') + '/+') + + @responses.activate + def test_update_placement_group_all_params(self): + """ + update_placement_group() + """ + # Set up mock + url = self.preprocess_url(_base_url + '/placement_groups/testString') + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::placement-group:r018-418fe842-a3e9-47b9-a938-1aa5bd632871", "href": "https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r018-418fe842-a3e9-47b9-a938-1aa5bd632871", "id": "r018-418fe842-a3e9-47b9-a938-1aa5bd632871", "lifecycle_state": "stable", "name": "my-placement-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "placement_group", "strategy": "host_spread"}' + responses.add(responses.PATCH, + url, + 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 + id = 'testString' + placement_group_patch = placement_group_patch_model + + # Invoke method + 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 + + + @responses.activate + def test_update_placement_group_value_error(self): + """ + test_update_placement_group_value_error() + """ + # Set up mock + url = self.preprocess_url(_base_url + '/placement_groups/testString') + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::placement-group:r018-418fe842-a3e9-47b9-a938-1aa5bd632871", "href": "https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r018-418fe842-a3e9-47b9-a938-1aa5bd632871", "id": "r018-418fe842-a3e9-47b9-a938-1aa5bd632871", "lifecycle_state": "stable", "name": "my-placement-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "placement_group", "strategy": "host_spread"}' + responses.add(responses.PATCH, + url, + 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 + id = 'testString' + placement_group_patch = placement_group_patch_model + + # 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) + + + +# endregion +############################################################################## +# End of Service: PlacementGroups +############################################################################## + ############################################################################## # Start of Service: Volumes ############################################################################## @@ -11734,7 +12163,7 @@ def test_list_volumes_all_params(self): """ # Set up mock url = self.preprocess_url(_base_url + '/volumes') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volumes?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volumes?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "volumes": [{"active": true, "busy": true, "capacity": 1000, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}]}' + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volumes?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volumes?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "volumes": [{"active": true, "bandwidth": 1000, "busy": true, "capacity": 1000, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}]}' responses.add(responses.GET, url, body=mock_response, @@ -11775,7 +12204,7 @@ def test_list_volumes_required_params(self): """ # Set up mock url = self.preprocess_url(_base_url + '/volumes') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volumes?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volumes?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "volumes": [{"active": true, "busy": true, "capacity": 1000, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}]}' + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volumes?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volumes?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "volumes": [{"active": true, "bandwidth": 1000, "busy": true, "capacity": 1000, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}]}' responses.add(responses.GET, url, body=mock_response, @@ -11798,7 +12227,7 @@ def test_list_volumes_value_error(self): """ # Set up mock url = self.preprocess_url(_base_url + '/volumes') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volumes?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volumes?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "volumes": [{"active": true, "busy": true, "capacity": 1000, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}]}' + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volumes?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volumes?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "volumes": [{"active": true, "bandwidth": 1000, "busy": true, "capacity": 1000, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}]}' responses.add(responses.GET, url, body=mock_response, @@ -11836,7 +12265,7 @@ def test_create_volume_all_params(self): """ # Set up mock url = self.preprocess_url(_base_url + '/volumes') - mock_response = '{"active": true, "busy": true, "capacity": 1000, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"active": true, "bandwidth": 1000, "busy": true, "capacity": 1000, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.POST, url, body=mock_response, @@ -11893,7 +12322,7 @@ def test_create_volume_value_error(self): """ # Set up mock url = self.preprocess_url(_base_url + '/volumes') - mock_response = '{"active": true, "busy": true, "capacity": 1000, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"active": true, "bandwidth": 1000, "busy": true, "capacity": 1000, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.POST, url, body=mock_response, @@ -12025,7 +12454,7 @@ def test_get_volume_all_params(self): """ # Set up mock url = self.preprocess_url(_base_url + '/volumes/testString') - mock_response = '{"active": true, "busy": true, "capacity": 1000, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"active": true, "bandwidth": 1000, "busy": true, "capacity": 1000, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.GET, url, body=mock_response, @@ -12053,7 +12482,7 @@ def test_get_volume_value_error(self): """ # Set up mock url = self.preprocess_url(_base_url + '/volumes/testString') - mock_response = '{"active": true, "busy": true, "capacity": 1000, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"active": true, "bandwidth": 1000, "busy": true, "capacity": 1000, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.GET, url, body=mock_response, @@ -12095,16 +12524,23 @@ def test_update_volume_all_params(self): """ # Set up mock url = self.preprocess_url(_base_url + '/volumes/testString') - mock_response = '{"active": true, "busy": true, "capacity": 1000, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"active": true, "bandwidth": 1000, "busy": true, "capacity": 1000, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.PATCH, url, body=mock_response, content_type='application/json', status=200) + # Construct a dict representation of a VolumeProfileIdentityByName model + volume_profile_identity_model = {} + volume_profile_identity_model['name'] = 'general-purpose' + # Construct a dict representation of a VolumePatch model volume_patch_model = {} + volume_patch_model['capacity'] = 100 + volume_patch_model['iops'] = 10000 volume_patch_model['name'] = 'my-volume' + volume_patch_model['profile'] = volume_profile_identity_model # Set up parameter values id = 'testString' @@ -12132,16 +12568,23 @@ def test_update_volume_value_error(self): """ # Set up mock url = self.preprocess_url(_base_url + '/volumes/testString') - mock_response = '{"active": true, "busy": true, "capacity": 1000, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"active": true, "bandwidth": 1000, "busy": true, "capacity": 1000, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.PATCH, url, body=mock_response, content_type='application/json', status=200) + # Construct a dict representation of a VolumeProfileIdentityByName model + volume_profile_identity_model = {} + volume_profile_identity_model['name'] = 'general-purpose' + # Construct a dict representation of a VolumePatch model volume_patch_model = {} + volume_patch_model['capacity'] = 100 + volume_patch_model['iops'] = 10000 volume_patch_model['name'] = 'my-volume' + volume_patch_model['profile'] = volume_profile_identity_model # Set up parameter values id = 'testString' @@ -14928,11 +15371,11 @@ def test_create_security_group_all_params(self): # Construct a dict representation of a SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP model security_group_rule_prototype_model = {} + security_group_rule_prototype_model['code'] = 0 security_group_rule_prototype_model['direction'] = 'inbound' security_group_rule_prototype_model['ip_version'] = 'ipv4' - security_group_rule_prototype_model['remote'] = security_group_rule_remote_prototype_model - security_group_rule_prototype_model['code'] = 0 security_group_rule_prototype_model['protocol'] = 'icmp' + security_group_rule_prototype_model['remote'] = security_group_rule_remote_prototype_model security_group_rule_prototype_model['type'] = 8 # Set up parameter values @@ -14989,11 +15432,11 @@ def test_create_security_group_value_error(self): # Construct a dict representation of a SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP model security_group_rule_prototype_model = {} + security_group_rule_prototype_model['code'] = 0 security_group_rule_prototype_model['direction'] = 'inbound' security_group_rule_prototype_model['ip_version'] = 'ipv4' - security_group_rule_prototype_model['remote'] = security_group_rule_remote_prototype_model - security_group_rule_prototype_model['code'] = 0 security_group_rule_prototype_model['protocol'] = 'icmp' + security_group_rule_prototype_model['remote'] = security_group_rule_remote_prototype_model security_group_rule_prototype_model['type'] = 8 # Set up parameter values @@ -15659,11 +16102,11 @@ def test_create_security_group_rule_all_params(self): # Construct a dict representation of a SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP model security_group_rule_prototype_model = {} + security_group_rule_prototype_model['code'] = 0 security_group_rule_prototype_model['direction'] = 'inbound' security_group_rule_prototype_model['ip_version'] = 'ipv4' - security_group_rule_prototype_model['remote'] = security_group_rule_remote_prototype_model - security_group_rule_prototype_model['code'] = 0 security_group_rule_prototype_model['protocol'] = 'icmp' + security_group_rule_prototype_model['remote'] = security_group_rule_remote_prototype_model security_group_rule_prototype_model['type'] = 8 # Set up parameter values @@ -15705,11 +16148,11 @@ def test_create_security_group_rule_value_error(self): # Construct a dict representation of a SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP model security_group_rule_prototype_model = {} + security_group_rule_prototype_model['code'] = 0 security_group_rule_prototype_model['direction'] = 'inbound' security_group_rule_prototype_model['ip_version'] = 'ipv4' - security_group_rule_prototype_model['remote'] = security_group_rule_remote_prototype_model - security_group_rule_prototype_model['code'] = 0 security_group_rule_prototype_model['protocol'] = 'icmp' + security_group_rule_prototype_model['remote'] = security_group_rule_remote_prototype_model security_group_rule_prototype_model['type'] = 8 # Set up parameter values @@ -19689,7 +20132,7 @@ def test_list_load_balancer_listeners_all_params(self): """ # Set up mock url = self.preprocess_url(_base_url + '/load_balancers/testString/listeners') - mock_response = '{"listeners": [{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:cloudcerts:us-south:a/123456:b8866ea4-b8df-467e-801a-da1db7e020bf:certificate:78ff9c4c97d013fb2a95b21dddde7758"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "port": 443, "protocol": "http", "provisioning_status": "active"}]}' + mock_response = '{"listeners": [{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:cloudcerts:us-south:a/123456:b8866ea4-b8df-467e-801a-da1db7e020bf:certificate:78ff9c4c97d013fb2a95b21dddde7758"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "https_redirect": {"http_status_code": 301, "listener": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "uri": "/example?doc=get"}, "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "port": 443, "protocol": "http", "provisioning_status": "active"}]}' responses.add(responses.GET, url, body=mock_response, @@ -19717,7 +20160,7 @@ def test_list_load_balancer_listeners_value_error(self): """ # Set up mock url = self.preprocess_url(_base_url + '/load_balancers/testString/listeners') - mock_response = '{"listeners": [{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:cloudcerts:us-south:a/123456:b8866ea4-b8df-467e-801a-da1db7e020bf:certificate:78ff9c4c97d013fb2a95b21dddde7758"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "port": 443, "protocol": "http", "provisioning_status": "active"}]}' + mock_response = '{"listeners": [{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:cloudcerts:us-south:a/123456:b8866ea4-b8df-467e-801a-da1db7e020bf:certificate:78ff9c4c97d013fb2a95b21dddde7758"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "https_redirect": {"http_status_code": 301, "listener": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "uri": "/example?doc=get"}, "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "port": 443, "protocol": "http", "provisioning_status": "active"}]}' responses.add(responses.GET, url, body=mock_response, @@ -19759,7 +20202,7 @@ def test_create_load_balancer_listener_all_params(self): """ # Set up mock url = self.preprocess_url(_base_url + '/load_balancers/testString/listeners') - mock_response = '{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:cloudcerts:us-south:a/123456:b8866ea4-b8df-467e-801a-da1db7e020bf:certificate:78ff9c4c97d013fb2a95b21dddde7758"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "port": 443, "protocol": "http", "provisioning_status": "active"}' + mock_response = '{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:cloudcerts:us-south:a/123456:b8866ea4-b8df-467e-801a-da1db7e020bf:certificate:78ff9c4c97d013fb2a95b21dddde7758"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "https_redirect": {"http_status_code": 301, "listener": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "uri": "/example?doc=get"}, "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "port": 443, "protocol": "http", "provisioning_status": "active"}' responses.add(responses.POST, url, body=mock_response, @@ -19774,6 +20217,16 @@ def test_create_load_balancer_listener_all_params(self): 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' @@ -19801,6 +20254,7 @@ def test_create_load_balancer_listener_all_params(self): certificate_instance = certificate_instance_identity_model connection_limit = 2000 default_pool = load_balancer_pool_identity_model + https_redirect = load_balancer_listener_https_redirect_prototype_model policies = [load_balancer_listener_policy_prototype_model] # Invoke method @@ -19812,6 +20266,7 @@ def test_create_load_balancer_listener_all_params(self): certificate_instance=certificate_instance, connection_limit=connection_limit, default_pool=default_pool, + https_redirect=https_redirect, policies=policies, headers={} ) @@ -19827,6 +20282,7 @@ def test_create_load_balancer_listener_all_params(self): assert req_body['certificate_instance'] == certificate_instance_identity_model assert req_body['connection_limit'] == 2000 assert req_body['default_pool'] == load_balancer_pool_identity_model + assert req_body['https_redirect'] == load_balancer_listener_https_redirect_prototype_model assert req_body['policies'] == [load_balancer_listener_policy_prototype_model] @@ -19837,7 +20293,7 @@ def test_create_load_balancer_listener_value_error(self): """ # Set up mock url = self.preprocess_url(_base_url + '/load_balancers/testString/listeners') - mock_response = '{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:cloudcerts:us-south:a/123456:b8866ea4-b8df-467e-801a-da1db7e020bf:certificate:78ff9c4c97d013fb2a95b21dddde7758"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "port": 443, "protocol": "http", "provisioning_status": "active"}' + mock_response = '{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:cloudcerts:us-south:a/123456:b8866ea4-b8df-467e-801a-da1db7e020bf:certificate:78ff9c4c97d013fb2a95b21dddde7758"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "https_redirect": {"http_status_code": 301, "listener": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "uri": "/example?doc=get"}, "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "port": 443, "protocol": "http", "provisioning_status": "active"}' responses.add(responses.POST, url, body=mock_response, @@ -19852,6 +20308,16 @@ def test_create_load_balancer_listener_value_error(self): 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' @@ -19879,6 +20345,7 @@ def test_create_load_balancer_listener_value_error(self): certificate_instance = certificate_instance_identity_model connection_limit = 2000 default_pool = load_balancer_pool_identity_model + https_redirect = load_balancer_listener_https_redirect_prototype_model policies = [load_balancer_listener_policy_prototype_model] # Pass in all but one required param and check for a ValueError @@ -19983,7 +20450,7 @@ def test_get_load_balancer_listener_all_params(self): """ # Set up mock url = self.preprocess_url(_base_url + '/load_balancers/testString/listeners/testString') - mock_response = '{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:cloudcerts:us-south:a/123456:b8866ea4-b8df-467e-801a-da1db7e020bf:certificate:78ff9c4c97d013fb2a95b21dddde7758"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "port": 443, "protocol": "http", "provisioning_status": "active"}' + mock_response = '{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:cloudcerts:us-south:a/123456:b8866ea4-b8df-467e-801a-da1db7e020bf:certificate:78ff9c4c97d013fb2a95b21dddde7758"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "https_redirect": {"http_status_code": 301, "listener": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "uri": "/example?doc=get"}, "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "port": 443, "protocol": "http", "provisioning_status": "active"}' responses.add(responses.GET, url, body=mock_response, @@ -20013,7 +20480,7 @@ def test_get_load_balancer_listener_value_error(self): """ # Set up mock url = self.preprocess_url(_base_url + '/load_balancers/testString/listeners/testString') - mock_response = '{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:cloudcerts:us-south:a/123456:b8866ea4-b8df-467e-801a-da1db7e020bf:certificate:78ff9c4c97d013fb2a95b21dddde7758"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "port": 443, "protocol": "http", "provisioning_status": "active"}' + mock_response = '{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:cloudcerts:us-south:a/123456:b8866ea4-b8df-467e-801a-da1db7e020bf:certificate:78ff9c4c97d013fb2a95b21dddde7758"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "https_redirect": {"http_status_code": 301, "listener": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "uri": "/example?doc=get"}, "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "port": 443, "protocol": "http", "provisioning_status": "active"}' responses.add(responses.GET, url, body=mock_response, @@ -20057,7 +20524,7 @@ def test_update_load_balancer_listener_all_params(self): """ # Set up mock url = self.preprocess_url(_base_url + '/load_balancers/testString/listeners/testString') - mock_response = '{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:cloudcerts:us-south:a/123456:b8866ea4-b8df-467e-801a-da1db7e020bf:certificate:78ff9c4c97d013fb2a95b21dddde7758"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "port": 443, "protocol": "http", "provisioning_status": "active"}' + mock_response = '{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:cloudcerts:us-south:a/123456:b8866ea4-b8df-467e-801a-da1db7e020bf:certificate:78ff9c4c97d013fb2a95b21dddde7758"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "https_redirect": {"http_status_code": 301, "listener": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "uri": "/example?doc=get"}, "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "port": 443, "protocol": "http", "provisioning_status": "active"}' responses.add(responses.PATCH, url, body=mock_response, @@ -20072,12 +20539,23 @@ def test_update_load_balancer_listener_all_params(self): load_balancer_pool_identity_model = {} load_balancer_pool_identity_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' + # Construct a dict representation of a LoadBalancerListenerIdentityById model + load_balancer_listener_identity_model = {} + load_balancer_listener_identity_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' + + # Construct a dict representation of a LoadBalancerListenerHTTPSRedirectPatch model + load_balancer_listener_https_redirect_patch_model = {} + load_balancer_listener_https_redirect_patch_model['http_status_code'] = 301 + load_balancer_listener_https_redirect_patch_model['listener'] = load_balancer_listener_identity_model + load_balancer_listener_https_redirect_patch_model['uri'] = '/example?doc=get' + # Construct a dict representation of a LoadBalancerListenerPatch model load_balancer_listener_patch_model = {} load_balancer_listener_patch_model['accept_proxy_protocol'] = True load_balancer_listener_patch_model['certificate_instance'] = certificate_instance_identity_model load_balancer_listener_patch_model['connection_limit'] = 2000 load_balancer_listener_patch_model['default_pool'] = load_balancer_pool_identity_model + load_balancer_listener_patch_model['https_redirect'] = load_balancer_listener_https_redirect_patch_model load_balancer_listener_patch_model['port'] = 443 load_balancer_listener_patch_model['protocol'] = 'http' @@ -20109,7 +20587,7 @@ def test_update_load_balancer_listener_value_error(self): """ # Set up mock url = self.preprocess_url(_base_url + '/load_balancers/testString/listeners/testString') - mock_response = '{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:cloudcerts:us-south:a/123456:b8866ea4-b8df-467e-801a-da1db7e020bf:certificate:78ff9c4c97d013fb2a95b21dddde7758"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "port": 443, "protocol": "http", "provisioning_status": "active"}' + mock_response = '{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:cloudcerts:us-south:a/123456:b8866ea4-b8df-467e-801a-da1db7e020bf:certificate:78ff9c4c97d013fb2a95b21dddde7758"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "https_redirect": {"http_status_code": 301, "listener": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "uri": "/example?doc=get"}, "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "port": 443, "protocol": "http", "provisioning_status": "active"}' responses.add(responses.PATCH, url, body=mock_response, @@ -20124,12 +20602,23 @@ def test_update_load_balancer_listener_value_error(self): load_balancer_pool_identity_model = {} load_balancer_pool_identity_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' + # Construct a dict representation of a LoadBalancerListenerIdentityById model + load_balancer_listener_identity_model = {} + load_balancer_listener_identity_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' + + # Construct a dict representation of a LoadBalancerListenerHTTPSRedirectPatch model + load_balancer_listener_https_redirect_patch_model = {} + load_balancer_listener_https_redirect_patch_model['http_status_code'] = 301 + load_balancer_listener_https_redirect_patch_model['listener'] = load_balancer_listener_identity_model + load_balancer_listener_https_redirect_patch_model['uri'] = '/example?doc=get' + # Construct a dict representation of a LoadBalancerListenerPatch model load_balancer_listener_patch_model = {} load_balancer_listener_patch_model['accept_proxy_protocol'] = True load_balancer_listener_patch_model['certificate_instance'] = certificate_instance_identity_model load_balancer_listener_patch_model['connection_limit'] = 2000 load_balancer_listener_patch_model['default_pool'] = load_balancer_pool_identity_model + load_balancer_listener_patch_model['https_redirect'] = load_balancer_listener_https_redirect_patch_model load_balancer_listener_patch_model['port'] = 443 load_balancer_listener_patch_model['protocol'] = 'http' @@ -27225,6 +27714,8 @@ def test_instance_serialization(self): 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 @@ -27430,6 +27921,8 @@ def test_instance_collection_serialization(self): 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 @@ -29162,21 +29655,24 @@ def test_instance_initialization_serialization(self): key_reference_deleted_model = {} # KeyReferenceDeleted key_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - key_reference_instance_initialization_context_model = {} # KeyReferenceInstanceInitializationContextKeyReference - key_reference_instance_initialization_context_model['crn'] = 'crn:[...]' - key_reference_instance_initialization_context_model['deleted'] = key_reference_deleted_model - key_reference_instance_initialization_context_model['fingerprint'] = 'SHA256:RJ+YWs2kupwFGiJuLqY85twmcdLOUcjIc9cA6IR8n8E' - key_reference_instance_initialization_context_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/keys/82679077-ac3b-4c10-be16-63e9c21f0f45' - key_reference_instance_initialization_context_model['id'] = '82679077-ac3b-4c10-be16-63e9c21f0f45' - key_reference_instance_initialization_context_model['name'] = 'my-key-1' + key_reference_model = {} # KeyReference + key_reference_model['crn'] = 'crn:[...]' + key_reference_model['deleted'] = key_reference_deleted_model + key_reference_model['fingerprint'] = 'SHA256:RJ+YWs2kupwFGiJuLqY85twmcdLOUcjIc9cA6IR8n8E' + key_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/keys/82679077-ac3b-4c10-be16-63e9c21f0f45' + key_reference_model['id'] = '82679077-ac3b-4c10-be16-63e9c21f0f45' + key_reference_model['name'] = 'my-key-1' + + key_identity_by_fingerprint_model = {} # KeyIdentityByFingerprint + key_identity_by_fingerprint_model['fingerprint'] = 'SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY' instance_initialization_password_model = {} # InstanceInitializationPassword instance_initialization_password_model['encrypted_password'] = 'VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4=' - instance_initialization_password_model['encryption_key'] = key_reference_instance_initialization_context_model + instance_initialization_password_model['encryption_key'] = key_identity_by_fingerprint_model # Construct a json representation of a InstanceInitialization model instance_initialization_model_json = {} - instance_initialization_model_json['keys'] = [key_reference_instance_initialization_context_model] + instance_initialization_model_json['keys'] = [key_reference_model] instance_initialization_model_json['password'] = instance_initialization_password_model # Construct a model instance of InstanceInitialization by calling from_dict on the json representation @@ -29206,21 +29702,13 @@ def test_instance_initialization_password_serialization(self): # 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_instance_initialization_context_model = {} # KeyReferenceInstanceInitializationContextKeyReference - key_reference_instance_initialization_context_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803' - key_reference_instance_initialization_context_model['deleted'] = key_reference_deleted_model - key_reference_instance_initialization_context_model['fingerprint'] = 'SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY' - key_reference_instance_initialization_context_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803' - key_reference_instance_initialization_context_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803' - key_reference_instance_initialization_context_model['name'] = 'my-key' + 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_reference_instance_initialization_context_model + instance_initialization_password_model_json['encryption_key'] = key_identity_by_fingerprint_model # Construct a model instance of InstanceInitializationPassword by calling from_dict on the json representation instance_initialization_password_model = InstanceInitializationPassword.from_dict(instance_initialization_password_model_json) @@ -29256,6 +29744,7 @@ def test_instance_patch_serialization(self): instance_patch_model_json = {} instance_patch_model_json['name'] = 'my-instance' instance_patch_model_json['profile'] = instance_patch_profile_model + instance_patch_model_json['total_volume_bandwidth'] = 500 # Construct a model instance of InstancePatch by calling from_dict on the json representation instance_patch_model = InstancePatch.from_dict(instance_patch_model_json) @@ -29319,6 +29808,10 @@ def test_instance_profile_serialization(self): instance_profile_port_speed_model['type'] = 'fixed' instance_profile_port_speed_model['value'] = 1000 + instance_profile_volume_bandwidth_model = {} # InstanceProfileVolumeBandwidthFixed + instance_profile_volume_bandwidth_model['type'] = 'fixed' + instance_profile_volume_bandwidth_model['value'] = 20000 + instance_profile_vcpu_architecture_model = {} # InstanceProfileVCPUArchitecture instance_profile_vcpu_architecture_model['default'] = 'testString' instance_profile_vcpu_architecture_model['type'] = 'fixed' @@ -29338,6 +29831,7 @@ def test_instance_profile_serialization(self): instance_profile_model_json['name'] = 'bc1-4x16' instance_profile_model_json['os_architecture'] = instance_profile_os_architecture_model instance_profile_model_json['port_speed'] = instance_profile_port_speed_model + instance_profile_model_json['total_volume_bandwidth'] = instance_profile_volume_bandwidth_model instance_profile_model_json['vcpu_architecture'] = instance_profile_vcpu_architecture_model instance_profile_model_json['vcpu_count'] = instance_profile_vcpu_model @@ -29403,6 +29897,10 @@ def test_instance_profile_collection_serialization(self): instance_profile_port_speed_model['type'] = 'fixed' instance_profile_port_speed_model['value'] = 1000 + instance_profile_volume_bandwidth_model = {} # InstanceProfileVolumeBandwidthFixed + instance_profile_volume_bandwidth_model['type'] = 'fixed' + instance_profile_volume_bandwidth_model['value'] = 20000 + instance_profile_vcpu_architecture_model = {} # InstanceProfileVCPUArchitecture instance_profile_vcpu_architecture_model['default'] = 'testString' instance_profile_vcpu_architecture_model['type'] = 'fixed' @@ -29421,6 +29919,7 @@ def test_instance_profile_collection_serialization(self): instance_profile_model['name'] = 'bc1-4x16' instance_profile_model['os_architecture'] = instance_profile_os_architecture_model instance_profile_model['port_speed'] = instance_profile_port_speed_model + instance_profile_model['total_volume_bandwidth'] = instance_profile_volume_bandwidth_model instance_profile_model['vcpu_architecture'] = instance_profile_vcpu_architecture_model instance_profile_model['vcpu_count'] = instance_profile_vcpu_model @@ -29773,7 +30272,7 @@ def test_instance_template_collection_serialization(self): 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['capacity'] = 38 volume_prototype_instance_by_image_context_model['encryption_key'] = encryption_key_identity_model volume_prototype_instance_by_image_context_model['iops'] = 10000 volume_prototype_instance_by_image_context_model['name'] = 'my-volume' @@ -29801,6 +30300,7 @@ def test_instance_template_collection_serialization(self): instance_template_model['placement_target'] = instance_placement_target_prototype_model instance_template_model['profile'] = instance_profile_identity_model instance_template_model['resource_group'] = resource_group_reference_model + instance_template_model['total_volume_bandwidth'] = 500 instance_template_model['user_data'] = 'testString' instance_template_model['volume_attachments'] = [volume_attachment_prototype_instance_context_model] instance_template_model['vpc'] = vpc_identity_model @@ -30042,7 +30542,7 @@ def test_key_serialization(self): 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'] = 'AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En' + key_model_json['public_key'] = 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En' key_model_json['resource_group'] = resource_group_reference_model key_model_json['type'] = 'rsa' @@ -30073,8 +30573,8 @@ def test_key_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - page_link_model = {} # PageLink - page_link_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/keys?limit=50' + 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' @@ -30089,7 +30589,7 @@ def test_key_collection_serialization(self): key_model['id'] = '82679077-ac3b-4c10-be16-63e9c21f0f45' key_model['length'] = 2048 key_model['name'] = 'my-key-1' - key_model['public_key'] = 'ssh-rsa AAAAB...n' + 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' @@ -30098,7 +30598,7 @@ def test_key_collection_serialization(self): # Construct a json representation of a KeyCollection model key_collection_model_json = {} - key_collection_model_json['first'] = page_link_model + 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 @@ -30119,6 +30619,35 @@ def test_key_collection_serialization(self): key_collection_model_json2 = key_collection_model.to_dict() assert key_collection_model_json2 == key_collection_model_json +class TestModel_KeyCollectionFirst(): + """ + Test Class for KeyCollectionFirst + """ + + def test_key_collection_first_serialization(self): + """ + Test serialization/deserialization for KeyCollectionFirst + """ + + # 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 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 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 key_collection_first_model == key_collection_first_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 + class TestModel_KeyCollectionNext(): """ Test Class for KeyCollectionNext @@ -30177,6 +30706,45 @@ def test_key_patch_serialization(self): key_patch_model_json2 = key_patch_model.to_dict() assert key_patch_model_json2 == key_patch_model_json +class TestModel_KeyReference(): + """ + Test Class for KeyReference + """ + + def test_key_reference_serialization(self): + """ + Test serialization/deserialization for KeyReference + """ + + # 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 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 KeyReference by calling from_dict on the json representation + key_reference_model_dict = KeyReference.from_dict(key_reference_model_json).__dict__ + key_reference_model2 = KeyReference(**key_reference_model_dict) + + # Verify the model instances are equivalent + assert key_reference_model == key_reference_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 + class TestModel_KeyReferenceDeleted(): """ Test Class for KeyReferenceDeleted @@ -30511,6 +31079,19 @@ def test_load_balancer_listener_serialization(self): load_balancer_pool_reference_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' load_balancer_pool_reference_model['name'] = 'my-load-balancer-pool' + load_balancer_listener_reference_deleted_model = {} # LoadBalancerListenerReferenceDeleted + load_balancer_listener_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + load_balancer_listener_reference_model = {} # LoadBalancerListenerReference + load_balancer_listener_reference_model['deleted'] = load_balancer_listener_reference_deleted_model + load_balancer_listener_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004' + load_balancer_listener_reference_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' + + load_balancer_listener_https_redirect_model = {} # LoadBalancerListenerHTTPSRedirect + load_balancer_listener_https_redirect_model['http_status_code'] = 301 + load_balancer_listener_https_redirect_model['listener'] = load_balancer_listener_reference_model + load_balancer_listener_https_redirect_model['uri'] = '/example?doc=get' + load_balancer_listener_policy_reference_deleted_model = {} # LoadBalancerListenerPolicyReferenceDeleted load_balancer_listener_policy_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' @@ -30527,6 +31108,7 @@ def test_load_balancer_listener_serialization(self): load_balancer_listener_model_json['created_at'] = "2019-01-01T12:00:00Z" load_balancer_listener_model_json['default_pool'] = load_balancer_pool_reference_model load_balancer_listener_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004' + load_balancer_listener_model_json['https_redirect'] = load_balancer_listener_https_redirect_model load_balancer_listener_model_json['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' load_balancer_listener_model_json['policies'] = [load_balancer_listener_policy_reference_model] load_balancer_listener_model_json['port'] = 443 @@ -30572,6 +31154,19 @@ def test_load_balancer_listener_collection_serialization(self): load_balancer_pool_reference_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' load_balancer_pool_reference_model['name'] = 'my-load-balancer-pool' + load_balancer_listener_reference_deleted_model = {} # LoadBalancerListenerReferenceDeleted + load_balancer_listener_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + load_balancer_listener_reference_model = {} # LoadBalancerListenerReference + load_balancer_listener_reference_model['deleted'] = load_balancer_listener_reference_deleted_model + load_balancer_listener_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004' + load_balancer_listener_reference_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' + + load_balancer_listener_https_redirect_model = {} # LoadBalancerListenerHTTPSRedirect + load_balancer_listener_https_redirect_model['http_status_code'] = 301 + load_balancer_listener_https_redirect_model['listener'] = load_balancer_listener_reference_model + load_balancer_listener_https_redirect_model['uri'] = '/example?doc=get' + load_balancer_listener_policy_reference_deleted_model = {} # LoadBalancerListenerPolicyReferenceDeleted load_balancer_listener_policy_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' @@ -30587,6 +31182,7 @@ def test_load_balancer_listener_collection_serialization(self): load_balancer_listener_model['created_at'] = "2019-01-01T12:00:00Z" load_balancer_listener_model['default_pool'] = load_balancer_pool_reference_model load_balancer_listener_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004' + load_balancer_listener_model['https_redirect'] = load_balancer_listener_https_redirect_model load_balancer_listener_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' load_balancer_listener_model['policies'] = [load_balancer_listener_policy_reference_model] load_balancer_listener_model['port'] = 443 @@ -30612,6 +31208,119 @@ def test_load_balancer_listener_collection_serialization(self): 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_LoadBalancerListenerHTTPSRedirect(): + """ + Test Class for LoadBalancerListenerHTTPSRedirect + """ + + def test_load_balancer_listener_https_redirect_serialization(self): + """ + Test serialization/deserialization for LoadBalancerListenerHTTPSRedirect + """ + + # 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' + + # 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 load_balancer_listener_https_redirect_model == load_balancer_listener_https_redirect_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 + +class TestModel_LoadBalancerListenerHTTPSRedirectPatch(): + """ + Test Class for LoadBalancerListenerHTTPSRedirectPatch + """ + + def test_load_balancer_listener_https_redirect_patch_serialization(self): + """ + Test serialization/deserialization for LoadBalancerListenerHTTPSRedirectPatch + """ + + # 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 model instance of LoadBalancerListenerHTTPSRedirectPatch by calling from_dict on the json representation + load_balancer_listener_https_redirect_patch_model = LoadBalancerListenerHTTPSRedirectPatch.from_dict(load_balancer_listener_https_redirect_patch_model_json) + assert load_balancer_listener_https_redirect_patch_model != False + + # Construct a model instance of LoadBalancerListenerHTTPSRedirectPatch by calling from_dict on the json representation + load_balancer_listener_https_redirect_patch_model_dict = LoadBalancerListenerHTTPSRedirectPatch.from_dict(load_balancer_listener_https_redirect_patch_model_json).__dict__ + load_balancer_listener_https_redirect_patch_model2 = LoadBalancerListenerHTTPSRedirectPatch(**load_balancer_listener_https_redirect_patch_model_dict) + + # Verify the model instances are equivalent + assert 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 + 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_LoadBalancerListenerHTTPSRedirectPrototype(): + """ + Test Class for LoadBalancerListenerHTTPSRedirectPrototype + """ + + def test_load_balancer_listener_https_redirect_prototype_serialization(self): + """ + Test serialization/deserialization for LoadBalancerListenerHTTPSRedirectPrototype + """ + + # 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 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 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 + 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_LoadBalancerListenerPatch(): """ Test Class for LoadBalancerListenerPatch @@ -30630,12 +31339,21 @@ def test_load_balancer_listener_patch_serialization(self): 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' + + load_balancer_listener_https_redirect_patch_model = {} # LoadBalancerListenerHTTPSRedirectPatch + load_balancer_listener_https_redirect_patch_model['http_status_code'] = 301 + load_balancer_listener_https_redirect_patch_model['listener'] = load_balancer_listener_identity_model + load_balancer_listener_https_redirect_patch_model['uri'] = '/example?doc=get' + # Construct a json representation of a LoadBalancerListenerPatch model load_balancer_listener_patch_model_json = {} load_balancer_listener_patch_model_json['accept_proxy_protocol'] = True load_balancer_listener_patch_model_json['certificate_instance'] = certificate_instance_identity_model load_balancer_listener_patch_model_json['connection_limit'] = 2000 load_balancer_listener_patch_model_json['default_pool'] = load_balancer_pool_identity_model + load_balancer_listener_patch_model_json['https_redirect'] = load_balancer_listener_https_redirect_patch_model load_balancer_listener_patch_model_json['port'] = 443 load_balancer_listener_patch_model_json['protocol'] = 'http' @@ -33678,34 +34396,222 @@ def test_operating_system_reference_serialization(self): operating_system_reference_model_json2 = operating_system_reference_model.to_dict() assert operating_system_reference_model_json2 == operating_system_reference_model_json -class TestModel_PageLink(): +class TestModel_PlacementGroup(): """ - Test Class for PageLink + Test Class for PlacementGroup """ - def test_page_link_serialization(self): + def test_placement_group_serialization(self): """ - Test serialization/deserialization for PageLink + Test serialization/deserialization for PlacementGroup """ - # Construct a json representation of a PageLink model - page_link_model_json = {} - page_link_model_json['href'] = 'testString' + # Construct dict forms of any model objects needed in order to build this model. + + resource_group_reference_model = {} # ResourceGroupReference + resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/4bbce614c13444cd8fc5e7e878ef8e21' + resource_group_reference_model['id'] = '4bbce614c13444cd8fc5e7e878ef8e21' + resource_group_reference_model['name'] = 'Default' + + # Construct a json representation of a PlacementGroup model + placement_group_model_json = {} + placement_group_model_json['created_at'] = "2019-01-01T12:00:00Z" + placement_group_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::placement-group:r018-418fe842-a3e9-47b9-a938-1aa5bd632871' + placement_group_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r018-418fe842-a3e9-47b9-a938-1aa5bd632871' + placement_group_model_json['id'] = 'r018-418fe842-a3e9-47b9-a938-1aa5bd632871' + placement_group_model_json['lifecycle_state'] = 'stable' + placement_group_model_json['name'] = 'my-placement-group' + placement_group_model_json['resource_group'] = resource_group_reference_model + placement_group_model_json['resource_type'] = 'placement_group' + placement_group_model_json['strategy'] = 'host_spread' - # Construct a model instance of PageLink by calling from_dict on the json representation - page_link_model = PageLink.from_dict(page_link_model_json) - assert page_link_model != False + # Construct a model instance of PlacementGroup by calling from_dict on the json representation + placement_group_model = PlacementGroup.from_dict(placement_group_model_json) + assert placement_group_model != False - # Construct a model instance of PageLink by calling from_dict on the json representation - page_link_model_dict = PageLink.from_dict(page_link_model_json).__dict__ - page_link_model2 = PageLink(**page_link_model_dict) + # Construct a model instance of PlacementGroup by calling from_dict on the json representation + placement_group_model_dict = PlacementGroup.from_dict(placement_group_model_json).__dict__ + placement_group_model2 = PlacementGroup(**placement_group_model_dict) # Verify the model instances are equivalent - assert page_link_model == page_link_model2 + assert placement_group_model == placement_group_model2 # Convert model instance back to dict and verify no loss of data - page_link_model_json2 = page_link_model.to_dict() - assert page_link_model_json2 == page_link_model_json + placement_group_model_json2 = placement_group_model.to_dict() + assert placement_group_model_json2 == placement_group_model_json + +class TestModel_PlacementGroupCollection(): + """ + Test Class for PlacementGroupCollection + """ + + def test_placement_group_collection_serialization(self): + """ + Test serialization/deserialization for PlacementGroupCollection + """ + + # 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 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 placement_group_collection_model == placement_group_collection_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 + +class TestModel_PlacementGroupCollectionFirst(): + """ + Test Class for PlacementGroupCollectionFirst + """ + + def test_placement_group_collection_first_serialization(self): + """ + Test serialization/deserialization for PlacementGroupCollectionFirst + """ + + # 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 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 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 placement_group_collection_first_model == placement_group_collection_first_model2 + + # Convert model instance back to dict and verify no loss of data + placement_group_collection_first_model_json2 = placement_group_collection_first_model.to_dict() + assert placement_group_collection_first_model_json2 == placement_group_collection_first_model_json + +class TestModel_PlacementGroupCollectionNext(): + """ + Test Class for PlacementGroupCollectionNext + """ + + def test_placement_group_collection_next_serialization(self): + """ + Test serialization/deserialization for PlacementGroupCollectionNext + """ + + # 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 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 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 placement_group_collection_next_model == placement_group_collection_next_model2 + + # Convert model instance back to dict and verify no loss of data + placement_group_collection_next_model_json2 = placement_group_collection_next_model.to_dict() + assert placement_group_collection_next_model_json2 == placement_group_collection_next_model_json + +class TestModel_PlacementGroupPatch(): + """ + Test Class for PlacementGroupPatch + """ + + def test_placement_group_patch_serialization(self): + """ + Test serialization/deserialization for PlacementGroupPatch + """ + + # 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 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 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 placement_group_patch_model == placement_group_patch_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 + +class TestModel_PlacementGroupReferenceDeleted(): + """ + Test Class for PlacementGroupReferenceDeleted + """ + + def test_placement_group_reference_deleted_serialization(self): + """ + Test serialization/deserialization for PlacementGroupReferenceDeleted + """ + + # 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 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 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 placement_group_reference_deleted_model == placement_group_reference_deleted_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 class TestModel_PublicGateway(): """ @@ -34597,6 +35503,7 @@ def test_route_serialization(self): # Construct a json representation of a Route model route_model_json = {} + route_model_json['action'] = 'delegate' route_model_json['created_at'] = "2019-01-01T12:00:00Z" route_model_json['destination'] = '192.168.3.0/24' route_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531' @@ -34647,6 +35554,7 @@ def test_route_collection_serialization(self): zone_reference_model['name'] = 'us-south-1' route_model = {} # Route + route_model['action'] = 'delegate' route_model['created_at'] = "2019-01-01T12:00:00Z" route_model['destination'] = '192.168.3.0/24' route_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531' @@ -37429,6 +38337,7 @@ def test_volume_serialization(self): # Construct a json representation of a Volume model volume_model_json = {} volume_model_json['active'] = True + volume_model_json['bandwidth'] = 1000 volume_model_json['busy'] = True volume_model_json['capacity'] = 1000 volume_model_json['created_at'] = "2019-01-01T12:00:00Z" @@ -37491,6 +38400,7 @@ def test_volume_attachment_serialization(self): # 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 @@ -37542,6 +38452,7 @@ def test_volume_attachment_collection_serialization(self): volume_reference_model['name'] = 'my-boot-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'] = True volume_attachment_model['device'] = volume_attachment_device_model @@ -37649,7 +38560,7 @@ def test_volume_attachment_prototype_instance_by_image_context_serialization(sel 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['capacity'] = 38 volume_prototype_instance_by_image_context_model['encryption_key'] = encryption_key_identity_model volume_prototype_instance_by_image_context_model['iops'] = 10000 volume_prototype_instance_by_image_context_model['name'] = 'my-volume' @@ -38018,6 +38929,7 @@ def test_volume_collection_serialization(self): volume_model = {} # Volume volume_model['active'] = True + volume_model['bandwidth'] = 1000 volume_model['busy'] = True volume_model['capacity'] = 1000 volume_model['created_at'] = "2019-01-01T12:00:00Z" @@ -38128,9 +39040,17 @@ def test_volume_patch_serialization(self): Test serialization/deserialization for VolumePatch """ + # Construct dict forms of any model objects needed in order to build this model. + + volume_profile_identity_model = {} # VolumeProfileIdentityByName + volume_profile_identity_model['name'] = 'general-purpose' + # Construct a json representation of a VolumePatch model volume_patch_model_json = {} + volume_patch_model_json['capacity'] = 100 + volume_patch_model_json['iops'] = 10000 volume_patch_model_json['name'] = 'my-volume' + volume_patch_model_json['profile'] = volume_profile_identity_model # Construct a model instance of VolumePatch by calling from_dict on the json representation volume_patch_model = VolumePatch.from_dict(volume_patch_model_json) @@ -38332,7 +39252,7 @@ def test_volume_prototype_instance_by_image_context_serialization(self): # 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['capacity'] = 38 volume_prototype_instance_by_image_context_model_json['encryption_key'] = encryption_key_identity_model volume_prototype_instance_by_image_context_model_json['iops'] = 10000 volume_prototype_instance_by_image_context_model_json['name'] = 'my-volume' @@ -40476,6 +41396,45 @@ def test_instance_placement_target_dedicated_host_reference_serialization(self): 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_InstancePlacementTargetPlacementGroupReference(): + """ + Test Class for InstancePlacementTargetPlacementGroupReference + """ + + def test_instance_placement_target_placement_group_reference_serialization(self): + """ + Test serialization/deserialization for InstancePlacementTargetPlacementGroupReference + """ + + # 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' + + # 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 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 + 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_InstanceProfileBandwidthDependent(): """ Test Class for InstanceProfileBandwidthDependent @@ -40519,7 +41478,7 @@ def test_instance_profile_bandwidth_enum_serialization(self): 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'] = [38] + instance_profile_bandwidth_enum_model_json['values'] = [16000, 32000, 48000] # 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) @@ -41208,6 +42167,129 @@ def test_instance_profile_vcpu_range_serialization(self): 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_InstanceProfileVolumeBandwidthDependent(): + """ + Test Class for InstanceProfileVolumeBandwidthDependent + """ + + def test_instance_profile_volume_bandwidth_dependent_serialization(self): + """ + Test serialization/deserialization for InstanceProfileVolumeBandwidthDependent + """ + + # 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 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 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 instance_profile_volume_bandwidth_dependent_model == instance_profile_volume_bandwidth_dependent_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 + +class TestModel_InstanceProfileVolumeBandwidthEnum(): + """ + Test Class for InstanceProfileVolumeBandwidthEnum + """ + + def test_instance_profile_volume_bandwidth_enum_serialization(self): + """ + Test serialization/deserialization for InstanceProfileVolumeBandwidthEnum + """ + + # 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 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 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 instance_profile_volume_bandwidth_enum_model == instance_profile_volume_bandwidth_enum_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 + +class TestModel_InstanceProfileVolumeBandwidthFixed(): + """ + Test Class for InstanceProfileVolumeBandwidthFixed + """ + + def test_instance_profile_volume_bandwidth_fixed_serialization(self): + """ + Test serialization/deserialization for InstanceProfileVolumeBandwidthFixed + """ + + # 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 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 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 instance_profile_volume_bandwidth_fixed_model == instance_profile_volume_bandwidth_fixed_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 + +class TestModel_InstanceProfileVolumeBandwidthRange(): + """ + Test Class for InstanceProfileVolumeBandwidthRange + """ + + def test_instance_profile_volume_bandwidth_range_serialization(self): + """ + Test serialization/deserialization for InstanceProfileVolumeBandwidthRange + """ + + # 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 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 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 instance_profile_volume_bandwidth_range_model == instance_profile_volume_bandwidth_range_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 + class TestModel_InstancePrototypeInstanceByImage(): """ Test Class for InstancePrototypeInstanceByImage @@ -41263,7 +42345,7 @@ def test_instance_prototype_instance_by_image_serialization(self): 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['capacity'] = 38 volume_prototype_instance_by_image_context_model['encryption_key'] = encryption_key_identity_model volume_prototype_instance_by_image_context_model['iops'] = 10000 volume_prototype_instance_by_image_context_model['name'] = 'my-volume' @@ -41288,6 +42370,7 @@ def test_instance_prototype_instance_by_image_serialization(self): 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_instance_context_model] instance_prototype_instance_by_image_model_json['vpc'] = vpc_identity_model @@ -41366,7 +42449,7 @@ def test_instance_prototype_instance_by_source_template_serialization(self): 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['capacity'] = 38 volume_prototype_instance_by_image_context_model['encryption_key'] = encryption_key_identity_model volume_prototype_instance_by_image_context_model['iops'] = 10000 volume_prototype_instance_by_image_context_model['name'] = 'my-volume' @@ -41394,6 +42477,7 @@ def test_instance_prototype_instance_by_source_template_serialization(self): 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_instance_context_model] instance_prototype_instance_by_source_template_model_json['vpc'] = vpc_identity_model @@ -41499,6 +42583,7 @@ def test_instance_prototype_instance_by_volume_serialization(self): 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_instance_context_model] instance_prototype_instance_by_volume_model_json['vpc'] = vpc_identity_model @@ -41663,7 +42748,7 @@ def test_instance_template_prototype_instance_by_image_serialization(self): 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['capacity'] = 38 volume_prototype_instance_by_image_context_model['encryption_key'] = encryption_key_identity_model volume_prototype_instance_by_image_context_model['iops'] = 10000 volume_prototype_instance_by_image_context_model['name'] = 'my-volume' @@ -41688,6 +42773,7 @@ def test_instance_template_prototype_instance_by_image_serialization(self): instance_template_prototype_instance_by_image_model_json['placement_target'] = instance_placement_target_prototype_model instance_template_prototype_instance_by_image_model_json['profile'] = instance_profile_identity_model instance_template_prototype_instance_by_image_model_json['resource_group'] = resource_group_identity_model + instance_template_prototype_instance_by_image_model_json['total_volume_bandwidth'] = 500 instance_template_prototype_instance_by_image_model_json['user_data'] = 'testString' instance_template_prototype_instance_by_image_model_json['volume_attachments'] = [volume_attachment_prototype_instance_context_model] instance_template_prototype_instance_by_image_model_json['vpc'] = vpc_identity_model @@ -41766,7 +42852,7 @@ def test_instance_template_prototype_instance_by_source_template_serialization(s 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['capacity'] = 38 volume_prototype_instance_by_image_context_model['encryption_key'] = encryption_key_identity_model volume_prototype_instance_by_image_context_model['iops'] = 10000 volume_prototype_instance_by_image_context_model['name'] = 'my-volume' @@ -41794,6 +42880,7 @@ def test_instance_template_prototype_instance_by_source_template_serialization(s instance_template_prototype_instance_by_source_template_model_json['placement_target'] = instance_placement_target_prototype_model instance_template_prototype_instance_by_source_template_model_json['profile'] = instance_profile_identity_model instance_template_prototype_instance_by_source_template_model_json['resource_group'] = resource_group_identity_model + instance_template_prototype_instance_by_source_template_model_json['total_volume_bandwidth'] = 500 instance_template_prototype_instance_by_source_template_model_json['user_data'] = 'testString' instance_template_prototype_instance_by_source_template_model_json['volume_attachments'] = [volume_attachment_prototype_instance_context_model] instance_template_prototype_instance_by_source_template_model_json['vpc'] = vpc_identity_model @@ -41899,6 +42986,7 @@ def test_instance_template_prototype_instance_by_volume_serialization(self): instance_template_prototype_instance_by_volume_model_json['placement_target'] = instance_placement_target_prototype_model instance_template_prototype_instance_by_volume_model_json['profile'] = instance_profile_identity_model instance_template_prototype_instance_by_volume_model_json['resource_group'] = resource_group_identity_model + instance_template_prototype_instance_by_volume_model_json['total_volume_bandwidth'] = 500 instance_template_prototype_instance_by_volume_model_json['user_data'] = 'testString' instance_template_prototype_instance_by_volume_model_json['volume_attachments'] = [volume_attachment_prototype_instance_context_model] instance_template_prototype_instance_by_volume_model_json['vpc'] = vpc_identity_model @@ -41978,7 +43066,7 @@ def test_instance_template_instance_by_image_serialization(self): 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['capacity'] = 38 volume_prototype_instance_by_image_context_model['encryption_key'] = encryption_key_identity_model volume_prototype_instance_by_image_context_model['iops'] = 10000 volume_prototype_instance_by_image_context_model['name'] = 'my-volume' @@ -42007,6 +43095,7 @@ def test_instance_template_instance_by_image_serialization(self): instance_template_instance_by_image_model_json['placement_target'] = instance_placement_target_prototype_model instance_template_instance_by_image_model_json['profile'] = instance_profile_identity_model instance_template_instance_by_image_model_json['resource_group'] = resource_group_reference_model + instance_template_instance_by_image_model_json['total_volume_bandwidth'] = 500 instance_template_instance_by_image_model_json['user_data'] = 'testString' instance_template_instance_by_image_model_json['volume_attachments'] = [volume_attachment_prototype_instance_context_model] instance_template_instance_by_image_model_json['vpc'] = vpc_identity_model @@ -42030,119 +43119,6 @@ def test_instance_template_instance_by_image_serialization(self): instance_template_instance_by_image_model_json2 = instance_template_instance_by_image_model.to_dict() assert instance_template_instance_by_image_model_json2 == instance_template_instance_by_image_model_json -class TestModel_InstanceTemplateInstanceBySourceTemplate(): - """ - Test Class for InstanceTemplateInstanceBySourceTemplate - """ - - def test_instance_template_instance_by_source_template_serialization(self): - """ - Test serialization/deserialization for InstanceTemplateInstanceBySourceTemplate - """ - - # Construct dict forms of any model objects needed in order to build this model. - - key_identity_model = {} # KeyIdentityById - key_identity_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803' - - security_group_identity_model = {} # SecurityGroupIdentityById - security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' - - subnet_identity_model = {} # SubnetIdentityById - subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' - - network_interface_prototype_model = {} # NetworkInterfacePrototype - network_interface_prototype_model['allow_ip_spoofing'] = True - network_interface_prototype_model['name'] = 'my-network-interface' - network_interface_prototype_model['primary_ipv4_address'] = '10.0.0.5' - network_interface_prototype_model['security_groups'] = [security_group_identity_model] - network_interface_prototype_model['subnet'] = subnet_identity_model - - instance_placement_target_prototype_model = {} # InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById - instance_placement_target_prototype_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' - - instance_profile_identity_model = {} # InstanceProfileIdentityByName - instance_profile_identity_model['name'] = 'cc1-16x32' - - resource_group_reference_model = {} # ResourceGroupReference - resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' - resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' - resource_group_reference_model['name'] = 'my-resource-group' - - volume_attachment_volume_prototype_instance_context_model = {} # VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityById - volume_attachment_volume_prototype_instance_context_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5' - - volume_attachment_prototype_instance_context_model = {} # VolumeAttachmentPrototypeInstanceContext - volume_attachment_prototype_instance_context_model['delete_volume_on_instance_delete'] = True - volume_attachment_prototype_instance_context_model['name'] = 'my-volume-attachment' - volume_attachment_prototype_instance_context_model['volume'] = volume_attachment_volume_prototype_instance_context_model - - vpc_identity_model = {} # VPCIdentityById - vpc_identity_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b' - - encryption_key_identity_model = {} # EncryptionKeyIdentityByCRN - encryption_key_identity_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179' - - volume_profile_identity_model = {} # VolumeProfileIdentityByName - volume_profile_identity_model['name'] = 'general-purpose' - - volume_prototype_instance_by_image_context_model = {} # VolumePrototypeInstanceByImageContext - volume_prototype_instance_by_image_context_model['capacity'] = 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_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'] = '72b27b5c-f4b0-48bb-b954-5becc7c1dcb8' - - 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' - - # Construct a json representation of a InstanceTemplateInstanceBySourceTemplate model - instance_template_instance_by_source_template_model_json = {} - instance_template_instance_by_source_template_model_json['created_at'] = "2019-01-01T12:00:00Z" - instance_template_instance_by_source_template_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_template_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a' - instance_template_instance_by_source_template_model_json['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803' - instance_template_instance_by_source_template_model_json['keys'] = [key_identity_model] - instance_template_instance_by_source_template_model_json['name'] = 'my-instance-template' - instance_template_instance_by_source_template_model_json['network_interfaces'] = [network_interface_prototype_model] - instance_template_instance_by_source_template_model_json['placement_target'] = instance_placement_target_prototype_model - instance_template_instance_by_source_template_model_json['profile'] = instance_profile_identity_model - instance_template_instance_by_source_template_model_json['resource_group'] = resource_group_reference_model - instance_template_instance_by_source_template_model_json['user_data'] = 'testString' - instance_template_instance_by_source_template_model_json['volume_attachments'] = [volume_attachment_prototype_instance_context_model] - instance_template_instance_by_source_template_model_json['vpc'] = vpc_identity_model - instance_template_instance_by_source_template_model_json['boot_volume_attachment'] = volume_attachment_prototype_instance_by_image_context_model - instance_template_instance_by_source_template_model_json['image'] = image_identity_model - instance_template_instance_by_source_template_model_json['primary_network_interface'] = network_interface_prototype_model - instance_template_instance_by_source_template_model_json['source_template'] = instance_template_identity_model - instance_template_instance_by_source_template_model_json['zone'] = zone_identity_model - - # Construct a model instance of InstanceTemplateInstanceBySourceTemplate by calling from_dict on the json representation - instance_template_instance_by_source_template_model = InstanceTemplateInstanceBySourceTemplate.from_dict(instance_template_instance_by_source_template_model_json) - assert instance_template_instance_by_source_template_model != False - - # Construct a model instance of InstanceTemplateInstanceBySourceTemplate by calling from_dict on the json representation - instance_template_instance_by_source_template_model_dict = InstanceTemplateInstanceBySourceTemplate.from_dict(instance_template_instance_by_source_template_model_json).__dict__ - instance_template_instance_by_source_template_model2 = InstanceTemplateInstanceBySourceTemplate(**instance_template_instance_by_source_template_model_dict) - - # Verify the model instances are equivalent - assert instance_template_instance_by_source_template_model == instance_template_instance_by_source_template_model2 - - # Convert model instance back to dict and verify no loss of data - instance_template_instance_by_source_template_model_json2 = instance_template_instance_by_source_template_model.to_dict() - assert instance_template_instance_by_source_template_model_json2 == instance_template_instance_by_source_template_model_json - class TestModel_InstanceTemplateInstanceByVolume(): """ Test Class for InstanceTemplateInstanceByVolume @@ -42230,6 +43206,7 @@ def test_instance_template_instance_by_volume_serialization(self): instance_template_instance_by_volume_model_json['placement_target'] = instance_placement_target_prototype_model instance_template_instance_by_volume_model_json['profile'] = instance_profile_identity_model instance_template_instance_by_volume_model_json['resource_group'] = resource_group_reference_model + instance_template_instance_by_volume_model_json['total_volume_bandwidth'] = 500 instance_template_instance_by_volume_model_json['user_data'] = 'testString' instance_template_instance_by_volume_model_json['volume_attachments'] = [volume_attachment_prototype_instance_context_model] instance_template_instance_by_volume_model_json['vpc'] = vpc_identity_model @@ -42281,6 +43258,35 @@ def test_key_identity_by_crn_serialization(self): 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_KeyIdentityByFingerprint(): + """ + Test Class for KeyIdentityByFingerprint + """ + + def test_key_identity_by_fingerprint_serialization(self): + """ + Test serialization/deserialization for KeyIdentityByFingerprint + """ + + # 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 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 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 key_identity_by_fingerprint_model == key_identity_by_fingerprint_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 + class TestModel_KeyIdentityByHref(): """ Test Class for KeyIdentityByHref @@ -42339,103 +43345,6 @@ def test_key_identity_by_id_serialization(self): 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_KeyIdentityKeyIdentityByFingerprint(): - """ - Test Class for KeyIdentityKeyIdentityByFingerprint - """ - - def test_key_identity_key_identity_by_fingerprint_serialization(self): - """ - Test serialization/deserialization for KeyIdentityKeyIdentityByFingerprint - """ - - # Construct a json representation of a KeyIdentityKeyIdentityByFingerprint model - key_identity_key_identity_by_fingerprint_model_json = {} - key_identity_key_identity_by_fingerprint_model_json['fingerprint'] = 'SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY' - - # Construct a model instance of KeyIdentityKeyIdentityByFingerprint by calling from_dict on the json representation - key_identity_key_identity_by_fingerprint_model = KeyIdentityKeyIdentityByFingerprint.from_dict(key_identity_key_identity_by_fingerprint_model_json) - assert key_identity_key_identity_by_fingerprint_model != False - - # Construct a model instance of KeyIdentityKeyIdentityByFingerprint by calling from_dict on the json representation - key_identity_key_identity_by_fingerprint_model_dict = KeyIdentityKeyIdentityByFingerprint.from_dict(key_identity_key_identity_by_fingerprint_model_json).__dict__ - key_identity_key_identity_by_fingerprint_model2 = KeyIdentityKeyIdentityByFingerprint(**key_identity_key_identity_by_fingerprint_model_dict) - - # Verify the model instances are equivalent - assert key_identity_key_identity_by_fingerprint_model == key_identity_key_identity_by_fingerprint_model2 - - # Convert model instance back to dict and verify no loss of data - key_identity_key_identity_by_fingerprint_model_json2 = key_identity_key_identity_by_fingerprint_model.to_dict() - assert key_identity_key_identity_by_fingerprint_model_json2 == key_identity_key_identity_by_fingerprint_model_json - -class TestModel_KeyReferenceInstanceInitializationContextKeyIdentityByFingerprint(): - """ - Test Class for KeyReferenceInstanceInitializationContextKeyIdentityByFingerprint - """ - - def test_key_reference_instance_initialization_context_key_identity_by_fingerprint_serialization(self): - """ - Test serialization/deserialization for KeyReferenceInstanceInitializationContextKeyIdentityByFingerprint - """ - - # Construct a json representation of a KeyReferenceInstanceInitializationContextKeyIdentityByFingerprint model - key_reference_instance_initialization_context_key_identity_by_fingerprint_model_json = {} - key_reference_instance_initialization_context_key_identity_by_fingerprint_model_json['fingerprint'] = 'SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY' - - # Construct a model instance of KeyReferenceInstanceInitializationContextKeyIdentityByFingerprint by calling from_dict on the json representation - key_reference_instance_initialization_context_key_identity_by_fingerprint_model = KeyReferenceInstanceInitializationContextKeyIdentityByFingerprint.from_dict(key_reference_instance_initialization_context_key_identity_by_fingerprint_model_json) - assert key_reference_instance_initialization_context_key_identity_by_fingerprint_model != False - - # Construct a model instance of KeyReferenceInstanceInitializationContextKeyIdentityByFingerprint by calling from_dict on the json representation - key_reference_instance_initialization_context_key_identity_by_fingerprint_model_dict = KeyReferenceInstanceInitializationContextKeyIdentityByFingerprint.from_dict(key_reference_instance_initialization_context_key_identity_by_fingerprint_model_json).__dict__ - key_reference_instance_initialization_context_key_identity_by_fingerprint_model2 = KeyReferenceInstanceInitializationContextKeyIdentityByFingerprint(**key_reference_instance_initialization_context_key_identity_by_fingerprint_model_dict) - - # Verify the model instances are equivalent - assert key_reference_instance_initialization_context_key_identity_by_fingerprint_model == key_reference_instance_initialization_context_key_identity_by_fingerprint_model2 - - # Convert model instance back to dict and verify no loss of data - key_reference_instance_initialization_context_key_identity_by_fingerprint_model_json2 = key_reference_instance_initialization_context_key_identity_by_fingerprint_model.to_dict() - assert key_reference_instance_initialization_context_key_identity_by_fingerprint_model_json2 == key_reference_instance_initialization_context_key_identity_by_fingerprint_model_json - -class TestModel_KeyReferenceInstanceInitializationContextKeyReference(): - """ - Test Class for KeyReferenceInstanceInitializationContextKeyReference - """ - - def test_key_reference_instance_initialization_context_key_reference_serialization(self): - """ - Test serialization/deserialization for KeyReferenceInstanceInitializationContextKeyReference - """ - - # 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 KeyReferenceInstanceInitializationContextKeyReference model - key_reference_instance_initialization_context_key_reference_model_json = {} - key_reference_instance_initialization_context_key_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803' - key_reference_instance_initialization_context_key_reference_model_json['deleted'] = key_reference_deleted_model - key_reference_instance_initialization_context_key_reference_model_json['fingerprint'] = 'SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY' - key_reference_instance_initialization_context_key_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803' - key_reference_instance_initialization_context_key_reference_model_json['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803' - key_reference_instance_initialization_context_key_reference_model_json['name'] = 'my-key' - - # Construct a model instance of KeyReferenceInstanceInitializationContextKeyReference by calling from_dict on the json representation - key_reference_instance_initialization_context_key_reference_model = KeyReferenceInstanceInitializationContextKeyReference.from_dict(key_reference_instance_initialization_context_key_reference_model_json) - assert key_reference_instance_initialization_context_key_reference_model != False - - # Construct a model instance of KeyReferenceInstanceInitializationContextKeyReference by calling from_dict on the json representation - key_reference_instance_initialization_context_key_reference_model_dict = KeyReferenceInstanceInitializationContextKeyReference.from_dict(key_reference_instance_initialization_context_key_reference_model_json).__dict__ - key_reference_instance_initialization_context_key_reference_model2 = KeyReferenceInstanceInitializationContextKeyReference(**key_reference_instance_initialization_context_key_reference_model_dict) - - # Verify the model instances are equivalent - assert key_reference_instance_initialization_context_key_reference_model == key_reference_instance_initialization_context_key_reference_model2 - - # Convert model instance back to dict and verify no loss of data - key_reference_instance_initialization_context_key_reference_model_json2 = key_reference_instance_initialization_context_key_reference_model.to_dict() - assert key_reference_instance_initialization_context_key_reference_model_json2 == key_reference_instance_initialization_context_key_reference_model_json - class TestModel_LoadBalancerIdentityByCRN(): """ Test Class for LoadBalancerIdentityByCRN @@ -42523,6 +43432,100 @@ def test_load_balancer_identity_by_id_serialization(self): 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_LoadBalancerListenerIdentityByHref(): + """ + Test Class for LoadBalancerListenerIdentityByHref + """ + + def test_load_balancer_listener_identity_by_href_serialization(self): + """ + Test serialization/deserialization for LoadBalancerListenerIdentityByHref + """ + + # 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 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 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 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 + 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_LoadBalancerListenerIdentityById(): + """ + Test Class for LoadBalancerListenerIdentityById + """ + + def test_load_balancer_listener_identity_by_id_serialization(self): + """ + Test serialization/deserialization for LoadBalancerListenerIdentityById + """ + + # 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 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 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 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 + 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_LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch(): + """ + Test Class for LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch + """ + + def test_load_balancer_listener_policy_target_patch_load_balancer_listener_https_redirect_patch_serialization(self): + """ + Test serialization/deserialization for LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch + """ + + # 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 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 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 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 + 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_LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch(): """ Test Class for LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch @@ -42553,6 +43556,42 @@ def test_load_balancer_listener_policy_target_patch_load_balancer_listener_polic 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_LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype(): + """ + Test Class for LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype + """ + + def test_load_balancer_listener_policy_target_prototype_load_balancer_listener_https_redirect_prototype_serialization(self): + """ + Test serialization/deserialization for LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype + """ + + # 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 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 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 + 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_LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype(): """ Test Class for LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype @@ -42583,6 +43622,47 @@ def test_load_balancer_listener_policy_target_prototype_load_balancer_listener_p 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_LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect(): + """ + Test Class for LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect + """ + + def test_load_balancer_listener_policy_target_load_balancer_listener_https_redirect_serialization(self): + """ + Test serialization/deserialization for LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect + """ + + # 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' + + # 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 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 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 + 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_LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL(): """ Test Class for LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL @@ -44269,8 +45349,8 @@ def test_security_group_rule_prototype_security_group_rule_protocol_all_serializ 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['remote'] = security_group_rule_remote_prototype_model 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 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) @@ -44304,11 +45384,11 @@ def test_security_group_rule_prototype_security_group_rule_protocol_icmp_seriali # 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['remote'] = security_group_rule_remote_prototype_model - security_group_rule_prototype_security_group_rule_protocol_icmp_model_json['code'] = 0 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 model instance of SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP by calling from_dict on the json representation @@ -44345,10 +45425,10 @@ def test_security_group_rule_prototype_security_group_rule_protocol_tcpudp_seria 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['remote'] = security_group_rule_remote_prototype_model 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 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) @@ -46750,6 +47830,93 @@ def test_instance_placement_target_prototype_dedicated_host_identity_dedicated_h 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_InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN(): + """ + Test Class for InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN + """ + + def test_instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_crn_serialization(self): + """ + Test serialization/deserialization for InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN + """ + + # 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 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 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 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 + 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_InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref(): + """ + Test Class for InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref + """ + + def test_instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_href_serialization(self): + """ + Test serialization/deserialization for InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref + """ + + # 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 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 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 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 + 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_InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityById(): + """ + Test Class for InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityById + """ + + def test_instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_id_serialization(self): + """ + Test serialization/deserialization for InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityById + """ + + # 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 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 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 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 + 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_LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref(): """ Test Class for LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref @@ -47542,7 +48709,7 @@ def test_volume_attachment_prototype_volume_volume_prototype_instance_context_vo volume_attachment_prototype_volume_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_source_snapshot_model_json['iops'] = 10000 volume_attachment_prototype_volume_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_source_snapshot_model_json['name'] = 'my-volume' volume_attachment_prototype_volume_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_source_snapshot_model_json['profile'] = volume_profile_identity_model - volume_attachment_prototype_volume_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_source_snapshot_model_json['capacity'] = 100 + volume_attachment_prototype_volume_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_source_snapshot_model_json['capacity'] = 38 volume_attachment_prototype_volume_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_source_snapshot_model_json['encryption_key'] = encryption_key_identity_model volume_attachment_prototype_volume_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_source_snapshot_model_json['source_snapshot'] = snapshot_identity_model @@ -47715,7 +48882,7 @@ def test_volume_attachment_volume_prototype_instance_context_volume_prototype_in volume_attachment_volume_prototype_instance_context_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_source_snapshot_model_json['iops'] = 10000 volume_attachment_volume_prototype_instance_context_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_source_snapshot_model_json['name'] = 'my-volume' volume_attachment_volume_prototype_instance_context_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_source_snapshot_model_json['profile'] = volume_profile_identity_model - volume_attachment_volume_prototype_instance_context_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_source_snapshot_model_json['capacity'] = 100 + volume_attachment_volume_prototype_instance_context_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_source_snapshot_model_json['capacity'] = 38 volume_attachment_volume_prototype_instance_context_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_source_snapshot_model_json['encryption_key'] = encryption_key_identity_model volume_attachment_volume_prototype_instance_context_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_source_snapshot_model_json['source_snapshot'] = snapshot_identity_model From 55b928428c0de73be746182dd9cb288f96fc0891 Mon Sep 17 00:00:00 2001 From: "astha.jain" Date: Mon, 27 Sep 2021 22:10:52 -0400 Subject: [PATCH 2/2] fix(release): remove 3.9 --- .travis.yml | 2 +- requirements-dev.txt | 2 +- requirements.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3e67d84..bd06fb9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,7 +12,7 @@ matrix: - python: 3.6 - python: 3.7 - python: 3.8 - - python: 3.9 + # - python: 3.9 before_install: - npm install npm@latest -g diff --git a/requirements-dev.txt b/requirements-dev.txt index 880ea38..e4c3a45 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -6,4 +6,4 @@ pytest>=6.2.1,<7.0.0 pytest-cov>=2.2.1,<3.0.0 pytest-rerunfailures>=3.1 responses>=0.12.1,<1.0.0 -tox>=3.2.0,<4.0.0 \ No newline at end of file +tox>=3.2.0,<4.0.0 diff --git a/requirements.txt b/requirements.txt index a7968ed..68ddfcc 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,2 @@ python_dateutil>=2.5.3,<3.0.0 -ibm_cloud_sdk_core>=3.11.3 \ No newline at end of file +ibm_cloud_sdk_core>=3.11.3