Skip to content

Commit

Permalink
Added support for healthCheckUnhealthyDurationBeforeReplacement und…
Browse files Browse the repository at this point in the history
…er launchSpecification. (#286)
  • Loading branch information
sharadkesarwani authored Mar 18, 2024
1 parent 8172ada commit fdb3473
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 17 deletions.
1 change: 1 addition & 0 deletions examples/service/ocean/providers/aws/create/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ func main() {
ImageID: spotinst.String("ami-12345"),
Monitoring: spotinst.Bool(false),
SecurityGroupIDs: []string{"sg-foo"},
HealthCheckUnhealthyDurationBeforeReplacement: spotinst.Int(180),
BlockDeviceMappings: []*aws.ClusterBlockDeviceMappings{
&aws.ClusterBlockDeviceMappings{
DeviceName: spotinst.String("/dev/sdf"),
Expand Down
3 changes: 3 additions & 0 deletions examples/service/ocean/providers/aws/update/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ func main() {
Categories: []string{"General_purpose", "Compute_optimized"},
},
},
LaunchSpecification: &aws.LaunchSpecification{
HealthCheckUnhealthyDurationBeforeReplacement: spotinst.Int(60),
},
},
},
})
Expand Down
42 changes: 25 additions & 17 deletions service/ocean/providers/aws/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,23 +201,24 @@ type Filters struct {
}

type LaunchSpecification struct {
AssociatePublicIPAddress *bool `json:"associatePublicIpAddress,omitempty"`
AssociateIPv6Address *bool `json:"associateIpv6Address,omitempty"`
SecurityGroupIDs []string `json:"securityGroupIds,omitempty"`
ImageID *string `json:"imageId,omitempty"`
KeyPair *string `json:"keyPair,omitempty"`
UserData *string `json:"userData,omitempty"`
IAMInstanceProfile *IAMInstanceProfile `json:"iamInstanceProfile,omitempty"`
Tags []*Tag `json:"tags,omitempty"`
LoadBalancers []*LoadBalancer `json:"loadBalancers,omitempty"`
RootVolumeSize *int `json:"rootVolumeSize,omitempty"`
Monitoring *bool `json:"monitoring,omitempty"`
EBSOptimized *bool `json:"ebsOptimized,omitempty"`
UseAsTemplateOnly *bool `json:"useAsTemplateOnly,omitempty"`
InstanceMetadataOptions *InstanceMetadataOptions `json:"instanceMetadataOptions,omitempty"`
BlockDeviceMappings []*ClusterBlockDeviceMappings `json:"blockDeviceMappings,omitempty"`
LaunchSpecScheduling *LaunchSpecScheduling `json:"scheduling,omitempty"`
ResourceTagSpecification *ResourceTagSpecification `json:"resourceTagSpecification,omitempty"`
AssociatePublicIPAddress *bool `json:"associatePublicIpAddress,omitempty"`
AssociateIPv6Address *bool `json:"associateIpv6Address,omitempty"`
SecurityGroupIDs []string `json:"securityGroupIds,omitempty"`
ImageID *string `json:"imageId,omitempty"`
KeyPair *string `json:"keyPair,omitempty"`
UserData *string `json:"userData,omitempty"`
IAMInstanceProfile *IAMInstanceProfile `json:"iamInstanceProfile,omitempty"`
Tags []*Tag `json:"tags,omitempty"`
LoadBalancers []*LoadBalancer `json:"loadBalancers,omitempty"`
RootVolumeSize *int `json:"rootVolumeSize,omitempty"`
HealthCheckUnhealthyDurationBeforeReplacement *int `json:"healthCheckUnhealthyDurationBeforeReplacement,omitempty"`
Monitoring *bool `json:"monitoring,omitempty"`
EBSOptimized *bool `json:"ebsOptimized,omitempty"`
UseAsTemplateOnly *bool `json:"useAsTemplateOnly,omitempty"`
InstanceMetadataOptions *InstanceMetadataOptions `json:"instanceMetadataOptions,omitempty"`
BlockDeviceMappings []*ClusterBlockDeviceMappings `json:"blockDeviceMappings,omitempty"`
LaunchSpecScheduling *LaunchSpecScheduling `json:"scheduling,omitempty"`
ResourceTagSpecification *ResourceTagSpecification `json:"resourceTagSpecification,omitempty"`

forceSendFields []string
nullFields []string
Expand Down Expand Up @@ -1683,6 +1684,13 @@ func (o *LaunchSpecification) SetResourceTagSpecification(v *ResourceTagSpecific
return o
}

func (o *LaunchSpecification) SetHealthCheckUnhealthyDurationBeforeReplacement(v *int) *LaunchSpecification {
if o.HealthCheckUnhealthyDurationBeforeReplacement = v; o.HealthCheckUnhealthyDurationBeforeReplacement == nil {
o.nullFields = append(o.nullFields, "HealthCheckUnhealthyDurationBeforeReplacement")
}
return o
}

// endregion

// region LoadBalancer
Expand Down

0 comments on commit fdb3473

Please sign in to comment.