Documentation ¶
Index ¶
- Constants
- func ResourceGroupIdFromNodePool(nodepool *hwmgmtv1alpha1.NodePool) string
- type HardwareManagerClient
- func (c *HardwareManagerClient) CheckResourceGroupRequest(ctx context.Context, jobId string) (*hwmgrapi.RhprotoJobStatus, error)
- func (c *HardwareManagerClient) CreateResourceGroup(ctx context.Context, nodepool *hwmgmtv1alpha1.NodePool) (string, error)
- func (c *HardwareManagerClient) DeleteResourceGroup(ctx context.Context, nodepool *hwmgmtv1alpha1.NodePool) (string, error)
- func (c *HardwareManagerClient) GetResourceGroup(ctx context.Context, nodepool *hwmgmtv1alpha1.NodePool) (*hwmgrapi.RhprotoResourceGroupObjectGetResponseBody, error)
- func (c *HardwareManagerClient) GetResourcePools(ctx context.Context) (*hwmgrapi.ApiprotoResourcePoolsResp, error)
- func (c *HardwareManagerClient) GetSecret(ctx context.Context, secretKey string) (*hwmgrapi.RhprotoGetSecretsResponseBody, error)
- func (c *HardwareManagerClient) GetTenant() string
- func (c *HardwareManagerClient) GetToken(ctx context.Context) (string, error)
- func (c *HardwareManagerClient) ResourceGroupFromNodePool(nodepool *hwmgmtv1alpha1.NodePool) *hwmgrapi.CreateResourceGroupJSONRequestBody
Constants ¶
const ( RoleKey = "role" DefaultTenant = "default_tenant" )
Variables ¶
This section is empty.
Functions ¶
func ResourceGroupIdFromNodePool ¶
func ResourceGroupIdFromNodePool(nodepool *hwmgmtv1alpha1.NodePool) string
ResourceGroupIdFromNodePool returns the resource group identifier corresponding to the specified nodepool
Types ¶
type HardwareManagerClient ¶
type HardwareManagerClient struct { HwmgrClient *hwmgrapi.ClientWithResponses Logger *slog.Logger Namespace string // contains filtered or unexported fields }
HardwareManagerClient provides functions for calling the hardware manager APIs
func NewClientWithResponses ¶
func NewClientWithResponses( ctx context.Context, logger *slog.Logger, rtclient client.Client, hwmgr *pluginv1alpha1.HardwareManager) (*HardwareManagerClient, error)
NewClientWithResponses creates an authenticated client connected to the hardware manager
func (*HardwareManagerClient) CheckResourceGroupRequest ¶
func (c *HardwareManagerClient) CheckResourceGroupRequest(ctx context.Context, jobId string) (*hwmgrapi.RhprotoJobStatus, error)
CheckResourceGroupRequest queries the hardware manager for the status of a job
func (*HardwareManagerClient) CreateResourceGroup ¶
func (c *HardwareManagerClient) CreateResourceGroup(ctx context.Context, nodepool *hwmgmtv1alpha1.NodePool) (string, error)
CreateResourceGroup sends a request to the hardware manager, returns a jobId TODO: Improve error handling for different status codes
func (*HardwareManagerClient) DeleteResourceGroup ¶
func (c *HardwareManagerClient) DeleteResourceGroup(ctx context.Context, nodepool *hwmgmtv1alpha1.NodePool) (string, error)
DeleteResourceGroup asks the hardware manager to delete the resource group associated with the specified nodepool
func (*HardwareManagerClient) GetResourceGroup ¶
func (c *HardwareManagerClient) GetResourceGroup(ctx context.Context, nodepool *hwmgmtv1alpha1.NodePool) (*hwmgrapi.RhprotoResourceGroupObjectGetResponseBody, error)
GetResourceGroup queries the hardware manager to get the resource group data
func (*HardwareManagerClient) GetResourcePools ¶
func (c *HardwareManagerClient) GetResourcePools(ctx context.Context) (*hwmgrapi.ApiprotoResourcePoolsResp, error)
GetResourceGroup queries the hardware manager to get the resource group data
func (*HardwareManagerClient) GetSecret ¶
func (c *HardwareManagerClient) GetSecret(ctx context.Context, secretKey string) (*hwmgrapi.RhprotoGetSecretsResponseBody, error)
GetResourceGroup queries the hardware manager to get the resource group data
func (*HardwareManagerClient) GetTenant ¶
func (c *HardwareManagerClient) GetTenant() string
GetTenant gets the tenant parameter from the hwmgr configuration
func (*HardwareManagerClient) GetToken ¶
func (c *HardwareManagerClient) GetToken(ctx context.Context) (string, error)
GetToken sends a request to the hardware manager to request an authentication token
func (*HardwareManagerClient) ResourceGroupFromNodePool ¶
func (c *HardwareManagerClient) ResourceGroupFromNodePool(nodepool *hwmgmtv1alpha1.NodePool) *hwmgrapi.CreateResourceGroupJSONRequestBody
ResourceGroupFromNodePool transforms data from a nodepool object to a CreateResourceGroupJSONRequestBody instance