models

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Copyright 2023 The Cloud-Barista Authors.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2023 The Cloud-Barista Authors.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2023 The Cloud-Barista Authors.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2023 The Cloud-Barista Authors.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2023 The Cloud-Barista Authors.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2023 The Cloud-Barista Authors.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APICredentialParams

type APICredentialParams struct {
	GCPCredentialJson string
	GCPCredentialPath string
	AWSAccessKey      string
	AWSSecretKey      string
	NCPAccessKey      string
	NCPSecretKey      string
}

type AWSCredentials

type AWSCredentials struct {
	AccessKey string `json:"accessKey" form:"accessKey"`
	SecretKey string `json:"secretKey" form:"secretKey"`
}

type AWSMigrationParams

type AWSMigrationParams struct {
	ObjectStorageParams
}

type BackupTask

type BackupTask struct {
	DataTask
}

type BaseParams

type BaseParams struct {
	ProviderParams
	RegionParams
	ProfileParams
}

type BaseProfile

type BaseProfile struct {
	ProfileName string `json:"profileName" form:"profileName"`
}

type BasicBackupTask

type BasicBackupTask struct {
	BasicTask
	SourcePoint ProviderConfig `json:"sourcePoint,omitempty"`
	TargetPoint ProviderConfig `json:"targetPoint,omitempty"`
}

type BasicDataTask

type BasicDataTask struct {
	BasicTask
	Directory   string         `json:"Directory,omitempty" swaggerignore:"true"`
	Dummy       GenFileParams  `json:"dummy"`
	SourcePoint ProviderConfig `json:"sourcePoint,omitempty"`
	TargetPoint ProviderConfig `json:"targetPoint,omitempty"`
}

type BasicFlow

type BasicFlow struct {
	FlowID   string     `json:"FlowID,omitempty"`
	FlowName string     `json:"FlowName"`
	Tasks    []DataTask `json:"tasks"`
	Status   Status     `json:"status"`
}

type BasicPageResponse

type BasicPageResponse struct {
	Content string  `json:"Content"`
	Error   *string `json:"Error"`
	OS      string  `json:"OS"`
	TmpPath string  `json:"TmpPath"`

	Regions    []string `json:"Regions"`
	AWSRegions []string `json:"AWSRegions"`
	GCPRegions []string `json:"GCPRegions"`
	NCPRegions []string `json:"NCPRegions"`
}

type BasicResponse

type BasicResponse struct {
	Result string  `json:"Result"`
	Error  *string `json:"Error"`
}

type BasicSchedule

type BasicSchedule struct {
	ScheduleID   string          `json:"ScheduleID,omitempty"`
	ScheduleName string          `json:"ScheduleName"`
	Tasks        []BasicDataTask `json:"tasks"`
	Cron         string          `json:"cron,omitempty"`
	StartTime    *time.Time      `json:"startTime,omitempty"`
	TimeZone     string          `json:"tz,omitempty"`

	Status Status `json:"status"`
}

type BasicTask

type BasicTask struct {
	TaskMeta `json:"meta,omitempty" swaggerignore:"true"`
	Status   `json:"status,omitempty" swaggerignore:"true"`
}

type CloudServiceType

type CloudServiceType string

Service type

const (
	ComputeService CloudServiceType = "compute"
	ObejectStorage CloudServiceType = "objectstorage"
	RDBMS          CloudServiceType = "rdbms"
	NRDBMS         CloudServiceType = "nrdbms"
)

type CommandTask

type CommandTask struct {
	Task
	TaskFilePath string
	GenFileParams
	SourcePoint     ProviderConfig `json:"sourcePoint,omitempty"`
	TargetPoint     ProviderConfig `json:"targetPoint,omitempty"`
	DeleteDBList    []string
	DeleteTableList []string
}

type CredParams

type CredParams struct {
	AccessKey   string
	SecretKey   string
	GcpCredPath string
	GcpCredJson string
}

type DataTask

type DataTask struct {
	OperationParams
	BasicDataTask
}

type FileFormatParams

type FileFormatParams struct {
	CheckSQL        bool `json:"checkSQL" form:"checkSQL"`
	CheckCSV        bool `json:"checkCSV" form:"checkCSV"`
	CheckTXT        bool `json:"checkTXT" form:"checkTXT"`
	CheckPNG        bool `json:"checkPNG" form:"checkPNG"`
	CheckGIF        bool `json:"checkGIF" form:"checkGIF"`
	CheckZIP        bool `json:"checkZIP" form:"checkZIP"`
	CheckJSON       bool `json:"checkJSON" form:"checkJSON"`
	CheckXML        bool `json:"checkXML" form:"checkXML"`
	CheckServerJSON bool `json:"checkServerJSON" form:"checkServerJSON"`
	CheckServerSQL  bool `json:"checkServerSQL" form:"checkServerSQL"`
}

type FileSizeParams

type FileSizeParams struct {
	SizeSQL        string `json:"sizeSQL" form:"sizeSQL"`
	SizeCSV        string `json:"sizeCSV" form:"sizeCSV"`
	SizeTXT        string `json:"sizeTXT" form:"sizeTXT"`
	SizePNG        string `json:"sizePNG" form:"sizePNG"`
	SizeGIF        string `json:"sizeGIF" form:"sizeGIF"`
	SizeZIP        string `json:"sizeZIP" form:"sizeZIP"`
	SizeJSON       string `json:"sizeJSON" form:"sizeJSON"`
	SizeXML        string `json:"sizeXML" form:"sizeXML"`
	SizeServerJSON string `json:"sizeServerJSON" form:"sizeServerJSON"`
	SizeServerSQL  string `json:"sizeServerSQL" form:"sizeServerSQL"`
}

type FirestoreParams

type FirestoreParams struct {
	DatabaseID string `json:"databaseId" form:"databaseId"`
	ProjectID  string `json:"projectId" form:"projectId"`
}

type Flow

type Flow struct {
	OperationParams
	BasicFlow
}

type GCPCredentalCreateParams

type GCPCredentalCreateParams struct {
	GCPCredentialJson string                `form:"gcpCredentialJson" json:"gcpCredentialJson"`
	GCPCredential     *multipart.FileHeader `form:"gcpCredential" json:"-" swaggerignore:"true"`
}

type GCPCredentials

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

type GCPMigrationParams

type GCPMigrationParams struct {
	ProjectID  string `json:"projectId" form:"projectId"`
	DatabaseID string `json:"databaseId" form:"databaseId"`
	GCPBucket  string `json:"bucket" form:"bucket"`
}

type GcpNosqlParams

type GcpNosqlParams struct {
	DatabaseID string `json:"databaseId" form:"databaseId"`
	ProjectID  string `json:"projectId" form:"projectId"`
}

type GenFileParams

type GenFileParams struct {
	Directory string `json:"Directory,omitempty" swaggerignore:"true"`
	DummyPath string `json:"dummyPath,omitempty" swaggerignore:"true"`
	FileFormatParams
	FileSizeParams
}

type GenMySQLParams

type GenMySQLParams struct {
	BaseParams
	MySQLParams
}

type GenTaskTarget

type GenTaskTarget struct {
	ProviderConfig
	GenFileParams
}

type GenarateTask

type GenarateTask struct {
	Task
	Dummy       GenFileParams  `json:"dummy"`
	TargetPoint ProviderConfig `json:"targetPoint"`
}

type LinuxMigrationParams

type LinuxMigrationParams struct {
	Path string `json:"path" form:"path"`
}

type MigrateTask

type MigrateTask struct {
	DataTask
}

type MigrationMySQLForm

type MigrationMySQLForm struct {
	SProvider     string `json:"srcProvider" form:"srcProvider"`
	SHost         string `json:"srcHost" form:"srcHost"`
	SPort         string `json:"srcPort" form:"srcPort"`
	SUsername     string `json:"srcUsername" form:"srcUsername"`
	SPassword     string `json:"srcPassword" form:"srcPassword"`
	SDatabaseName string `json:"srcDatabaseName" form:"srcDatabaseName"`

	DProvider     string `json:"destProvider" form:"destProvider"`
	DHost         string `json:"destHost" form:"destHost"`
	DPort         string `json:"destPort" form:"destPort"`
	DUsername     string `json:"destUsername" form:"destUsername"`
	DPassword     string `json:"destPassword" form:"destPassword"`
	DDatabaseName string `json:"destDatabaseName" form:"destDatabaseName"`
}

type MigrationMySQLParams

type MigrationMySQLParams struct {
	SourcePoint MySQLParams
	TargetPoint MySQLParams
}

type MigrationParams

type MigrationParams struct {
	OperationParams
	//src
	SrcProvider ProviderConfig

	//dst
	DstProvider ProviderConfig
}

type MongoMigrationParams

type MongoMigrationParams struct {
	MongoHost     string `form:"host" json:"host"`
	MongoPort     string `form:"port" json:"port"`
	MongoUsername string `form:"username" json:"username"`
	MongoPassword string `form:"password" json:"password"`
	MongoDBName   string `form:"databaseName" json:"databaseName"`
}

type MySQLParams

type MySQLParams struct {
	Host         string `json:"host" form:"host"`
	Port         string `json:"port" form:"port"`
	User         string `json:"username" form:"username"`
	Password     string `json:"password" form:"password"`
	DatabaseName string `json:"databaseName" form:"databaseName"`
}

type NCPCredentials

type NCPCredentials struct {
	AccessKey string `json:"accessKey" form:"accessKey"`
	SecretKey string `json:"secretKey" form:"secretKey"`
}

type NCPMigrationParams

type NCPMigrationParams struct {
	ObjectStorageParams
}

type NoSQLParams

type NoSQLParams struct {
	GcpNosqlParams
}

type Object

type Object struct {
	ChecksumAlgorithm []string
	ETag              string
	Key               string
	LastModified      time.Time
	Size              int64
	StorageClass      string
	Provider
}

object

type ObjectStorageParams

type ObjectStorageParams struct {
	Bucket   string `json:"bucket" form:"bucket"`
	Endpoint string `json:"endpoint" form:"endpoint"`
}

type OperationParams

type OperationParams struct {
	OperationId string `json:"operationId" form:"operationId"`
}

type ProfileCredentials

type ProfileCredentials struct {
	AWS AWSCredentials `json:"aws,omitempty"`
	NCP NCPCredentials `json:"ncp,omitempty"`
	GCP GCPCredentials `json:"gcp,omitempty"`
}

type ProfileParams

type ProfileParams struct {
	ProfileName string `json:"profileName" form:"profileName"`
}

type Provider

type Provider string

Cloud Service Provider type

const (
	AWS Provider = "aws"
	GCP Provider = "gcp"
	NCP Provider = "ncp"
	OPM Provider = "on-premise"
)

type ProviderConfig

type ProviderConfig struct {
	// common
	BaseParams
	// linux,win
	LinuxMigrationParams
	// osc
	ObjectStorageParams
	// RDB
	MySQLParams
	// NRDB
	NoSQLParams
}

type ProviderParams

type ProviderParams struct {
	Provider string `json:"provider" form:"provider"`
}

type RegionParams

type RegionParams struct {
	Region string `json:"region" form:"region"`
}

type RestoreTask

type RestoreTask struct {
	DataTask
}

type Schedule

type Schedule struct {
	OperationParams
	TagParams
	BasicSchedule
}

type ServiceType

type ServiceType struct {
	Type CloudServiceType `json:"type" form:"type"` // The type of cloud service
}

type Status

type Status string

Status type

const (
	StatusActive    Status = "active"
	StatusInactive  Status = "inactive"
	StatusPending   Status = "pending"
	StatusCompleted Status = "completed"
	StatusFailed    Status = "failed"
)

type TagParams

type TagParams struct {
	Tag []string `json:"tag,omitempty"`
}

type Task

type Task struct {
	OperationParams
	TagParams
	BasicTask
}

type TaskMeta

type TaskMeta struct {
	ServiceType CloudServiceType `json:"serviceType"`
	TaskType    TaskType         `json:"taskType" `
	TaskID      string           `json:"taskId,omitempty" `
	TaskName    string           `json:"taskName,omitempty" `
	Description string           `json:"description,omitempty"`
}

type TaskType

type TaskType string

Task type

const (
	Generate TaskType = "generate"
	Migrate  TaskType = "migrate"
	Backup   TaskType = "backup"
	Restore  TaskType = "restore"
)

Jump to

Keyboard shortcuts

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