Skip to content

Commit

Permalink
PLT-1439:Add support for node deletion and get machine lists
Browse files Browse the repository at this point in the history
Signed-off-by: Sivaanand Murugesan <[email protected]>
  • Loading branch information
SivaanandM committed Oct 18, 2024
1 parent 1c111ac commit a924c89
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions client/node_actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,3 +223,40 @@ func (h *V1Client) GetNodeMaintenanceStatusVsphere(configUID, machineName, nodeI
}
return resp.Payload.Status.MaintenanceStatus, nil
}

// GetNodeListInEdgeNativeMachinePool retrieves machine in the edge-native machine pool
func (h *V1Client) GetNodeListInEdgeNativeMachinePool(configUID, machineName string) (*models.V1EdgeNativeMachines, error) {
params := clientv1.NewV1CloudConfigsEdgeNativePoolMachinesListParamsWithContext(h.ctx).
WithConfigUID(configUID).
WithMachinePoolName(machineName)
resp, err := h.Client.V1CloudConfigsEdgeNativePoolMachinesList(params)
if err != nil {
return nil, err
}
return resp.Payload, nil
}

// GetNodeInEdgeNativeMachinePool retrieves specific machine in the edge-native machine pool.
func (h *V1Client) GetNodeInEdgeNativeMachinePool(configUID, machineName, machineID string) (*models.V1EdgeNativeMachine, error) {
params := clientv1.NewV1CloudConfigsEdgeNativePoolMachinesUIDGetParamsWithContext(h.ctx).
WithConfigUID(configUID).
WithMachinePoolName(machineName).WithMachineUID(machineID)
resp, err := h.Client.V1CloudConfigsEdgeNativePoolMachinesUIDGet(params)
if err != nil {
return nil, err
}
return resp.Payload, nil
}

// DeleteNodeInEdgeNativeMachinePool delete the specific node in the edge-native machine pool
func (h *V1Client) DeleteNodeInEdgeNativeMachinePool(configUID, machineName, machineID string) error {
params := clientv1.NewV1CloudConfigsEdgeNativePoolMachinesUIDDeleteParamsWithContext(h.ctx).
WithConfigUID(configUID).
WithMachinePoolName(machineName).
WithMachineUID(machineID)
_, err := h.Client.V1CloudConfigsEdgeNativePoolMachinesUIDDelete(params)
if err != nil {
return err
}
return nil
}

0 comments on commit a924c89

Please sign in to comment.