wlm

package
v0.0.0-...-4fbc790 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 10, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package wlm contains types and functions to interact with WorkloadManager cloud APIs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitializeSQLServerValidation

func InitializeSQLServerValidation(projectID, instance string) *wlmngr.SqlserverValidation

InitializeSQLServerValidation initializes and returns SqlserverValidation.

func InitializeWriteInsightRequest

func InitializeWriteInsightRequest(sqlservervalidation *wlmngr.SqlserverValidation, instanceID string) *wlmngr.WriteInsightRequest

InitializeWriteInsightRequest initializes and returns WriteInsightRequest.

func UpdateValidationDetails

func UpdateValidationDetails(sqlservervalidation *wlmngr.SqlserverValidation, details []sqlserverutils.MetricDetails) *wlmngr.SqlserverValidation

UpdateValidationDetails update ValidationDetails in SqlserverValidation.

Types

type MockWlmService

type MockWlmService struct {
	MockError    bool
	MockHTTPCode int
	Request      *workloadmanager.WriteInsightRequest
}

MockWlmService mocks WorkloadManagerService for testing usage.

func (*MockWlmService) InitializeMockWriteInsightRequest

func (m *MockWlmService) InitializeMockWriteInsightRequest() *workloadmanager.WriteInsightRequest

InitializeMockWriteInsightRequest mock function.

func (*MockWlmService) SendRequest

func (m *MockWlmService) SendRequest(location string) (*workloadmanager.WriteInsightResponse, error)

SendRequest mock function.

func (*MockWlmService) UpdateRequest

func (m *MockWlmService) UpdateRequest(writeInsightRequest *workloadmanager.WriteInsightRequest)

UpdateRequest mock function.

type WLM

type WLM struct {
	Request *wlmngr.WriteInsightRequest
	// contains filtered or unexported fields
}

WLM struct which contains workloadmanager service.

func NewWorkloadManager

func NewWorkloadManager(ctx context.Context) (*WLM, error)

NewWorkloadManager creates new WLM and it return non-nil error if any error was caught.

func (*WLM) SendRequest

func (wlm *WLM) SendRequest(location string) (*wlmngr.WriteInsightResponse, error)

SendRequest sends request to wlmngr.

func (*WLM) UpdateRequest

func (wlm *WLM) UpdateRequest(writeInsightRequest *wlmngr.WriteInsightRequest)

UpdateRequest updates WLM request.

type WorkloadManagerService

type WorkloadManagerService interface {
	SendRequest(string) (*wlmngr.WriteInsightResponse, error)
	UpdateRequest(*wlmngr.WriteInsightRequest)
}

WorkloadManagerService the interface of WLM.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL