database

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2020 License: GPL-3.0, GPL-3.0-or-later Imports: 14 Imported by: 0

Documentation

Overview

Package database contains methods used to perform CRUD operations to the MongoDB database

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddAssociatedClusterNameAndVirtualizationNode

func AddAssociatedClusterNameAndVirtualizationNode(olderThan time.Time) bson.A

func AddHardwareAbstraction

func AddHardwareAbstraction(field string) bson.A

func FilterByLocationAndEnvironmentSteps

func FilterByLocationAndEnvironmentSteps(location string, environment string) interface{}

FilterByLocationAndEnvironmentSteps return the steps required to filter the data by the location and environment field.

func FilterByOldnessSteps

func FilterByOldnessSteps(olderThan time.Time) bson.A

func PagingMetadataStage

func PagingMetadataStage(page int, size int) interface{}

PagingMetadataStage insert PagingStage

Types

type MongoDatabase

type MongoDatabase struct {
	// Config contains the dataservice global configuration
	Config config.Configuration
	// Client contain the mongodb client
	Client *mongo.Client
	// TimeNow contains a function that return the current time
	TimeNow func() time.Time
	// OperatingSystemAggregationRules contains rules used to aggregate various operating systems
	OperatingSystemAggregationRules []config.AggregationRule
	// Log contains logger formatted
	Log *logrus.Logger
}

MongoDatabase is a implementation

func (*MongoDatabase) ArchiveHost

func (md *MongoDatabase) ArchiveHost(hostname string) utils.AdvancedErrorInterface

ArchiveHost archive the specified host

func (*MongoDatabase) ConnectToMongodb

func (md *MongoDatabase) ConnectToMongodb()

ConnectToMongodb connects to the MongoDB and return the connection

func (*MongoDatabase) DeletePatchingFunction

func (md *MongoDatabase) DeletePatchingFunction(hostname string) utils.AdvancedErrorInterface

DeletePatchingFunction delete the patching function

func (*MongoDatabase) ExistHostdata

func (md *MongoDatabase) ExistHostdata(hostname string) (bool, utils.AdvancedErrorInterface)

ExistHostdata return true if exist a non-archived hostdata with the hostname equal hostname

func (*MongoDatabase) ExistNotInClusterHost

func (md *MongoDatabase) ExistNotInClusterHost(hostname string) (bool, utils.AdvancedErrorInterface)

ExistNotInClusterHost return true if the host specified by hostname exist and it is not in cluster, otherwise false

func (*MongoDatabase) FindHostData

func (md *MongoDatabase) FindHostData(hostname string) (model.HostDataBE, utils.AdvancedErrorInterface)

FindHostData find the current hostdata with a certain hostname

func (*MongoDatabase) FindPatchingFunction

func (md *MongoDatabase) FindPatchingFunction(hostname string) (model.PatchingFunction, utils.AdvancedErrorInterface)

FindPatchingFunction find the the patching function associated to the hostname in the database

func (*MongoDatabase) GetAverageOracleExadataStorageUsageStats

func (md *MongoDatabase) GetAverageOracleExadataStorageUsageStats(location string, environment string, olderThan time.Time) (float64, utils.AdvancedErrorInterface)

GetAverageOracleExadataStorageUsageStats return the average usage of cell disks of exadata

func (*MongoDatabase) GetCluster

func (md *MongoDatabase) GetCluster(clusterName string, olderThan time.Time) (interface{}, utils.AdvancedErrorInterface)

GetCluster fetch all information about a cluster in the database

func (*MongoDatabase) GetEnvironmentStats

func (md *MongoDatabase) GetEnvironmentStats(location string, olderThan time.Time) ([]interface{}, utils.AdvancedErrorInterface)

GetEnvironmentStats return a array containing the number of hosts per environment

func (*MongoDatabase) GetHost

func (md *MongoDatabase) GetHost(hostname string, olderThan time.Time, raw bool) (interface{}, utils.AdvancedErrorInterface)

GetHost fetch all informations about a host in the database

func (*MongoDatabase) GetHostsCountStats

func (md *MongoDatabase) GetHostsCountStats(location string, environment string, olderThan time.Time) (int, utils.AdvancedErrorInterface)

GetHostsCountStats return the number of the non-archived hosts

func (*MongoDatabase) GetHostsCountUsingTechnologies

func (md *MongoDatabase) GetHostsCountUsingTechnologies(location string, environment string, olderThan time.Time) (map[string]float64, utils.AdvancedErrorInterface)

GetHostsCountUsingTechnologies return a map that contains the number of usages for every features

func (*MongoDatabase) GetOperatingSystemStats

func (md *MongoDatabase) GetOperatingSystemStats(location string, olderThan time.Time) ([]interface{}, utils.AdvancedErrorInterface)

GetOperatingSystemStats return a array containing the number of hosts per operanting system

func (*MongoDatabase) GetOracleDatabaseAgreement

func (md *MongoDatabase) GetOracleDatabaseAgreement(agreementID string) (*model.OracleDatabaseAgreement, utils.AdvancedErrorInterface)

GetOracleDatabaseAgreement return the agreement specified by id

func (*MongoDatabase) GetOracleDatabaseAgreementByAssociatedPart

func (md *MongoDatabase) GetOracleDatabaseAgreementByAssociatedPart(associatedPartID primitive.ObjectID) (*model.OracleDatabaseAgreement, utils.AdvancedErrorInterface)

GetOracleDatabaseAgreementByAssociatedPart return the agreement specified by an associated part id

func (*MongoDatabase) GetOracleDatabaseArchivelogStatusStats

func (md *MongoDatabase) GetOracleDatabaseArchivelogStatusStats(location string, environment string, olderThan time.Time) ([]interface{}, utils.AdvancedErrorInterface)

GetOracleDatabaseArchivelogStatusStats return a array containing the number of databases per archivelog status

func (*MongoDatabase) GetOracleDatabaseDataguardStatusStats

func (md *MongoDatabase) GetOracleDatabaseDataguardStatusStats(location string, environment string, olderThan time.Time) ([]interface{}, utils.AdvancedErrorInterface)

GetOracleDatabaseDataguardStatusStats return a array containing the number of databases per dataguard status

func (*MongoDatabase) GetOracleDatabaseEnvironmentStats

func (md *MongoDatabase) GetOracleDatabaseEnvironmentStats(location string, olderThan time.Time) ([]interface{}, utils.AdvancedErrorInterface)

GetOracleDatabaseEnvironmentStats return a array containing the number of databases per environment

func (*MongoDatabase) GetOracleDatabaseHighReliabilityStats

func (md *MongoDatabase) GetOracleDatabaseHighReliabilityStats(location string, environment string, olderThan time.Time) ([]interface{}, utils.AdvancedErrorInterface)

GetOracleDatabaseHighReliabilityStats return a array containing the number of databases per high-reliability status

func (*MongoDatabase) GetOracleDatabasePatchStatusStats

func (md *MongoDatabase) GetOracleDatabasePatchStatusStats(location string, windowTime time.Time, olderThan time.Time) ([]interface{}, utils.AdvancedErrorInterface)

GetOracleDatabasePatchStatusStats return a array containing the number of databases per patch status

func (*MongoDatabase) GetOracleDatabaseRACStatusStats

func (md *MongoDatabase) GetOracleDatabaseRACStatusStats(location string, environment string, olderThan time.Time) ([]interface{}, utils.AdvancedErrorInterface)

GetOracleDatabaseRACStatusStats return a array containing the number of databases per RAC status

func (*MongoDatabase) GetOracleDatabaseVersionStats

func (md *MongoDatabase) GetOracleDatabaseVersionStats(location string, olderThan time.Time) ([]interface{}, utils.AdvancedErrorInterface)

GetOracleDatabaseVersionStats return a array containing the number of databases per version

func (*MongoDatabase) GetOracleExadataPatchStatusStats

func (md *MongoDatabase) GetOracleExadataPatchStatusStats(location string, environment string, windowTime time.Time, olderThan time.Time) ([]interface{}, utils.AdvancedErrorInterface)

GetOracleExadataPatchStatusStats return a array containing the number of exadata per patch status

func (*MongoDatabase) GetOracleExadataStorageErrorCountStatusStats

func (md *MongoDatabase) GetOracleExadataStorageErrorCountStatusStats(location string, environment string, olderThan time.Time) ([]interface{}, utils.AdvancedErrorInterface)

GetOracleExadataStorageErrorCountStatusStats return a array containing the number of cell disks of exadata per error count status

func (*MongoDatabase) GetTopReclaimableOracleDatabaseStats

func (md *MongoDatabase) GetTopReclaimableOracleDatabaseStats(location string, limit int, olderThan time.Time) ([]interface{}, utils.AdvancedErrorInterface)

GetTopReclaimableOracleDatabaseStats return a array containing the total sum of reclaimable of segments advisors of the top reclaimable databases

func (*MongoDatabase) GetTopUnusedOracleDatabaseInstanceResourceStats

func (md *MongoDatabase) GetTopUnusedOracleDatabaseInstanceResourceStats(location string, environment string, limit int, olderThan time.Time) ([]interface{}, utils.AdvancedErrorInterface)

GetTopUnusedOracleDatabaseInstanceResourceStats return a array containing top unused instance resource by workload

func (*MongoDatabase) GetTopWorkloadOracleDatabaseStats

func (md *MongoDatabase) GetTopWorkloadOracleDatabaseStats(location string, limit int, olderThan time.Time) ([]interface{}, utils.AdvancedErrorInterface)

GetTopWorkloadOracleDatabaseStats return a array containing top databases by workload

func (*MongoDatabase) GetTotalOracleDatabaseDatafileSizeStats

func (md *MongoDatabase) GetTotalOracleDatabaseDatafileSizeStats(location string, environment string, olderThan time.Time) (float64, utils.AdvancedErrorInterface)

GetTotalOracleDatabaseDatafileSizeStats return the total size of datafiles of databases

func (*MongoDatabase) GetTotalOracleDatabaseMemorySizeStats

func (md *MongoDatabase) GetTotalOracleDatabaseMemorySizeStats(location string, environment string, olderThan time.Time) (float64, utils.AdvancedErrorInterface)

GetTotalOracleDatabaseMemorySizeStats return the total of memory size of databases

func (*MongoDatabase) GetTotalOracleDatabaseSegmentSizeStats

func (md *MongoDatabase) GetTotalOracleDatabaseSegmentSizeStats(location string, environment string, olderThan time.Time) (float64, utils.AdvancedErrorInterface)

GetTotalOracleDatabaseSegmentSizeStats return the total size of segments of databases

func (*MongoDatabase) GetTotalOracleDatabaseWorkStats

func (md *MongoDatabase) GetTotalOracleDatabaseWorkStats(location string, environment string, olderThan time.Time) (float64, utils.AdvancedErrorInterface)

GetTotalOracleDatabaseWorkStats return the total work of databases

func (*MongoDatabase) GetTotalOracleExadataCPUStats

func (md *MongoDatabase) GetTotalOracleExadataCPUStats(location string, environment string, olderThan time.Time) (interface{}, utils.AdvancedErrorInterface)

GetTotalOracleExadataCPUStats return the total cpu of exadata

func (*MongoDatabase) GetTotalOracleExadataMemorySizeStats

func (md *MongoDatabase) GetTotalOracleExadataMemorySizeStats(location string, environment string, olderThan time.Time) (float64, utils.AdvancedErrorInterface)

GetTotalOracleExadataMemorySizeStats return the total size of memory of exadata

func (*MongoDatabase) GetTypeStats

func (md *MongoDatabase) GetTypeStats(location string, olderThan time.Time) ([]interface{}, utils.AdvancedErrorInterface)

GetTypeStats return a array containing the number of hosts per type

func (*MongoDatabase) Init

func (md *MongoDatabase) Init()

Init initializes the connection to the database

func (*MongoDatabase) InsertOracleDatabaseAgreement

func (md *MongoDatabase) InsertOracleDatabaseAgreement(agreement model.OracleDatabaseAgreement) (*mongo.InsertOneResult, utils.AdvancedErrorInterface)

InsertOracleDatabaseAgreement insert an Oracle/Database agreement into the database

func (*MongoDatabase) ListEnvironments

func (md *MongoDatabase) ListEnvironments(location string, environment string, olderThan time.Time) ([]string, utils.AdvancedErrorInterface)

ListEnvironments list environments

func (*MongoDatabase) ListHostUsingOracleDatabaseLicenses

func (md *MongoDatabase) ListHostUsingOracleDatabaseLicenses() ([]dto.HostUsingOracleDatabaseLicenses, utils.AdvancedErrorInterface)

ListHostUsingOracleDatabaseLicenses lists the hosts/clusters that need to be licensed by Oracle/Database agreements

func (*MongoDatabase) ListLocations

func (md *MongoDatabase) ListLocations(location string, environment string, olderThan time.Time) ([]string, utils.AdvancedErrorInterface)

ListLocations list locations

func (*MongoDatabase) ListOracleDatabaseAgreements

func (md *MongoDatabase) ListOracleDatabaseAgreements() ([]dto.OracleDatabaseAgreementFE, utils.AdvancedErrorInterface)

ListOracleDatabaseAgreements lists the Oracle/Database agreements

func (*MongoDatabase) RemoveOracleDatabaseAgreement

func (md *MongoDatabase) RemoveOracleDatabaseAgreement(id primitive.ObjectID) utils.AdvancedErrorInterface

RemoveOracleDatabaseAgreement remove an Oracle/Database agreement from the database

func (*MongoDatabase) ReplaceHostData

func (md *MongoDatabase) ReplaceHostData(hostData model.HostDataBE) utils.AdvancedErrorInterface

ReplaceHostData adds a new hostdata to the database

func (*MongoDatabase) SavePatchingFunction

func (md *MongoDatabase) SavePatchingFunction(pf model.PatchingFunction) utils.AdvancedErrorInterface

SavePatchingFunction saves the patching function

func (*MongoDatabase) SearchAlerts

func (md *MongoDatabase) SearchAlerts(mode string, keywords []string, sortBy string, sortDesc bool,
	page, pageSize int, location, environment, severity, status string, from, to time.Time,
) ([]map[string]interface{}, utils.AdvancedErrorInterface)

SearchAlerts search alerts

func (*MongoDatabase) SearchClusters

func (md *MongoDatabase) SearchClusters(full bool, keywords []string, sortBy string, sortDesc bool, page int, pageSize int, location string, environment string, olderThan time.Time) ([]map[string]interface{}, utils.AdvancedErrorInterface)

SearchClusters search clusters

func (*MongoDatabase) SearchHosts

func (md *MongoDatabase) SearchHosts(mode string, keywords []string, otherFilters SearchHostsFilters, sortBy string, sortDesc bool, page int, pageSize int, location string, environment string, olderThan time.Time) ([]map[string]interface{}, utils.AdvancedErrorInterface)

SearchHosts search hosts

func (*MongoDatabase) SearchOracleDatabaseAddms

func (md *MongoDatabase) SearchOracleDatabaseAddms(keywords []string, sortBy string, sortDesc bool, page int, pageSize int, location string, environment string, olderThan time.Time) ([]map[string]interface{}, utils.AdvancedErrorInterface)

SearchOracleDatabaseAddms search addms

func (*MongoDatabase) SearchOracleDatabaseLicenseModifiers

func (md *MongoDatabase) SearchOracleDatabaseLicenseModifiers(keywords []string, sortBy string, sortDesc bool, page int, pageSize int) ([]map[string]interface{}, utils.AdvancedErrorInterface)

SearchOracleDatabaseLicenseModifiers search license modifiers

func (*MongoDatabase) SearchOracleDatabasePatchAdvisors

func (md *MongoDatabase) SearchOracleDatabasePatchAdvisors(keywords []string, sortBy string, sortDesc bool, page int, pageSize int, windowTime time.Time, location string, environment string, olderThan time.Time, status string) ([]map[string]interface{}, utils.AdvancedErrorInterface)

SearchOracleDatabasePatchAdvisors search patch advisors

func (*MongoDatabase) SearchOracleDatabaseSegmentAdvisors

func (md *MongoDatabase) SearchOracleDatabaseSegmentAdvisors(keywords []string, sortBy string, sortDesc bool, page int, pageSize int, location string, environment string, olderThan time.Time) ([]map[string]interface{}, utils.AdvancedErrorInterface)

SearchOracleDatabaseSegmentAdvisors search segment advisors

func (*MongoDatabase) SearchOracleDatabaseUsedLicenses

func (md *MongoDatabase) SearchOracleDatabaseUsedLicenses(sortBy string, sortDesc bool, page int, pageSize int,
	location string, environment string, olderThan time.Time,
) (*dto.OracleDatabaseUsedLicenseSearchResponse, utils.AdvancedErrorInterface)

SearchOracleDatabaseUsedLicenses search used licenses

func (*MongoDatabase) SearchOracleDatabases

func (md *MongoDatabase) SearchOracleDatabases(full bool, keywords []string, sortBy string, sortDesc bool, page int, pageSize int, location string, environment string, olderThan time.Time) ([]map[string]interface{}, utils.AdvancedErrorInterface)

SearchOracleDatabases search databases

func (*MongoDatabase) SearchOracleExadata

func (md *MongoDatabase) SearchOracleExadata(full bool, keywords []string, sortBy string, sortDesc bool, page int, pageSize int, location string, environment string, olderThan time.Time) ([]interface{}, utils.AdvancedErrorInterface)

SearchOracleExadata search exadata

func (*MongoDatabase) UpdateAlertsStatus

func (md *MongoDatabase) UpdateAlertsStatus(ids []primitive.ObjectID, newStatus string) utils.AdvancedErrorInterface

UpdateAlertsStatus change the status of the specified alerts

func (*MongoDatabase) UpdateOracleDatabaseAgreement

func (md *MongoDatabase) UpdateOracleDatabaseAgreement(agreement model.OracleDatabaseAgreement) utils.AdvancedErrorInterface

UpdateOracleDatabaseAgreement update an Oracle/Database agreement in the database

type MongoDatabaseInterface

type MongoDatabaseInterface interface {
	// Init initializes the connection to the database
	Init()
	// SearchHosts search hosts
	SearchHosts(mode string, keywords []string, otherFilters SearchHostsFilters, sortBy string, sortDesc bool, page int, pageSize int, location string, environment string, olderThan time.Time) ([]map[string]interface{}, utils.AdvancedErrorInterface)
	// GetHost fetch all informations about a host in the database
	GetHost(hostname string, olderThan time.Time, raw bool) (interface{}, utils.AdvancedErrorInterface)
	// SearchAlerts search alerts
	SearchAlerts(mode string, keywords []string, sortBy string, sortDesc bool, page, pageSize int, location, environment, severity, status string, from, to time.Time) ([]map[string]interface{}, utils.AdvancedErrorInterface)
	// SearchClusters search clusters
	SearchClusters(full bool, keywords []string, sortBy string, sortDesc bool, page int, pageSize int, location string, environment string, olderThan time.Time) ([]map[string]interface{}, utils.AdvancedErrorInterface)
	// GetCluster fetch all information about a cluster in the database
	GetCluster(clusterName string, olderThan time.Time) (interface{}, utils.AdvancedErrorInterface)
	// SearchOracleDatabaseAddms search addms
	SearchOracleDatabaseAddms(keywords []string, sortBy string, sortDesc bool, page int, pageSize int, location string, environment string, olderThan time.Time) ([]map[string]interface{}, utils.AdvancedErrorInterface)
	// SearchOracleDatabaseSegmentAdvisors search segment advisors
	SearchOracleDatabaseSegmentAdvisors(keywords []string, sortBy string, sortDesc bool, page int, pageSize int, location string, environment string, olderThan time.Time) ([]map[string]interface{}, utils.AdvancedErrorInterface)
	// SearchOracleDatabasePatchAdvisors search patch advisors
	SearchOracleDatabasePatchAdvisors(keywords []string, sortBy string, sortDesc bool, page int, pageSize int, windowTime time.Time, location string, environment string, olderThan time.Time, status string) ([]map[string]interface{}, utils.AdvancedErrorInterface)
	// SearchOracleDatabases search databases
	SearchOracleDatabases(full bool, keywords []string, sortBy string, sortDesc bool, page int, pageSize int, location string, environment string, olderThan time.Time) ([]map[string]interface{}, utils.AdvancedErrorInterface)
	// SearchOracleExadata search exadata
	SearchOracleExadata(full bool, keywords []string, sortBy string, sortDesc bool, page int, pageSize int, location string, environment string, olderThan time.Time) ([]interface{}, utils.AdvancedErrorInterface)
	// SearchOracleDatabaseUsedLicenses search consumed licenses
	SearchOracleDatabaseUsedLicenses(sortBy string, sortDesc bool, page int, pageSize int, location string, environment string, olderThan time.Time) (*dto.OracleDatabaseUsedLicenseSearchResponse, utils.AdvancedErrorInterface)
	// SearchOracleDatabaseLicenseModifiers search license modifiers
	SearchOracleDatabaseLicenseModifiers(keywords []string, sortBy string, sortDesc bool, page int, pageSize int) ([]map[string]interface{}, utils.AdvancedErrorInterface)

	// ListLocations list locations
	ListLocations(location string, environment string, olderThan time.Time) ([]string, utils.AdvancedErrorInterface)
	// ListEnvironments list environments
	ListEnvironments(location string, environment string, olderThan time.Time) ([]string, utils.AdvancedErrorInterface)
	// GetHostsCountStats return the number of the non-archived hosts
	GetHostsCountStats(location string, environment string, olderThan time.Time) (int, utils.AdvancedErrorInterface)
	// GetEnvironmentStats return a array containing the number of hosts per environment
	GetEnvironmentStats(location string, olderThan time.Time) ([]interface{}, utils.AdvancedErrorInterface)
	// GetTypeStats return a array containing the number of hosts per operating system
	GetOperatingSystemStats(location string, olderThan time.Time) ([]interface{}, utils.AdvancedErrorInterface)
	// GetTypeStats return a array containing the number of hosts per type
	GetTypeStats(location string, olderThan time.Time) ([]interface{}, utils.AdvancedErrorInterface)
	// GetTopUnusedOracleDatabaseInstanceResourceStats return a array containing top unused instance resource by workload
	GetTopUnusedOracleDatabaseInstanceResourceStats(location string, environment string, limit int, olderThan time.Time) ([]interface{}, utils.AdvancedErrorInterface)
	// GetOracleDatabaseEnvironmentStats return a array containing the number of databases per environment
	GetOracleDatabaseEnvironmentStats(location string, olderThan time.Time) ([]interface{}, utils.AdvancedErrorInterface)
	// GetOracleDatabaseHighReliabilityStats return a array containing the number of databases per high-reliability status
	GetOracleDatabaseHighReliabilityStats(location string, environment string, olderThan time.Time) ([]interface{}, utils.AdvancedErrorInterface)
	// GetOracleDatabaseVersionStats return a array containing the number of databases per version
	GetOracleDatabaseVersionStats(location string, olderThan time.Time) ([]interface{}, utils.AdvancedErrorInterface)
	// GetTopReclaimableOracleDatabaseStats return a array containing the total sum of reclaimable of segments advisors of the top reclaimable databases
	GetTopReclaimableOracleDatabaseStats(location string, limit int, olderThan time.Time) ([]interface{}, utils.AdvancedErrorInterface)
	// GetOracleDatabasePatchStatusStats return a array containing the number of databases per patch status
	GetOracleDatabasePatchStatusStats(location string, windowTime time.Time, olderThan time.Time) ([]interface{}, utils.AdvancedErrorInterface)
	// GetTopWorkloadOracleDatabaseStats return a array containing top databases by workload
	GetTopWorkloadOracleDatabaseStats(location string, limit int, olderThan time.Time) ([]interface{}, utils.AdvancedErrorInterface)
	// GetOracleDatabaseDataguardStatusStats return a array containing the number of databases per dataguard status
	GetOracleDatabaseDataguardStatusStats(location string, environment string, olderThan time.Time) ([]interface{}, utils.AdvancedErrorInterface)
	// GetOracleDatabaseRACStatusStats return a array containing the number of databases per RAC status
	GetOracleDatabaseRACStatusStats(location string, environment string, olderThan time.Time) ([]interface{}, utils.AdvancedErrorInterface)
	// GetOracleDatabaseArchivelogStatusStats return a array containing the number of databases per archivelog status
	GetOracleDatabaseArchivelogStatusStats(location string, environment string, olderThan time.Time) ([]interface{}, utils.AdvancedErrorInterface)
	// GetTotalOracleDatabaseWorkStats return the total work of databases
	GetTotalOracleDatabaseWorkStats(location string, environment string, olderThan time.Time) (float64, utils.AdvancedErrorInterface)
	// GetTotalOracleDatabaseMemorySizeStats return the total of memory size of databases
	GetTotalOracleDatabaseMemorySizeStats(location string, environment string, olderThan time.Time) (float64, utils.AdvancedErrorInterface)
	// GetTotalOracleDatabaseDatafileSizeStats return the total size of datafiles of databases
	GetTotalOracleDatabaseDatafileSizeStats(location string, environment string, olderThan time.Time) (float64, utils.AdvancedErrorInterface)
	// GetTotalOracleDatabaseSegmentSizeStats return the total size of segments of databases
	GetTotalOracleDatabaseSegmentSizeStats(location string, environment string, olderThan time.Time) (float64, utils.AdvancedErrorInterface)
	// GetTotalOracleExadataMemorySizeStats return the total size of memory of exadata
	GetTotalOracleExadataMemorySizeStats(location string, environment string, olderThan time.Time) (float64, utils.AdvancedErrorInterface)
	// GetTotalOracleExadataCPUStats return the total cpu of exadata
	GetTotalOracleExadataCPUStats(location string, environment string, olderThan time.Time) (interface{}, utils.AdvancedErrorInterface)
	// GetAverageOracleExadataStorageUsageStats return the average usage of cell disks of exadata
	GetAverageOracleExadataStorageUsageStats(location string, environment string, olderThan time.Time) (float64, utils.AdvancedErrorInterface)
	// GetOracleExadataStorageErrorCountStatusStats return a array containing the number of cell disks of exadata per error count status
	GetOracleExadataStorageErrorCountStatusStats(location string, environment string, olderThan time.Time) ([]interface{}, utils.AdvancedErrorInterface)
	// GetOracleExadataPatchStatusStats return a array containing the number of exadata per patch status
	GetOracleExadataPatchStatusStats(location string, environment string, windowTime time.Time, olderThan time.Time) ([]interface{}, utils.AdvancedErrorInterface)

	// InsertOracleDatabaseAgreement insert an Oracle/Database agreement into the database
	InsertOracleDatabaseAgreement(agreement model.OracleDatabaseAgreement) (*mongo.InsertOneResult, utils.AdvancedErrorInterface)
	// GetOracleDatabaseAgreement return the agreement specified by id
	GetOracleDatabaseAgreement(agreementID string) (*model.OracleDatabaseAgreement, utils.AdvancedErrorInterface)
	// GetOracleDatabaseAgreementByAssociatedPart return the agreement specified by an associated part id
	GetOracleDatabaseAgreementByAssociatedPart(associatedPartID primitive.ObjectID) (*model.OracleDatabaseAgreement, utils.AdvancedErrorInterface)
	// UpdateOracleDatabaseAgreement update an Oracle/Database agreement in the database
	UpdateOracleDatabaseAgreement(agreement model.OracleDatabaseAgreement) utils.AdvancedErrorInterface
	// RemoveOracleDatabaseAgreement remove an Oracle/Database agreement from the database
	RemoveOracleDatabaseAgreement(id primitive.ObjectID) utils.AdvancedErrorInterface

	// ListOracleDatabaseAgreements lists the Oracle/Database agreements
	ListOracleDatabaseAgreements() ([]dto.OracleDatabaseAgreementFE, utils.AdvancedErrorInterface)
	// ListHostUsingOracleDatabaseLicenses lists the hosts/clusters that need to be licensed by Oracle/Database agreements
	ListHostUsingOracleDatabaseLicenses() ([]dto.HostUsingOracleDatabaseLicenses, utils.AdvancedErrorInterface)

	// SavePatchingFunction saves the patching function
	SavePatchingFunction(pf model.PatchingFunction) utils.AdvancedErrorInterface
	// ReplaceHostData adds a new hostdata to the database
	ReplaceHostData(hostData model.HostDataBE) utils.AdvancedErrorInterface
	// UpdateAlertsStatus change the status of the specified alerts
	UpdateAlertsStatus(id []primitive.ObjectID, newStatus string) utils.AdvancedErrorInterface
	// ArchiveHost archive the specified host
	ArchiveHost(hostname string) utils.AdvancedErrorInterface
	// DeletePatchingFunction delete the patching function
	DeletePatchingFunction(hostname string) utils.AdvancedErrorInterface

	// FindPatchingFunction find the the patching function associated to the hostname in the database
	FindPatchingFunction(hostname string) (model.PatchingFunction, utils.AdvancedErrorInterface)
	// FindHostData find the current hostdata with a certain hostname
	FindHostData(hostname string) (model.HostDataBE, utils.AdvancedErrorInterface)
	// ExistHostdata return true if the host specified by hostname exist, otherwise false
	ExistHostdata(hostname string) (bool, utils.AdvancedErrorInterface)
	// GetHostsCountUsingTechnologies return a map that contains the number of usages for every features
	GetHostsCountUsingTechnologies(location string, environment string, olderThan time.Time) (map[string]float64, utils.AdvancedErrorInterface)
	// ExistNotInClusterHost return true if the host specified by hostname exist and it is not in cluster, otherwise false
	ExistNotInClusterHost(hostname string) (bool, utils.AdvancedErrorInterface)
}

MongoDatabaseInterface is a interface that wrap methods used to perform CRUD operations in the mongodb database

type SearchHostsFilters

type SearchHostsFilters struct {
	Hostname                      string
	Database                      string
	Technology                    string
	HardwareAbstractionTechnology string
	Cluster                       *string
	VirtualizationNode            string
	OperatingSystem               string
	Kernel                        string
	LTEMemoryTotal                float64
	GTEMemoryTotal                float64
	LTESwapTotal                  float64
	GTESwapTotal                  float64
	IsMemberOfCluster             *bool
	CPUModel                      string
	LTECPUCores                   int
	GTECPUCores                   int
	LTECPUThreads                 int
	GTECPUThreads                 int
}

SearchHostsFilters contains all filters for the SearchHosts API

Jump to

Keyboard shortcuts

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