migration

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package migration is to provision target multi-cloud infra for migration

Package migration is to privision targat multi-cloud infra for migration

Index

Constants

View Source
const (
	// ActionCreate is const for Create
	ActionCreate string = "Create"

	// ActionTerminate is const for Terminate
	ActionTerminate string = "Terminate"

	// ActionSuspend is const for Suspend
	ActionSuspend string = "Suspend"

	// ActionResume is const for Resume
	ActionResume string = "Resume"

	// ActionReboot is const for Reboot
	ActionReboot string = "Reboot"

	// ActionRefine is const for Refine
	ActionRefine string = "Refine"

	// ActionComplete is const for Complete
	ActionComplete string = "None"
)
View Source
const (
	// StatusRunning is const for Running
	StatusRunning string = "Running"

	// StatusSuspended is const for Suspended
	StatusSuspended string = "Suspended"

	// StatusFailed is const for Failed
	StatusFailed string = "Failed"

	// StatusTerminated is const for Terminated
	StatusTerminated string = "Terminated"

	// StatusCreating is const for Creating
	StatusCreating string = "Creating"

	// StatusSuspending is const for Suspending
	StatusSuspending string = "Suspending"

	// StatusResuming is const for Resuming
	StatusResuming string = "Resuming"

	// StatusRebooting is const for Rebooting
	StatusRebooting string = "Rebooting"

	// StatusTerminating is const for Terminating
	StatusTerminating string = "Terminating"

	// StatusUndefined is const for Undefined
	StatusUndefined string = "Undefined"

	// StatusComplete is const for Complete
	StatusComplete string = "None"
)
View Source
const DefaultSystemLabel string = "Managed by CM-Beetle"

DefaultSystemLabel is const for string to specify the Default System Label

Variables

This section is empty.

Functions

func CreateObjectStorage added in v0.5.1

func CreateObjectStorage(nsId string, req storagemodel.RecommendedObjectStorage, seed string) error

CreateObjectStorage migrates object storages to the target cloud. It applies late-binding via the seed parameter, creates each bucket, then configures versioning and CORS according to CSP support information.

func CreateVMInfra added in v0.1.1

func CreateVMInfra(nsId string, targetInfraModel *cloudmodel.RecommendedInfra) (cloudmodel.VmInfraInfo, error)

CreateVMInfra creates a VM infrastructure for the computing infra migration

func CreateVMInfraWithDefaults added in v0.3.1

func CreateVMInfraWithDefaults(nsId string, infraModel *cloudmodel.InfraDynamicReq) (cloudmodel.VmInfraInfo, error)

CreateVMInfraWithDefaults Create a VM infrastructure with defaults for the computing infra migration

func DeleteObjectStorage added in v0.5.1

func DeleteObjectStorage(nsId, osId, option string) error

DeleteObjectStorage deletes a specific object storage. Treats 404 as already deleted (idempotent). option controls deletion behavior: "" (standard), "empty" (empty first), "force" (force with contents), "reconcile" (metadata only).

func DeleteStorageObject added in v0.5.1

func DeleteStorageObject(nsId, osId, objectKey string) error

DeleteStorageObject deletes a specific object from an object storage bucket.

func DeleteVMInfra added in v0.1.1

func DeleteVMInfra(nsId, infraId, option string) (common.SimpleMsg, error)

Delete the migrated VM infrastructure

func ExistObjectStorage added in v0.5.1

func ExistObjectStorage(nsId, osId string) (bool, error)

ExistObjectStorage checks whether a specific object storage exists.

func GenerateConnectionName added in v0.5.1

func GenerateConnectionName(csp, region string) (string, error)

GenerateConnectionName builds and validates a connection name from csp and region.

func GetVMInfra added in v0.1.1

func GetVMInfra(nsId, infraId string) (cloudmodel.InfraInfo, error)

Get the migrated VM infrastructure

func ListAllVMInfraInfo added in v0.2.4

func ListAllVMInfraInfo(nsId string) (cloudmodel.InfraInfoList, error)

List all migrated VM infrastructures

func ListVMInfraIDs added in v0.2.4

func ListVMInfraIDs(nsId string, option string) (cloudmodel.IdList, error)

Get all migrated VM infrastructures

Types

type MigratedObjectStorageInfo added in v0.5.1

type MigratedObjectStorageInfo struct {
	Id             string `json:"id"`                     // Bucket ID (unique identifier within the namespace)
	Name           string `json:"name"`                   // Bucket name in the target cloud
	Status         string `json:"status"`                 // Current status (e.g., "Available")
	Description    string `json:"description"`            // Description
	ConnectionName string `json:"connectionName"`         // Connection identifier (format: "{csp}-{region}")
	CreationDate   string `json:"creationDate,omitempty"` // Bucket creation date (RFC 3339)
}

MigratedObjectStorageInfo represents an object storage bucket created in the target cloud via CM-Beetle.

func GetObjectStorage added in v0.5.1

func GetObjectStorage(nsId, osId string) (MigratedObjectStorageInfo, error)

GetObjectStorage returns details of a specific migrated object storage.

type MigratedObjectStorageListResponse added in v0.5.1

type MigratedObjectStorageListResponse struct {
	ObjectStorages []MigratedObjectStorageInfo `json:"objectStorages"`
}

MigratedObjectStorageListResponse is the list response for migrated object storages.

func ListObjectStorages added in v0.5.1

func ListObjectStorages(nsId string) (MigratedObjectStorageListResponse, error)

ListObjectStorages returns all migrated object storages in the namespace.

type StorageObjectInfo added in v0.5.1

type StorageObjectInfo struct {
	Key          string `json:"key"`                    // Object key (relative path within the bucket)
	Size         int64  `json:"size"`                   // Size in bytes
	LastModified string `json:"lastModified,omitempty"` // Last modified timestamp (RFC 3339)
	ETag         string `json:"eTag,omitempty"`         // Entity tag (content hash)
	StorageClass string `json:"storageClass,omitempty"` // Storage class (e.g., STANDARD)
}

StorageObjectInfo represents a single object in an object storage bucket.

type StorageObjectListResponse added in v0.5.1

type StorageObjectListResponse struct {
	OsId    string              `json:"osId"`    // Object storage ID
	Count   int                 `json:"count"`   // Total number of objects
	Objects []StorageObjectInfo `json:"objects"` // List of objects
}

StorageObjectListResponse is the list response for objects in an object storage bucket.

func ListObjectStorageObjects added in v0.5.1

func ListObjectStorageObjects(nsId, osId string) (StorageObjectListResponse, error)

ListObjectStorageObjects returns the list of objects stored in a specific object storage bucket.

type StorageObjectMetadata added in v0.5.1

type StorageObjectMetadata struct {
	Key          string `json:"key"`                    // Object key
	Size         int64  `json:"size"`                   // Size in bytes
	LastModified string `json:"lastModified,omitempty"` // Last modified timestamp
	ETag         string `json:"eTag,omitempty"`         // Entity tag (content hash)
	StorageClass string `json:"storageClass,omitempty"` // Storage class
}

StorageObjectMetadata represents the metadata of a single object returned by a HEAD request.

func GetStorageObject added in v0.5.1

func GetStorageObject(nsId, osId, objectKey string) (StorageObjectMetadata, error)

GetStorageObject retrieves metadata of a specific object from an object storage bucket.

Jump to

Keyboard shortcuts

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