Skip to content

Commit

Permalink
feat: add UpdateAwsHybridMachinePool and DeleteAwsHybridMachinePool f…
Browse files Browse the repository at this point in the history
…uncs
  • Loading branch information
ahmad-ibra committed Dec 6, 2024
1 parent cffd326 commit 8577b3a
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions client/hybrid.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,32 @@ func (h *V1Client) PutAwsHybridConfig(configUID string, hybridConfig *models.V1A
}

// CreateAwsHybridMachinePool creates a Hybrid AWS cloud config's Edge-Native machine pool
func (h *V1Client) CreateAwsHybridMachinePool(configUID string, machinePool *models.V1HybridEdgeNativeMachinePoolConfigEntity) error {
func (h *V1Client) CreateAwsHybridMachinePool(configUID string, machinePoolConfig *models.V1HybridEdgeNativeMachinePoolConfigEntity) error {
params := clientv1.NewV1AwsCloudConfigsEdgeNativeUIDMachinePoolCreateParamsWithContext(h.ctx).
WithBody(machinePool).
WithBody(machinePoolConfig).
WithConfigUID(configUID)

_, err := h.Client.V1AwsCloudConfigsEdgeNativeUIDMachinePoolCreate(params)
return err
}

// UpdateAwsHybridMachinePool updates the specified Hybrid AWS cluster cloud config's Edge-Native machine pool
func (h *V1Client) UpdateAwsHybridMachinePool(configUID, machinePoolName string, machinePoolConfig *models.V1HybridEdgeNativeMachinePoolConfigUpdateEntity) error {
params := clientv1.NewV1AwsCloudConfigsEdgeNativeMachinePoolUpdateParamsWithContext(h.ctx).
WithBody(machinePoolConfig).
WithMachinePoolName(machinePoolName).
WithConfigUID(configUID)

_, err := h.Client.V1AwsCloudConfigsEdgeNativeMachinePoolUpdate(params)
return err
}

// DeleteAwsHybridMachinePool deletes the specified Edge-Native machine pool of hybrid AWS cluster
func (h *V1Client) DeleteAwsHybridMachinePool(configUID, machinePoolName string) error {
params := clientv1.NewV1AwsCloudConfigsEdgeNativeMachinePoolDeleteParamsWithContext(h.ctx).
WithMachinePoolName(machinePoolName).
WithConfigUID(configUID)

_, err := h.Client.V1AwsCloudConfigsEdgeNativeMachinePoolDelete(params)
return err
}

0 comments on commit 8577b3a

Please sign in to comment.