service

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: 18 Imported by: 0

Documentation

Overview

Package service is a package that provides methods for querying data

Package service is a package that provides methods for querying data

Package service is a package that provides methods for querying data

Package service is a package that provides methods for querying data

Package service is a package that provides methods for querying data

Package service is a package that provides methods for querying data

Package service is a package that provides methods for querying data

Package service is a package that provides methods for querying data

Package service is a package that provides methods for querying data

Package service is a package that provides methods for querying data

Package service is a package that provides methods for querying data

Package service is a package that provides methods for querying data

Package service is a package that provides methods for querying data

Index

Constants

View Source
const DatabaseLicensesFixerCode = `` /* 631-byte string literal not displayed */
View Source
const DatabaseLicensesFixerMarker = "DATABASE_LICENSES_FIXER"

DatabaseLicensesFixerCode is the code used to modify the value of a license when the DatabaseLicensesFixerMarker is missing It assumes that the vars has the following structure:

{
	"licenseModifiers": {
		"dbname1": {
			"license1": 0,
			"license2": 2,
			...
		},
		"dbname2": {
			"license1": 0,
			"license2": 2,
			...
		},
		"..."
	}
}
View Source
const DatabaseTagsAdderCode = `` /* 307-byte string literal not displayed */
View Source
const DatabaseTagsAdderMarker = "DATABASE_TAGS_ADDER"

DatabaseTagsAdderCode is the code used to add a tag to a database when the DatabaseTagsAdderMarker is missing It assumes that the vars has the following structure:

{
	"tags": {
		"dbname1": ["tag1", "tag2", ...],
		"dbname2": ["tag1", "tag2", ...],
		"..."
	}
}

Variables

This section is empty.

Functions

This section is empty.

Types

type APIService

type APIService struct {
	// Config contains the dataservice global configuration
	Config config.Configuration
	// Version of the saved data
	Version string
	// Database contains the database layer
	Database database.MongoDatabaseInterface
	// TimeNow contains a function that return the current time
	TimeNow func() time.Time
	// Log contains logger formatted
	Log *logrus.Logger
	// TechnologyInfos contains the list of technologies with their informations
	TechnologyInfos []model.TechnologyInfo
	// OracleDatabaseAgreementParts contains the list of Oracle/Database agreeement parts
	OracleDatabaseAgreementParts []model.OracleDatabasePart
	// NewObjectID return a new ObjectID
	NewObjectID func() primitive.ObjectID
}

APIService is the concrete implementation of APIServiceInterface.

func (*APIService) AckAlerts

AckAlerts ack the specified alerts

func (*APIService) AddAssociatedPartToOracleDbAgreement

func (as *APIService) AddAssociatedPartToOracleDbAgreement(request dto.AssociatedPartInOracleDbAgreementRequest,
) (string, utils.AdvancedErrorInterface)

AddAssociatedPartToOracleDbAgreement add associated part to OracleDatabaseAgreement or create a new one

func (*APIService) AddHostToAssociatedPart

func (as *APIService) AddHostToAssociatedPart(associatedPartID primitive.ObjectID, hostname string,
) utils.AdvancedErrorInterface

AddHostToAssociatedPart add an host to AssociatedPart

func (*APIService) AddTagToOracleDatabase

func (as *APIService) AddTagToOracleDatabase(hostname string, dbname string, tagname string) utils.AdvancedErrorInterface

AddTagToOracleDatabase add the tag to the database if it hasn't the tag

func (*APIService) ApplyPatch

ApplyPatch apply the patch pf to the relative host

func (*APIService) ArchiveHost

func (as *APIService) ArchiveHost(hostname string) utils.AdvancedErrorInterface

ArchiveHost archive the specified host

func (*APIService) DeleteAssociatedPartFromOracleDatabaseAgreement

func (as *APIService) DeleteAssociatedPartFromOracleDatabaseAgreement(associatedPartID primitive.ObjectID,
) utils.AdvancedErrorInterface

DeleteAssociatedPartFromOracleDatabaseAgreement delete associated part from OracleDatabaseAgreement

func (*APIService) DeleteOracleDatabaseLicenseModifier

func (as *APIService) DeleteOracleDatabaseLicenseModifier(hostname string, dbname string, licenseName string) utils.AdvancedErrorInterface

DeleteOracleDatabaseLicenseModifier delete the modifier of a certain license

func (*APIService) DeletePatchingFunction

func (as *APIService) DeletePatchingFunction(hostname string) utils.AdvancedErrorInterface

DeletePatchingFunction delete the patching function of a host

func (*APIService) DeleteTagOfOracleDatabase

func (as *APIService) DeleteTagOfOracleDatabase(hostname string, dbname string, tagname string) utils.AdvancedErrorInterface

DeleteTagOfOracleDatabase delete the tag from the database if it hasn't the tag

func (*APIService) GetAverageOracleExadataStorageUsageStats

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

GetAverageOracleExadataStorageUsageStats return the average usage of cell disks of exadata

func (*APIService) GetCluster

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

GetCluster return the cluster specified in the clusterName param

func (*APIService) GetDefaultDatabaseTags

func (as *APIService) GetDefaultDatabaseTags() ([]string, utils.AdvancedErrorInterface)

GetDefaultDatabaseTags return the default list of database tags from configuration

func (*APIService) GetEnvironmentStats

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

GetEnvironmentStats return a array containing the number of hosts per environment

func (*APIService) GetErcoleFeatures

func (as *APIService) GetErcoleFeatures() (map[string]bool, utils.AdvancedErrorInterface)

GetErcoleFeatures return a map of active/inactive features

func (*APIService) GetHost

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

GetHost return the host specified in the hostname param

func (*APIService) GetHostsCountStats

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

GetHostsCountStats return the number of the non-archived hosts

func (*APIService) GetInfoForFrontendDashboard

func (as *APIService) GetInfoForFrontendDashboard(location string, environment string, olderThan time.Time) (map[string]interface{}, utils.AdvancedErrorInterface)

GetInfoForFrontendDashboard return all informations needed for the frontend dashboard page

func (*APIService) GetOperatingSystemStats

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

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

func (*APIService) GetOracleDatabaseAgreementPartsList

func (as *APIService) GetOracleDatabaseAgreementPartsList() ([]model.OracleDatabasePart, utils.AdvancedErrorInterface)

GetOracleDatabaseAgreementPartsList return the list of Oracle/Database agreement parts

func (*APIService) GetOracleDatabaseAgreementPartsMap

func (as *APIService) GetOracleDatabaseAgreementPartsMap() (parts map[string]model.OracleDatabasePart, err utils.AdvancedErrorInterface)

GetOracleDatabaseAgreementPartsList return Oracle/Database agreement parts mapped by their PartID

func (*APIService) GetOracleDatabaseArchivelogStatusStats

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

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

func (*APIService) GetOracleDatabaseDataguardStatusStats

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

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

func (*APIService) GetOracleDatabaseEnvironmentStats

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

GetOracleDatabaseEnvironmentStats return a array containing the number of databases per environment

func (*APIService) GetOracleDatabaseHighReliabilityStats

func (as *APIService) 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 (*APIService) GetOracleDatabaseLicensesCompliance

func (as *APIService) GetOracleDatabaseLicensesCompliance() ([]dto.OracleDatabaseLicenseUsage, utils.AdvancedErrorInterface)

func (*APIService) GetOracleDatabasePatchStatusStats

func (as *APIService) 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 (*APIService) GetOracleDatabaseRACStatusStats

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

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

func (*APIService) GetOracleDatabaseVersionStats

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

GetOracleDatabaseVersionStats return a array containing the number of databases per version

func (*APIService) GetOracleExadataPatchStatusStats

func (as *APIService) 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 (*APIService) GetOracleExadataStorageErrorCountStatusStats

func (as *APIService) 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 (*APIService) GetOraclePart

func (as *APIService) GetOraclePart(partID string) (*model.OracleDatabasePart, utils.AdvancedErrorInterface)

GetOraclePart return a Part by ID

func (*APIService) GetPatchingFunction

func (as *APIService) GetPatchingFunction(hostname string) (interface{}, utils.AdvancedErrorInterface)

GetPatchingFunction return the patching function specified in the hostname param

func (*APIService) GetTechnologyList

func (as *APIService) GetTechnologyList() ([]model.TechnologyInfo, utils.AdvancedErrorInterface)

GetTechnologyList return the list of technologies

func (*APIService) GetTopReclaimableOracleDatabaseStats

func (as *APIService) 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 (*APIService) GetTopUnusedOracleDatabaseInstanceResourceStats

func (as *APIService) 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 (*APIService) GetTopWorkloadOracleDatabaseStats

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

GetTopWorkloadOracleDatabaseStats return a array containing top databases by workload

func (*APIService) GetTotalOracleDatabaseDatafileSizeStats

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

GetTotalOracleDatabaseDatafileSizeStats return the total size of datafiles of databases

func (*APIService) GetTotalOracleDatabaseMemorySizeStats

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

GetTotalOracleDatabaseMemorySizeStats return the total of memory size of databases

func (*APIService) GetTotalOracleDatabaseSegmentSizeStats

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

GetTotalOracleDatabaseSegmentSizeStats return the total size of segments of databases

func (*APIService) GetTotalOracleDatabaseWorkStats

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

GetTotalOracleDatabaseWorkStats return the total work of databases

func (*APIService) GetTotalOracleExadataCPUStats

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

GetTotalOracleExadataCPUStats return the total cpu of exadata

func (*APIService) GetTotalOracleExadataMemorySizeStats

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

GetTotalOracleExadataMemorySizeStats return the total size of memory of exadata

func (*APIService) GetTotalTechnologiesComplianceStats

func (as *APIService) GetTotalTechnologiesComplianceStats(location string, environment string, olderThan time.Time) (map[string]interface{}, utils.AdvancedErrorInterface)

GetTotalTechnologiesComplianceStats return the total compliance of all technologies

func (*APIService) GetTypeStats

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

GetTypeStats return a array containing the number of hosts per type

func (*APIService) Init

func (as *APIService) Init()

Init initializes the service and database

func (*APIService) ListEnvironments

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

ListEnvironments list environments

func (*APIService) ListLocations

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

ListLocations list locations

func (*APIService) ListManagedTechnologies

func (as *APIService) ListManagedTechnologies(sortBy string, sortDesc bool, location string, environment string, olderThan time.Time) ([]model.TechnologyStatus, utils.AdvancedErrorInterface)

ListManagedTechnologies returns the list of Technologies with some stats

func (*APIService) RemoveHostFromAssociatedPart

func (as *APIService) RemoveHostFromAssociatedPart(associatedPartID primitive.ObjectID, hostname string,
) utils.AdvancedErrorInterface

RemoveHostFromAssociatedPart remove host from AssociatedPart

func (*APIService) SearchAlerts

func (as *APIService) SearchAlerts(mode string, search 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 (*APIService) SearchAssociatedPartsInOracleDatabaseAgreements

func (as *APIService) SearchAssociatedPartsInOracleDatabaseAgreements(filters dto.SearchOracleDatabaseAgreementsFilter,
) ([]dto.OracleDatabaseAgreementFE, utils.AdvancedErrorInterface)

SearchAssociatedPartsInOracleDatabaseAgreements search OracleDatabase associated parts agreements

func (*APIService) SearchClusters

func (as *APIService) SearchClusters(full bool, search 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 (*APIService) SearchHosts

func (as *APIService) SearchHosts(mode string, search string, otherFilters database.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 (*APIService) SearchOracleDatabaseAddms

func (as *APIService) SearchOracleDatabaseAddms(search 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 (*APIService) SearchOracleDatabaseLicenseModifiers

func (as *APIService) SearchOracleDatabaseLicenseModifiers(search string, sortBy string, sortDesc bool, page int, pageSize int) ([]map[string]interface{}, utils.AdvancedErrorInterface)

SearchOracleDatabaseLicenseModifiers search license modifiers

func (*APIService) SearchOracleDatabasePatchAdvisors

func (as *APIService) SearchOracleDatabasePatchAdvisors(search 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 (*APIService) SearchOracleDatabaseSegmentAdvisors

func (as *APIService) SearchOracleDatabaseSegmentAdvisors(search 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 (*APIService) SearchOracleDatabaseUsedLicenses

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

SearchOracleDatabaseUsedLicenses return the list of used licenses

func (*APIService) SearchOracleDatabases

func (as *APIService) SearchOracleDatabases(full bool, search 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 (*APIService) SearchOracleExadata

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

SearchOracleExadata search exadata

func (*APIService) SetOracleDatabaseLicenseModifier

func (as *APIService) SetOracleDatabaseLicenseModifier(hostname string, dbname string, licenseName string, newValue int) utils.AdvancedErrorInterface

SetOracleDatabaseLicenseModifier set the value of certain license to newValue

func (*APIService) SetPatchingFunction

func (as *APIService) SetPatchingFunction(hostname string, pf model.PatchingFunction) (interface{}, utils.AdvancedErrorInterface)

SetPatchingFunction set the patching function of a host

func (*APIService) UpdateAssociatedPartOfOracleDbAgreement

func (as *APIService) UpdateAssociatedPartOfOracleDbAgreement(request dto.AssociatedPartInOracleDbAgreementRequest,
) utils.AdvancedErrorInterface

UpdateAssociatedPartOfOracleDbAgreement update associated part in OracleDatabaseAgreement

type APIServiceInterface

type APIServiceInterface interface {
	// Init initialize the service
	Init()
	// SearchHosts search hosts
	SearchHosts(mode string, search string, otherFilters database.SearchHostsFilters, sortBy string, sortDesc bool, page int, pageSize int, location string, environment string, olderThan time.Time) ([]map[string]interface{}, utils.AdvancedErrorInterface)
	// GetHost return the host specified in the hostname param
	GetHost(hostname string, olderThan time.Time, raw bool) (interface{}, utils.AdvancedErrorInterface)
	// ListManagedTechnologies returns the list of technologies with some stats
	ListManagedTechnologies(sortBy string, sortDesc bool, location string, environment string, olderThan time.Time) ([]model.TechnologyStatus, utils.AdvancedErrorInterface)
	// SearchAlerts search alerts
	SearchAlerts(mode string, search 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, search string, sortBy string, sortDesc bool, page int, pageSize int, location string, environment string, olderThan time.Time) ([]map[string]interface{}, utils.AdvancedErrorInterface)
	// GetCluster return the cluster specified in the clusterName param
	GetCluster(clusterName string, olderThan time.Time) (interface{}, utils.AdvancedErrorInterface)
	// SearchOracleDatabaseAddms search addm
	SearchOracleDatabaseAddms(search 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(search 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(search 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, search 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, search string, sortBy string, sortDesc bool, page int, pageSize int, location string, environment string, olderThan time.Time) ([]interface{}, utils.AdvancedErrorInterface)
	// SearchOracleDatabaseUsedLicenses return the list of consumed licenses
	SearchOracleDatabaseUsedLicenses(sortBy string, sortDesc bool, page int, pageSize int, location string, environment string, olderThan time.Time) (*dto.OracleDatabaseUsedLicenseSearchResponse, 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)
	// SearchOracleDatabaseLicenseModifiers search license modifiers
	SearchOracleDatabaseLicenseModifiers(search string, sortBy string, sortDesc bool, page int, pageSize int) ([]map[string]interface{}, utils.AdvancedErrorInterface)

	// GetPatchingFunction return the patching function specified in the hostname param
	GetPatchingFunction(hostname string) (interface{}, 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)
	// GetOperatingSystemStats 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)
	// GetTotalTechnologiesComplianceStats return the total compliance of all technologie
	GetTotalTechnologiesComplianceStats(location string, environment string, olderThan time.Time) (map[string]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)
	// GetDefaultDatabaseTags return the default list of database tags from configuration
	GetDefaultDatabaseTags() ([]string, utils.AdvancedErrorInterface)
	// GetErcoleFeatures return a map of active/inactive features
	GetErcoleFeatures() (map[string]bool, utils.AdvancedErrorInterface)
	// GetErcoleFeatures return the list of technologies
	GetTechnologyList() ([]model.TechnologyInfo, utils.AdvancedErrorInterface)

	// Add associated part to OracleDatabaseAgreement or create a new one
	AddAssociatedPartToOracleDbAgreement(request dto.AssociatedPartInOracleDbAgreementRequest) (string, utils.AdvancedErrorInterface)
	// Update associated part in OracleDatabaseAgreement
	UpdateAssociatedPartOfOracleDbAgreement(request dto.AssociatedPartInOracleDbAgreementRequest) utils.AdvancedErrorInterface
	// Search OracleDatabase associated parts agreements
	SearchAssociatedPartsInOracleDatabaseAgreements(filters dto.SearchOracleDatabaseAgreementsFilter) ([]dto.OracleDatabaseAgreementFE, utils.AdvancedErrorInterface)
	// Delete associated part from OracleDatabaseAgreement
	DeleteAssociatedPartFromOracleDatabaseAgreement(associatedPartID primitive.ObjectID) utils.AdvancedErrorInterface
	// Add an host to AssociatedPart
	AddHostToAssociatedPart(associatedPartID primitive.ObjectID, hostname string) utils.AdvancedErrorInterface
	// Remove host from AssociatedPart
	RemoveHostFromAssociatedPart(associatedPartID primitive.ObjectID, hostname string) utils.AdvancedErrorInterface

	GetOracleDatabaseAgreementPartsList() ([]model.OracleDatabasePart, utils.AdvancedErrorInterface)
	GetOracleDatabaseLicensesCompliance() ([]dto.OracleDatabaseLicenseUsage, utils.AdvancedErrorInterface)

	// PATCHING FUNCTIONS
	// SetPatchingFunction set the patching function of a host
	SetPatchingFunction(hostname string, pf model.PatchingFunction) (interface{}, utils.AdvancedErrorInterface)
	// DeletePatchingFunction delete the patching function of a host
	DeletePatchingFunction(hostname string) utils.AdvancedErrorInterface

	// AddTagToOracleDatabase add the tag to the database if it hasn't the tag
	AddTagToOracleDatabase(hostname string, dbname string, tagname string) utils.AdvancedErrorInterface
	// DeleteTagOfOracleDatabase delete the tag from the database if it hasn't the tag
	DeleteTagOfOracleDatabase(hostname string, dbname string, tagname string) utils.AdvancedErrorInterface
	// SetOracleDatabaseLicenseModifier set the value of certain license to newValue
	SetOracleDatabaseLicenseModifier(hostname string, dbname string, licenseName string, newValue int) utils.AdvancedErrorInterface
	// DeleteOracleDatabaseLicenseModifier delete the modifier of a certain license
	DeleteOracleDatabaseLicenseModifier(hostname string, dbname string, licenseName string) utils.AdvancedErrorInterface
	// AckAlerts ack the specified alerts
	AckAlerts(ids []primitive.ObjectID) utils.AdvancedErrorInterface
	// ArchiveHost archive the specified host
	ArchiveHost(hostname string) utils.AdvancedErrorInterface

	// GetInfoForFrontendDashboard return all informations needed for the frontend dashboard page
	GetInfoForFrontendDashboard(location string, environment string, olderThan time.Time) (map[string]interface{}, utils.AdvancedErrorInterface)
}

APIServiceInterface is a interface that wrap methods used to querying data

Jump to

Keyboard shortcuts

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