diff --git a/.travis.yml b/.travis.yml index 2873f46..848b47b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,9 +9,10 @@ notifications: matrix: include: - - python: 3.7 - python: 3.8 - python: 3.9 + - python: 3.10 + - python: 3.11 before_install: - npm install -g npm@latest || npm install -g npm@9 diff --git a/ibm_vpc/common.py b/ibm_vpc/common.py index 0a4ce5d..21a8224 100644 --- a/ibm_vpc/common.py +++ b/ibm_vpc/common.py @@ -22,7 +22,6 @@ import uuid from ibm_vpc.version import __version__ -HEADER_NAME_X_CORRELATION_ID = 'X-Correlation-Id' HEADER_NAME_X_REQUEST_ID = 'X-Request-Id' HEADER_NAME_USER_AGENT = 'User-Agent' SDK_NAME = 'vpc-python-sdk' @@ -36,12 +35,6 @@ def get_system_info(): platform.system(), # OS platform.python_version()) # Python version -def get_x_correlation_id(): - """ - Get the value to be sent in the X-Correlation-Id header. - """ - return str(uuid.uuid4()) - def get_x_request_id(): """ Get the value to be sent in the X-Request-Id header. @@ -65,7 +58,6 @@ def get_sdk_headers(service_name, service_version, operation_id): """ headers = {} - headers[HEADER_NAME_X_CORRELATION_ID] = get_x_correlation_id() headers[HEADER_NAME_X_REQUEST_ID] = get_x_request_id() headers[HEADER_NAME_USER_AGENT] = get_user_agent() return headers diff --git a/ibm_vpc/vpc_v1.py b/ibm_vpc/vpc_v1.py index c09a46a..8d74058 100644 --- a/ibm_vpc/vpc_v1.py +++ b/ibm_vpc/vpc_v1.py @@ -14,14 +14,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -# IBM OpenAPI SDK Code Generator Version: 3.76.0-ad3e6f96-20230724-172814 +# IBM OpenAPI SDK Code Generator Version: 3.80.0-29334a73-20230925-151553 """ The IBM Cloud Virtual Private Cloud (VPC) API can be used to programmatically provision and manage virtual server instances, along with subnets, volumes, load balancers, and more. -API Version: 2023-11-07 +API Version: 2023-10-24 """ from datetime import datetime @@ -53,7 +53,7 @@ class VpcV1(BaseService): @classmethod def new_instance( cls, - version: str = '2023-11-07', + version: str = '2023-10-24', service_name: str = DEFAULT_SERVICE_NAME, generation: int = 2, ) -> 'VpcV1': @@ -63,7 +63,7 @@ def new_instance( :param str version: The API version, in format `YYYY-MM-DD`. For the API behavior documented here, specify any date between `2023-10-10` and - `2023-11-08`. + `2023-11-15`. """ if version is None: raise ValueError('version must be provided') @@ -79,7 +79,7 @@ def new_instance( def __init__( self, - version: str = '2023-11-07', + version: str = '2023-10-24', authenticator: Authenticator = None, generation: int = 2, ) -> None: @@ -88,7 +88,7 @@ def __init__( :param str version: The API version, in format `YYYY-MM-DD`. For the API behavior documented here, specify any date between `2023-10-10` and - `2023-11-08`. + `2023-11-15`. :param Authenticator authenticator: The authenticator specifies the authentication mechanism. Get up to date information from https://github.com/IBM/python-sdk-core/blob/main/README.md @@ -1404,7 +1404,7 @@ def create_vpc_route( is distributed between them. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `CreateVpcRouteResponse` object + :rtype: DetailedResponse with `dict` result representing a `Route` object Deprecated: this method is deprecated and may be removed in a future release. """ @@ -1537,7 +1537,7 @@ def get_vpc_route( :param str id: The route identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `GetVpcRouteResponse` object + :rtype: DetailedResponse with `dict` result representing a `Route` object Deprecated: this method is deprecated and may be removed in a future release. """ @@ -1599,7 +1599,7 @@ def update_vpc_route( :param RoutePatch route_patch: The route 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 `UpdateVpcRouteResponse` object + :rtype: DetailedResponse with `dict` result representing a `Route` object Deprecated: this method is deprecated and may be removed in a future release. """ @@ -5715,7 +5715,7 @@ def create_instance_network_interface( :param str instance_id: The virtual server instance identifier. :param SubnetIdentity subnet: The associated subnet. :param bool allow_ip_spoofing: (optional) Indicates whether source IP - spoofing is allowed on this instance interface. + spoofing is allowed on this instance network interface. :param str name: (optional) The name for the instance network interface. The name must not be used by another network interface on the virtual server instance. If unspecified, the name will be a hyphenated list of @@ -10445,7 +10445,7 @@ def create_bare_metal_server( network_interfaces: List['BareMetalServerNetworkInterfacePrototype'] = None, resource_group: 'ResourceGroupIdentity' = None, trusted_platform_module: 'BareMetalServerTrustedPlatformModulePrototype' = None, - vpc: 'BareMetalServerPrototypeVpc' = None, + vpc: 'VPCIdentity' = None, **kwargs, ) -> DetailedResponse: """ @@ -10479,8 +10479,8 @@ def create_bare_metal_server( used. :param BareMetalServerTrustedPlatformModulePrototype trusted_platform_module: (optional) - :param BareMetalServerPrototypeVpc vpc: (optional) The VPC this bare metal - server will reside in. + :param VPCIdentity vpc: (optional) The VPC this bare metal server will + reside in. If specified, it must match the VPC for the subnets that the network interfaces of the bare metal server are attached to. @@ -27600,11 +27600,11 @@ class BareMetalServerNetworkInterface: - Has an `allowed_vlans` property which controls the VLANs that will be permitted to use the PCI interface - - Cannot directly use an IEEE 802.1q VLAN tag. + - Cannot directly use an IEEE 802.1Q tag. - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its array of `allowed_vlans`. - - Must use an IEEE 802.1q tag. + - Must use an IEEE 802.1Q tag. - Has its own security groups and does not inherit those of the PCI device through which traffic flows. @@ -27677,11 +27677,11 @@ def __init__( - Has an `allowed_vlans` property which controls the VLANs that will be permitted to use the PCI interface - - Cannot directly use an IEEE 802.1q VLAN tag. + - Cannot directly use an IEEE 802.1Q tag. - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its array of `allowed_vlans`. - - Must use an IEEE 802.1q tag. + - Must use an IEEE 802.1Q tag. - Has its own security groups and does not inherit those of the PCI device through which traffic flows. @@ -27753,10 +27753,10 @@ class InterfaceTypeEnum(str, Enum): - Has an `allowed_vlans` property which controls the VLANs that will be permitted to use the PCI interface - - Cannot directly use an IEEE 802.1q VLAN tag. + - Cannot directly use an IEEE 802.1Q tag. - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its array of `allowed_vlans`. - - Must use an IEEE 802.1q tag. + - Must use an IEEE 802.1Q tag. - Has its own security groups and does not inherit those of the PCI device through which traffic flows. @@ -28045,8 +28045,10 @@ class BareMetalServerNetworkInterfacePatch: :attr bool allow_ip_spoofing: (optional) Indicates whether source IP spoofing is allowed on this bare metal server network interface. - :attr List[int] allowed_vlans: (optional) Indicates what VLAN IDs (for VLAN type - only) can use this physical (PCI type) interface. + :attr List[int] allowed_vlans: (optional) The VLAN IDs to allow for `vlan` + interfaces using this PCI interface, replacing any existing VLAN IDs. The + specified values must include IDs for all `vlan` interfaces currently using this + PCI interface. :attr bool enable_infrastructure_nat: (optional) If `true`: - The VPC infrastructure performs any needed NAT operations. - `floating_ips` must not have more than one floating IP. @@ -28073,8 +28075,10 @@ def __init__( :param bool allow_ip_spoofing: (optional) Indicates whether source IP spoofing is allowed on this bare metal server network interface. - :param List[int] allowed_vlans: (optional) Indicates what VLAN IDs (for - VLAN type only) can use this physical (PCI type) interface. + :param List[int] allowed_vlans: (optional) The VLAN IDs to allow for `vlan` + interfaces using this PCI interface, replacing any existing VLAN IDs. The + specified values must include IDs for all `vlan` interfaces currently using + this PCI interface. :param bool enable_infrastructure_nat: (optional) If `true`: - The VPC infrastructure performs any needed NAT operations. - `floating_ips` must not have more than one floating IP. @@ -28168,12 +28172,12 @@ class BareMetalServerNetworkInterfacePrototype: - Has an `allowed_vlans` property which controls the VLANs that will be permitted to use the PCI interface - - Cannot directly use an IEEE 802.1q VLAN tag. + - Cannot directly use an IEEE 802.1Q tag. - Not supported on bare metal servers with a `cpu.architecture` of `s390x` - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its array of `allowed_vlans`. - - Must use an IEEE 802.1q tag. + - Must use an IEEE 802.1Q tag. - Has its own security groups and does not inherit those of the PCI device through which traffic flows. @@ -28222,13 +28226,13 @@ def __init__( - Has an `allowed_vlans` property which controls the VLANs that will be permitted to use the PCI interface - - Cannot directly use an IEEE 802.1q VLAN tag. + - Cannot directly use an IEEE 802.1Q tag. - Not supported on bare metal servers with a `cpu.architecture` of `s390x` - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its array of `allowed_vlans`. - - Must use an IEEE 802.1q tag. + - Must use an IEEE 802.1Q tag. - Has its own security groups and does not inherit those of the PCI device through which traffic flows. @@ -28315,11 +28319,11 @@ class InterfaceTypeEnum(str, Enum): - Has an `allowed_vlans` property which controls the VLANs that will be permitted to use the PCI interface - - Cannot directly use an IEEE 802.1q VLAN tag. + - Cannot directly use an IEEE 802.1Q tag. - Not supported on bare metal servers with a `cpu.architecture` of `s390x` - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its array of `allowed_vlans`. - - Must use an IEEE 802.1q tag. + - Must use an IEEE 802.1Q tag. - Has its own security groups and does not inherit those of the PCI device through which traffic flows. @@ -28550,8 +28554,8 @@ class BareMetalServerPrimaryNetworkInterfacePrototype: :attr bool allow_ip_spoofing: (optional) Indicates whether source IP spoofing is allowed on this bare metal server network interface. - :attr List[int] allowed_vlans: (optional) Indicates what VLAN IDs (for VLAN type - only) can use this physical (PCI type) interface. + :attr List[int] allowed_vlans: (optional) The VLAN IDs allowed for `vlan` + interfaces using this PCI interface. :attr bool enable_infrastructure_nat: (optional) If `true`: - The VPC infrastructure performs any needed NAT operations. - `floating_ips` must not have more than one floating IP. @@ -28570,7 +28574,7 @@ class BareMetalServerPrimaryNetworkInterfacePrototype: - Has an `allowed_vlans` property which controls the VLANs that will be permitted to use the PCI interface - - Cannot directly use an IEEE 802.1q VLAN tag. + - Cannot directly use an IEEE 802.1Q tag. - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. :attr str name: (optional) The name for this bare metal server network interface. The name must not be used by another network interface on the bare @@ -28608,8 +28612,8 @@ def __init__( :param SubnetIdentity subnet: The associated subnet. :param bool allow_ip_spoofing: (optional) Indicates whether source IP spoofing is allowed on this bare metal server network interface. - :param List[int] allowed_vlans: (optional) Indicates what VLAN IDs (for - VLAN type only) can use this physical (PCI type) interface. + :param List[int] allowed_vlans: (optional) The VLAN IDs allowed for `vlan` + interfaces using this PCI interface. :param bool enable_infrastructure_nat: (optional) If `true`: - The VPC infrastructure performs any needed NAT operations. - `floating_ips` must not have more than one floating IP. @@ -28631,7 +28635,7 @@ def __init__( - Has an `allowed_vlans` property which controls the VLANs that will be permitted to use the PCI interface - - Cannot directly use an IEEE 802.1q VLAN tag. + - Cannot directly use an IEEE 802.1Q tag. - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. :param str name: (optional) The name for this bare metal server network @@ -28753,7 +28757,7 @@ class InterfaceTypeEnum(str, Enum): - Has an `allowed_vlans` property which controls the VLANs that will be permitted to use the PCI interface - - Cannot directly use an IEEE 802.1q VLAN tag. + - Cannot directly use an IEEE 802.1Q tag. - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. """ @@ -30065,27 +30069,6 @@ class ValuesEnum(str, Enum): -class BareMetalServerPrototypeVpc: - """ - The VPC this bare metal server will reside in. - If specified, it must match the VPC for the subnets that the network interfaces of the - bare metal server are attached to. - - """ - - def __init__( - self, - ) -> None: - """ - Initialize a BareMetalServerPrototypeVpc object. - - """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['BareMetalServerPrototypeVpcVPCIdentityById', 'BareMetalServerPrototypeVpcVPCIdentityByCRN', 'BareMetalServerPrototypeVpcVPCIdentityByHref']) - ) - raise Exception(msg) - - class BareMetalServerStatusReason: """ BareMetalServerStatusReason. @@ -30800,264 +30783,6 @@ def __ne__(self, other: 'CloudObjectStorageObjectReference') -> bool: return not self == other -class CreateVpcRouteResponse: - """ - CreateVpcRouteResponse. - - :attr str action: The action to perform with a packet matching the route: - - `delegate`: delegate to system-provided routes - - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound - routes - - `deliver`: deliver the packet to the specified `next_hop` - - `drop`: drop the packet. - :attr datetime created_at: The date and time that the route was created. - :attr RouteCreator creator: (optional) If present, the resource that created the - route. Routes with this property present cannot - be directly deleted. All routes with an `origin` of `service` will have this - property set, - and future `origin` values may also have this property set. - :attr str destination: The destination CIDR of the route. - :attr str href: The URL for this route. - :attr str id: The unique identifier for this route. - :attr str lifecycle_state: The lifecycle state of the route. - :attr str name: The name for this route. The name is unique across all routes in - the routing table. - :attr RouteNextHop next_hop: If `action` is `deliver`, the next hop that packets - will be delivered to. For - other `action` values, its `address` will be `0.0.0.0`. - :attr str origin: (optional) The origin of this route: - - `service`: route was directly created by a service - - `user`: route was directly created by a user - The enumerated values for this property are expected to expand in the future. - When processing this property, check for and log unknown values. Optionally halt - processing and surface the error, or bypass the route on which the unexpected - property value was encountered. - :attr int priority: The priority of this route. Smaller values have higher - priority. - If a routing table contains multiple routes with the same `zone` and - `destination`, the route with the highest priority (smallest value) is selected. - If two routes have the same `destination` and `priority`, traffic is distributed - between them. - :attr ZoneReference zone: The zone the route applies to. (Traffic from subnets - in this zone will be - subject to this route.). - """ - - def __init__( - self, - action: str, - created_at: datetime, - destination: str, - href: str, - id: str, - lifecycle_state: str, - name: str, - next_hop: 'RouteNextHop', - priority: int, - zone: 'ZoneReference', - *, - creator: 'RouteCreator' = None, - origin: str = None, - ) -> None: - """ - Initialize a CreateVpcRouteResponse object. - - :param str action: The action to perform with a packet matching the route: - - `delegate`: delegate to system-provided routes - - `delegate_vpc`: delegate to system-provided routes, ignoring - Internet-bound routes - - `deliver`: deliver the packet to the specified `next_hop` - - `drop`: drop the packet. - :param datetime created_at: The date and time that the route was created. - :param str destination: The destination CIDR of the route. - :param str href: The URL for this route. - :param str id: The unique identifier for this route. - :param str lifecycle_state: The lifecycle state of the route. - :param str name: The name for this route. The name is unique across all - routes in the routing table. - :param RouteNextHop next_hop: If `action` is `deliver`, the next hop that - packets will be delivered to. For - other `action` values, its `address` will be `0.0.0.0`. - :param int priority: The priority of this route. Smaller values have higher - priority. - If a routing table contains multiple routes with the same `zone` and - `destination`, the route with the highest priority (smallest value) is - selected. If two routes have the same `destination` and `priority`, traffic - is distributed between them. - :param ZoneReference zone: The zone the route applies to. (Traffic from - subnets in this zone will be - subject to this route.). - """ - self.action = action - self.created_at = created_at - self.creator = creator - self.destination = destination - self.href = href - self.id = id - self.lifecycle_state = lifecycle_state - self.name = name - self.next_hop = next_hop - self.origin = origin - self.priority = priority - self.zone = zone - - @classmethod - def from_dict(cls, _dict: Dict) -> 'CreateVpcRouteResponse': - """Initialize a CreateVpcRouteResponse object from a json dictionary.""" - args = {} - if 'action' in _dict: - args['action'] = _dict.get('action') - else: - raise ValueError('Required property \'action\' not present in CreateVpcRouteResponse JSON') - if 'created_at' in _dict: - args['created_at'] = string_to_datetime(_dict.get('created_at')) - else: - raise ValueError('Required property \'created_at\' not present in CreateVpcRouteResponse JSON') - if 'creator' in _dict: - args['creator'] = _dict.get('creator') - if 'destination' in _dict: - args['destination'] = _dict.get('destination') - else: - raise ValueError('Required property \'destination\' not present in CreateVpcRouteResponse JSON') - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in CreateVpcRouteResponse JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') - else: - raise ValueError('Required property \'id\' not present in CreateVpcRouteResponse JSON') - if 'lifecycle_state' in _dict: - args['lifecycle_state'] = _dict.get('lifecycle_state') - else: - raise ValueError('Required property \'lifecycle_state\' not present in CreateVpcRouteResponse JSON') - if 'name' in _dict: - args['name'] = _dict.get('name') - else: - raise ValueError('Required property \'name\' not present in CreateVpcRouteResponse JSON') - if 'next_hop' in _dict: - args['next_hop'] = _dict.get('next_hop') - else: - raise ValueError('Required property \'next_hop\' not present in CreateVpcRouteResponse JSON') - if 'origin' in _dict: - args['origin'] = _dict.get('origin') - if 'priority' in _dict: - args['priority'] = _dict.get('priority') - else: - raise ValueError('Required property \'priority\' not present in CreateVpcRouteResponse JSON') - if 'zone' in _dict: - args['zone'] = ZoneReference.from_dict(_dict.get('zone')) - else: - raise ValueError('Required property \'zone\' not present in CreateVpcRouteResponse JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a CreateVpcRouteResponse object from a json dictionary.""" - return cls.from_dict(_dict) - - def to_dict(self) -> Dict: - """Return a json dictionary representing this model.""" - _dict = {} - if hasattr(self, 'action') and self.action is not None: - _dict['action'] = self.action - if hasattr(self, 'created_at') and self.created_at is not None: - _dict['created_at'] = datetime_to_string(self.created_at) - if hasattr(self, 'creator') and getattr(self, 'creator') is not None: - if isinstance(getattr(self, 'creator'), dict): - _dict['creator'] = getattr(self, 'creator') - else: - _dict['creator'] = getattr(self, 'creator').to_dict() - if hasattr(self, 'destination') and self.destination is not None: - _dict['destination'] = self.destination - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id - if hasattr(self, 'lifecycle_state') and self.lifecycle_state is not None: - _dict['lifecycle_state'] = self.lifecycle_state - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'next_hop') and self.next_hop is not None: - if isinstance(self.next_hop, dict): - _dict['next_hop'] = self.next_hop - else: - _dict['next_hop'] = self.next_hop.to_dict() - if hasattr(self, 'origin') and getattr(self, 'origin') is not None: - _dict['origin'] = getattr(self, 'origin') - if hasattr(self, 'priority') and self.priority is not None: - _dict['priority'] = self.priority - if hasattr(self, 'zone') and self.zone is not None: - if isinstance(self.zone, dict): - _dict['zone'] = self.zone - else: - _dict['zone'] = self.zone.to_dict() - return _dict - - def _to_dict(self): - """Return a json dictionary representing this model.""" - return self.to_dict() - - def __str__(self) -> str: - """Return a `str` version of this CreateVpcRouteResponse object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'CreateVpcRouteResponse') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ - - def __ne__(self, other: 'CreateVpcRouteResponse') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - class ActionEnum(str, Enum): - """ - The action to perform with a packet matching the route: - - `delegate`: delegate to system-provided routes - - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound - routes - - `deliver`: deliver the packet to the specified `next_hop` - - `drop`: drop the packet. - """ - - DELEGATE = 'delegate' - DELEGATE_VPC = 'delegate_vpc' - DELIVER = 'deliver' - DROP = 'drop' - - - class LifecycleStateEnum(str, Enum): - """ - The lifecycle state of the route. - """ - - DELETING = 'deleting' - FAILED = 'failed' - PENDING = 'pending' - STABLE = 'stable' - SUSPENDED = 'suspended' - UPDATING = 'updating' - WAITING = 'waiting' - - - class OriginEnum(str, Enum): - """ - The origin of this route: - - `service`: route was directly created by a service - - `user`: route was directly created by a user - The enumerated values for this property are expected to expand in the future. When - processing this property, check for and log unknown values. Optionally halt - processing and surface the error, or bypass the route on which the unexpected - property value was encountered. - """ - - SERVICE = 'service' - USER = 'user' - - - class DNSInstanceIdentity: """ Identifies a DNS instance by a unique property. @@ -38128,264 +37853,6 @@ def __ne__(self, other: 'GenericResourceReferenceDeleted') -> bool: return not self == other -class GetVpcRouteResponse: - """ - GetVpcRouteResponse. - - :attr str action: The action to perform with a packet matching the route: - - `delegate`: delegate to system-provided routes - - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound - routes - - `deliver`: deliver the packet to the specified `next_hop` - - `drop`: drop the packet. - :attr datetime created_at: The date and time that the route was created. - :attr RouteCreator creator: (optional) If present, the resource that created the - route. Routes with this property present cannot - be directly deleted. All routes with an `origin` of `service` will have this - property set, - and future `origin` values may also have this property set. - :attr str destination: The destination CIDR of the route. - :attr str href: The URL for this route. - :attr str id: The unique identifier for this route. - :attr str lifecycle_state: The lifecycle state of the route. - :attr str name: The name for this route. The name is unique across all routes in - the routing table. - :attr RouteNextHop next_hop: If `action` is `deliver`, the next hop that packets - will be delivered to. For - other `action` values, its `address` will be `0.0.0.0`. - :attr str origin: (optional) The origin of this route: - - `service`: route was directly created by a service - - `user`: route was directly created by a user - The enumerated values for this property are expected to expand in the future. - When processing this property, check for and log unknown values. Optionally halt - processing and surface the error, or bypass the route on which the unexpected - property value was encountered. - :attr int priority: The priority of this route. Smaller values have higher - priority. - If a routing table contains multiple routes with the same `zone` and - `destination`, the route with the highest priority (smallest value) is selected. - If two routes have the same `destination` and `priority`, traffic is distributed - between them. - :attr ZoneReference zone: The zone the route applies to. (Traffic from subnets - in this zone will be - subject to this route.). - """ - - def __init__( - self, - action: str, - created_at: datetime, - destination: str, - href: str, - id: str, - lifecycle_state: str, - name: str, - next_hop: 'RouteNextHop', - priority: int, - zone: 'ZoneReference', - *, - creator: 'RouteCreator' = None, - origin: str = None, - ) -> None: - """ - Initialize a GetVpcRouteResponse object. - - :param str action: The action to perform with a packet matching the route: - - `delegate`: delegate to system-provided routes - - `delegate_vpc`: delegate to system-provided routes, ignoring - Internet-bound routes - - `deliver`: deliver the packet to the specified `next_hop` - - `drop`: drop the packet. - :param datetime created_at: The date and time that the route was created. - :param str destination: The destination CIDR of the route. - :param str href: The URL for this route. - :param str id: The unique identifier for this route. - :param str lifecycle_state: The lifecycle state of the route. - :param str name: The name for this route. The name is unique across all - routes in the routing table. - :param RouteNextHop next_hop: If `action` is `deliver`, the next hop that - packets will be delivered to. For - other `action` values, its `address` will be `0.0.0.0`. - :param int priority: The priority of this route. Smaller values have higher - priority. - If a routing table contains multiple routes with the same `zone` and - `destination`, the route with the highest priority (smallest value) is - selected. If two routes have the same `destination` and `priority`, traffic - is distributed between them. - :param ZoneReference zone: The zone the route applies to. (Traffic from - subnets in this zone will be - subject to this route.). - """ - self.action = action - self.created_at = created_at - self.creator = creator - self.destination = destination - self.href = href - self.id = id - self.lifecycle_state = lifecycle_state - self.name = name - self.next_hop = next_hop - self.origin = origin - self.priority = priority - self.zone = zone - - @classmethod - def from_dict(cls, _dict: Dict) -> 'GetVpcRouteResponse': - """Initialize a GetVpcRouteResponse object from a json dictionary.""" - args = {} - if 'action' in _dict: - args['action'] = _dict.get('action') - else: - raise ValueError('Required property \'action\' not present in GetVpcRouteResponse JSON') - if 'created_at' in _dict: - args['created_at'] = string_to_datetime(_dict.get('created_at')) - else: - raise ValueError('Required property \'created_at\' not present in GetVpcRouteResponse JSON') - if 'creator' in _dict: - args['creator'] = _dict.get('creator') - if 'destination' in _dict: - args['destination'] = _dict.get('destination') - else: - raise ValueError('Required property \'destination\' not present in GetVpcRouteResponse JSON') - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in GetVpcRouteResponse JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') - else: - raise ValueError('Required property \'id\' not present in GetVpcRouteResponse JSON') - if 'lifecycle_state' in _dict: - args['lifecycle_state'] = _dict.get('lifecycle_state') - else: - raise ValueError('Required property \'lifecycle_state\' not present in GetVpcRouteResponse JSON') - if 'name' in _dict: - args['name'] = _dict.get('name') - else: - raise ValueError('Required property \'name\' not present in GetVpcRouteResponse JSON') - if 'next_hop' in _dict: - args['next_hop'] = _dict.get('next_hop') - else: - raise ValueError('Required property \'next_hop\' not present in GetVpcRouteResponse JSON') - if 'origin' in _dict: - args['origin'] = _dict.get('origin') - if 'priority' in _dict: - args['priority'] = _dict.get('priority') - else: - raise ValueError('Required property \'priority\' not present in GetVpcRouteResponse JSON') - if 'zone' in _dict: - args['zone'] = ZoneReference.from_dict(_dict.get('zone')) - else: - raise ValueError('Required property \'zone\' not present in GetVpcRouteResponse JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a GetVpcRouteResponse object from a json dictionary.""" - return cls.from_dict(_dict) - - def to_dict(self) -> Dict: - """Return a json dictionary representing this model.""" - _dict = {} - if hasattr(self, 'action') and self.action is not None: - _dict['action'] = self.action - if hasattr(self, 'created_at') and self.created_at is not None: - _dict['created_at'] = datetime_to_string(self.created_at) - if hasattr(self, 'creator') and getattr(self, 'creator') is not None: - if isinstance(getattr(self, 'creator'), dict): - _dict['creator'] = getattr(self, 'creator') - else: - _dict['creator'] = getattr(self, 'creator').to_dict() - if hasattr(self, 'destination') and self.destination is not None: - _dict['destination'] = self.destination - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id - if hasattr(self, 'lifecycle_state') and self.lifecycle_state is not None: - _dict['lifecycle_state'] = self.lifecycle_state - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'next_hop') and self.next_hop is not None: - if isinstance(self.next_hop, dict): - _dict['next_hop'] = self.next_hop - else: - _dict['next_hop'] = self.next_hop.to_dict() - if hasattr(self, 'origin') and getattr(self, 'origin') is not None: - _dict['origin'] = getattr(self, 'origin') - if hasattr(self, 'priority') and self.priority is not None: - _dict['priority'] = self.priority - if hasattr(self, 'zone') and self.zone is not None: - if isinstance(self.zone, dict): - _dict['zone'] = self.zone - else: - _dict['zone'] = self.zone.to_dict() - return _dict - - def _to_dict(self): - """Return a json dictionary representing this model.""" - return self.to_dict() - - def __str__(self) -> str: - """Return a `str` version of this GetVpcRouteResponse object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'GetVpcRouteResponse') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ - - def __ne__(self, other: 'GetVpcRouteResponse') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - class ActionEnum(str, Enum): - """ - The action to perform with a packet matching the route: - - `delegate`: delegate to system-provided routes - - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound - routes - - `deliver`: deliver the packet to the specified `next_hop` - - `drop`: drop the packet. - """ - - DELEGATE = 'delegate' - DELEGATE_VPC = 'delegate_vpc' - DELIVER = 'deliver' - DROP = 'drop' - - - class LifecycleStateEnum(str, Enum): - """ - The lifecycle state of the route. - """ - - DELETING = 'deleting' - FAILED = 'failed' - PENDING = 'pending' - STABLE = 'stable' - SUSPENDED = 'suspended' - UPDATING = 'updating' - WAITING = 'waiting' - - - class OriginEnum(str, Enum): - """ - The origin of this route: - - `service`: route was directly created by a service - - `user`: route was directly created by a user - The enumerated values for this property are expected to expand in the future. When - processing this property, check for and log unknown values. Optionally halt - processing and surface the error, or bypass the route on which the unexpected - property value was encountered. - """ - - SERVICE = 'service' - USER = 'user' - - - class IKEPolicy: """ IKEPolicy. @@ -61067,7 +60534,7 @@ class NetworkInterface: NetworkInterface. :attr bool allow_ip_spoofing: Indicates whether source IP spoofing is allowed on - this instance interface. + this instance network interface. :attr datetime created_at: The date and time that the instance network interface was created. :attr List[FloatingIPReference] floating_ips: The floating IPs associated with @@ -61105,7 +60572,7 @@ def __init__( Initialize a NetworkInterface object. :param bool allow_ip_spoofing: Indicates whether source IP spoofing is - allowed on this instance interface. + allowed on this instance network interface. :param datetime created_at: The date and time that the instance network interface was created. :param List[FloatingIPReference] floating_ips: The floating IPs associated @@ -61723,7 +61190,7 @@ class NetworkInterfacePatch: NetworkInterfacePatch. :attr bool allow_ip_spoofing: (optional) Indicates whether source IP spoofing is - allowed on this instance interface. + allowed on this instance network interface. :attr str name: (optional) The name for the instance network interface. The name must not be used by another network interface on the virtual server instance. """ @@ -61738,7 +61205,7 @@ def __init__( Initialize a NetworkInterfacePatch object. :param bool allow_ip_spoofing: (optional) Indicates whether source IP - spoofing is allowed on this instance interface. + spoofing is allowed on this instance network interface. :param str name: (optional) The name for the instance network interface. The name must not be used by another network interface on the virtual server instance. @@ -61794,7 +61261,7 @@ class NetworkInterfacePrototype: NetworkInterfacePrototype. :attr bool allow_ip_spoofing: (optional) Indicates whether source IP spoofing is - allowed on this instance interface. + allowed on this instance network interface. :attr str name: (optional) The name for the instance network interface. The name must not be used by another network interface on the virtual server instance. If unspecified, the name will be a hyphenated list of randomly-selected words. @@ -61826,7 +61293,7 @@ def __init__( :param SubnetIdentity subnet: The associated subnet. :param bool allow_ip_spoofing: (optional) Indicates whether source IP - spoofing is allowed on this instance interface. + spoofing is allowed on this instance network interface. :param str name: (optional) The name for the instance network interface. The name must not be used by another network interface on the virtual server instance. If unspecified, the name will be a hyphenated list of @@ -75380,264 +74847,6 @@ class ResourceTypeEnum(str, Enum): -class UpdateVpcRouteResponse: - """ - UpdateVpcRouteResponse. - - :attr str action: The action to perform with a packet matching the route: - - `delegate`: delegate to system-provided routes - - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound - routes - - `deliver`: deliver the packet to the specified `next_hop` - - `drop`: drop the packet. - :attr datetime created_at: The date and time that the route was created. - :attr RouteCreator creator: (optional) If present, the resource that created the - route. Routes with this property present cannot - be directly deleted. All routes with an `origin` of `service` will have this - property set, - and future `origin` values may also have this property set. - :attr str destination: The destination CIDR of the route. - :attr str href: The URL for this route. - :attr str id: The unique identifier for this route. - :attr str lifecycle_state: The lifecycle state of the route. - :attr str name: The name for this route. The name is unique across all routes in - the routing table. - :attr RouteNextHop next_hop: If `action` is `deliver`, the next hop that packets - will be delivered to. For - other `action` values, its `address` will be `0.0.0.0`. - :attr str origin: (optional) The origin of this route: - - `service`: route was directly created by a service - - `user`: route was directly created by a user - The enumerated values for this property are expected to expand in the future. - When processing this property, check for and log unknown values. Optionally halt - processing and surface the error, or bypass the route on which the unexpected - property value was encountered. - :attr int priority: The priority of this route. Smaller values have higher - priority. - If a routing table contains multiple routes with the same `zone` and - `destination`, the route with the highest priority (smallest value) is selected. - If two routes have the same `destination` and `priority`, traffic is distributed - between them. - :attr ZoneReference zone: The zone the route applies to. (Traffic from subnets - in this zone will be - subject to this route.). - """ - - def __init__( - self, - action: str, - created_at: datetime, - destination: str, - href: str, - id: str, - lifecycle_state: str, - name: str, - next_hop: 'RouteNextHop', - priority: int, - zone: 'ZoneReference', - *, - creator: 'RouteCreator' = None, - origin: str = None, - ) -> None: - """ - Initialize a UpdateVpcRouteResponse object. - - :param str action: The action to perform with a packet matching the route: - - `delegate`: delegate to system-provided routes - - `delegate_vpc`: delegate to system-provided routes, ignoring - Internet-bound routes - - `deliver`: deliver the packet to the specified `next_hop` - - `drop`: drop the packet. - :param datetime created_at: The date and time that the route was created. - :param str destination: The destination CIDR of the route. - :param str href: The URL for this route. - :param str id: The unique identifier for this route. - :param str lifecycle_state: The lifecycle state of the route. - :param str name: The name for this route. The name is unique across all - routes in the routing table. - :param RouteNextHop next_hop: If `action` is `deliver`, the next hop that - packets will be delivered to. For - other `action` values, its `address` will be `0.0.0.0`. - :param int priority: The priority of this route. Smaller values have higher - priority. - If a routing table contains multiple routes with the same `zone` and - `destination`, the route with the highest priority (smallest value) is - selected. If two routes have the same `destination` and `priority`, traffic - is distributed between them. - :param ZoneReference zone: The zone the route applies to. (Traffic from - subnets in this zone will be - subject to this route.). - """ - self.action = action - self.created_at = created_at - self.creator = creator - self.destination = destination - self.href = href - self.id = id - self.lifecycle_state = lifecycle_state - self.name = name - self.next_hop = next_hop - self.origin = origin - self.priority = priority - self.zone = zone - - @classmethod - def from_dict(cls, _dict: Dict) -> 'UpdateVpcRouteResponse': - """Initialize a UpdateVpcRouteResponse object from a json dictionary.""" - args = {} - if 'action' in _dict: - args['action'] = _dict.get('action') - else: - raise ValueError('Required property \'action\' not present in UpdateVpcRouteResponse JSON') - if 'created_at' in _dict: - args['created_at'] = string_to_datetime(_dict.get('created_at')) - else: - raise ValueError('Required property \'created_at\' not present in UpdateVpcRouteResponse JSON') - if 'creator' in _dict: - args['creator'] = _dict.get('creator') - if 'destination' in _dict: - args['destination'] = _dict.get('destination') - else: - raise ValueError('Required property \'destination\' not present in UpdateVpcRouteResponse JSON') - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in UpdateVpcRouteResponse JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') - else: - raise ValueError('Required property \'id\' not present in UpdateVpcRouteResponse JSON') - if 'lifecycle_state' in _dict: - args['lifecycle_state'] = _dict.get('lifecycle_state') - else: - raise ValueError('Required property \'lifecycle_state\' not present in UpdateVpcRouteResponse JSON') - if 'name' in _dict: - args['name'] = _dict.get('name') - else: - raise ValueError('Required property \'name\' not present in UpdateVpcRouteResponse JSON') - if 'next_hop' in _dict: - args['next_hop'] = _dict.get('next_hop') - else: - raise ValueError('Required property \'next_hop\' not present in UpdateVpcRouteResponse JSON') - if 'origin' in _dict: - args['origin'] = _dict.get('origin') - if 'priority' in _dict: - args['priority'] = _dict.get('priority') - else: - raise ValueError('Required property \'priority\' not present in UpdateVpcRouteResponse JSON') - if 'zone' in _dict: - args['zone'] = ZoneReference.from_dict(_dict.get('zone')) - else: - raise ValueError('Required property \'zone\' not present in UpdateVpcRouteResponse JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a UpdateVpcRouteResponse object from a json dictionary.""" - return cls.from_dict(_dict) - - def to_dict(self) -> Dict: - """Return a json dictionary representing this model.""" - _dict = {} - if hasattr(self, 'action') and self.action is not None: - _dict['action'] = self.action - if hasattr(self, 'created_at') and self.created_at is not None: - _dict['created_at'] = datetime_to_string(self.created_at) - if hasattr(self, 'creator') and getattr(self, 'creator') is not None: - if isinstance(getattr(self, 'creator'), dict): - _dict['creator'] = getattr(self, 'creator') - else: - _dict['creator'] = getattr(self, 'creator').to_dict() - if hasattr(self, 'destination') and self.destination is not None: - _dict['destination'] = self.destination - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id - if hasattr(self, 'lifecycle_state') and self.lifecycle_state is not None: - _dict['lifecycle_state'] = self.lifecycle_state - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'next_hop') and self.next_hop is not None: - if isinstance(self.next_hop, dict): - _dict['next_hop'] = self.next_hop - else: - _dict['next_hop'] = self.next_hop.to_dict() - if hasattr(self, 'origin') and getattr(self, 'origin') is not None: - _dict['origin'] = getattr(self, 'origin') - if hasattr(self, 'priority') and self.priority is not None: - _dict['priority'] = self.priority - if hasattr(self, 'zone') and self.zone is not None: - if isinstance(self.zone, dict): - _dict['zone'] = self.zone - else: - _dict['zone'] = self.zone.to_dict() - return _dict - - def _to_dict(self): - """Return a json dictionary representing this model.""" - return self.to_dict() - - def __str__(self) -> str: - """Return a `str` version of this UpdateVpcRouteResponse object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'UpdateVpcRouteResponse') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ - - def __ne__(self, other: 'UpdateVpcRouteResponse') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - class ActionEnum(str, Enum): - """ - The action to perform with a packet matching the route: - - `delegate`: delegate to system-provided routes - - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound - routes - - `deliver`: deliver the packet to the specified `next_hop` - - `drop`: drop the packet. - """ - - DELEGATE = 'delegate' - DELEGATE_VPC = 'delegate_vpc' - DELIVER = 'deliver' - DROP = 'drop' - - - class LifecycleStateEnum(str, Enum): - """ - The lifecycle state of the route. - """ - - DELETING = 'deleting' - FAILED = 'failed' - PENDING = 'pending' - STABLE = 'stable' - SUSPENDED = 'suspended' - UPDATING = 'updating' - WAITING = 'waiting' - - - class OriginEnum(str, Enum): - """ - The origin of this route: - - `service`: route was directly created by a service - - `user`: route was directly created by a user - The enumerated values for this property are expected to expand in the future. When - processing this property, check for and log unknown values. Optionally halt - processing and surface the error, or bypass the route on which the unexpected - property value was encountered. - """ - - SERVICE = 'service' - USER = 'user' - - - class VCPU: """ The VCPU configuration. @@ -88550,15 +87759,15 @@ class BareMetalServerNetworkInterfaceByPCI(BareMetalServerNetworkInterface): :attr str status: The status of the bare metal server network interface. :attr SubnetReference subnet: The associated subnet. :attr str type: The bare metal server network interface type. - :attr List[int] allowed_vlans: Indicates what VLAN IDs (for VLAN type only) can - use this physical (PCI type) interface. + :attr List[int] allowed_vlans: The VLAN IDs allowed for `vlan` interfaces using + this PCI interface. :attr str interface_type: - `pci`: a physical PCI device which can only be created or deleted when the bare metal server is stopped - Has an `allowed_vlans` property which controls the VLANs that will be permitted to use the PCI interface - - Cannot directly use an IEEE 802.1q VLAN tag. + - Cannot directly use an IEEE 802.1Q tag. """ def __init__( @@ -88615,15 +87824,15 @@ def __init__( :param str status: The status of the bare metal server network interface. :param SubnetReference subnet: The associated subnet. :param str type: The bare metal server network interface type. - :param List[int] allowed_vlans: Indicates what VLAN IDs (for VLAN type - only) can use this physical (PCI type) interface. + :param List[int] allowed_vlans: The VLAN IDs allowed for `vlan` interfaces + using this PCI interface. :param str interface_type: - `pci`: a physical PCI device which can only be created or deleted when the bare metal server is stopped - Has an `allowed_vlans` property which controls the VLANs that will be permitted to use the PCI interface - - Cannot directly use an IEEE 802.1q VLAN tag. + - Cannot directly use an IEEE 802.1Q tag. """ # pylint: disable=super-init-not-called self.allow_ip_spoofing = allow_ip_spoofing @@ -88834,7 +88043,7 @@ class InterfaceTypeEnum(str, Enum): - Has an `allowed_vlans` property which controls the VLANs that will be permitted to use the PCI interface - - Cannot directly use an IEEE 802.1q VLAN tag. + - Cannot directly use an IEEE 802.1Q tag. """ PCI = 'pci' @@ -88875,20 +88084,25 @@ class BareMetalServerNetworkInterfaceByVLAN(BareMetalServerNetworkInterface): :attr str status: The status of the bare metal server network interface. :attr SubnetReference subnet: The associated subnet. :attr str type: The bare metal server network interface type. - :attr bool allow_interface_to_float: Indicates if the interface can float to any - other server within the same - `resource_group`. The interface will float automatically if the network detects - a GARP or RARP on another bare metal server in the resource group. Applies only - to `vlan` type interfaces. + :attr bool allow_interface_to_float: Indicates if the data path for the network + interface can float to another bare metal server. Can only be `true` for network + interfaces with an `interface_type` of `vlan`. + If `true`, and the network detects traffic for this data path on another bare + metal server in the resource group, the network interface will be automatically + deleted from this bare metal server and a new network interface with the same + `id`, `name` and `vlan` will be created on the other bare metal server. + For the data path to float, the other bare metal server must be in the same + `resource_group`, and must have a network interface with `interface_type` of + `pci` with `allowed_vlans` including this network interface's `vlan`. :attr str interface_type: - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its array of `allowed_vlans`. - - Must use an IEEE 802.1q tag. + - Must use an IEEE 802.1Q tag. - Has its own security groups and does not inherit those of the PCI device through which traffic flows. - :attr int vlan: Indicates the 802.1Q VLAN ID tag that must be used for all - traffic on this interface. + :attr int vlan: The VLAN ID used in the IEEE 802.1Q tag present in all traffic + on this interface. """ def __init__( @@ -88946,19 +88160,25 @@ def __init__( :param str status: The status of the bare metal server network interface. :param SubnetReference subnet: The associated subnet. :param str type: The bare metal server network interface type. - :param bool allow_interface_to_float: Indicates if the interface can float - to any other server within the same - `resource_group`. The interface will float automatically if the network - detects a GARP or RARP on another bare metal server in the resource group. - Applies only to `vlan` type interfaces. + :param bool allow_interface_to_float: Indicates if the data path for the + network interface can float to another bare metal server. Can only be + `true` for network interfaces with an `interface_type` of `vlan`. + If `true`, and the network detects traffic for this data path on another + bare metal server in the resource group, the network interface will be + automatically deleted from this bare metal server and a new network + interface with the same `id`, `name` and `vlan` will be created on the + other bare metal server. + For the data path to float, the other bare metal server must be in the same + `resource_group`, and must have a network interface with `interface_type` + of `pci` with `allowed_vlans` including this network interface's `vlan`. :param str interface_type: - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its array of `allowed_vlans`. - - Must use an IEEE 802.1q tag. + - Must use an IEEE 802.1Q tag. - Has its own security groups and does not inherit those of the PCI device through which traffic flows. - :param int vlan: Indicates the 802.1Q VLAN ID tag that must be used for all + :param int vlan: The VLAN ID used in the IEEE 802.1Q tag present in all traffic on this interface. """ # pylint: disable=super-init-not-called @@ -89174,7 +88394,7 @@ class InterfaceTypeEnum(str, Enum): - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its array of `allowed_vlans`. - - Must use an IEEE 802.1q tag. + - Must use an IEEE 802.1Q tag. - Has its own security groups and does not inherit those of the PCI device through which traffic flows. @@ -89394,15 +88614,15 @@ class BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByP groups to use for this bare metal server network interface. If unspecified, the VPC's default security group is used. :attr SubnetIdentity subnet: The associated subnet. - :attr List[int] allowed_vlans: (optional) Indicates what VLAN IDs (for VLAN type - only) can use this physical (PCI type) interface. + :attr List[int] allowed_vlans: (optional) The VLAN IDs to allow for `vlan` + interfaces using this PCI interface. :attr str interface_type: - `pci`: a physical PCI device which can only be created or deleted when the bare metal server is stopped - Has an `allowed_vlans` property which controls the VLANs that will be permitted to use the PCI interface - - Cannot directly use an IEEE 802.1q VLAN tag. + - Cannot directly use an IEEE 802.1Q tag. - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. """ @@ -89428,7 +88648,7 @@ def __init__( - Has an `allowed_vlans` property which controls the VLANs that will be permitted to use the PCI interface - - Cannot directly use an IEEE 802.1q VLAN tag. + - Cannot directly use an IEEE 802.1Q tag. - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. :param bool allow_ip_spoofing: (optional) Indicates whether source IP @@ -89457,8 +88677,8 @@ def __init__( :param List[SecurityGroupIdentity] security_groups: (optional) The security groups to use for this bare metal server network interface. If unspecified, the VPC's default security group is used. - :param List[int] allowed_vlans: (optional) Indicates what VLAN IDs (for - VLAN type only) can use this physical (PCI type) interface. + :param List[int] allowed_vlans: (optional) The VLAN IDs to allow for `vlan` + interfaces using this PCI interface. """ # pylint: disable=super-init-not-called self.allow_ip_spoofing = allow_ip_spoofing @@ -89560,7 +88780,7 @@ class InterfaceTypeEnum(str, Enum): - Has an `allowed_vlans` property which controls the VLANs that will be permitted to use the PCI interface - - Cannot directly use an IEEE 802.1q VLAN tag. + - Cannot directly use an IEEE 802.1Q tag. - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. """ @@ -89597,21 +88817,26 @@ class BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByV groups to use for this bare metal server network interface. If unspecified, the VPC's default security group is used. :attr SubnetIdentity subnet: The associated subnet. - :attr bool allow_interface_to_float: (optional) Indicates if the interface can - float to any other server within the same - `resource_group`. The interface will float automatically if the network detects - a GARP or RARP on another bare metal server in the resource group. Applies only - to `vlan` type interfaces. + :attr bool allow_interface_to_float: (optional) Indicates if the data path for + the network interface can float to another bare metal server. Can only be `true` + for network interfaces with an `interface_type` of `vlan`. + If `true`, and the network detects traffic for this data path on another bare + metal server in the resource group, the network interface will be automatically + deleted from this bare metal server and a new network interface with the same + `id`, `name` and `vlan` will be created on the other bare metal server. + For the data path to float, the other bare metal server must be in the same + `resource_group`, and must have a network interface with `interface_type` of + `pci` with `allowed_vlans` including this network interface's `vlan`. :attr str interface_type: - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its array of `allowed_vlans`. - - Must use an IEEE 802.1q tag. + - Must use an IEEE 802.1Q tag. - Has its own security groups and does not inherit those of the PCI device through which traffic flows. - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. - :attr int vlan: Indicates the 802.1Q VLAN ID tag that must be used for all - traffic on this interface. + :attr int vlan: The VLAN ID used in the IEEE 802.1Q tag present in all traffic + on this interface. """ def __init__( @@ -89634,13 +88859,13 @@ def __init__( :param str interface_type: - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its array of `allowed_vlans`. - - Must use an IEEE 802.1q tag. + - Must use an IEEE 802.1Q tag. - Has its own security groups and does not inherit those of the PCI device through which traffic flows. - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. - :param int vlan: Indicates the 802.1Q VLAN ID tag that must be used for all + :param int vlan: The VLAN ID used in the IEEE 802.1Q tag present in all traffic on this interface. :param bool allow_ip_spoofing: (optional) Indicates whether source IP spoofing is allowed on this bare metal server network interface. @@ -89668,11 +88893,17 @@ def __init__( :param List[SecurityGroupIdentity] security_groups: (optional) The security groups to use for this bare metal server network interface. If unspecified, the VPC's default security group is used. - :param bool allow_interface_to_float: (optional) Indicates if the interface - can float to any other server within the same - `resource_group`. The interface will float automatically if the network - detects a GARP or RARP on another bare metal server in the resource group. - Applies only to `vlan` type interfaces. + :param bool allow_interface_to_float: (optional) Indicates if the data path + for the network interface can float to another bare metal server. Can only + be `true` for network interfaces with an `interface_type` of `vlan`. + If `true`, and the network detects traffic for this data path on another + bare metal server in the resource group, the network interface will be + automatically deleted from this bare metal server and a new network + interface with the same `id`, `name` and `vlan` will be created on the + other bare metal server. + For the data path to float, the other bare metal server must be in the same + `resource_group`, and must have a network interface with `interface_type` + of `pci` with `allowed_vlans` including this network interface's `vlan`. """ # pylint: disable=super-init-not-called self.allow_ip_spoofing = allow_ip_spoofing @@ -89778,7 +89009,7 @@ class InterfaceTypeEnum(str, Enum): - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its array of `allowed_vlans`. - - Must use an IEEE 802.1q tag. + - Must use an IEEE 802.1Q tag. - Has its own security groups and does not inherit those of the PCI device through which traffic flows. @@ -92131,186 +91362,6 @@ class TypeEnum(str, Enum): -class BareMetalServerPrototypeVpcVPCIdentityByCRN(BareMetalServerPrototypeVpc): - """ - BareMetalServerPrototypeVpcVPCIdentityByCRN. - - :attr str crn: The CRN for this VPC. - """ - - def __init__( - self, - crn: str, - ) -> None: - """ - Initialize a BareMetalServerPrototypeVpcVPCIdentityByCRN object. - - :param str crn: The CRN for this VPC. - """ - # pylint: disable=super-init-not-called - self.crn = crn - - @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerPrototypeVpcVPCIdentityByCRN': - """Initialize a BareMetalServerPrototypeVpcVPCIdentityByCRN object from a json dictionary.""" - args = {} - if 'crn' in _dict: - args['crn'] = _dict.get('crn') - else: - raise ValueError('Required property \'crn\' not present in BareMetalServerPrototypeVpcVPCIdentityByCRN JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a BareMetalServerPrototypeVpcVPCIdentityByCRN object from 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 BareMetalServerPrototypeVpcVPCIdentityByCRN object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'BareMetalServerPrototypeVpcVPCIdentityByCRN') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ - - def __ne__(self, other: 'BareMetalServerPrototypeVpcVPCIdentityByCRN') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - -class BareMetalServerPrototypeVpcVPCIdentityByHref(BareMetalServerPrototypeVpc): - """ - BareMetalServerPrototypeVpcVPCIdentityByHref. - - :attr str href: The URL for this VPC. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a BareMetalServerPrototypeVpcVPCIdentityByHref object. - - :param str href: The URL for this VPC. - """ - # pylint: disable=super-init-not-called - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerPrototypeVpcVPCIdentityByHref': - """Initialize a BareMetalServerPrototypeVpcVPCIdentityByHref object from a json dictionary.""" - args = {} - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in BareMetalServerPrototypeVpcVPCIdentityByHref JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a BareMetalServerPrototypeVpcVPCIdentityByHref object from a json dictionary.""" - return cls.from_dict(_dict) - - def to_dict(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 BareMetalServerPrototypeVpcVPCIdentityByHref object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'BareMetalServerPrototypeVpcVPCIdentityByHref') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ - - def __ne__(self, other: 'BareMetalServerPrototypeVpcVPCIdentityByHref') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - -class BareMetalServerPrototypeVpcVPCIdentityById(BareMetalServerPrototypeVpc): - """ - BareMetalServerPrototypeVpcVPCIdentityById. - - :attr str id: The unique identifier for this VPC. - """ - - def __init__( - self, - id: str, - ) -> None: - """ - Initialize a BareMetalServerPrototypeVpcVPCIdentityById object. - - :param str id: The unique identifier for this VPC. - """ - # pylint: disable=super-init-not-called - self.id = id - - @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerPrototypeVpcVPCIdentityById': - """Initialize a BareMetalServerPrototypeVpcVPCIdentityById object from a json dictionary.""" - args = {} - if 'id' in _dict: - args['id'] = _dict.get('id') - else: - raise ValueError('Required property \'id\' not present in BareMetalServerPrototypeVpcVPCIdentityById JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a BareMetalServerPrototypeVpcVPCIdentityById object from 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 BareMetalServerPrototypeVpcVPCIdentityById object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'BareMetalServerPrototypeVpcVPCIdentityById') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ - - def __ne__(self, other: 'BareMetalServerPrototypeVpcVPCIdentityById') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - class CatalogOfferingIdentityCatalogOfferingByCRN(CatalogOfferingIdentity): """ CatalogOfferingIdentityCatalogOfferingByCRN. diff --git a/test/unit/test_common.py b/test/unit/test_common.py index bf63b48..f5e40a2 100644 --- a/test/unit/test_common.py +++ b/test/unit/test_common.py @@ -33,7 +33,6 @@ def test_get_sdk_headers(self): headers = common.get_sdk_headers('example_service', 'V1', 'operation1') self.assertIsNotNone(headers) self.assertIsNotNone(headers.get('User-Agent')) - self.assertIsNotNone(headers.get('X-Correlation-Id')) self.assertIsNotNone(headers.get('X-Request-Id')) self.assertIn('vpc-python-sdk', headers.get('User-Agent')) diff --git a/test/unit/test_vpc_v1.py b/test/unit/test_vpc_v1.py index 9747699..66879d6 100644 --- a/test/unit/test_vpc_v1.py +++ b/test/unit/test_vpc_v1.py @@ -2497,7 +2497,7 @@ def test_create_vpc_route_all_params(self): """ # Set up mock url = preprocess_url('/vpcs/testString/routes') - mock_response = '{"action": "delegate", "created_at": "2019-01-01T12:00:00.000Z", "creator": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-vpn-gateway", "resource_type": "vpn_gateway"}, "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "origin": "service", "priority": 1, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"action": "delegate", "created_at": "2019-01-01T12:00:00.000Z", "creator": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-vpn-gateway", "resource_type": "vpn_gateway"}, "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "origin": "service", "priority": 1, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.POST, url, @@ -2563,7 +2563,7 @@ def test_create_vpc_route_value_error(self): """ # Set up mock url = preprocess_url('/vpcs/testString/routes') - mock_response = '{"action": "delegate", "created_at": "2019-01-01T12:00:00.000Z", "creator": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-vpn-gateway", "resource_type": "vpn_gateway"}, "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "origin": "service", "priority": 1, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"action": "delegate", "created_at": "2019-01-01T12:00:00.000Z", "creator": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-vpn-gateway", "resource_type": "vpn_gateway"}, "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "origin": "service", "priority": 1, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.POST, url, @@ -2701,7 +2701,7 @@ def test_get_vpc_route_all_params(self): """ # Set up mock url = preprocess_url('/vpcs/testString/routes/testString') - mock_response = '{"action": "delegate", "created_at": "2019-01-01T12:00:00.000Z", "creator": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-vpn-gateway", "resource_type": "vpn_gateway"}, "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "origin": "service", "priority": 1, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"action": "delegate", "created_at": "2019-01-01T12:00:00.000Z", "creator": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-vpn-gateway", "resource_type": "vpn_gateway"}, "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "origin": "service", "priority": 1, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.GET, url, @@ -2741,7 +2741,7 @@ def test_get_vpc_route_value_error(self): """ # Set up mock url = preprocess_url('/vpcs/testString/routes/testString') - mock_response = '{"action": "delegate", "created_at": "2019-01-01T12:00:00.000Z", "creator": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-vpn-gateway", "resource_type": "vpn_gateway"}, "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "origin": "service", "priority": 1, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"action": "delegate", "created_at": "2019-01-01T12:00:00.000Z", "creator": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-vpn-gateway", "resource_type": "vpn_gateway"}, "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "origin": "service", "priority": 1, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.GET, url, @@ -2786,7 +2786,7 @@ def test_update_vpc_route_all_params(self): """ # Set up mock url = preprocess_url('/vpcs/testString/routes/testString') - mock_response = '{"action": "delegate", "created_at": "2019-01-01T12:00:00.000Z", "creator": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-vpn-gateway", "resource_type": "vpn_gateway"}, "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "origin": "service", "priority": 1, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"action": "delegate", "created_at": "2019-01-01T12:00:00.000Z", "creator": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-vpn-gateway", "resource_type": "vpn_gateway"}, "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "origin": "service", "priority": 1, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.PATCH, url, @@ -2841,7 +2841,7 @@ def test_update_vpc_route_value_error(self): """ # Set up mock url = preprocess_url('/vpcs/testString/routes/testString') - mock_response = '{"action": "delegate", "created_at": "2019-01-01T12:00:00.000Z", "creator": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-vpn-gateway", "resource_type": "vpn_gateway"}, "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "origin": "service", "priority": 1, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"action": "delegate", "created_at": "2019-01-01T12:00:00.000Z", "creator": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-vpn-gateway", "resource_type": "vpn_gateway"}, "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "origin": "service", "priority": 1, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.PATCH, url, @@ -20092,9 +20092,9 @@ def test_create_bare_metal_server_all_params(self): bare_metal_server_trusted_platform_module_prototype_model = {} bare_metal_server_trusted_platform_module_prototype_model['mode'] = 'disabled' - # Construct a dict representation of a BareMetalServerPrototypeVpcVPCIdentityById model - bare_metal_server_prototype_vpc_model = {} - bare_metal_server_prototype_vpc_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b' + # Construct a dict representation of a VPCIdentityById model + vpc_identity_model = {} + vpc_identity_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b' # Set up parameter values initialization = bare_metal_server_initialization_prototype_model @@ -20106,7 +20106,7 @@ def test_create_bare_metal_server_all_params(self): network_interfaces = [bare_metal_server_network_interface_prototype_model] resource_group = resource_group_identity_model trusted_platform_module = bare_metal_server_trusted_platform_module_prototype_model - vpc = bare_metal_server_prototype_vpc_model + vpc = vpc_identity_model # Invoke method response = _service.create_bare_metal_server( @@ -20137,7 +20137,7 @@ def test_create_bare_metal_server_all_params(self): assert req_body['network_interfaces'] == [bare_metal_server_network_interface_prototype_model] assert req_body['resource_group'] == resource_group_identity_model assert req_body['trusted_platform_module'] == bare_metal_server_trusted_platform_module_prototype_model - assert req_body['vpc'] == bare_metal_server_prototype_vpc_model + assert req_body['vpc'] == vpc_identity_model def test_create_bare_metal_server_all_params_with_retries(self): # Enable retries and run test_create_bare_metal_server_all_params. @@ -20229,9 +20229,9 @@ def test_create_bare_metal_server_value_error(self): bare_metal_server_trusted_platform_module_prototype_model = {} bare_metal_server_trusted_platform_module_prototype_model['mode'] = 'disabled' - # Construct a dict representation of a BareMetalServerPrototypeVpcVPCIdentityById model - bare_metal_server_prototype_vpc_model = {} - bare_metal_server_prototype_vpc_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b' + # Construct a dict representation of a VPCIdentityById model + vpc_identity_model = {} + vpc_identity_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b' # Set up parameter values initialization = bare_metal_server_initialization_prototype_model @@ -20243,7 +20243,7 @@ def test_create_bare_metal_server_value_error(self): network_interfaces = [bare_metal_server_network_interface_prototype_model] resource_group = resource_group_identity_model trusted_platform_module = bare_metal_server_trusted_platform_module_prototype_model - vpc = bare_metal_server_prototype_vpc_model + vpc = vpc_identity_model # Pass in all but one required param and check for a ValueError req_param_dict = { @@ -45831,54 +45831,6 @@ def test_cloud_object_storage_object_reference_serialization(self): assert cloud_object_storage_object_reference_model_json2 == cloud_object_storage_object_reference_model_json -class TestModel_CreateVpcRouteResponse: - """ - Test Class for CreateVpcRouteResponse - """ - - def test_create_vpc_route_response_serialization(self): - """ - Test serialization/deserialization for CreateVpcRouteResponse - """ - - # Construct dict forms of any model objects needed in order to build this model. - - route_next_hop_model = {} # RouteNextHopIP - route_next_hop_model['address'] = '192.168.3.4' - - zone_reference_model = {} # ZoneReference - zone_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1' - zone_reference_model['name'] = 'us-south-1' - - # Construct a json representation of a CreateVpcRouteResponse model - create_vpc_route_response_model_json = {} - create_vpc_route_response_model_json['action'] = 'delegate' - create_vpc_route_response_model_json['created_at'] = '2019-01-01T12:00:00Z' - create_vpc_route_response_model_json['destination'] = '192.168.3.0/24' - create_vpc_route_response_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531' - create_vpc_route_response_model_json['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531' - create_vpc_route_response_model_json['lifecycle_state'] = 'stable' - create_vpc_route_response_model_json['name'] = 'my-route-1' - create_vpc_route_response_model_json['next_hop'] = route_next_hop_model - create_vpc_route_response_model_json['priority'] = 1 - create_vpc_route_response_model_json['zone'] = zone_reference_model - - # Construct a model instance of CreateVpcRouteResponse by calling from_dict on the json representation - create_vpc_route_response_model = CreateVpcRouteResponse.from_dict(create_vpc_route_response_model_json) - assert create_vpc_route_response_model != False - - # Construct a model instance of CreateVpcRouteResponse by calling from_dict on the json representation - create_vpc_route_response_model_dict = CreateVpcRouteResponse.from_dict(create_vpc_route_response_model_json).__dict__ - create_vpc_route_response_model2 = CreateVpcRouteResponse(**create_vpc_route_response_model_dict) - - # Verify the model instances are equivalent - assert create_vpc_route_response_model == create_vpc_route_response_model2 - - # Convert model instance back to dict and verify no loss of data - create_vpc_route_response_model_json2 = create_vpc_route_response_model.to_dict() - assert create_vpc_route_response_model_json2 == create_vpc_route_response_model_json - - class TestModel_DNSInstanceReference: """ Test Class for DNSInstanceReference @@ -48857,54 +48809,6 @@ def test_generic_resource_reference_deleted_serialization(self): assert generic_resource_reference_deleted_model_json2 == generic_resource_reference_deleted_model_json -class TestModel_GetVpcRouteResponse: - """ - Test Class for GetVpcRouteResponse - """ - - def test_get_vpc_route_response_serialization(self): - """ - Test serialization/deserialization for GetVpcRouteResponse - """ - - # Construct dict forms of any model objects needed in order to build this model. - - route_next_hop_model = {} # RouteNextHopIP - route_next_hop_model['address'] = '192.168.3.4' - - zone_reference_model = {} # ZoneReference - zone_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1' - zone_reference_model['name'] = 'us-south-1' - - # Construct a json representation of a GetVpcRouteResponse model - get_vpc_route_response_model_json = {} - get_vpc_route_response_model_json['action'] = 'delegate' - get_vpc_route_response_model_json['created_at'] = '2019-01-01T12:00:00Z' - get_vpc_route_response_model_json['destination'] = '192.168.3.0/24' - get_vpc_route_response_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531' - get_vpc_route_response_model_json['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531' - get_vpc_route_response_model_json['lifecycle_state'] = 'stable' - get_vpc_route_response_model_json['name'] = 'my-route-1' - get_vpc_route_response_model_json['next_hop'] = route_next_hop_model - get_vpc_route_response_model_json['priority'] = 1 - get_vpc_route_response_model_json['zone'] = zone_reference_model - - # Construct a model instance of GetVpcRouteResponse by calling from_dict on the json representation - get_vpc_route_response_model = GetVpcRouteResponse.from_dict(get_vpc_route_response_model_json) - assert get_vpc_route_response_model != False - - # Construct a model instance of GetVpcRouteResponse by calling from_dict on the json representation - get_vpc_route_response_model_dict = GetVpcRouteResponse.from_dict(get_vpc_route_response_model_json).__dict__ - get_vpc_route_response_model2 = GetVpcRouteResponse(**get_vpc_route_response_model_dict) - - # Verify the model instances are equivalent - assert get_vpc_route_response_model == get_vpc_route_response_model2 - - # Convert model instance back to dict and verify no loss of data - get_vpc_route_response_model_json2 = get_vpc_route_response_model.to_dict() - assert get_vpc_route_response_model_json2 == get_vpc_route_response_model_json - - class TestModel_IKEPolicy: """ Test Class for IKEPolicy @@ -63376,54 +63280,6 @@ def test_trusted_profile_reference_serialization(self): assert trusted_profile_reference_model_json2 == trusted_profile_reference_model_json -class TestModel_UpdateVpcRouteResponse: - """ - Test Class for UpdateVpcRouteResponse - """ - - def test_update_vpc_route_response_serialization(self): - """ - Test serialization/deserialization for UpdateVpcRouteResponse - """ - - # Construct dict forms of any model objects needed in order to build this model. - - route_next_hop_model = {} # RouteNextHopIP - route_next_hop_model['address'] = '192.168.3.4' - - zone_reference_model = {} # ZoneReference - zone_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1' - zone_reference_model['name'] = 'us-south-1' - - # Construct a json representation of a UpdateVpcRouteResponse model - update_vpc_route_response_model_json = {} - update_vpc_route_response_model_json['action'] = 'delegate' - update_vpc_route_response_model_json['created_at'] = '2019-01-01T12:00:00Z' - update_vpc_route_response_model_json['destination'] = '192.168.3.0/24' - update_vpc_route_response_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531' - update_vpc_route_response_model_json['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531' - update_vpc_route_response_model_json['lifecycle_state'] = 'stable' - update_vpc_route_response_model_json['name'] = 'my-route-1' - update_vpc_route_response_model_json['next_hop'] = route_next_hop_model - update_vpc_route_response_model_json['priority'] = 1 - update_vpc_route_response_model_json['zone'] = zone_reference_model - - # Construct a model instance of UpdateVpcRouteResponse by calling from_dict on the json representation - update_vpc_route_response_model = UpdateVpcRouteResponse.from_dict(update_vpc_route_response_model_json) - assert update_vpc_route_response_model != False - - # Construct a model instance of UpdateVpcRouteResponse by calling from_dict on the json representation - update_vpc_route_response_model_dict = UpdateVpcRouteResponse.from_dict(update_vpc_route_response_model_json).__dict__ - update_vpc_route_response_model2 = UpdateVpcRouteResponse(**update_vpc_route_response_model_dict) - - # Verify the model instances are equivalent - assert update_vpc_route_response_model == update_vpc_route_response_model2 - - # Convert model instance back to dict and verify no loss of data - update_vpc_route_response_model_json2 = update_vpc_route_response_model.to_dict() - assert update_vpc_route_response_model_json2 == update_vpc_route_response_model_json - - class TestModel_VCPU: """ Test Class for VCPU @@ -68922,7 +68778,7 @@ def test_bare_metal_server_network_interface_prototype_bare_metal_server_network bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_pci_prototype_model_json['primary_ip'] = network_interface_ip_prototype_model bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_pci_prototype_model_json['security_groups'] = [security_group_identity_model] bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_pci_prototype_model_json['subnet'] = subnet_identity_model - bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_pci_prototype_model_json['allowed_vlans'] = [4] + bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_pci_prototype_model_json['allowed_vlans'] = [] bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_pci_prototype_model_json['interface_type'] = 'pci' # Construct a model instance of BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype by calling from_dict on the json representation @@ -69876,96 +69732,6 @@ def test_bare_metal_server_profile_network_interface_count_range_serialization(s assert bare_metal_server_profile_network_interface_count_range_model_json2 == bare_metal_server_profile_network_interface_count_range_model_json -class TestModel_BareMetalServerPrototypeVpcVPCIdentityByCRN: - """ - Test Class for BareMetalServerPrototypeVpcVPCIdentityByCRN - """ - - def test_bare_metal_server_prototype_vpc_vpc_identity_by_crn_serialization(self): - """ - Test serialization/deserialization for BareMetalServerPrototypeVpcVPCIdentityByCRN - """ - - # Construct a json representation of a BareMetalServerPrototypeVpcVPCIdentityByCRN model - bare_metal_server_prototype_vpc_vpc_identity_by_crn_model_json = {} - bare_metal_server_prototype_vpc_vpc_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b' - - # Construct a model instance of BareMetalServerPrototypeVpcVPCIdentityByCRN by calling from_dict on the json representation - bare_metal_server_prototype_vpc_vpc_identity_by_crn_model = BareMetalServerPrototypeVpcVPCIdentityByCRN.from_dict(bare_metal_server_prototype_vpc_vpc_identity_by_crn_model_json) - assert bare_metal_server_prototype_vpc_vpc_identity_by_crn_model != False - - # Construct a model instance of BareMetalServerPrototypeVpcVPCIdentityByCRN by calling from_dict on the json representation - bare_metal_server_prototype_vpc_vpc_identity_by_crn_model_dict = BareMetalServerPrototypeVpcVPCIdentityByCRN.from_dict(bare_metal_server_prototype_vpc_vpc_identity_by_crn_model_json).__dict__ - bare_metal_server_prototype_vpc_vpc_identity_by_crn_model2 = BareMetalServerPrototypeVpcVPCIdentityByCRN(**bare_metal_server_prototype_vpc_vpc_identity_by_crn_model_dict) - - # Verify the model instances are equivalent - assert bare_metal_server_prototype_vpc_vpc_identity_by_crn_model == bare_metal_server_prototype_vpc_vpc_identity_by_crn_model2 - - # Convert model instance back to dict and verify no loss of data - bare_metal_server_prototype_vpc_vpc_identity_by_crn_model_json2 = bare_metal_server_prototype_vpc_vpc_identity_by_crn_model.to_dict() - assert bare_metal_server_prototype_vpc_vpc_identity_by_crn_model_json2 == bare_metal_server_prototype_vpc_vpc_identity_by_crn_model_json - - -class TestModel_BareMetalServerPrototypeVpcVPCIdentityByHref: - """ - Test Class for BareMetalServerPrototypeVpcVPCIdentityByHref - """ - - def test_bare_metal_server_prototype_vpc_vpc_identity_by_href_serialization(self): - """ - Test serialization/deserialization for BareMetalServerPrototypeVpcVPCIdentityByHref - """ - - # Construct a json representation of a BareMetalServerPrototypeVpcVPCIdentityByHref model - bare_metal_server_prototype_vpc_vpc_identity_by_href_model_json = {} - bare_metal_server_prototype_vpc_vpc_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b' - - # Construct a model instance of BareMetalServerPrototypeVpcVPCIdentityByHref by calling from_dict on the json representation - bare_metal_server_prototype_vpc_vpc_identity_by_href_model = BareMetalServerPrototypeVpcVPCIdentityByHref.from_dict(bare_metal_server_prototype_vpc_vpc_identity_by_href_model_json) - assert bare_metal_server_prototype_vpc_vpc_identity_by_href_model != False - - # Construct a model instance of BareMetalServerPrototypeVpcVPCIdentityByHref by calling from_dict on the json representation - bare_metal_server_prototype_vpc_vpc_identity_by_href_model_dict = BareMetalServerPrototypeVpcVPCIdentityByHref.from_dict(bare_metal_server_prototype_vpc_vpc_identity_by_href_model_json).__dict__ - bare_metal_server_prototype_vpc_vpc_identity_by_href_model2 = BareMetalServerPrototypeVpcVPCIdentityByHref(**bare_metal_server_prototype_vpc_vpc_identity_by_href_model_dict) - - # Verify the model instances are equivalent - assert bare_metal_server_prototype_vpc_vpc_identity_by_href_model == bare_metal_server_prototype_vpc_vpc_identity_by_href_model2 - - # Convert model instance back to dict and verify no loss of data - bare_metal_server_prototype_vpc_vpc_identity_by_href_model_json2 = bare_metal_server_prototype_vpc_vpc_identity_by_href_model.to_dict() - assert bare_metal_server_prototype_vpc_vpc_identity_by_href_model_json2 == bare_metal_server_prototype_vpc_vpc_identity_by_href_model_json - - -class TestModel_BareMetalServerPrototypeVpcVPCIdentityById: - """ - Test Class for BareMetalServerPrototypeVpcVPCIdentityById - """ - - def test_bare_metal_server_prototype_vpc_vpc_identity_by_id_serialization(self): - """ - Test serialization/deserialization for BareMetalServerPrototypeVpcVPCIdentityById - """ - - # Construct a json representation of a BareMetalServerPrototypeVpcVPCIdentityById model - bare_metal_server_prototype_vpc_vpc_identity_by_id_model_json = {} - bare_metal_server_prototype_vpc_vpc_identity_by_id_model_json['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b' - - # Construct a model instance of BareMetalServerPrototypeVpcVPCIdentityById by calling from_dict on the json representation - bare_metal_server_prototype_vpc_vpc_identity_by_id_model = BareMetalServerPrototypeVpcVPCIdentityById.from_dict(bare_metal_server_prototype_vpc_vpc_identity_by_id_model_json) - assert bare_metal_server_prototype_vpc_vpc_identity_by_id_model != False - - # Construct a model instance of BareMetalServerPrototypeVpcVPCIdentityById by calling from_dict on the json representation - bare_metal_server_prototype_vpc_vpc_identity_by_id_model_dict = BareMetalServerPrototypeVpcVPCIdentityById.from_dict(bare_metal_server_prototype_vpc_vpc_identity_by_id_model_json).__dict__ - bare_metal_server_prototype_vpc_vpc_identity_by_id_model2 = BareMetalServerPrototypeVpcVPCIdentityById(**bare_metal_server_prototype_vpc_vpc_identity_by_id_model_dict) - - # Verify the model instances are equivalent - assert bare_metal_server_prototype_vpc_vpc_identity_by_id_model == bare_metal_server_prototype_vpc_vpc_identity_by_id_model2 - - # Convert model instance back to dict and verify no loss of data - bare_metal_server_prototype_vpc_vpc_identity_by_id_model_json2 = bare_metal_server_prototype_vpc_vpc_identity_by_id_model.to_dict() - assert bare_metal_server_prototype_vpc_vpc_identity_by_id_model_json2 == bare_metal_server_prototype_vpc_vpc_identity_by_id_model_json - - class TestModel_CatalogOfferingIdentityCatalogOfferingByCRN: """ Test Class for CatalogOfferingIdentityCatalogOfferingByCRN