controller

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: 28 Imported by: 1

Documentation

Overview

Package controller has handlers and their request/response bodies for migration APIs

Package controller has handlers and their request/response bodies for migration APIs

Package controller has handlers and their request/response bodies for migration APIs

Package controller has handlers and their request/response bodies for migration APIs

Package controller is to handle REST API for beetle

Package common is to handle REST API for common funcitonalities

Package common is to handle REST API for common funcitonalities

Package controller provides REST API controllers for migration reports

Package controller has handlers for infrastructure summary APIs

Package controller contains the handlers for REST API

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AlignNames added in v0.5.1

func AlignNames(c echo.Context) error

AlignNames godoc @ID AlignNames @Summary Propagate a resource name change to all dependent child resources @Description When a parent/primary resource is renamed (e.g., VNet), this API updates all @Description child/dependent references in the model (e.g., SecurityGroup.VNetId, SubGroup.VNetId). @Description @Description **Supported resourceType values** (cb-tumblebug convention): @Description - `vNet` : Rename VNet → propagates to SecurityGroup.VNetId, SubGroup.VNetId @Description - `subnet` : Rename Subnet → propagates to SubGroup.SubnetId @Description - `sshKey` : Rename SSH Key → propagates to SubGroup.SshKeyId @Description - `securityGroup` : Rename SecurityGroup → propagates to SubGroup.SecurityGroupIds @Description - `infra` : Rename Infra (no child propagation) @Description @Description After propagation, names are validated for referential integrity. @Description The returned model uses **base names only** (NameSeed is applied at migration time via query param). @Description @Description See also: [API Guide: Align Names](https://github.com/cloud-barista/cm-beetle/blob/main/docs/api-guide-align-names.md) @Description @Tags [Infrastructure] Resource Naming @Accept json @Produce json @Param resourceType query string true "Resource type to rename" Enums(vNet,subnet,securityGroup,sshKey,infra) @Param oldName query string true "Current name of the resource (before change)" @Param newName query string true "New name of the resource (after change)" @Param UserInfra body cloudmodel.RecommendedInfra true "The recommendation model to update" @Param X-Request-Id header string false "Unique request ID" @Success 200 {object} model.ApiResponse[cloudmodel.RecommendedInfra] "Updated and validated model (base names)" @Failure 400 {object} model.ApiResponse[any] "Invalid request or referential integrity failure" @Router /naming/alignment [post]

func CheckHTTPVersion added in v0.4.6

func CheckHTTPVersion(c echo.Context) error

CheckHTTPVersion godoc @ID CheckHTTPVersion @Summary Check HTTP version of incoming request @Description Checks and returns the HTTP protocol version of the incoming request. @Description @Description [Note] @Description - The X-Request-Id header value (auto-generated if not provided) is propagated to Tumblebug when Beetle calls its APIs for distributed tracing. @Tags [Admin] API Request Management @Accept json @Produce json @Param X-Request-Id header string false "Unique request ID (auto-generated if not provided). Used for tracking request status and correlating logs." @Success 200 {object} model.ApiResponse[string] "HTTP protocol version (e.g., HTTP/1.1, HTTP/2.0)" @Failure 500 {object} model.ApiResponse[any] "Internal server error" @Router /httpVersion [get]

func CreateMigratedSSHKey added in v0.3.1

func CreateMigratedSSHKey(c echo.Context) error

CreateMigratedSSHKey godoc @ID CreateMigratedSSHKey @Summary Create a migrated SSH key @Description Create a new migrated SSH key in the namespace @Tags [Migration] Resources for VM infrastructure @Accept json @Produce json @Param nsId path string true "Namespace ID" default(mig01) @Param option query string false "Option: [required params for register] connectionName, name, cspResourceId, fingerprint, username, publicKey, privateKey" Enums(register) @Param x-request-id header string false "Custom request ID for tracking" @Param x-credential-holder header string false "Credential holder ID for selecting which credentials to use (default: system default holder)" @Param sshKeyReq body tbmodel.SshKeyReq true "Details for an SSH key object" @Success 200 {object} tbmodel.SshKeyInfo @Failure 404 {object} tbmodel.SimpleMsg @Failure 500 {object} tbmodel.SimpleMsg @Router /migration/ns/{nsId}/resources/sshKey [post]

func CreateMigratedSecurityGroup added in v0.3.1

func CreateMigratedSecurityGroup(c echo.Context) error

CreateMigratedSecurityGroup godoc @ID CreateMigratedSecurityGroup @Summary Create a migrated security group @Description Create a new migrated security group in the namespace @Tags [Migration] Resources for VM infrastructure @Accept json @Produce json @Param nsId path string true "Namespace ID" default(mig01) @Param option query string false "Option: [required params for register] connectionName, name, vNetId, cspResourceId" Enums(register) @Param x-request-id header string false "Custom request ID for tracking" @Param x-credential-holder header string false "Credential holder ID for selecting which credentials to use (default: system default holder)" @Param securityGroupReq body tbmodel.SecurityGroupReq true "Details for an securityGroup object" @Success 200 {object} tbmodel.SecurityGroupInfo @Failure 404 {object} tbmodel.SimpleMsg @Failure 500 {object} tbmodel.SimpleMsg @Router /migration/ns/{nsId}/resources/securityGroup [post]

func CreateVNet added in v0.3.1

func CreateVNet(c echo.Context) error

CreateVNet godoc @ID CreateVNet @Summary Create a migrated virtual network @Description Create a new migrated virtual network in the namespace @Tags [Migration] Resources for VM infrastructure @Accept json @Produce json @Param nsId path string true "Namespace ID" default(mig01) @Param x-request-id header string false "Custom request ID for tracking" @Param x-credential-holder header string false "Credential holder ID for selecting which credentials to use (default: system default holder)" @Param vNetReq body tbmodel.VNetReq true "Virtual Network creation request" @Success 201 {object} tbmodel.VNetInfo @Failure 404 {object} tbmodel.SimpleMsg @Failure 409 {object} tbmodel.SimpleMsg @Failure 500 {object} tbmodel.SimpleMsg @Router /migration/ns/{nsId}/resources/vNet [post]

func DeleteInfra added in v0.1.1

func DeleteInfra(c echo.Context) error

DeleteInfra godoc @ID DeleteInfra @Summary Delete the migrated mult-cloud infrastructure (MCI) @Description Delete the migrated mult-cloud infrastructure (MCI) @Tags [Migration] Infrastructure @Accept json @Produce json @Param nsId path string true "Namespace ID" default(mig01) @Param infraId path string true "Migrated Cloud Infrastructure ID (the actual ID returned by the migration API; includes NameSeed prefix if used, e.g., 'my-infra101')" default(my-infra101) @Param option query string false "Option for deletion" Enums(terminate,force) default(terminate) @Param X-Request-Id header string false "Unique request ID (auto-generated if not provided). Used for tracking request status and correlating logs." @Success 200 {object} model.ApiResponse[any] "The result of deleting the migrated multi-cloud infrastructure" @Failure 404 {object} model.ApiResponse[any] @Failure 500 {object} model.ApiResponse[any] @Router /migration/ns/{nsId}/infra/{infraId} [delete]

func DeleteMigratedSSHKey added in v0.3.1

func DeleteMigratedSSHKey(c echo.Context) error

DeleteMigratedSSHKey godoc @ID DeleteMigratedSSHKey @Summary Delete a migrated SSH key @Description Delete a specific migrated SSH key in the namespace @Tags [Migration] Resources for VM infrastructure @Accept json @Produce json @Param nsId path string true "Namespace ID" default(mig01) @Param sshKeyId path string true "SSH Key ID" default(mig-sshkey-01) @Param x-request-id header string false "Custom request ID for tracking" @Param x-credential-holder header string false "Credential holder ID for selecting which credentials to use (default: system default holder)" @Success 200 {object} tbmodel.SimpleMsg @Failure 404 {object} tbmodel.SimpleMsg @Failure 500 {object} tbmodel.SimpleMsg @Router /migration/ns/{nsId}/resources/sshKey/{sshKeyId} [delete]

func DeleteMigratedSSHKeys added in v0.5.1

func DeleteMigratedSSHKeys(c echo.Context) error

DeleteMigratedSSHKeys godoc @ID DeleteMigratedSSHKeys @Summary Delete multiple migrated SSH keys @Description Delete multiple migrated SSH keys in the namespace @Tags [Migration] Resources for VM infrastructure @Accept json @Produce json @Param nsId path string true "Namespace ID" default(mig01) @Param match query string false "Delete resources containing matched ID-substring only" default() @Param x-request-id header string false "Custom request ID for tracking" @Param x-credential-holder header string false "Credential holder ID for selecting which credentials to use (default: system default holder)" @Success 200 {object} tbmodel.ResourceDeleteResults @Failure 404 {object} tbmodel.SimpleMsg @Router /migration/ns/{nsId}/resources/sshKey [delete]

func DeleteMigratedSecurityGroup added in v0.3.1

func DeleteMigratedSecurityGroup(c echo.Context) error

DeleteMigratedSecurityGroup godoc @ID DeleteMigratedSecurityGroup @Summary Delete a migrated security group @Description Delete a specific migrated security group in the namespace @Tags [Migration] Resources for VM infrastructure @Accept json @Produce json @Param nsId path string true "Namespace ID" default(mig01) @Param sgId path string true "Security Group ID" default(mig-sg-01) @Param x-request-id header string false "Custom request ID for tracking" @Param x-credential-holder header string false "Credential holder ID for selecting which credentials to use (default: system default holder)" @Success 200 {object} tbmodel.SimpleMsg @Failure 404 {object} tbmodel.SimpleMsg @Failure 500 {object} tbmodel.SimpleMsg @Router /migration/ns/{nsId}/resources/securityGroup/{sgId} [delete]

func DeleteMigratedSecurityGroups added in v0.3.8

func DeleteMigratedSecurityGroups(c echo.Context) error

DeleteMigratedSecurityGroups godoc @ID DeleteMigratedSecurityGroups @Summary Delete multiple migrated security groups @Description Delete multiple migrated security groups in the namespace @Tags [Migration] Resources for VM infrastructure @Accept json @Produce json @Param nsId path string true "Namespace ID" default(mig01) @Param match query string false "Delete resources containing matched ID-substring only" default() @Param x-request-id header string false "Custom request ID for tracking" @Param x-credential-holder header string false "Credential holder ID for selecting which credentials to use (default: system default holder)" @Success 200 {object} tbmodel.ResourceDeleteResults @Failure 404 {object} tbmodel.SimpleMsg @Router /migration/ns/{nsId}/resources/securityGroup [delete]

func DeleteMigratedVNet added in v0.3.1

func DeleteMigratedVNet(c echo.Context) error

DeleteMigratedVNet godoc @ID DeleteMigratedVNet @Summary Delete a migrated virtual network @Description Delete a specific migrated virtual network in the namespace. Action options: withsubnets (delete with subnets), reconcile (sync metadata with CSP state), force (force-delete on CSP) @Tags [Migration] Resources for VM infrastructure @Accept json @Produce json @Param nsId path string true "Namespace ID" default(mig01) @Param vNetId path string true "Virtual Network ID" default(mig-vnet-01) @Param action query string false "Action" Enums(withsubnets,reconcile,force) default(withsubnets) @Param x-request-id header string false "Custom request ID for tracking" @Param x-credential-holder header string false "Credential holder ID for selecting which credentials to use (default: system default holder)" @Success 200 {object} tbmodel.SimpleMsg @Failure 404 {object} tbmodel.SimpleMsg @Router /migration/ns/{nsId}/resources/vNet/{vNetId} [delete]

func DeleteMigratedVNets added in v0.5.1

func DeleteMigratedVNets(c echo.Context) error

DeleteMigratedVNets godoc @ID DeleteMigratedVNets @Summary Delete multiple migrated virtual networks @Description Delete multiple migrated virtual networks in the namespace @Tags [Migration] Resources for VM infrastructure @Accept json @Produce json @Param nsId path string true "Namespace ID" default(mig01) @Param match query string false "Delete resources containing matched ID-substring only" default() @Param x-request-id header string false "Custom request ID for tracking" @Param x-credential-holder header string false "Credential holder ID for selecting which credentials to use (default: system default holder)" @Success 200 {object} tbmodel.ResourceDeleteResults @Failure 404 {object} tbmodel.SimpleMsg @Router /migration/ns/{nsId}/resources/vNet [delete]

func DeleteObjectStorage added in v0.4.2

func DeleteObjectStorage(c echo.Context) error

DeleteObjectStorage godoc @ID DeleteObjectStorage @Summary Delete object storage (bucket) @Description Delete a specific object storage (bucket). @Description @Description Deletion behavior is controlled by the `option` query parameter (mutually exclusive): @Description - (none): Standard delete — fails if the bucket is not empty. @Description - `empty`: Empty the bucket first, then delete. @Description - `force`: Force-delete with all contents (passed to Spider as force=true). @Description - `reconcile`: Remove only Tumblebug metadata without calling the CSP delete API. @Tags [Migration] Managed middleware (preview) @Accept json @Produce json @Param nsId path string true "Namespace ID" default(mig01) @Param osId path string true "Object Storage ID (bucket ID)" @Param option query string false "Delete option" Enums(empty, force, reconcile) @Param X-Request-Id header string false "Unique request ID (auto-generated if not provided). Used for tracking request status and correlating logs." @Success 204 "Object storage deleted successfully" @Failure 400 {object} model.ApiResponse[any] "Invalid request parameters" @Failure 404 {object} model.ApiResponse[any] "Object storage not found" @Failure 500 {object} model.ApiResponse[any] "Internal server error during deletion" @Router /migration/middleware/ns/{nsId}/objectStorage/{osId} [delete]

func DeleteStorageObject added in v0.5.1

func DeleteStorageObject(c echo.Context) error

DeleteStorageObject godoc @ID DeleteStorageObject @Summary Delete an object from an object storage bucket @Description Delete a specific object from an object storage bucket @Description by proxying Tumblebug DELETE /ns/{nsId}/resources/objectStorage/{osId}/object/{objectKey}. @Description Note: URL-encode the objectKey if it contains slashes (e.g., folder%2Ffile.txt). @Tags [Migration] Managed middleware (preview) @Accept json @Produce json @Param nsId path string true "Namespace ID" default(mig01) @Param osId path string true "Object Storage ID (bucket ID)" @Param objectKey path string true "Object key (URL-encode slashes if needed)" @Param X-Request-Id header string false "Unique request ID (auto-generated if not provided). Used for tracking request status and correlating logs." @Success 204 "Object deleted" @Failure 400 {object} model.ApiResponse[any] "Invalid request parameters" @Failure 404 {object} model.ApiResponse[any] "Object not found" @Failure 500 {object} model.ApiResponse[any] "Internal server error" @Router /migration/middleware/ns/{nsId}/objectStorage/{osId}/object/{objectKey} [delete]

func ExistObjectStorage added in v0.4.2

func ExistObjectStorage(c echo.Context) error

ExistObjectStorage godoc @ID ExistObjectStorage @Summary Check object storage (bucket) existence @Description Check if a specific object storage (bucket) exists @Description @Description [Note] @Description - Returns 200 OK if the bucket exists, 404 Not Found if it doesn't exist @Tags [Migration] Managed middleware (preview) @Accept json @Produce json @Param nsId path string true "Namespace ID" default(mig01) @Param osId path string true "Object Storage ID (bucket ID)" @Param X-Request-Id header string false "Unique request ID (auto-generated if not provided). Used for tracking request status and correlating logs." @Success 200 "OK - Object storage exists" @Failure 400 {object} model.ApiResponse[any] "Invalid request parameters" @Failure 404 {object} model.ApiResponse[any] "Object storage not found" @Failure 500 {object} model.ApiResponse[any] "Internal server error during existence check" @Router /migration/middleware/ns/{nsId}/objectStorage/{osId} [head]

func GenerateMigrationReport added in v0.4.3

func GenerateMigrationReport(c echo.Context) error

GenerateMigrationReport godoc @ID GenerateMigrationReport @Summary Generate migration report (with source-target correlation analysis) @Description Generate a comprehensive migration report comparing source infrastructure with target cloud VMs, including resource mappings, network/security analysis, cost summary, and recommendations in Markdown or HTML format @Tags Summary/Report Infrastructure Analysis for Migration @Accept json @Produce text/markdown @Produce text/html @Param nsId path string true "Namespace ID" example("mig01") default(mig01) @Param infraId path string true "Infra ID" example("infra101") default(infra101) @Param format query string false "Report format: md or html" Enums(md,html) default(md) @Param download query string false "Download as file: true for file download, false for inline display (only affects browsers/Swagger UI, not curl)" Enums(true,false) default(false) @Param onpremiseInfraModel body controller.GenerateMigrationReportRequest true "Source infrastructure data from on-premise" @Success 200 {string} string "Migration report in markdown or HTML format" @Header 200 {string} Content-Disposition "inline; filename="migration-report.md" or "migration-report.html" (or attachment when download=true)" @Header 200 {string} Content-Type "text/markdown; charset=utf-8 or text/html; charset=utf-8" @Failure 400 {object} model.ApiResponse[any] "Invalid request parameters" @Failure 500 {object} model.ApiResponse[any] "Internal server error during report generation" @Router /report/migration/ns/{nsId}/infra/{infraId} [post]

func GenerateSourceInfraSummary added in v0.4.3

func GenerateSourceInfraSummary(c echo.Context) error

GenerateSourceInfraSummary godoc @ID GenerateSourceInfraSummary @Summary Generate source infrastructure summary @Description Generate a comprehensive source infrastructure summary from on-premise data in multiple formats based on 'format' query parameter: @Description @Description **Response Format by 'format' Parameter:** @Description - `format=json`: Returns ApiResponse[SourceInfraSummary] with Content-Type: application/json @Description - `format=md` (default): Returns markdown string with Content-Type: text/markdown; charset=utf-8 @Description - `format=html`: Returns HTML string with Content-Type: text/html; charset=utf-8 @Description @Description **Note:** API documentation shows JSON schema for reference, but actual default response is markdown format. @Description @Description **Markdown example**: https://github.com/cloud-barista/cm-beetle/blob/main/cmd/test-cli/infra/testresult/beetle-summary-source.md @Description @Description **Download Behavior:** @Description - `download=false` (default): Content displayed inline (viewable in browser/Swagger UI) @Description - `download=true`: Content downloaded as file (Content-Disposition: attachment) @Tags Summary/Report Infrastructure Analysis for Migration @Accept json @Produce json @Produce text/markdown @Produce text/html @Param format query string false "Summary format: md, html, or json" Enums(md,html,json) default(md) @Param download query string false "Download as file: true for file download, false for inline display (only affects browsers/Swagger UI, not curl)" Enums(true,false) default(false) @Param X-Request-Id header string false "Unique request ID (auto-generated if not provided). Used for tracking request status and correlating logs." @Param Request body controller.GenerateSourceInfraSummaryRequest true "Source infrastructure data" @Success 200 {object} model.ApiResponse[summary.SourceInfraSummary] "Successfully generated source infrastructure summary (format varies by 'format' parameter)" @Header 200 {string} Content-Disposition "inline; filename="source-summary.md" or "source-summary.html" (or attachment when download=true)" @Header 200 {string} Content-Type "text/markdown; charset=utf-8 or text/html; charset=utf-8" @Failure 400 {object} model.ApiResponse[any] "Invalid request parameters" @Failure 500 {object} model.ApiResponse[any] "Internal server error during summary generation" @Router /summary/source [post]

func GenerateTargetInfraSummary added in v0.4.3

func GenerateTargetInfraSummary(c echo.Context) error

GenerateTargetInfraSummary godoc @ID GenerateTargetInfraSummary @Summary Generate target infrastructure summary @Description Generate a comprehensive target infrastructure summary in multiple formats based on 'format' query parameter: @Description @Description **Response Format by 'format' Parameter:** @Description - `format=md` (default): Returns markdown string with Content-Type: text/markdown; charset=utf-8 @Description - `format=html`: Returns HTML string with Content-Type: text/html; charset=utf-8 @Description - `format=json`: Returns ApiResponse[TargetInfraSummary] with Content-Type: application/json @Description @Description **Note:** API documentation shows JSON schema for reference, but actual default response is markdown format. @Description @Description **Markdown example**: https://github.com/cloud-barista/cm-beetle/blob/main/cmd/test-cli/infra/testresult/beetle-summary-target-aws.md @Description @Description **Download Behavior:** @Description - `download=false` (default): Content displayed inline (viewable in browser/Swagger UI) @Description - `download=true`: Content downloaded as file (Content-Disposition: attachment) @Tags Summary/Report Infrastructure Analysis for Migration @Accept json @Produce json @Produce text/markdown @Produce text/html @Param nsId path string true "Namespace ID" default(mig01) @Param mciId path string true "Multi-Cloud Infrastructure (MCI) ID" default(mci101) @Param format query string false "Summary format: md, html, or json" Enums(md,html,json) default(md) @Param download query string false "Download as file: true for file download, false for inline display (only affects browsers/Swagger UI, not curl)" Enums(true,false) default(false) @Param X-Request-Id header string false "Unique request ID (auto-generated if not provided). Used for tracking request status and correlating logs." @Success 200 {object} model.ApiResponse[summary.TargetInfraSummary] "Successfully generated target infrastructure summary (format varies by 'format' parameter)" @Header 200 {string} Content-Disposition "inline; filename="target-summary.md" or "target-summary.html" (or attachment when download=true)" @Header 200 {string} Content-Type "text/markdown; charset=utf-8 or text/html; charset=utf-8" @Failure 400 {object} model.ApiResponse[any] "Invalid request parameters" @Failure 500 {object} model.ApiResponse[any] "Internal server error during summary generation" @Router /summary/target/ns/{nsId}/infra/{infraId} [get]

func GetDataMigrationEncryptionKey added in v0.5.1

func GetDataMigrationEncryptionKey(c echo.Context) error

GetDataMigrationEncryptionKey godoc @ID GetDataMigrationEncryptionKey @Summary Get encryption public key for secure data migration @Description Generate and return a one-time RSA public key for encrypting sensitive fields in DataMigrationModel. @Description @Description [Encryption Workflow] @Description 1. Client calls this API to get a public key bundle @Description 2. Client encrypts sensitive fields using the public key @Description 3. Client sends encrypted model to POST /migration/data @Description 4. Server decrypts using the stored private key (auto-deleted after use) @Description @Description [Note] @Description * **One-time key**: Automatically invalidated after first decryption use @Description * **Key validity**: 30 minutes from generation (configurable in server) @Description * **Encrypted fields**: SSH privateKey, S3 credentials, auth passwords/tokens @Description * **Algorithm**: RSA-OAEP-256 (key exchange) + AES-256-GCM (data encryption) @Description @Description [Client Example] @Description See: https://github.com/cloud-barista/cm-beetle/blob/main/transx/README.md#usage-encrypted-transmission-recommended-for-production @Description @Tags [Migration] Data (incubating) @Accept json @Produce json @Param X-Request-Id header string false "Unique request ID (auto-generated if not provided). Used for tracking request status and correlating logs." @Success 200 {object} model.ApiResponse[transx.PublicKeyBundle] "Public key bundle containing keyId, algorithm, publicKey (PEM), and expiresAt" @Failure 500 {object} model.ApiResponse[any] "Key generation failed" @Router /migration/data/encryptionKey [get]

func GetInfra added in v0.1.1

func GetInfra(c echo.Context) error

GetInfra godoc @ID GetInfra @Summary Get the migrated multi-cloud infrastructure (MCI) @Description Get the migrated multi-cloud infrastructure (MCI) @Tags [Migration] Infrastructure @Accept json @Produce json @Param nsId path string true "Namespace ID" default(mig01) @Param infraId path string true "Migrated Cloud Infrastructure ID (the actual ID returned by the migration API; includes NameSeed prefix if used, e.g., 'my-infra101')" default(my-infra101) @Param X-Request-Id header string false "Unique request ID (auto-generated if not provided). Used for tracking request status and correlating logs." @Success 200 {object} model.ApiResponse[MigrateInfraResponse] "The migrated multi-cloud infrastructure information" @Failure 404 {object} model.ApiResponse[any] @Failure 500 {object} model.ApiResponse[any] @Router /migration/ns/{nsId}/infra/{infraId} [get]

func GetMigratedSSHKey added in v0.3.1

func GetMigratedSSHKey(c echo.Context) error

GetMigratedSSHKey godoc @ID GetMigratedSSHKey @Summary Get a specific migrated SSH key @Description Get details of a specific migrated SSH key in the namespace @Tags [Migration] Resources for VM infrastructure @Accept json @Produce json @Param nsId path string true "Namespace ID" default(mig01) @Param sshKeyId path string true "SSH Key ID" default(mig-sshkey-01) @Param x-request-id header string false "Custom request ID for tracking" @Param x-credential-holder header string false "Credential holder ID for selecting which credentials to use (default: system default holder)" @Success 200 {object} tbmodel.SshKeyInfo @Failure 404 {object} tbmodel.SimpleMsg @Failure 500 {object} tbmodel.SimpleMsg @Router /migration/ns/{nsId}/resources/sshKey/{sshKeyId} [get]

func GetMigratedSecurityGroup added in v0.3.1

func GetMigratedSecurityGroup(c echo.Context) error

GetMigratedSecurityGroup godoc @ID GetMigratedSecurityGroup @Summary Get a specific migrated security group @Description Get details of a specific migrated security group in the namespace @Tags [Migration] Resources for VM infrastructure @Accept json @Produce json @Param nsId path string true "Namespace ID" default(mig01) @Param sgId path string true "Security Group ID" default(mig-sg-01) @Param x-request-id header string false "Custom request ID for tracking" @Param x-credential-holder header string false "Credential holder ID for selecting which credentials to use (default: system default holder)" @Success 200 {object} tbmodel.SecurityGroupInfo @Failure 404 {object} tbmodel.SimpleMsg @Failure 500 {object} tbmodel.SimpleMsg @Router /migration/ns/{nsId}/resources/securityGroup/{sgId} [get]

func GetMigratedVNet added in v0.3.1

func GetMigratedVNet(c echo.Context) error

GetMigratedVNet godoc @ID GetMigratedVNet @Summary Get a specific migrated virtual network @Description Get details of a specific virtual network in the namespace @Tags [Migration] Resources for VM infrastructure @Accept json @Produce json @Param nsId path string true "Namespace ID" default(mig01) @Param vNetId path string true "Virtual Network ID" default(mig-vnet-01) @Param x-request-id header string false "Custom request ID for tracking" @Param x-credential-holder header string false "Credential holder ID for selecting which credentials to use (default: system default holder)" @Success 200 {object} tbmodel.VNetInfo @Failure 404 {object} tbmodel.SimpleMsg @Failure 500 {object} tbmodel.SimpleMsg @Router /migration/ns/{nsId}/resources/vNet/{vNetId} [get]

func GetObjectStorage added in v0.4.2

func GetObjectStorage(c echo.Context) error

GetObjectStorage godoc @ID GetObjectStorage @Summary Get object storage (bucket) details @Description Get details of a specific object storage (bucket) @Tags [Migration] Managed middleware (preview) @Accept json @Produce json @Param nsId path string true "Namespace ID" default(mig01) @Param osId path string true "Object Storage ID (bucket ID)" @Param X-Request-Id header string false "Unique request ID (auto-generated if not provided). Used for tracking request status and correlating logs." @Success 200 {object} model.ApiResponse[migration.MigratedObjectStorageInfo] "Successfully retrieved object storage details" @Failure 400 {object} model.ApiResponse[any] "Invalid request parameters" @Failure 404 {object} model.ApiResponse[any] "Object storage not found" @Failure 500 {object} model.ApiResponse[any] "Internal server error during get operation" @Router /migration/middleware/ns/{nsId}/objectStorage/{osId} [get]

func GetStorageObject added in v0.5.1

func GetStorageObject(c echo.Context) error

GetStorageObject godoc @ID GetStorageObject @Summary Get metadata of an object in an object storage bucket @Description Retrieve metadata (key, size, ETag, last-modified, storage class) of a specific object @Description by proxying Tumblebug HEAD /ns/{nsId}/resources/objectStorage/{osId}/object/{objectKey}. @Description Note: URL-encode the objectKey if it contains slashes (e.g., folder%2Ffile.txt). @Tags [Migration] Managed middleware (preview) @Accept json @Produce json @Param nsId path string true "Namespace ID" default(mig01) @Param osId path string true "Object Storage ID (bucket ID)" @Param objectKey path string true "Object key (URL-encode slashes if needed)" @Param X-Request-Id header string false "Unique request ID (auto-generated if not provided). Used for tracking request status and correlating logs." @Success 200 {object} model.ApiResponse[migration.StorageObjectMetadata] "Object metadata retrieved" @Failure 400 {object} model.ApiResponse[any] "Invalid request parameters" @Failure 404 {object} model.ApiResponse[any] "Object not found" @Failure 500 {object} model.ApiResponse[any] "Internal server error" @Router /migration/middleware/ns/{nsId}/objectStorage/{osId}/object/{objectKey} [head]

func ListInfra added in v0.2.4

func ListInfra(c echo.Context) error

ListInfra godoc @ID ListInfra @Summary Get the migrated multi-cloud infrastructure (MCI) @Description Get the migrated multi-cloud infrastructure (MCI) @Tags [Migration] Infrastructure @Accept json @Produce json @Param nsId path string true "Namespace ID" default(mig01) @Param option query string false "Option for getting the migrated multi-cloud infrastructure" Enums(id) @Param X-Request-Id header string false "Unique request ID (auto-generated if not provided). Used for tracking request status and correlating logs." @Success 200 {object} model.ApiResponse[cloudmodel.InfraInfoList] "The info list of the migrated multi-cloud infrastructure (Infra)" @Success 200 {object} model.ApiResponse[cloudmodel.IdList] "The ID list of The migrated multi-cloud infrastructure (Infra)" @Failure 404 {object} model.ApiResponse[any] @Failure 500 {object} model.ApiResponse[any] @Router /migration/ns/{nsId}/infra [get]

func ListMigratedSSHKeys added in v0.3.1

func ListMigratedSSHKeys(c echo.Context) error

========== SSH Key Resource APIs ========== ListMigratedSSHKeys godoc @ID ListMigratedSSHKeys @Summary List all migrated SSH keys @Description Get the list of all migrated SSH keys in the namespace @Tags [Migration] Resources for VM infrastructure @Accept json @Produce json @Param nsId path string true "Namespace ID" default(mig01) @Param option query string false "Option" Enums(id) @Param filterKey query string false "Field key for filtering (ex: systemLabel)" @Param filterVal query string false "Field value for filtering (ex: Registered from CSP resource)" @Param x-request-id header string false "Custom request ID for tracking" @Param x-credential-holder header string false "Credential holder ID for selecting which credentials to use (default: system default holder)" @Success 200 {object} JSONResult{[DEFAULT]=tbresource.RestGetAllSshKeyResponse,[ID]=tbmodel.IdList} "Different return structures by the given option param" @Failure 404 {object} tbmodel.SimpleMsg @Failure 500 {object} tbmodel.SimpleMsg @Router /migration/ns/{nsId}/resources/sshKey [get]

func ListMigratedSecurityGroups added in v0.3.1

func ListMigratedSecurityGroups(c echo.Context) error

========== Security Group Resource APIs ========== ListMigratedSecurityGroups godoc @ID ListMigratedSecurityGroups @Summary List all migrated security groups @Description Get the list of all migrated security groups in the namespace @Tags [Migration] Resources for VM infrastructure @Accept json @Produce json @Param nsId path string true "Namespace ID" default(mig01) @Param option query string false "Option" Enums(id) @Param filterKey query string false "Field key for filtering (ex: systemLabel)" @Param filterVal query string false "Field value for filtering (ex: Registered from CSP resource)" @Param x-request-id header string false "Custom request ID for tracking" @Param x-credential-holder header string false "Credential holder ID for selecting which credentials to use (default: system default holder)" @Success 200 {object} JSONResult{[DEFAULT]=tbresource.RestGetAllSecurityGroupResponse,[ID]=tbmodel.IdList} "Different return structures by the given option param" @Failure 404 {object} tbmodel.SimpleMsg @Failure 500 {object} tbmodel.SimpleMsg @Router /migration/ns/{nsId}/resources/securityGroup [get]

func ListMigratedVNets added in v0.3.1

func ListMigratedVNets(c echo.Context) error

ListMigratedVNets godoc @ID ListMigratedVNets @Summary List all migrated virtual networks @Description Get the list of all migrated virtual networks in the namespace @Tags [Migration] Resources for VM infrastructure @Accept json @Produce json @Param nsId path string true "Namespace ID" default(mig01) @Param option query string false "Option" Enums(id) @Param filterKey query string false "Field key for filtering (ex: cspResourceName)" @Param filterVal query string false "Field value for filtering (ex: default-alibaba-ap-northeast-1-vpc)" @Param x-request-id header string false "Custom request ID for tracking" @Param x-credential-holder header string false "Credential holder ID for selecting which credentials to use (default: system default holder)" @Success 200 {object} JSONResult{[DEFAULT]=tbresource.RestGetAllVNetResponse,[ID]=tbmodel.IdList} "Different return structures by the given option param" @Failure 404 {object} tbmodel.SimpleMsg @Failure 500 {object} tbmodel.SimpleMsg @Router /migration/ns/{nsId}/resources/vNet [get]

func ListObjectStorageObjects added in v0.5.1

func ListObjectStorageObjects(c echo.Context) error

ListObjectStorageObjects godoc @ID ListObjectStorageObjects @Summary List objects in an object storage bucket @Description List all objects stored in a specific object storage bucket by proxying Tumblebug GET /ns/{nsId}/resources/objectStorage/{osId}/object @Tags [Migration] Managed middleware (preview) @Accept json @Produce json @Param nsId path string true "Namespace ID" default(mig01) @Param osId path string true "Object Storage ID (bucket ID)" @Param X-Request-Id header string false "Unique request ID (auto-generated if not provided). Used for tracking request status and correlating logs." @Success 200 {object} model.ApiResponse[migration.StorageObjectListResponse] "Successfully retrieved object list" @Failure 400 {object} model.ApiResponse[any] "Invalid request parameters" @Failure 404 {object} model.ApiResponse[any] "Object storage not found" @Failure 500 {object} model.ApiResponse[any] "Internal server error during list operation" @Router /migration/middleware/ns/{nsId}/objectStorage/{osId}/object [get]

func ListObjectStorages added in v0.4.2

func ListObjectStorages(c echo.Context) error

ListObjectStorages godoc @ID ListObjectStorages @Summary List object storages (buckets) @Description Get the list of all object storages (buckets) in the namespace @Tags [Migration] Managed middleware (preview) @Accept json @Produce json @Param nsId path string true "Namespace ID" default(mig01) @Param X-Request-Id header string false "Unique request ID (auto-generated if not provided). Used for tracking request status and correlating logs." @Success 200 {object} model.ApiResponse[migration.MigratedObjectStorageListResponse] "Successfully retrieved object storage list" @Failure 400 {object} model.ApiResponse[any] "Invalid request parameters" @Failure 500 {object} model.ApiResponse[any] "Internal server error during list operation" @Router /migration/middleware/ns/{nsId}/objectStorage [get]

func MigrateData added in v0.3.9

func MigrateData(c echo.Context) error

MigrateData godoc @ID MigrateData @Summary [Async] Migrate data from source to target @Description **Asynchronous Operation**: This API returns immediately with a request ID. The actual migration runs in the background. @Description @Description [How to Use] @Description 1. Call this API → Receive 202 Accepted with reqId @Description 2. Poll GET /request/{reqId} to check status @Description 3. Status flow: Handling → Success / Error @Description @Description [Endpoint Requirements] @Description * Both source and destination must be remote endpoints (SSH or object storage) @Description * Local filesystem access is not allowed for security reasons @Description @Description [Transfer Options] @Description * Strategy: auto (default), direct, relay @Description * SSH: Supports PrivateKey content or PrivateKeyPath @Description @Description [Encryption Support] @Description * To encrypt sensitive fields, first call GET /migration/data/encryptionKey @Description * Encrypted requests include `encryptionKeyId` field @Description * Server automatically detects and decrypts encrypted requests @Description @Description [Examples] @Description * Test results: https://github.com/cloud-barista/cm-beetle/blob/main/docs/test-results-data-migration.md @Description @Tags [Migration] Data (incubating) @Accept json @Produce json @Param X-Request-Id header string false "Unique request ID (auto-generated if not provided). Used as reqId for tracking migration status." @Param reqBody body transx.DataMigrationModel true "Data migration request (supports plaintext or encrypted with encryptionKeyId)" @Success 202 {object} model.ApiResponse[model.AsyncJobResponse] "Migration started - use GET /request/{reqId} to check status" @Failure 400 {object} model.ApiResponse[any] "Invalid request parameters or decryption failed" @Router /migration/data [post]

func MigrateInfra

func MigrateInfra(c echo.Context) error

MigrateInfra godoc @ID MigrateInfra @Summary Migrate an infrastructure to the multi-cloud infrastructure (MCI) with defaults @Description Migrate an infrastructure to the multi-cloud infrastructure (MCI) with defaults. @Description @Description **[Request Field: `nodeGroups[].cspImageName`]** Optional CSP-native image identifier. @Description - **Non-empty**: TumbleBug sends this to Spider directly, bypassing the per-VM image DB lookup (prevents stale image failures, e.g., Alibaba alibase images). @Description - **Empty**: TumbleBug uses `imageId` for the standard DB lookup (may encounter stale images for some CSPs). @Description - Recommended: pass the recommendation API response as-is to use the latest resolved image. @Tags [Migration] Infrastructure @Accept json @Produce json @Param nsId path string true "Namespace ID" default(mig01) @Param nameSeed query string false "Optional prefix for all resource names (e.g., 'blue' → 'blue-infra101', 'blue-vnet-01'). Applied at migration time." @Param infraInfo body MigrateInfraRequest true "Specify the information for the targeted multi-cloud infrastructure" @Param X-Request-Id header string false "Unique request ID (auto-generated if not provided). Used for tracking request status and correlating logs." @Success 201 {object} model.ApiResponse[MigrateInfraResponse] "Successfully migrated to the multi-cloud infrastructure" @Failure 404 {object} model.ApiResponse[any] @Failure 500 {object} model.ApiResponse[any] @Router /migration/ns/{nsId}/infra [post]

func MigrateInfraWithDefaults added in v0.3.1

func MigrateInfraWithDefaults(c echo.Context) error

MigrateInfraWithDefaults godoc @ID MigrateInfraWithDefaults @Summary Migrate an infrastructure to the multi-cloud infrastructure (MCI) with defaults @Description Migrate an infrastructure to the multi-cloud infrastructure (MCI) with defaults. @Tags [Migration] Infrastructure @Accept json @Produce json @Param nsId path string true "Namespace ID" default(mig01) @Param mciInfo body MigrateInfraWithDefaultsRequest true "Specify the information for the targeted mulci-cloud infrastructure (MCI)" @Param X-Request-Id header string false "Unique request ID (auto-generated if not provided). Used for tracking request status and correlating logs." @Success 201 {object} model.ApiResponse[MigrateInfraWithDefaultsResponse] "Successfully migrated to the multi-cloud infrastructure" @Failure 500 {object} model.ApiResponse[any] @Router /migration/ns/{nsId}/infraWithDefaults [post]

func MigrateObjectStorage added in v0.4.2

func MigrateObjectStorage(c echo.Context) error

MigrateObjectStorage godoc @ID MigrateObjectStorage @Summary Migrate object storages to cloud @Description Migrate object storages to cloud based on recommendation results @Description @Description [Note] @Description - This API creates object storages (buckets) in the target cloud within the specified namespace @Description - Input should be the output from RecommendObjectStorage API @Description - Connection name is automatically generated from CSP and region in the request body @Description @Description [Note] `nameSeed` enables dynamic naming via **Late Binding**. @Description - If `nameSeed` query param is set (e.g., `?nameSeed=my`), bucket names are prefixed at migration time: `my-os-01`. @Description - If `nameSeed` is omitted, bucket names are used as-is from the recommendation result. @Description @Description [Examples] @Description * Test results: https://github.com/cloud-barista/cm-beetle/blob/main/docs/test-results-data-migration.md @Description @Tags [Migration] Managed middleware (preview) @Accept json @Produce json @Param nsId path string true "Namespace ID" default(mig01) @Param nameSeed query string false "Optional prefix for bucket names (e.g., 'my' → 'my-os-01'). Applied at migration time." @Param request body MigrateObjectStorageRequest true "Object storage migration request (use RecommendObjectStorage response)" @Param X-Request-Id header string false "Unique request ID (auto-generated if not provided). Used for tracking request status and correlating logs." @Success 201 "Created - Object storages created successfully" @Failure 400 {object} model.ApiResponse[any] "Invalid request parameters" @Failure 500 {object} model.ApiResponse[any] "Internal server error during object storage creation" @Router /migration/middleware/ns/{nsId}/objectStorage [post]

func PreviewInfra added in v0.5.1

func PreviewInfra(c echo.Context) error

PreviewInfra godoc @ID PreviewInfra @Summary Preview resource names with NameSeed applied @Description Applies the `nameSeed` prefix to all resource names in the model and returns the result. @Description No resources are created — this is a dry-run to verify final names before migration. @Description @Description Example: if `nameSeed=blue` and `VNetName=vnet-01`, the preview returns `blue-vnet-01`. @Description @Tags [Infrastructure] Resource Naming @Accept json @Produce json @Param nameSeed query string false "Prefix to apply to all resource names (e.g., 'blue' → 'blue-vnet-01')" @Param UserInfra body cloudmodel.RecommendedInfra true "The recommendation model (base names)" @Success 200 {object} model.ApiResponse[cloudmodel.RecommendedInfra] "Model with NameSeed applied to all names" @Failure 400 {object} model.ApiResponse[any] "Invalid request format" @Router /naming/preview [post]

func RecommendK8sControlPlane added in v0.4.2

func RecommendK8sControlPlane(c echo.Context) error

RecommendK8sControlPlane godoc @ID RecommendK8sControlPlane @Summary Recommend K8s control plane configuration @Description Get recommendation for K8s control plane based on honeybee source cluster data @Description Returns configuration that can be directly used with cb-tumblebug k8sClusterDynamic API @Tags [Recommendation] K8s Cluster (prototype) @Accept json @Produce json @Param UserK8sInfra body recommendation.KubernetesInfoList true "Source cluster information from honeybee" @Param desiredProvider query string true "Provider (e.g., aws)" Enums(aws) @Param desiredRegion query string true "Region (e.g., ap-northeast-2)" default(ap-northeast-2) @Param X-Request-Id header string false "Unique request ID (auto-generated if not provided). Used for tracking request status and correlating logs." @Success 200 {object} model.ApiResponse[tbmodel.K8sClusterDynamicReq] "K8s control plane recommendation (ready for cb-tumblebug API)" @Failure 400 {object} model.ApiResponse[any] @Failure 500 {object} model.ApiResponse[any] @Router /recommendation/k8sControlPlane [post]

func RecommendK8sNodeGroup added in v0.4.2

func RecommendK8sNodeGroup(c echo.Context) error

RecommendK8sNodeGroup godoc @ID RecommendK8sNodeGroup @Summary Recommend K8s worker node group configuration @Description Get recommendation for K8s worker node group based on honeybee source cluster data @Description Returns configuration that can be directly used with cb-tumblebug k8sNodeGroupDynamic API @Tags [Recommendation] K8s Cluster (prototype) @Accept json @Produce json @Param UserK8sInfra body recommendation.KubernetesInfoList true "Source cluster information from honeybee" @Param desiredProvider query string true "Provider (e.g., aws)" Enums(aws) @Param desiredRegion query string true "Region (e.g., ap-northeast-2)" default(ap-northeast-2) @Param X-Request-Id header string false "Unique request ID (auto-generated if not provided). Used for tracking request status and correlating logs." @Success 200 {object} model.ApiResponse[tbmodel.K8sNodeGroupReq] "K8s worker node group recommendation (ready for cb-tumblebug API)" @Failure 400 {object} model.ApiResponse[any] @Failure 500 {object} model.ApiResponse[any] @Router /recommendation/k8sNodeGroup [post]

func RecommendObjectStorage added in v0.4.1

func RecommendObjectStorage(c echo.Context) error

RecommendObjectStorage godoc @ID RecommendObjectStorage @Summary Recommend an object storage for cloud migration @Description Recommend an appropriate object storage for cloud migration @Description @Description [Note] `desiredCsp` and `desiredRegion` are required. @Description - `desiredCsp` and `desiredRegion` can set on the query parameter or the request body. @Description @Description - If desiredCsp and desiredRegion are set on request body, the values in the query parameter will be ignored. @Description @Description [Note] The recommended bucket name uses a default pattern (`mig-bucket-01`, `mig-bucket-02`, ...). @Description - Bucket names must be globally unique across all accounts in the target cloud provider. @Description - CB-Tumblebug internally generates a uid and uses it as the actual bucket name in the cloud. @Description - The `bucketName` field in the recommendation result represents the intended name, not the final cloud resource name. @Description @Description [Note] To apply a naming prefix, use the `nameSeed` query parameter on the migration API (`POST /migration/.../objectStorage?nameSeed=xxx`). @Description @Tags [Recommendation] Managed middleware (preview) @Accept json @Produce json @Param request body RecommendObjectStorageRequest true "Specify the your object storage to be migrated" @Param desiredCsp query string false "CSP (e.g., aws, azure, gcp)" Enums(aws,azure,gcp,alibaba,tencent,ibm,openstack,ncp,nhn,kt) default(aws) @Param desiredRegion query string false "Region (e.g., ap-northeast-2)" default(ap-northeast-2) @Param X-Request-Id header string false "Unique request ID (auto-generated if not provided). Used for tracking request status and correlating logs." @Success 200 {object} model.ApiResponse[storagemodel.RecommendedObjectStorage] "Successfully recommended object storage" @Failure 400 {object} model.ApiResponse[any] "Invalid request parameters" @Failure 500 {object} model.ApiResponse[any] "Internal server error during recommendation" @Router /recommendation/middleware/objectStorage [post]

func RecommendSecurityGroups added in v0.3.1

func RecommendSecurityGroups(c echo.Context) error

RecommendSecurityGroups godoc @ID RecommendSecurityGroups @Summary Recommend an appropriate security group for cloud migration @Description Recommend an appropriate security group for cloud migration @Description @Description [Note] `desiredProvider` and `desiredRegion` are required. @Description - `desiredProvider` and `desiredRegion` can set on the query parameter or the request body. @Description @Description - If desiredProvider and desiredRegion are set on request body, the values in the query parameter will be ignored. @Tags [Recommendation] Resources for VM infrastructure @Accept json @Produce json @Param UserInfra body RecommendInfraRequest true "Specify the your infrastructure to be migrated" @Param desiredProvider query string false "Provider (e.g., aws, azure, gcp)" Enums(aws,azure,gcp,alibaba,ncp) default(aws) @Param desiredRegion query string false "Region (e.g., ap-northeast-2)" default(ap-northeast-2) @Param X-Request-Id header string false "Unique request ID (auto-generated if not provided). Used for tracking request status and correlating logs." @Success 200 {object} model.ApiResponse[cloudmodel.RecommendedSecurityGroupList] "Successfully recommended security group(s)" @Failure 400 {object} model.ApiResponse[any] "Invalid request parameters" @Failure 500 {object} model.ApiResponse[any] "Internal server error during recommendation" @Router /recommendation/resources/securityGroups [post]

func RecommendVMInfraWithDefaults added in v0.3.1

func RecommendVMInfraWithDefaults(c echo.Context) error

RecommendVMInfraWithDefaults godoc @ID RecommendVMInfraWithDefaults @Summary (To be updated) Recommend an appropriate VM infrastructure (i.e., MCI, multi-cloud infrastructure) with defaults for cloud migration @Description Recommend an appropriate VM infrastructure (i.e., MCI, multi-cloud infrastructure) with defaults for cloud migration @Description @Description [Note] `desiredCsp` and `desiredRegion` are required. @Description - `desiredCsp` and `desiredRegion` can set on the query parameter or the request body. @Description @Description - If desiredCsp and desiredRegion are set on request body, the values in the query parameter will be ignored. @Description @Description **[Response Field: `nodeGroups[].cspImageName`]** Set only when the spec-image review resolved a newer image than the DB cache. @Description - **Non-empty**: TumbleBug sends this to Spider directly, bypassing the per-VM image DB lookup (prevents stale image failures, e.g., Alibaba alibase images). @Description - **Empty**: TumbleBug uses `imageId` for the standard DB lookup path. @Tags [Recommendation] Infrastructure @Accept json @Produce json @Param UserInfra body RecommendInfraWithDefaultsRequest true "Specify the source infrastructure to be migrated" @Param desiredCsp query string false "Provider (e.g., aws, azure, gcp)" Enums(aws,azure,gcp,alibaba,ncp) default(aws) @Param desiredRegion query string false "Region (e.g., ap-northeast-2)" default(ap-northeast-2) @Param X-Request-Id header string false "Unique request ID (auto-generated if not provided). Used for tracking request status and correlating logs." @Success 200 {object} model.ApiResponse[RecommendInfraWithDefaultsResponse] "The result of recommended infrastructure" @Failure 404 {object} model.ApiResponse[any] @Failure 500 {object} model.ApiResponse[any] @Router /recommendation/infraWithDefaults [post]

func RecommendVNet added in v0.3.1

func RecommendVNet(c echo.Context) error

RecommendVNet godoc @ID RecommendVNet @Summary Recommend an appropriate virtual network for cloud migration @Description Recommend an appropriate virtual network for cloud migration @Description @Description [Note] `desiredProvider` and `desiredRegion` are required. @Description - `desiredProvider` and `desiredRegion` can set on the query parameter or the request body. @Description @Description - If desiredProvider and desiredRegion are set on request body, the values in the query parameter will be ignored. @Tags [Recommendation] Resources for VM infrastructure @Accept json @Produce json @Param UserInfra body RecommendInfraRequest true "Specify the your infrastructure to be migrated" @Param desiredProvider query string false "Provider (e.g., aws, azure, gcp)" Enums(aws,azure,gcp,alibaba,ncp) default(aws) @Param desiredRegion query string false "Region (e.g., ap-northeast-2)" default(ap-northeast-2) @Param X-Request-Id header string false "Unique request ID (auto-generated if not provided). Used for tracking request status and correlating logs." @Success 200 {object} model.ApiResponse[cloudmodel.RecommendedVNetList] "Successfully recommended vNet(s)" @Failure 400 {object} model.ApiResponse[any] "Invalid request parameters" @Failure 500 {object} model.ApiResponse[any] "Internal server error during recommendation" @Router /recommendation/resources/vNet [post]

func RecommendVmInfraCandidates added in v0.4.7

func RecommendVmInfraCandidates(c echo.Context) error

RecommendVmInfraCandidates godoc @ID RecommendVmInfraCandidates @Summary Recommend multiple VM infrastructure candidates for cloud migration @Description Recommend best-effort VM infrastructure (MCI) candidates for migrating on-premise workloads to cloud environments. @Description @Description - See overview and examples on https://github.com/cloud-barista/cm-beetle/discussions/256 @Description @Description **[Required Parameters: `desiredCsp`, `desiredRegion`]** The desired cloud service provider and region for the recommended infrastructure. @Description - if **desiredCsp** and **desiredRegion** are set on request body, the values in the query parameter will be ignored. @Description @Description **[Optional Parameters: `limit`]** Maximum number of recommended infrastructures to return (default: 3) @Description @Description **[Optional Parameters: `minMatchRate`]** Minimum match rate threshold for highly-matched classification (default: 90.0, range: 0-100) @Description @Description **[Response Field: `status`]** Candidate status based on the match rate threshold @Description - **highly-matched**: Candidates meet or exceed the match rate threshold @Description - **partially-matched**: Valid candidates below the match rate threshold @Description @Description **[Response Field: `description`]** Summary containing Candidate ID, status, match rate statistics (Min/Max/Avg), and VM counts @Description - Example: "Candidate #1 | partially-matched | Overall Match Rate: Min=88.9% Max=100.0% Avg=98.7% | VMs: 3 total, 2 matched, 1 acceptable" @Description @Description **[Response Field: `nodeGroups[].cspImageName`]** Set only when the spec-image review resolved a newer image than the DB cache. @Description - **Non-empty**: TumbleBug sends this to Spider directly, bypassing the per-VM image DB lookup (prevents stale image failures, e.g., Alibaba alibase images). @Description - **Empty**: TumbleBug uses `imageId` for the standard DB lookup path. @Description - Pass the recommendation response as-is to the migration API to ensure the resolved image is used. @Description @Tags [Recommendation] Infrastructure @Accept json @Produce json @Param UserInfra body RecommendInfraRequest true "Specify the source infrastructure to be migrated" @Param desiredCsp query string false "Provider (e.g., aws, azure, gcp)" Enums(aws,azure,gcp,alibaba,ncp) default(aws) @Param desiredRegion query string false "Region (e.g., ap-northeast-2)" default(ap-northeast-2) @Param limit query int false "Limit (default: 3) the number of recommended infrastructures" @Param minMatchRate query number false "Minimum match rate for highly-matched classification (default: 90.0, range: 0-100)" @Param X-Request-Id header string false "Unique request ID (auto-generated if not provided). Used for tracking request status and correlating logs." @Success 200 {object} model.ApiResponse[[]cloudmodel.RecommendedInfra] "Successfully recommended infrastructure candidates" @Failure 400 {object} model.ApiResponse[any] "Invalid request parameters" @Failure 500 {object} model.ApiResponse[any] "Internal server error during recommendation" @Router /recommendation/infra [post]

func RecommendVmOsImages added in v0.3.1

func RecommendVmOsImages(c echo.Context) error

RecommendVmOsImages godoc @ID RecommendVmOsImages @Summary Recommend an appropriate OS image for cloud migration @Description Recommend an appropriate OS image for cloud migration @Description @Description [Note] `desiredProvider` and `desiredRegion` are required. @Description - `desiredProvider` and `desiredRegion` can set on the query parameter or the request body. @Description @Description - If desiredProvider and desiredRegion are set on request body, the values in the query parameter will be ignored. @Tags [Recommendation] Resources for VM infrastructure @Accept json @Produce json @Param UserInfra body RecommendInfraRequest true "Specify the your infrastructure to be migrated" @Param desiredProvider query string false "Provider (e.g., aws, azure, gcp)" Enums(aws,azure,gcp,alibaba,ncp) default(aws) @Param desiredRegion query string false "Region (e.g., ap-northeast-2)" default(ap-northeast-2) @Param X-Request-Id header string false "Unique request ID (auto-generated if not provided). Used for tracking request status and correlating logs." @Success 200 {object} model.ApiResponse[cloudmodel.RecommendedOsImageList] "Successfully recommended VM OS image(s)" @Failure 400 {object} model.ApiResponse[any] "Invalid request parameters" @Failure 500 {object} model.ApiResponse[any] "Internal server error during recommendation" @Router /recommendation/resources/osImages [post]

func RecommendVmSpecs added in v0.3.1

func RecommendVmSpecs(c echo.Context) error

RecommendVmSpecs godoc @ID RecommendVmSpecs @Summary Recommend an appropriate VM specification for cloud migration @Description Recommend an appropriate VM specification for cloud migration @Description @Description [Note] `desiredProvider` and `desiredRegion` are required. @Description - `desiredProvider` and `desiredRegion` can set on the query parameter or the request body. @Description @Description - If desiredProvider and desiredRegion are set on request body, the values in the query parameter will be ignored. @Description - If `targetMachineId` is provided, only that specific machine will be processed. @Tags [Recommendation] Resources for VM infrastructure @Accept json @Produce json @Param UserInfra body RecommendInfraRequest true "Specify the your infrastructure to be migrated" @Param desiredProvider query string false "Provider (e.g., aws, azure, gcp)" Enums(aws,azure,gcp,alibaba,ncp) default(aws) @Param desiredRegion query string false "Region (e.g., ap-northeast-2)" default(ap-northeast-2) @Param targetMachineId query string false "Target Machine ID to focus recommendation on (optional)" @Param X-Request-Id header string false "Unique request ID (auto-generated if not provided). Used for tracking request status and correlating logs." @Success 200 {object} model.ApiResponse[cloudmodel.RecommendedSpecList] "Successfully recommended VM spec(s)" @Failure 400 {object} model.ApiResponse[any] "Invalid request parameters" @Failure 500 {object} model.ApiResponse[any] "Internal server error during recommendation" @Router /recommendation/resources/specs [post]

func RestDeleteAllRequests added in v0.4.6

func RestDeleteAllRequests(c echo.Context) error

RestDeleteAllRequests godoc @ID DeleteAllRequests @Summary Delete all requests' details @Description Deletes all API request tracking records from Beetle. @Description @Description [Note] @Description - This only clears Beetle's request tracking memory. @Description - It does NOT affect any data in Tumblebug or cancel any ongoing operations. @Tags [Admin] API Request Management @Accept json @Produce json @Success 200 {object} model.ApiResponse[any] @Router /requests [delete]

func RestDeleteRequest added in v0.4.6

func RestDeleteRequest(c echo.Context) error

RestDeleteRequest godoc @ID DeleteRequest @Summary Delete a specific request's details @Description Deletes the tracking details of a specific API request from Beetle. @Description @Description [Note] @Description - This only removes the request tracking record from Beetle's memory. @Description - It does NOT affect any data in Tumblebug or cancel any ongoing operations. @Tags [Admin] API Request Management @Accept json @Produce json @Param reqId path string true "Request ID to delete (from X-Request-Id header of a previous Beetle API call)" @Success 200 {object} model.ApiResponse[any] @Failure 404 {object} model.ApiResponse[any] @Router /request/{reqId} [delete]

func RestGetAllRequests added in v0.4.6

func RestGetAllRequests(c echo.Context) error

RestGetAllRequests godoc @ID GetAllRequests @Summary Get all requests @Description Retrieves all API requests tracked by Beetle with optional filters. @Description @Description [Note] @Description - Request tracking is managed independently by Beetle (not shared with Tumblebug). @Description - This API only returns requests made to Beetle, not to Tumblebug. @Description @Description [Status Values] @Description - Handling: Request is currently being processed @Description - Success: Request completed successfully @Description - Error: Request failed with an error @Tags [Admin] API Request Management @Accept json @Produce json @Param status query string false "Filter by request status" Enums(Handling, Success, Error) default() @Param method query string false "Filter by HTTP method (GET, POST, PUT, DELETE, etc.)" Enums(GET, POST, PUT, DELETE) default() @Param url query string false "Filter by request URL" @Param time query string false "Filter by time in minutes from now (to get recent requests)" @Param savefile query string false "Option to save the results to a file (set 'true' to activate)" Enums(true,false) default(false) @Success 200 {object} map[string][]common.RequestDetails @Router /requests [get]

func RestGetRequest added in v0.4.6

func RestGetRequest(c echo.Context) error

RestGetRequest godoc @ID GetRequest @Summary Get request details @Description Retrieves the details of a specific API request tracked by Beetle. @Description @Description [Note] @Description - Request tracking is managed independently by Beetle (not shared with Tumblebug). @Description - The reqId corresponds to the X-Request-Id header value from a previous API call. @Description - Do NOT call Tumblebug's /request/{reqId} API with this reqId; each system manages its own request tracking. @Description @Description [Status Values] @Description - Handling: Request is currently being processed @Description - Success: Request completed successfully @Description - Error: Request failed with an error @Tags [Admin] API Request Management @Accept json @Produce json @Param reqId path string true "Request ID (from X-Request-Id header of a previous Beetle API call)" @Success 200 {object} model.ApiResponse[common.RequestDetails] @Failure 404 {object} model.ApiResponse[any] @Failure 500 {object} model.ApiResponse[any] @Router /request/{reqId} [get]

func TestAuth added in v0.5.1

func TestAuth(c echo.Context) error

TestAuth godoc @ID TestAuth @Summary Test authentication @Description Checks if the request is authenticated and returns the auth type @Tags [Test] Utilities @Accept json @Produce json @Security BasicAuth @Security BearerAuth @Success 200 {object} model.ApiResponse[map[string]string] "Successfully authenticated" @Failure 400 {object} model.ApiResponse[any] "Invalid request parameters" @Router /test/auth [get] @x-order 2

func TestDecryptData added in v0.5.1

func TestDecryptData(c echo.Context) error

TestDecryptData godoc @ID TestDecryptData @Summary [TEST ONLY] Test decryption of encrypted data migration model @Description **⚠️ FOR TESTING ONLY**: This API tests server-side decryption without executing migration. @Description Use this to verify the encryption workflow before calling the actual migration API. @Description @Description Receives an encrypted DataMigrationModel, decrypts it, and returns verification results. @Description This API does NOT execute actual data migration. @Description @Description [Test Workflow] @Description 1. Call GET /migration/data/encryptionKey to get a public key @Description 2. Encrypt your model using the public key (client-side), or use POST /migration/data/test/encrypt @Description 3. Call this API with the encrypted model @Description 4. Verify the decryption result shows expected fields @Description @Description [Note] @Description * The encryption key is consumed (deleted) after this test @Description * You need to generate a new key for actual migration @Description @Tags [Migration] Data (incubating) @Accept json @Produce json @Param X-Request-Id header string false "Unique request ID" @Param reqBody body transx.DataMigrationModel true "Encrypted data migration model" @Success 200 {object} model.ApiResponse[transx.DataMigrationModel] "Decrypted model (sensitive fields restored)" @Failure 400 {object} model.ApiResponse[any] "Decryption failed or model not encrypted" @Router /migration/data/test/decrypt [post]

func TestEncryptData added in v0.5.1

func TestEncryptData(c echo.Context) error

TestEncryptData godoc @ID TestEncryptData @Summary [TEST ONLY] Encrypt sensitive fields in data migration model @Description **⚠️ FOR TESTING ONLY**: In production, encryption MUST be performed client-side. @Description This API is provided solely for testing the encryption workflow without implementing client-side encryption. @Description @Description Receives a plaintext DataMigrationModel and returns an encrypted version. @Description The server generates a new key pair, encrypts sensitive fields, and returns the encrypted model. @Description @Description [Security Warning] @Description * Sending plaintext credentials to server defeats the purpose of encryption @Description * Use this API only for development/testing environments @Description * In production, use client-side encryption with GET /migration/data/encryptionKey @Description @Description [Test Workflow] @Description 1. Call GET /migration/data/encryptionKey to get a public key bundle @Description 2. Call this API with the public key bundle and plaintext model @Description 3. Receive encrypted model with keyId @Description 4. Call POST /migration/data/test/decrypt to verify decryption @Description @Tags [Migration] Data (incubating) @Accept json @Produce json @Param X-Request-Id header string false "Unique request ID" @Param reqBody body model.EncryptionTestRequest true "Public key bundle and plaintext model" @Success 200 {object} model.ApiResponse[transx.DataMigrationModel] "Encrypted model with encryptionKeyId set" @Failure 400 {object} model.ApiResponse[any] "Invalid request" @Failure 500 {object} model.ApiResponse[any] "Encryption failed" @Router /migration/data/test/encrypt [post]

func TestStreamingResponse added in v0.4.6

func TestStreamingResponse(c echo.Context) error

TestStreamingResponse godoc @ID TestStreamingResponse @Summary Test streaming response (JSON Lines) @Description Returns multiple JSON objects as newline-delimited JSON (JSON Lines format) @Tags [Test] Utilities @Accept json @Produce json @Success 200 {object} map[string]any "Multiple JSON objects" @Router /test/streaming [get] @x-order 1

func TestTracing added in v0.4.6

func TestTracing(c echo.Context) error

TestTracing godoc @ID TestTracing @Description Tests distributed tracing by calling Tumblebug's readyz endpoint. @Description @Description [Note] @Description - The 'traceparent' header (W3C Trace Context) is propagated to Tumblebug for distributed tracing. @Description - The 'X-Request-Id' header is propagated for log correlation. @Description - Use this API to verify that tracing works correctly between Beetle and Tumblebug. @Tags [Test] Utilities @Accept json @Produce json @Param traceparent header string false "W3C Trace Context (e.g., 00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01). Used for distributed tracing." @Param X-Request-Id header string false "Unique request ID. Used for tracking request status and correlating logs." @Success 200 {object} model.ApiResponse[string] "Tumblebug service is ready" @Failure 503 {object} model.ApiResponse[any] "Tumblebug service unavailable" @Router /test/tracing [get]

func ValidateNames added in v0.5.1

func ValidateNames(c echo.Context) error

ValidateNames godoc @ID ValidateNames @Summary Validate resource names and referential integrity @Description Validates that all internal references within a RecommendedInfra model @Description are consistent and point to existing resources. @Description NameSeed is NOT applied here; this validates the base names only. @Description @Tags [Infrastructure] Resource Naming @Accept json @Produce json @Param UserInfra body cloudmodel.RecommendedInfra true "The recommendation model to validate" @Param X-Request-Id header string false "Unique request ID" @Success 200 {object} model.ApiResponse[any] "Naming and referential integrity are valid" @Failure 400 {object} model.ApiResponse[any] "Referential integrity validation failure" @Router /naming/validation [post]

Types

type GenerateMigrationReportRequest added in v0.4.3

type GenerateMigrationReportRequest struct {
	OnpremiseInfraModel onpremmodel.OnpremInfra `json:"onpremiseInfraModel" validate:"required"`
}

GenerateMigrationReportRequest represents the request body for generating a migration report

type GenerateSourceInfraSummaryRequest added in v0.4.3

type GenerateSourceInfraSummaryRequest struct {
	OnpremiseInfraModel onpremmodel.OnpremInfra `json:"onpremiseInfraModel" validate:"required"`
}

GenerateSourceInfraSummaryRequest represents the request body for source infrastructure summary

type JSONResult added in v0.3.1

type JSONResult struct {
}

JSONResult is a dummy struct for Swagger annotations.

type MigrateInfraRequest

type MigrateInfraRequest struct {
	cloudmodel.RecommendedInfra
}

type MigrateInfraResponse

type MigrateInfraResponse struct {
	cloudmodel.VmInfraInfo
}

type MigrateInfraWithDefaultsRequest added in v0.3.1

type MigrateInfraWithDefaultsRequest struct {
	cloudmodel.InfraDynamicReq
}

type MigrateInfraWithDefaultsResponse added in v0.3.1

type MigrateInfraWithDefaultsResponse struct {
	cloudmodel.VmInfraInfo
}

type MigrateObjectStorageRequest added in v0.4.2

type MigrateObjectStorageRequest struct {
	storagemodel.RecommendedObjectStorage
}

MigrateObjectStorageRequest represents a request for object storage migration

type RecommendInfraRequest

type RecommendInfraRequest struct {
	DesiredCspAndRegionPair cloudmodel.CloudProperty `json:"desiredCspAndRegionPair"`
	OnpremiseInfraModel     onpremmodel.OnpremInfra
}

type RecommendInfraResponse

type RecommendInfraResponse struct {
	cloudmodel.RecommendedInfra
}

type RecommendInfraWithDefaultsRequest added in v0.5.1

type RecommendInfraWithDefaultsRequest struct {
	DesiredCspAndRegionPair cloudmodel.CloudProperty `json:"desiredCspAndRegionPair"`
	OnpremiseInfraModel     onpremmodel.OnpremInfra
}

type RecommendInfraWithDefaultsResponse added in v0.5.1

type RecommendInfraWithDefaultsResponse struct {
	cloudmodel.RecommendedInfraDynamicList
}

type RecommendK8sClusterResponse added in v0.4.2

type RecommendK8sClusterResponse struct {
	tbmodel.K8sClusterDynamicReq
}

type RecommendObjectStorageRequest added in v0.4.1

type RecommendObjectStorageRequest struct {
	DesiredCloud         storagemodel.CloudProperty         `json:"desiredCloud" validate:"required"`
	SourceObjectStorages []storagemodel.SourceObjectStorage `json:"sourceObjectStorages" validate:"required,min=1"`
}

RecommendObjectStorageRequest represents a request for object storage migration recommendations

type RecommendVmSpecResponse added in v0.3.1

type RecommendVmSpecResponse struct {
	cloudmodel.RecommendedSpecList
}

Jump to

Keyboard shortcuts

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