Skip to content

Commit

Permalink
update model changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ramrutha497 committed Apr 16, 2024
1 parent f756c8c commit f26da86
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 45 deletions.
5 changes: 3 additions & 2 deletions spotinst_sdk2/clients/ocean/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
68 changes: 25 additions & 43 deletions spotinst_sdk2/models/ocean/gcp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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,
):
Expand All @@ -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__(
Expand All @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -785,7 +767,7 @@ class VNGScheduling:
"""
def __init__(
self,
tasks: VNGTasks):
tasks: List[VNGTasks]):
self.tasks = tasks


Expand Down Expand Up @@ -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
Expand All @@ -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,
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -967,15 +949,15 @@ 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,
controller_cluster_id: str = none,
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
Expand Down

0 comments on commit f26da86

Please sign in to comment.