diff --git a/client/cluster_edge.go.defer b/client/cluster_edge.go.defer deleted file mode 100644 index 85d919d4..00000000 --- a/client/cluster_edge.go.defer +++ /dev/null @@ -1,71 +0,0 @@ -package client - -import ( - clientV1 "github.com/spectrocloud/palette-api-go/client/v1" - "github.com/spectrocloud/palette-api-go/models" - "github.com/spectrocloud/palette-sdk-go/client/apiutil" -) - -func (h *V1Client) CreateClusterEdge(cluster *models.V1SpectroEdgeClusterEntity) (string, error) { - params := clientV1.NewV1SpectroClustersEdgeCreateParamsWithContext(h.ctx). - WithBody(cluster) - resp, err := h.Client.V1SpectroClustersEdgeCreate(params) - if err != nil { - return "", err - } - return *resp.Payload.UID, nil -} - -func (h *V1Client) CreateMachinePoolEdge(cloudConfigUid string, machinePool *models.V1EdgeMachinePoolConfigEntity) error { - params := clientV1.NewV1CloudConfigsEdgeMachinePoolCreateParamsWithContext(h.ctx). - WithConfigUID(cloudConfigUid). - WithBody(machinePool) - _, err := h.Client.V1CloudConfigsEdgeMachinePoolCreate(params) - return err -} - -func (h *V1Client) UpdateMachinePoolEdge(cloudConfigUid string, machinePool *models.V1EdgeMachinePoolConfigEntity) error { - params := clientV1.NewV1CloudConfigsEdgeMachinePoolUpdateParamsWithContext(h.ctx). - WithConfigUID(cloudConfigUid). - WithMachinePoolName(*machinePool.PoolConfig.Name). - WithBody(machinePool) - _, err := h.Client.V1CloudConfigsEdgeMachinePoolUpdate(params) - return err -} - -func (h *V1Client) DeleteMachinePoolEdge(cloudConfigUid, machinePoolName string) error { - params := clientV1.NewV1CloudConfigsEdgeMachinePoolDeleteParamsWithContext(h.ctx). - WithConfigUID(cloudConfigUid). - WithMachinePoolName(machinePoolName) - _, err := h.Client.V1CloudConfigsEdgeMachinePoolDelete(params) - return err -} - -func (h *V1Client) GetCloudConfigEdge(configUid string) (*models.V1EdgeCloudConfig, error) { - params := clientV1.NewV1CloudConfigsEdgeGetParamsWithContext(h.ctx). - WithConfigUID(configUid) - resp, err := h.Client.V1CloudConfigsEdgeGet(params) - if apiutil.Is404(err) { - return nil, nil - } else if err != nil { - return nil, err - } - return resp.Payload, nil -} - -func (h *V1Client) GetNodeStatusMapEdge(configUid, machinePoolName string) (map[string]models.V1CloudMachineStatus, error) { - params := clientV1.NewV1CloudConfigsEdgePoolMachinesListParamsWithContext(h.ctx). - WithConfigUID(configUid). - WithMachinePoolName(machinePoolName) - mpList, err := h.Client.V1CloudConfigsEdgePoolMachinesList(params) - if err != nil { - return nil, err - } - nMap := map[string]models.V1CloudMachineStatus{} - if len(mpList.Payload.Items) > 0 { - for _, node := range mpList.Payload.Items { - nMap[node.Metadata.UID] = *node.Status - } - } - return nMap, nil -} diff --git a/client/node_actions.go b/client/node_actions.go index 1ddae4a3..7a2eafd7 100644 --- a/client/node_actions.go +++ b/client/node_actions.go @@ -75,19 +75,6 @@ func (h *V1Client) GetNodeMaintenanceStatusAzure(configUid, machineName, nodeId return resp.Payload.Status.MaintenanceStatus, nil } -//func (h *V1Client) GetNodeMaintenanceStatusCoxEdge(configUid, machineName, nodeId string) (*models.V1MachineMaintenanceStatus, error) { -// params := clientV1.NewV1CloudConfigsCoxEdgePoolMachinesUIDGetParamsWithContext(h.ctx). -// WithConfigUID(configUid). -// WithMachinePoolName(machineName). -// WithMachineUID(nodeId) -// -// resp, err := h.Client.V1CloudConfigsCoxEdgePoolMachinesUIDGet(params) -// if err != nil { -// return nil, err -// } -// return resp.Payload.Status.MaintenanceStatus, nil -//} - func (h *V1Client) GetNodeMaintenanceStatusEdgeNative(configUid, machineName, nodeId string) (*models.V1MachineMaintenanceStatus, error) { params := clientV1.NewV1CloudConfigsEdgeNativePoolMachinesUIDGetParamsWithContext(h.ctx). WithConfigUID(configUid). @@ -101,19 +88,6 @@ func (h *V1Client) GetNodeMaintenanceStatusEdgeNative(configUid, machineName, no return resp.Payload.Status.MaintenanceStatus, nil } -//func (h *V1Client) GetNodeMaintenanceStatusEdge(configUid, machineName, nodeId string) (*models.V1MachineMaintenanceStatus, error) { -// params := clientV1.NewV1CloudConfigsEdgePoolMachinesUIDGetParamsWithContext(h.ctx). -// WithConfigUID(configUid). -// WithMachinePoolName(machineName). -// WithMachineUID(nodeId) -// -// resp, err := h.Client.V1CloudConfigsEdgePoolMachinesUIDGet(params) -// if err != nil { -// return nil, err -// } -// return resp.Payload.Status.MaintenanceStatus, nil -//} - func (h *V1Client) GetNodeMaintenanceStatusEdgeVsphere(configUid, machineName, nodeId string) (*models.V1MachineMaintenanceStatus, error) { params := clientV1.NewV1CloudConfigsVspherePoolMachinesUIDGetParamsWithContext(h.ctx). WithConfigUID(configUid).