retriever

package
v0.0.0-...-633508f Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ContentsMap map[string]map[string]interface{}

ContentsMap contains all policy data

Functions

This section is empty.

Types

type Retriever

type Retriever struct {
	CCXUrl          string
	ContentURL      string
	Client          *http.Client
	Token           string // token to connect to CRC
	DisconnectedEnv bool
}

Retriever struct

func NewRetriever

func NewRetriever(ccxurl string, ContentURL string, client *http.Client,
	token string) *Retriever

NewRetriever ...

func (*Retriever) CallContents

func (r *Retriever) CallContents(req *http.Request) (types.ContentsResponse, error)

CallContents - Makes HTTP call to get contents

func (*Retriever) CallInsights

func (r *Retriever) CallInsights(req *http.Request, cluster types.ManagedClusterInfo) (types.ResponseBody, error)

CallInsights ...

func (*Retriever) CreateContents

func (r *Retriever) CreateContents(responseBody types.ContentsResponse)

CreateContents - Populate json response from /contents call onto a Map to quick lookup

func (*Retriever) CreateInsightContentConfigmap

func (r *Retriever) CreateInsightContentConfigmap(dynamicClient dynamic.Interface)

CreateInsightContentConfigmap Creates a configmap to store content data in open-cluster-management namespace

func (*Retriever) CreateInsightsRequest

func (r *Retriever) CreateInsightsRequest(
	ctx context.Context,
	endpoint string,
	cluster types.ManagedClusterInfo,
	hubID string,
) (*http.Request, error)

CreateInsightsRequest ...

func (*Retriever) FetchClusters

func (r *Retriever) FetchClusters(
	monitor *monitor.Monitor,
	input chan types.ManagedClusterInfo,
	refreshToken bool,
	hubID string,
	dynamicClient dynamic.Interface,
)

FetchClusters forwards the managed clusters to RetrieveCCXReports function

func (*Retriever) GetContentConfigMap

func (r *Retriever) GetContentConfigMap(dynamicClient dynamic.Interface) *unstructured.Unstructured

GetContentConfigMap ...

func (*Retriever) GetContentRequest

func (r *Retriever) GetContentRequest(ctx context.Context, hubID string) (*http.Request, error)

GetContentRequest - Creates GET request for contents

func (*Retriever) GetContents

func (r *Retriever) GetContents(errorKey string, key string) interface{}

GetContents - Given Error_Key and field name returns value

func (*Retriever) GetFields

func (r *Retriever) GetFields(errorKey string) []string

GetFields - Given Error_Key gives the fields is has

func (*Retriever) GetPolicyInfo

func (r *Retriever) GetPolicyInfo(
	responseBody types.ResponseBody,
	cluster types.ManagedClusterInfo,
) (types.ProcessorData, error)

GetPolicyInfo ...

func (*Retriever) InitializeContents

func (r *Retriever) InitializeContents(hubID string, dynamicClient dynamic.Interface) int

InitializeContents ...

func (*Retriever) RetrieveReport

func (r *Retriever) RetrieveReport(
	hubID string,
	input chan types.ManagedClusterInfo,
	output chan types.ProcessorData,
	clusterCCXMap map[string]bool,
	isDisconnected bool,
)

RetrieveReport ...

func (*Retriever) StartTokenRefresh

func (r *Retriever) StartTokenRefresh() error

StartTokenRefresh sets the CRC token for use in Insights queries

Jump to

Keyboard shortcuts

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