models

package
v0.0.0-...-2fd657a Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AWS_S3            = "s3"
	GCP_CLOUD_STORAGE = "gcs"
)
View Source
const EXTERNAL_OPENSEARCH_ROOT_CERT = "" /* 5322-byte string literal not displayed */
View Source
const EXTERNAL_PG_ROOT_CERT = "" /* 44610-byte string literal not displayed */

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiResult

type ApiResult struct {
	Passed      bool          `json:"passed"`
	Message     string        `json:"msg"`
	Check       string        `json:"check"`
	Checks      []Checks      `json:"checks"`
	Error       *fiber.Error  `json:"error,omitempty"`
	Skipped     bool          `json:"skipped"`
	SkipMessage string        `json:"skip_message,omitempty"`
	Id          *SystemUserID `json:"id,omitempty"`
}

type Backup

type Backup struct {
	FileSystem    *FileSystem    `json:"file_system"`
	ObjectStorage *ObjectStorage `json:"object_storage"`
}

type BatchCheckRequest

type BatchCheckRequest struct {
	Checks []string `json:"checks"`
	Config *Config  `json:"config"`
}

type BatchCheckResponse

type BatchCheckResponse struct {
	Passed     bool               `json:"passed"`
	NodeResult []BatchCheckResult `json:"node_result"`
}

type BatchCheckResult

type BatchCheckResult struct {
	NodeType string      `json:"node_type"`
	Ip       string      `json:"ip"`
	Tests    []ApiResult `json:"tests"`
}

type Certificate

type Certificate struct {
	Fqdn         string      `json:"fqdn"`
	FqdnRootCert string      `json:"fqdn_root_ca"`
	NodeType     string      `json:"node_type"`
	Nodes        []*NodeCert `json:"nodes"`
}

type CertificateCheckRequest

type CertificateCheckRequest struct {
	RootCertificate  string `json:"root_certificate"`
	PrivateKey       string `json:"private_key"`
	NodeCertificate  string `json:"node_certificate"`
	AdminPrivateKey  string `json:"admin_private_key"`
	AdminCertificate string `json:"admin_certificate"`
}

type CertificateCheckResponse

type CertificateCheckResponse struct {
	Passed bool     `json:"passed"`
	Checks []Checks `json:"checks"`
}

type CheckAndType

type CheckAndType struct {
	CheckName string `json:"check_name"`
	CheckType string `json:"check_type"`
	CheckMsg  string `json:"check_msg"`
}

type CheckTriggerResponse

type CheckTriggerResponse struct {
	Status    string    `json:"status"`
	Result    ApiResult `json:"result"`
	Host      string    `json:"host"`
	NodeType  string    `json:"node_type"`
	CheckType string    `json:"check_type"`
}

type Checks

type Checks struct {
	Title         string `json:"title"`
	Passed        bool   `json:"passed"`
	SuccessMsg    string `json:"success_msg"`
	ErrorMsg      string `json:"error_msg"`
	ResolutionMsg string `json:"resolution_msg"`
	Skipped       bool   `json:"skipped"`
}

func NewFailureCheck

func NewFailureCheck(title string, errorMsg string, resolutionMsg string) *Checks

func NewSuccessCheck

func NewSuccessCheck(title string, successMsg string) *Checks

type ChecksResponse

type ChecksResponse struct {
	Passed bool     `json:"passed"`
	Checks []Checks `json:"checks"`
}

type Config

type Config struct {
	SSHUser         *SSHUser       `json:"ssh_user"`
	Arch            string         `json:"arch"`
	Profile         string         `json:"profile"`
	Backup          *Backup        `json:"backup"`
	Hardware        *Hardware      `json:"hardware"`
	ExternalDbType  string         `json:"external_db_type"`
	Certificate     []*Certificate `json:"certificate"`
	ExternalOS      *ExternalOS    `json:"external_opensearch"`
	ExternalPG      *ExternalPG    `json:"external_postgresql"`
	DeploymentState string         `json:"deployment_state"`
	APIToken        string         `json:"api_token"`
}

func NewConfig

func NewConfig() *Config

func (*Config) PopulateWith

func (c *Config) PopulateWith(haConfig *config.HaDeployConfig) error

type CountPerHARequirements

type CountPerHARequirements struct {
	AutomateCount        int `json:"automate_count"`
	ChefInfraServerCount int `json:"chef_infra_server_count"`
	PostgresqlCount      int `json:"postgresql_count"`
	OpenSearchCount      int `json:"opensearch_count"`
}

type ExternalOS

type ExternalOS struct {
	OSDomainName                  string `json:"opensearch_domain_name"`
	OSDomainURL                   string `json:"opensearch_domain_url"`
	OSUsername                    string `json:"opensearch_username"`
	OSUserPassword                string `json:"opensearch_user_password"`
	OSCert                        string `json:"opensearch_cert"`
	OSRoleArn                     string `json:"opensearch_role_arn"`
	OsSnapshotUserAccessKeySecret string `json:"os_snapshot_user_access_key_secret"`
	OsSnapshotUserAccessKeyId     string `json:"os_snapshot_user_access_key_id"`
}

type ExternalOSRequest

type ExternalOSRequest struct {
	OSDomainName   string `json:"opensearch_domain_name"`
	OSDomainURL    string `json:"opensearch_domain_url"`
	OSUsername     string `json:"opensearch_username"`
	OSUserPassword string `json:"opensearch_user_password"`
	OSCert         string `json:"opensearch_root_cert"`
}

type ExternalOpensearchCheck

type ExternalOpensearchCheck struct {
	Title         string `json:"title"`
	Passed        bool   `json:"passed"`
	Status        string `json:"status"`
	SuccessMsg    string `json:"success_msg"`
	ErrorMsg      string `json:"error_msg"`
	ResolutionMsg string `json:"resolution_msg"`
	DebugMsg      string `json:"debug_msg"`
}

type ExternalOpensearchResponse

type ExternalOpensearchResponse struct {
	Passed bool                      `json:"passed"`
	Checks []ExternalOpensearchCheck `json:"checks"`
}

type ExternalPG

type ExternalPG struct {
	PGInstanceURL       string `json:"postgresql_instance_url"`
	PGSuperuserName     string `json:"postgresql_superuser_username"`
	PGSuperuserPassword string `json:"postgresql_superuser_password"`
	PGDbUserName        string `json:"postgresql_dbuser_username"`
	PGDbUserPassword    string `json:"postgresql_dbuser_password"`
	PGRootCert          string `json:"postgresql_root_cert"`
}

type ExternalPgConnectionDetails

type ExternalPgConnectionDetails struct {
	Title         string `json:"title"`
	Passed        bool   `json:"passed"`
	Status        string `json:"status"`
	SuccessMsg    string `json:"success_msg"`
	ErrorMsg      string `json:"error_msg"`
	ResolutionMsg string `json:"resolution_msg"`
}

type ExternalPgRequest

type ExternalPgRequest struct {
	PostgresqlInstanceUrl       string `json:"postgresql_instance_url"`
	PostgresqlInstancePort      string `json:"postgresql_instance_port"`
	PostgresqlSuperUserUserName string `json:"postgresql_superuser_username"`
	PostgresqlSuperUserPassword string `json:"postgresql_superuser_password"`
	PostgresqlDbUserUserName    string `json:"postgresql_dbuser_username"`
	PostgresqlDbUserPassword    string `json:"postgresql_dbuser_password"`
	PostgresqlRootCert          string `json:"postgresql_root_cert"`
}

type ExternalPgResponse

type ExternalPgResponse struct {
	Passed bool                          `json:"passed"`
	Checks []ExternalPgConnectionDetails `json:"checks"`
}

type FileSystem

type FileSystem struct {
	MountLocation string `json:"mount_location"`
}

type FirewallRequest

type FirewallRequest struct {
	SourceNodeIP               string `json:"source_node_ip"`
	DestinationNodeIP          string `json:"destination_node_ip"`
	DestinationServicePort     string `json:"destination_service_port"`
	DestinationServiceProtocol string `json:"destination_service_protocol"`
	RootCert                   string `json:"root_cert"`
}

type FirewallResponse

type FirewallResponse struct {
	Passed bool     `json:"passed"`
	Checks []Checks `json:"checks"`
}

type FqdnRequest

type FqdnRequest struct {
	Fqdn              string   `json:"fqdn"`
	RootCert          string   `json:"root_cert"`
	IsAfterDeployment bool     `json:"is_after_deployment"`
	Nodes             []string `json:"nodes"`
	NodeType          string   `json:"node_type"`
}

type FqdnResponse

type FqdnResponse struct {
	Passed bool     `json:"passed"`
	Checks []Checks `json:"checks"`
}

type GCPCloudStorageConfigRequest

type GCPCloudStorageConfigRequest struct {
	BucketName               string             `json:"bucket_name"`
	GoogleServiceAccountFile string             `json:"google_service_account_file"`
	GcpServiceAccount        *GcpServiceAccount `json:"gcp_service_account"`
}

type GCPCloudStorageResponse

type GCPCloudStorageResponse struct {
	Passed bool     `json:"passed"`
	Checks []Checks `json:"checks"`
}

type GcpServiceAccount

type GcpServiceAccount struct {
	Type                    string `json:"type"`
	ProjectID               string `json:"project_id"`
	PrivateKeyID            string `json:"private_key_id"`
	PrivateKey              string `json:"private_key"`
	ClientEmail             string `json:"client_email"`
	ClientID                string `json:"client_id"`
	AuthURI                 string `json:"auth_uri"`
	TokenURI                string `json:"token_uri"`
	AuthProviderX509CertURL string `json:"auth_provider_x509_cert_url"`
	ClientX509CertURL       string `json:"client_x509_cert_url"`
	UniverseDomain          string `json:"universe_domain"`
}

type HTTPSServerResponse

type HTTPSServerResponse struct {
	Status string `json:"status"`
}

type HTTPsListener

type HTTPsListener interface {
	Shutdown(ctx context.Context) error
}

type Hardware

type Hardware struct {
	AutomateNodeCount        int      `json:"automate_node_count"`
	AutomateNodeIps          []string `json:"automate_node_ips"`
	ChefInfraServerNodeCount int      `json:"chef_infra_server_node_count"`
	ChefInfraServerNodeIps   []string `json:"chef_infra_server_node_ips"`
	PostgresqlNodeCount      int      `json:"postgresql_node_count"`
	PostgresqlNodeIps        []string `json:"postgresql_node_ips"`
	OpenSearchNodeCount      int      `json:"opensearch_node_count"`
	OpenSearchNodeIps        []string `json:"opensearch_node_ips"`
}

type HardwareResourceCheckResponse

type HardwareResourceCheckResponse struct {
	Status string                           `json:"status"`
	Result []HardwareResourceCountApiResult `json:"result"`
	Error  fiber.Error                      `json:"error"`
}

type HardwareResourceCountApiResult

type HardwareResourceCountApiResult struct {
	IP       string   `json:"ip"`
	NodeType string   `json:"node_type"`
	Checks   []Checks `json:"checks"`
}

type HardwareResourceResponse

type HardwareResourceResponse struct {
	IP       string   `json:"ip"`
	NodeType string   `json:"node_type"`
	Checks   []Checks `json:"checks"`
}

type MockServerFromBatchServiceResponse

type MockServerFromBatchServiceResponse struct {
	Host       string `json:"host"`
	Protocol   string `json:"protocol"`
	Port       int    `json:"port"`
	Error      error  `json:"error"`
	StatusCode int    `json:"status_code"`
}

type NFSMountCheckResponse

type NFSMountCheckResponse struct {
	Status string             `json:"status"`
	Result []NFSMountResponse `json:"result"`
	Error  fiber.Error        `json:"error"`
}

type NFSMountLocRequest

type NFSMountLocRequest struct {
	MountLocation string `json:"mount_location"`
}

type NFSMountLocResponse

type NFSMountLocResponse struct {
	Address            string `json:"address"`
	MountLocation      string `json:"mount_location"`
	Nfs                string `json:"nfs"`
	StorageCapacity    string `json:"storage_capacity"`
	AvailableFreeSpace string `json:"available_free_space"`
}

type NFSMountRequest

type NFSMountRequest struct {
	ExternalDbType         string   `json:"external_db_type"`
	AutomateNodeIPs        []string `json:"automate_node_ips"`
	ChefInfraServerNodeIPs []string `json:"chef_infra_server_node_ips"`
	PostgresqlNodeIPs      []string `json:"postgresql_node_ips"`
	OpensearchNodeIPs      []string `json:"opensearch_node_ips"`
	MountLocation          string   `json:"mount_location"`
}

type NFSMountResponse

type NFSMountResponse struct {
	IP        string   `json:"ip"`
	NodeType  string   `json:"node_type"`
	CheckList []Checks `json:"checks"`
	Error     error    `json:"error"`
}

type NodeCert

type NodeCert struct {
	IP        string `json:"ip"`
	RootCert  string `json:"root_cert"`
	Cert      string `json:"cert"`
	Key       string `json:"key"`
	AdminKey  string `json:"admin_key"`
	AdminCert string `json:"admin_cert"`
}

is this supposed to be cert_by_ip? this struct needs modifiation

type ObjectStorage

type ObjectStorage struct {
	Location                 string             `json:"location"`
	Endpoint                 string             `json:"endpoint"`
	BucketName               string             `json:"bucket_name"`
	BasePath                 string             `json:"base_path"`
	AccessKey                string             `json:"access_key"`
	SecretKey                string             `json:"secret_key"`
	AWSRegion                string             `json:"aws_region"`
	GoogleServiceAccountFile string             `json:"google_service_account_file"`
	GcpServiceAccount        *GcpServiceAccount `json:"gcp_service_account"`
}

type PortReachableRequest

type PortReachableRequest struct {
	DestinationNodeIp              string `json:"destination_node_ip"`
	DestinationNodePort            int    `json:"destination_node_port"`
	DestinationNodeServiceProtocol string `json:"destination_node_service_protocol"`
	RootCA                         string `json:"root_ca"`
}

type S3BackupDetails

type S3BackupDetails struct {
	Endpoint   string `json:"endpoint" validate:"required"`
	Username   string `json:"username" validate:"required"`
	Password   string `json:"password" validate:"required"`
	S3Bucket   string `json:"s3_bucket" validate:"required"`
	S3BasePath string `json:"s3_basepath" validate:"required"`
	AccessKey  string `json:"aws_access_key" validate:"required"`
	SecretKey  string `json:"aws_secret_key" validate:"required"`
	AWSRegion  string `json:"aws_region" validate:"required"`
	AWSRoleArn string `json:"aws_role_arn" validate:"required"`
}

type S3BackupManagedResponse

type S3BackupManagedResponse struct {
	Passed bool     `json:"passed"`
	Checks []Checks `json:"checks"`
}

type S3ConfigRequest

type S3ConfigRequest struct {
	Endpoint   string `json:"endpoint"`
	BucketName string `json:"bucket_name"`
	BasePath   string `json:"base_path"`
	AccessKey  string `json:"access_key"`
	SecretKey  string `json:"secret_key"`
	Region     string `json:"region"`
}

type S3ConfigResponse

type S3ConfigResponse struct {
	Passed bool     `json:"passed"`
	Checks []Checks `json:"checks"`
}

type SSHUser

type SSHUser struct {
	Username     string `json:"user_name"`
	Port         string `json:"ssh_port"`
	PrivateKey   string `json:"private_key"`
	SudoPassword string `json:"sudo_password"`
}

type SShUserRequest

type SShUserRequest struct {
	IP           string `json:"ip"`
	Username     string `json:"user_name"`
	Port         string `json:"ssh_port"`
	PrivateKey   string `json:"private_key"`
	SudoPassword string `json:"sudo_password"`
}

type Server

type Server struct {
	Port         int
	ListenerTCP  net.Listener
	ListenerUDP  net.PacketConn
	ListenerHTTP HTTPsListener
	SignalChan   chan bool
	Protocol     string
}

type ServiceDetails

type ServiceDetails struct {
	ServiceName string `json:"service_name"`
	Status      string `json:"status"`
	Version     string `json:"version"`
}

type SoftwareVersionDetails

type SoftwareVersionDetails struct {
	Passed bool     `json:"passed"`
	Checks []Checks `json:"checks"`
}

type SshUserChecksRequest

type SshUserChecksRequest struct {
	Ip           string `json:"ip"`
	UserName     string `json:"user_name"`
	Port         string `json:"ssh_port"`
	PrivateKey   string `json:"private_key"`
	SudoPassword string `json:"sudo_password"`
}

type StartMockServerRequestBody

type StartMockServerRequestBody struct {
	Port     int
	Protocol string
	Cert     string
	Key      string
}

StartMockServerRequestBody contains the configuration for starting a mock server.

type StatusApiResponse

type StatusApiResponse struct {
	Status string        `json:"status"`
	Result StatusDetails `json:"result"`
}

type StatusDetails

type StatusDetails struct {
	Status     string            `json:"status"`
	Services   *[]ServiceDetails `json:"services"`
	CliVersion string            `json:"cli_version"`
	Error      string            `json:"error"`
}

type StopMockServerRequestBody

type StopMockServerRequestBody struct {
	Port     int
	Protocol string
}

StopMockServerRequestBody contains the configuration for starting a mock server.

type StopMockServerResponse

type StopMockServerResponse struct {
	Status string `json:"status"`
	Result string `json:"result"`
}

type SystemUserID

type SystemUserID struct {
	UserID  string `json:"user_id,omitempty"`
	GroupID string `json:"group_id,omitempty"`
}

type SystemUserResponse

type SystemUserResponse struct {
	Passed bool          `json:"passed"`
	Checks []*Checks     `json:"checks"`
	Id     *SystemUserID `json:"id,omitempty"`
}

Jump to

Keyboard shortcuts

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