From f26da8641565dbac7b9b2ad8f1e68c85f46c3b4f Mon Sep 17 00:00:00 2001 From: Amrutha Ramanathan <105342664+ramrutha497@users.noreply.github.com> Date: Wed, 17 Apr 2024 02:55:03 +0530 Subject: [PATCH] update model changes --- spotinst_sdk2/clients/ocean/__init__.py | 5 +- spotinst_sdk2/models/ocean/gcp/__init__.py | 68 ++++++++-------------- 2 files changed, 28 insertions(+), 45 deletions(-) diff --git a/spotinst_sdk2/clients/ocean/__init__.py b/spotinst_sdk2/clients/ocean/__init__.py index 5974a9a1..43208611 100644 --- a/spotinst_sdk2/clients/ocean/__init__.py +++ b/spotinst_sdk2/clients/ocean/__init__.py @@ -2279,8 +2279,9 @@ def update_elastigroup_to_ocean(self, group_id: str): return formatted_response["response"]["items"][0] - def import_gke_cluster_to_ocean(self, cluster_name: str, include_launchSpecs: bool, location: str, - node_pool_name: str, import_gke_to_ocean: gcp_ocean.ImportGkeClusterToOcean): + def import_gke_cluster_to_ocean(self, cluster_name: str, location: str, + import_gke_to_ocean: gcp_ocean.ImportGkeClusterToOcean, + include_launchSpecs: bool = None, node_pool_name: str = None): """ Create an Ocean configuration according to an GKE Cluster configuration. diff --git a/spotinst_sdk2/models/ocean/gcp/__init__.py b/spotinst_sdk2/models/ocean/gcp/__init__.py index 077a4503..2bbdd90f 100644 --- a/spotinst_sdk2/models/ocean/gcp/__init__.py +++ b/spotinst_sdk2/models/ocean/gcp/__init__.py @@ -48,16 +48,16 @@ class ResourceLimits: """ # Arguments max_memory_gib: int - max_vcpu: int + max_v_cpu: int """ def __init__( self, max_memory_gib: int = none, - max_vcpu: int = none + max_v_cpu: int = none ): self.max_memory_gib = max_memory_gib - self.max_vcpu = max_vcpu + self.max_v_cpu = max_v_cpu class AutoScaler: @@ -297,15 +297,15 @@ def __init__( class NetworkInterfaces: """ # Arguments - access_configs: AccessConfigs - alias_ip_ranges: AliasIpRanges + access_configs: List[AccessConfigs] + alias_ip_ranges: List[AliasIpRanges] network: str project_id: str """ def __init__( self, - access_configs: AccessConfigs = none, - alias_ip_ranges: AliasIpRanges = none, + access_configs: List[AccessConfigs] = none, + alias_ip_ranges: List[AliasIpRanges] = none, network: str = none, project_id: str = none, ): @@ -322,7 +322,7 @@ class Compute: backend_services: BackendServices instance_types: InstanceTypes launch_specification: LaunchSpecification - network_interfaces: NetworkInterfaces + network_interfaces: List(NetworkInterfaces) subnet_name: str """ def __init__( @@ -331,7 +331,7 @@ def __init__( backend_services: BackendServices = none, instance_types: InstanceTypes = none, launch_specification: LaunchSpecification = none, - network_interfaces: NetworkInterfaces = none, + network_interfaces: List[NetworkInterfaces] = none, subnet_name: str = none ): self.availability_zones = availability_zones @@ -602,13 +602,13 @@ def toJSON(self): class AllMatch: """ # Arguments - all_matches: List[Attribute] + all_match: List[Attribute] """ def __init__( self, - all_matches: List[Attribute] = none): - self.all_matches = all_matches + all_match: List[Attribute] = none): + self.all_match = all_match class Conditions: @@ -711,35 +711,17 @@ class AutoScale: # Arguments auto_headroom_percentage: int headrooms: List[Headroom] + down: Down """ def __init__( self, auto_headroom_percentage: int = none, - headrooms: List[Headroom] = none + headrooms: List[Headroom] = none, + down: Down = none ): self.auto_headroom_percentage = auto_headroom_percentage self.headrooms = headrooms - - -class VNGNetworkInterfaces: - """ - # Arguments - access_configs: AccessConfigs - alias_ip_ranges: AliasIpRanges - network: str - project_id: str - """ - def __init__( - self, - access_configs: List[AccessConfigs] = none, - alias_ip_ranges: List[AliasIpRanges] = none, - network: str = none, - project_id: str = none, - ): - self.access_configs = access_configs - self.alias_ip_ranges = alias_ip_ranges - self.network = network - self.project_id = project_id + self.down = down class VNGResourceLimits: @@ -785,7 +767,7 @@ class VNGScheduling: """ def __init__( self, - tasks: VNGTasks): + tasks: List[VNGTasks]): self.tasks = tasks @@ -839,9 +821,9 @@ class VirtualNodeGroup: labels: List[Labels] metadata: List[Metadata] name: str - network_interfaces: List[VNGNetworkInterfaces] + network_interfaces: List[NetworkInterfaces] ocean_id: str - resourceLimits: ResourceLimits + resource_limits: ResourceLimits restrict_scale_down: bool root_volume_size: int root_volume_type: str @@ -862,9 +844,9 @@ def __init__( labels: List[Labels] = none, metadata: List[Metadata] = none, name: str = none, - network_interfaces: List[VNGNetworkInterfaces] = none, + network_interfaces: List[NetworkInterfaces] = none, ocean_id: str = none, - resourceLimits: VNGResourceLimits = none, + resource_limits: VNGResourceLimits = none, restrict_scale_down: bool = none, root_volume_size: int = none, root_volume_type: str = none, @@ -885,7 +867,7 @@ def __init__( self.name = name self.network_interfaces = network_interfaces self.ocean_id = ocean_id - self.resourceLimits = resourceLimits + self.resource_limits = resource_limits self.restrict_scale_down = restrict_scale_down self.root_volume_size = root_volume_size self.root_volume_type = root_volume_type @@ -957,7 +939,7 @@ def toJSON(self): class ImportGkeClusterToOcean: """ # Arguments - autoScaler: AutoScaler + auto_scaler: AutoScaler availability_zones: List[str] backend_services: List[BackendServices] capacity: Capacity @@ -967,7 +949,7 @@ class ImportGkeClusterToOcean: """ def __init__( self, - autoScaler: AutoScaler = none, + auto_scaler: AutoScaler = none, availability_zones: List[str] = none, backend_services: List[BackendServices] = none, capacity: Capacity = none, @@ -975,7 +957,7 @@ def __init__( instance_types: InstanceTypes = none, name: str = none ): - self.autoScaler = autoScaler + self.auto_scaler = auto_scaler self.availability_zones = availability_zones self.backend_services = backend_services self.capacity = capacity