Skip to content

Commit

Permalink
update gcp model
Browse files Browse the repository at this point in the history
  • Loading branch information
ramrutha497 committed Oct 15, 2024
1 parent 089b99e commit 28bc65c
Showing 1 changed file with 43 additions and 9 deletions.
52 changes: 43 additions & 9 deletions spotinst_sdk2/models/ocean/gcp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,22 +178,48 @@ def __init__(
self.scheme = scheme


class Filters:
"""
# Arguments
exclude_families: List[str]
include_families: List[str]
max_memory_gi_b: float
max_vcpu: int
min_memory_gi_b: float
min_vcpu: int
"""

def __init__(self,
exclude_families: List[str] = none,
include_families: List[str] = none,
max_memory_gi_b: float = none,
max_vcpu: int = none,
min_memory_gi_b: float = none,
min_vcpu: int = none):
self.exclude_families = exclude_families
self.include_families = include_families
self.max_memory_gi_b = max_memory_gi_b
self.max_vcpu = max_vcpu
self.min_memory_gi_b = min_memory_gi_b
self.min_vcpu = min_vcpu


class InstanceTypes:
"""
# Arguments
blacklist: List[str]
whitelist: List[str]
preferred_types: List[str]
filters: Filters
"""

def __init__(
self,
blacklist: List[str] = none,
whitelist: List[str] = none,
preferred_types: List[str] = none):
filters: Filters = none):
self.blacklist = blacklist
self.whitelist = whitelist
self.preferred_types = preferred_types
self.filters = filters


class Labels:
Expand Down Expand Up @@ -229,6 +255,7 @@ def __init__(
class RootVolumeType(Enum):
pd_standard = "pd-standard"
pd_ssd = "pd-ssd"
pd_balanced = "pd-balanced"


class ShieldedInstanceConfig:
Expand Down Expand Up @@ -517,17 +544,20 @@ class Strategy:
draining_timeout: int
preemptible_percentage: int
provisioning_model: ProvisioningModel
should_utilize_commitments: bool
"""

def __init__(
self,
draining_timeout: int = none,
preemptible_percentage: int = none,
provisioning_model: ProvisioningModel = none
provisioning_model: ProvisioningModel = none,
should_utilize_commitments: bool = none
):
self.draining_timeout = draining_timeout
self.preemptible_percentage = preemptible_percentage
self.provisioning_model = provisioning_model
self.should_utilize_commitments = should_utilize_commitments
# endregion


Expand Down Expand Up @@ -581,6 +611,7 @@ def toJSON(self):
# endregion


# RightSizingRecommendationFilter
class Type(Enum):
label = "label"
annotation = "annotation"
Expand Down Expand Up @@ -636,8 +667,10 @@ def __init__(self, filter: RightSizingRecommendationFilter = none):
def toJSON(self):
return json.dumps(self, default=lambda o: o.__dict__,
sort_keys=True, indent=4)
# endregion


# region AggregatedClusterCosts
class AllMatch:
"""
# Arguments
Expand Down Expand Up @@ -721,6 +754,7 @@ def __init__(self, aggregated_cluster_costs: AggregatedClusterCosts = none):
def toJSON(self):
return json.dumps(self, default=lambda o: o.__dict__,
sort_keys=True, indent=4)
# endregion


# region VirtualNodeGroup
Expand Down Expand Up @@ -853,8 +887,8 @@ class VirtualNodeGroup:
# Arguments
auto_scale: AutoScale
availability_zones: List[str]
filters: Filters
instance_types: List[str]
preferred_types: List[str]
labels: List[Labels]
metadata: List[Metadata]
name: str
Expand All @@ -863,7 +897,7 @@ class VirtualNodeGroup:
resource_limits: ResourceLimits
restrict_scale_down: bool
root_volume_size_in_gb: int
root_volume_type: str
root_volume_type: RootVolumeType
scheduling: Scheduling
service_account: str
shielded_instance_config: ShieldedInstanceConfig
Expand All @@ -879,7 +913,7 @@ def __init__(
auto_scale: AutoScale = none,
availability_zones: List[str] = none,
instance_types: List[str] = none,
preferred_types: List[str] = none,
filters: Filters = none,
labels: List[Labels] = none,
metadata: List[Metadata] = none,
name: str = none,
Expand All @@ -888,7 +922,7 @@ def __init__(
resource_limits: VNGResourceLimits = none,
restrict_scale_down: bool = none,
root_volume_size_in_gb: int = none,
root_volume_type: str = none,
root_volume_type: RootVolumeType = none,
scheduling: VNGScheduling = none,
service_account: str = none,
shielded_instance_config: ShieldedInstanceConfig = none,
Expand All @@ -901,7 +935,7 @@ def __init__(
self.auto_scale = auto_scale
self.availability_zones = availability_zones
self.instance_types = instance_types
self.preferred_types = preferred_types
self.filters = filters
self.labels = labels
self.metadata = metadata
self.name = name
Expand Down

0 comments on commit 28bc65c

Please sign in to comment.