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 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 ¶
Package controller has handlers and their request/response bodies for validation APIs
Index ¶
- func AlignNames(c echo.Context) error
- func CheckHTTPVersion(c echo.Context) error
- func CheckSSHReady(c echo.Context) error
- func CreateMigratedSSHKey(c echo.Context) error
- func CreateMigratedSecurityGroup(c echo.Context) error
- func CreateVNet(c echo.Context) error
- func DeleteInfra(c echo.Context) error
- func DeleteMigratedSSHKey(c echo.Context) error
- func DeleteMigratedSSHKeys(c echo.Context) error
- func DeleteMigratedSecurityGroup(c echo.Context) error
- func DeleteMigratedSecurityGroups(c echo.Context) error
- func DeleteMigratedVNet(c echo.Context) error
- func DeleteMigratedVNets(c echo.Context) error
- func DeleteNlb(c echo.Context) error
- func DeleteObjectStorage(c echo.Context) error
- func DeleteStorageObject(c echo.Context) error
- func ExistObjectStorage(c echo.Context) error
- func GenerateMigrationReport(c echo.Context) error
- func GenerateSourceInfraSummary(c echo.Context) error
- func GenerateTargetInfraSummary(c echo.Context) error
- func GetDataMigrationEncryptionKey(c echo.Context) error
- func GetInfra(c echo.Context) error
- func GetMigratedSSHKey(c echo.Context) error
- func GetMigratedSecurityGroup(c echo.Context) error
- func GetMigratedVNet(c echo.Context) error
- func GetNlb(c echo.Context) error
- func GetNlbHealth(c echo.Context) error
- func GetObjectStorage(c echo.Context) error
- func GetObjectStorageSupport(c echo.Context) error
- func GetSecurityPublicKey(c echo.Context) error
- func GetStorageObject(c echo.Context) error
- func InspectObjectStorage(c echo.Context) error
- func ListInfra(c echo.Context) error
- func ListMigratedSSHKeys(c echo.Context) error
- func ListMigratedSecurityGroups(c echo.Context) error
- func ListMigratedVNets(c echo.Context) error
- func ListNlbs(c echo.Context) error
- func ListObjectStorageObjects(c echo.Context) error
- func ListObjectStorages(c echo.Context) error
- func MigrateData(c echo.Context) error
- func MigrateInfra(c echo.Context) error
- func MigrateInfraWithDefaults(c echo.Context) error
- func MigrateNlbs(c echo.Context) error
- func MigrateObjectStorage(c echo.Context) error
- func PreviewInfra(c echo.Context) error
- func RecommendInfraWithNlbCandidates(c echo.Context) error
- func RecommendK8sControlPlane(c echo.Context) error
- func RecommendK8sNodeGroup(c echo.Context) error
- func RecommendMultiInfraCandidates(c echo.Context) error
- func RecommendMultiInfraWithNlbCandidates(c echo.Context) error
- func RecommendObjectStorage(c echo.Context) error
- func RecommendSecurityGroups(c echo.Context) error
- func RecommendVMInfraWithDefaults(c echo.Context) error
- func RecommendVNet(c echo.Context) error
- func RecommendVmInfraCandidates(c echo.Context) error
- func RecommendVmOsImages(c echo.Context) error
- func RecommendVmSpecs(c echo.Context) error
- func RestDeleteAllRequests(c echo.Context) error
- func RestDeleteRequest(c echo.Context) error
- func RestGetAllRequests(c echo.Context) error
- func RestGetRequest(c echo.Context) error
- func ScanObjectStorage(c echo.Context) error
- func TestAuth(c echo.Context) error
- func TestDecryptData(c echo.Context) error
- func TestEncryptData(c echo.Context) error
- func TestStreamingResponse(c echo.Context) error
- func TestTracing(c echo.Context) error
- func ValidateInfra(c echo.Context) error
- func ValidateNames(c echo.Context) error
- type CheckSSHReadyResponse
- type GenerateMigrationReportRequest
- type GenerateSourceInfraSummaryRequest
- type InspectObjectStorageRequest
- type JSONResult
- type MigrateInfraRequest
- type MigrateInfraResponse
- type MigrateInfraWithDefaultsRequest
- type MigrateInfraWithDefaultsResponse
- type MigrateObjectStorageRequest
- type NodeSSHStatus
- type RecommendInfraRequest
- type RecommendInfraResponse
- type RecommendInfraWithDefaultsRequest
- type RecommendInfraWithDefaultsResponse
- type RecommendInfraWithNlbRequest
- type RecommendK8sClusterResponse
- type RecommendMultiInfraRequest
- type RecommendMultiInfraWithNlbRequest
- type RecommendObjectStorageRequest
- type RecommendVmSpecResponse
- type ScanObjectStorageRequest
- type ScannedBucketSummary
- type ValidateInfraRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AlignNames ¶ added in v0.5.1
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
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 CheckSSHReady ¶ added in v0.5.7
CheckSSHReady godoc @ID CheckSSHReady @Summary Check SSH readiness for migrated infrastructure nodes @Description Check if all nodes in the migrated infrastructure are SSH-accessible. @Description @Description "Running" status doesn't mean cloud-init (SSH user setup) is done; timing varies by @Description CSP (IBM Cloud VPC: up to ~3 min in testing). Works for any CSP. @Description @Description **Rate limiting**: At most **1 check per 30 seconds per infrastructure**, counted per @Description `nsId:infraId` rather than per caller, because the protected resource is the nodes' own SSH @Description servers. The window matches this API's own **30 s** runtime, so only one check per @Description infrastructure runs at a time. An early or concurrent call is rejected with **`429`** plus a @Description **`Retry-After`** header in seconds, and performs no SSH activity. A client that awaits each @Description response is never rate limited: a not-ready check runs the full 30 s before answering. @Description @Description **Check Method**: This API runs a lightweight command on each node via Tumblebug's @Description remote command API (not a direct connection from CM-Beetle), so it reuses Tumblebug's @Description existing SSH/bastion setup for the node's CSP. It re-probes every **10 s** for up to @Description **30 s**, returning as soon as every node responds. @Description @Description **Response Options**: @Description - Default (no option): Returns summary information (ready, totalNodes, readyNodes, message) @Description - option=detail: Returns summary + detailed node status array (nodeStatus) for troubleshooting (per-node SSH readiness) @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" @Param option query string false "Response format (detail: include per-node SSH readiness information)" Enums(detail) default() @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[CheckSSHReadyResponse] "SSH readiness check completed" @Failure 400 {object} model.ApiResponse[any] "Invalid request parameters" @Failure 404 {object} model.ApiResponse[any] "Infrastructure not found" @Failure 429 {object} model.ApiResponse[any] "Checked less than 30 s after the previous check for this infrastructure; retry after the seconds given in Retry-After" @Failure 500 {object} model.ApiResponse[any] "Internal server error" @Router /migration/ns/{nsId}/infra/{infraId}/ssh-ready [get]
func CreateMigratedSSHKey ¶ added in v0.3.1
CreateMigratedSSHKey godoc @ID CreateMigratedSSHKey @Summary Create a migrated SSH key @Description Create a new migrated SSH key in the namespace @Tags [Migration] Resources for 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
CreateMigratedSecurityGroup godoc @ID CreateMigratedSecurityGroup @Summary Create a migrated security group @Description Create a new migrated security group in the namespace @Tags [Migration] Resources for 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
CreateVNet godoc @ID CreateVNet @Summary Create a migrated virtual network @Description Create a new migrated virtual network in the namespace @Tags [Migration] Resources for 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
DeleteInfra godoc @ID DeleteInfra @Summary Delete the migrated multi-cloud infrastructure (Infra) (sync by default; async via Prefer: respond-async) @Description Delete the migrated multi-cloud infrastructure (Infra). @Description @Description This operation can take a long time (multiple settle-time waits and vNet-deletion @Description retries). By default it runs synchronously. Send header `Prefer: respond-async` to run @Description it asynchronously instead: receive 202 Accepted with a reqId, then poll GET /request/{reqId} @Description (status flow: Handling → Success / Error). Only the "respond-async" token is recognized. @Description @Description **Rate limiting** — Calls to CB-Tumblebug are paced at **~1.6 req/s (one per 625 ms)** to stay @Description under its **2 req/s per-client-IP** limit. This operation allows its paced read up to **30 s** @Description for a slot, rather than the usual 8 s, because deletion tolerates a longer wait. On timeout the @Description response is **`503`** with a **`Retry-After`** header in seconds. @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., 'test-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." @Param Prefer header string false "Set to 'respond-async' to run this deletion asynchronously (RFC 7240)" Enums(respond-async) @Success 200 {object} model.ApiResponse[any] "The result of deleting the migrated multi-cloud infrastructure" @Success 202 {object} model.ApiResponse[model.AsyncJobResponse] "Deletion started asynchronously - use GET /request/{reqId} to check status" @Failure 404 {object} model.ApiResponse[any] @Failure 500 {object} model.ApiResponse[any] @Failure 503 {object} model.ApiResponse[any] "Too many concurrent async jobs, or no pacing slot within the 30 s wait budget; retry after the seconds given in Retry-After" @Router /migration/ns/{nsId}/infra/{infraId} [delete]
func DeleteMigratedSSHKey ¶ added in v0.3.1
DeleteMigratedSSHKey godoc @ID DeleteMigratedSSHKey @Summary Delete a migrated SSH key @Description Delete a specific migrated SSH key in the namespace @Tags [Migration] Resources for 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
DeleteMigratedSSHKeys godoc @ID DeleteMigratedSSHKeys @Summary Delete multiple migrated SSH keys @Description Delete multiple migrated SSH keys in the namespace @Tags [Migration] Resources for 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
DeleteMigratedSecurityGroup godoc @ID DeleteMigratedSecurityGroup @Summary Delete a migrated security group @Description Delete a specific migrated security group in the namespace @Tags [Migration] Resources for 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
DeleteMigratedSecurityGroups godoc @ID DeleteMigratedSecurityGroups @Summary Delete multiple migrated security groups @Description Delete multiple migrated security groups in the namespace @Tags [Migration] Resources for 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
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 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
DeleteMigratedVNets godoc @ID DeleteMigratedVNets @Summary Delete multiple migrated virtual networks @Description Delete multiple migrated virtual networks in the namespace @Tags [Migration] Resources for 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 DeleteNlb ¶ added in v0.5.3
DeleteNlb godoc @ID DeleteNlb @Summary Delete an NLB @Description Delete a specific NLB from the target infra. @Description @Description [Note] Some CSPs delete NLBs asynchronously — the API returns success before ENIs are fully released. @Description Deleting VNet/subnets immediately after NLB deletion may cause dependency errors (e.g., DependencyViolation on AWS). @Description CM-Beetle waits a short period (e.g., 15s) after a successful deletion response to allow CSP-side cleanup to complete. @Description @Description By default this API runs synchronously (always includes the 15s settle wait). Send header @Description `Prefer: respond-async` to run it asynchronously instead: receive 202 Accepted with a reqId, @Description then poll GET /request/{reqId} (status flow: Handling → Success / Error). @Tags [Migration] Managed Network Load Balancer (NLB) - preview @Accept json @Produce json @Param nsId path string true "Namespace ID" default(mig01) @Param infraId path string true "Infra ID" @Param nlbId path string true "NLB ID" @Param X-Request-Id header string false "Unique request ID" @Param Prefer header string false "Set to 'respond-async' to run this deletion asynchronously (RFC 7240)" Enums(respond-async) @Success 204 "NLB deleted (includes 15s settle wait for CSP async cleanup)" @Success 202 {object} model.ApiResponse[model.AsyncJobResponse] "Deletion started asynchronously - use GET /request/{reqId} to check status" @Failure 400 {object} model.ApiResponse[any] "Invalid request parameters" @Failure 500 {object} model.ApiResponse[any] "Internal server error" @Failure 503 {object} model.ApiResponse[any] "Too many requests - retry after the given time" @Header 503 {string} Retry-After "Seconds until client should retry" @Router /migration/middleware/ns/{nsId}/infra/{infraId}/nlb/{nlbId} [delete]
func DeleteObjectStorage ¶ added in v0.4.2
DeleteObjectStorage godoc @ID DeleteObjectStorage @Summary Delete object storage (bucket) @Description Delete a specific object storage (bucket). @Description @Description By default this API runs synchronously. Send header `Prefer: respond-async` to run it @Description asynchronously (RFC 7240). Check progress via GET /request/{reqId} @Description (status flow: Handling → Success / Error). Only the "respond-async" token is recognized. @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 Object Storage @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 Prefer header string false "Set to 'respond-async' to run this deletion asynchronously (RFC 7240)" Enums(respond-async) @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 (synchronous)" @Success 202 {object} model.ApiResponse[model.AsyncJobResponse] "Object storage deletion started asynchronously - use GET /request/{reqId} to check status" @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" @Failure 503 {object} model.ApiResponse[any] "Too many requests - retry after the given time" @Header 503 {string} Retry-After "Seconds until client should retry" @Router /migration/middleware/ns/{nsId}/objectStorage/{osId} [delete]
func DeleteStorageObject ¶ added in v0.5.1
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 Object Storage @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" @Failure 503 {object} model.ApiResponse[any] "Too many requests - retry after the given time" @Header 503 {string} Retry-After "Seconds until client should retry" @Router /migration/middleware/ns/{nsId}/objectStorage/{osId}/object/{objectKey} [delete]
func ExistObjectStorage ¶ added in v0.4.2
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 Object Storage @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" @Failure 503 {object} model.ApiResponse[any] "Too many requests - retry after the given time" @Header 503 {string} Retry-After "Seconds until client should retry" @Router /migration/middleware/ns/{nsId}/objectStorage/{osId} [head]
func GenerateMigrationReport ¶ added in v0.4.3
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
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
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 infraId path string true "Infra ID" default(infra101) @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
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
GetInfra godoc @ID GetInfra @Summary Get the migrated multi-cloud infrastructure (Infra) @Description Get the migrated multi-cloud infrastructure (Infra) @Description @Description **Rate limiting** — Calls to CB-Tumblebug are paced at **~1.6 req/s (one per 625 ms)** to stay @Description under its **2 req/s per-client-IP** limit, and wait up to **8 s** for a slot. If none frees up @Description in time the response is **`503`** with a **`Retry-After`** header in seconds. Those are the @Description defaults; operators tune them via `BEETLE_TUMBLEBUG_RETRIEVAL_REQUESTS_PER_SEC` and `_MAX_WAIT_SEC`. @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., 'test-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] @Failure 503 {object} model.ApiResponse[any] "No pacing slot within the 8 s wait budget; retry after the seconds given in Retry-After" @Router /migration/ns/{nsId}/infra/{infraId} [get]
func GetMigratedSSHKey ¶ added in v0.3.1
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 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
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 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
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 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 GetNlb ¶ added in v0.5.3
GetNlb godoc @ID GetNlb @Summary Get NLB details @Description Get details of a specific NLB @Tags [Migration] Managed Network Load Balancer (NLB) - preview @Accept json @Produce json @Param nsId path string true "Namespace ID" default(mig01) @Param infraId path string true "Infra ID" @Param nlbId path string true "NLB ID" @Param X-Request-Id header string false "Unique request ID" @Success 200 {object} model.ApiResponse[cloudmodel.NLBInfo] "NLB details" @Failure 400 {object} model.ApiResponse[any] "Invalid request parameters" @Failure 404 {object} model.ApiResponse[any] "NLB not found" @Failure 500 {object} model.ApiResponse[any] "Internal server error" @Failure 503 {object} model.ApiResponse[any] "Too many requests - retry after the given time" @Header 503 {string} Retry-After "Seconds until client should retry" @Router /migration/middleware/ns/{nsId}/infra/{infraId}/nlb/{nlbId} [get]
func GetNlbHealth ¶ added in v0.5.4
GetNlbHealth godoc @ID GetNlbHealth @Summary Get NLB health status (live CSP check) @Description Perform a live health check on NLB backend targets via the CSP. @Description Unlike GET /nlb/{nlbId} (which returns cached state), this endpoint queries the CSP directly @Description to retrieve the current health status of VM targets in the NLB target group. @Tags [Migration] Managed Network Load Balancer (NLB) - preview @Accept json @Produce json @Param nsId path string true "Namespace ID" default(mig01) @Param infraId path string true "Infra ID" @Param nlbId path string true "NLB ID" @Param X-Request-Id header string false "Unique request ID" @Success 200 {object} model.ApiResponse[cloudmodel.NLBInfo] "NLB health info (live from CSP)" @Failure 400 {object} model.ApiResponse[any] "Invalid request parameters" @Failure 404 {object} model.ApiResponse[any] "NLB not found" @Failure 500 {object} model.ApiResponse[any] "Internal server error" @Failure 503 {object} model.ApiResponse[any] "Too many requests - retry after the given time" @Header 503 {string} Retry-After "Seconds until client should retry" @Router /migration/middleware/ns/{nsId}/infra/{infraId}/nlb/{nlbId}/healthz [get]
func GetObjectStorage ¶ added in v0.4.2
GetObjectStorage godoc @ID GetObjectStorage @Summary Get object storage (bucket) details @Description Get details of a specific object storage (bucket) @Tags [Migration] Managed Object Storage @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[storagemodel.ObjectStorageInfo] "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" @Failure 503 {object} model.ApiResponse[any] "Too many requests - retry after the given time" @Header 503 {string} Retry-After "Seconds until client should retry" @Router /migration/middleware/ns/{nsId}/objectStorage/{osId} [get]
func GetObjectStorageSupport ¶ added in v0.5.7
GetObjectStorageSupport godoc @ID GetObjectStorageSupport @Summary Get CSP feature support map for object storage (Proxied to Tumblebug) @Description Forward object storage support request to CB-Tumblebug via Proxy (Returns ObjectStorageSupportResponse) @Tags [Recommendation] Managed Object Storage @Accept json @Produce json @Success 200 {object} tbmodel.ObjectStorageSupportResponse @Router /recommendation/middleware/objectStorage/support [get]
func GetSecurityPublicKey ¶ added in v0.5.7
GetSecurityPublicKey godoc @ID GetSecurityPublicKey @Summary (CM-Beetle) Get RSA public key for credential encryption @Description Generate and return a one-time RSA public key bundle for encrypting sensitive CSP access credentials (accessKey, secretKey, tokens) before scanning or sending across web clients. @Tags [Minimal Test] @Accept json @Produce json @Param X-Request-Id header string false "Unique request ID" @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/security/publicKey [get]
func GetStorageObject ¶ added in v0.5.1
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 Object Storage @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" @Failure 503 {object} model.ApiResponse[any] "Too many requests - retry after the given time" @Header 503 {string} Retry-After "Seconds until client should retry" @Router /migration/middleware/ns/{nsId}/objectStorage/{osId}/object/{objectKey} [head]
func InspectObjectStorage ¶ added in v0.5.7
InspectObjectStorage godoc @ID InspectObjectStorage @Summary (CM-Beetle) Collect deep metadata from selected source object storage buckets @Description Deeply inspect and extract feature/usage metadata (totalSizeBytes, objectCount, versioning, encryption, CORS, policy, tags, creationDate) from selected cloud object storage buckets. @Description @Description [Note] Extracted fields strictly conform to Beetle's Recommendation API input specification (`SourceObjectStorage`). @Description - Versioning: Extracted via `GetBucketVersioning`. If versioning is disabled or error occurs, `versioningEnabled` is false. @Description - Encryption: Extracted via `GetBucketEncryption`. If encryption rules are absent or error occurs, `encryptionEnabled` is false. @Description - CORS: Extracted via `GetBucketCors`. If CORS rules are absent or error occurs, `corsEnabled` is false and `corsRule` is nil. @Description - Public Access: Extracted via `GetBucketPolicy`. If wildcard public policy statement is detected, `isPublic` is true, otherwise false. @Description - Tags: Extracted via `GetBucketTagging`. If tags are not set, `tags` is nil/empty map. @Description - CreationDate: Extracted via bucket listing creation timestamp formatted in RFC 3339 format. @Description - AccessFrequency: Defaults to `"frequent"` (Standard storage tier baseline for recommendation). @Tags [Minimal Test] @Accept json @Produce json @Param request body InspectObjectStorageRequest true "Parameters and selected bucket names for deep object storage inspection" @Param X-Request-Id header string false "Unique request ID" @Success 200 {object} model.ApiResponse[storagemodel.SourceObjectStorage] "Successfully collected source object storage model for selected buckets" @Failure 400 {object} model.ApiResponse[any] "Invalid request parameters or missing credentials" @Failure 500 {object} model.ApiResponse[any] "Failed to inspect object storage buckets" @Router /migration/middleware/objectStorage/inspect [post]
func ListInfra ¶ added in v0.2.4
ListInfra godoc @ID ListInfra @Summary Get the migrated multi-cloud infrastructure (Infra) @Description Get the migrated multi-cloud infrastructure (Infra) @Description @Description **Rate limiting** — Calls to CB-Tumblebug are paced at **~1.6 req/s (one per 625 ms)** to stay @Description under its **2 req/s per-client-IP** limit, and wait up to **8 s** for a slot. If none frees up @Description in time the response is **`503`** with a **`Retry-After`** header in seconds. Those are the @Description defaults; operators tune them via `BEETLE_TUMBLEBUG_RETRIEVAL_REQUESTS_PER_SEC` and `_MAX_WAIT_SEC`. @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] @Failure 503 {object} model.ApiResponse[any] "No pacing slot within the 8 s wait budget; retry after the seconds given in Retry-After" @Router /migration/ns/{nsId}/infra [get]
func ListMigratedSSHKeys ¶ added in v0.3.1
========== 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 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
========== 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 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
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 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 ListNlbs ¶ added in v0.5.3
ListNlbs godoc @ID ListNlbs @Summary List NLBs in a cloud infra @Description Get the list of all NLBs in the specified namespace and infra @Tags [Migration] Managed Network Load Balancer (NLB) - preview @Accept json @Produce json @Param nsId path string true "Namespace ID" default(mig01) @Param infraId path string true "Infra ID" @Param X-Request-Id header string false "Unique request ID" @Success 200 {object} model.ApiResponse[[]cloudmodel.NLBInfo] "NLB list" @Failure 400 {object} model.ApiResponse[any] "Invalid request parameters" @Failure 500 {object} model.ApiResponse[any] "Internal server error" @Failure 503 {object} model.ApiResponse[any] "Too many requests - retry after the given time" @Header 503 {string} Retry-After "Seconds until client should retry" @Router /migration/middleware/ns/{nsId}/infra/{infraId}/nlb [get]
func ListObjectStorageObjects ¶ added in v0.5.1
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 Object Storage @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" @Failure 503 {object} model.ApiResponse[any] "Too many requests - retry after the given time" @Header 503 {string} Retry-After "Seconds until client should retry" @Router /migration/middleware/ns/{nsId}/objectStorage/{osId}/object [get]
func ListObjectStorages ¶ added in v0.4.2
ListObjectStorages godoc @ID ListObjectStorages @Summary List object storages (buckets) @Description Get the list of all object storages (buckets) in the namespace @Tags [Migration] Managed Object Storage @Accept json @Produce json @Param nsId path string true "Namespace ID" default(mig01) @Param option query string false "Option to filter list (e.g., 'id')" 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[storagemodel.ObjectStorageListResponse] "Successfully retrieved object storage list (default)" @Success 200 {object} model.ApiResponse[storagemodel.IdList] "Successfully retrieved object storage ID list (option=id)" @Failure 400 {object} model.ApiResponse[any] "Invalid request parameters" @Failure 500 {object} model.ApiResponse[any] "Internal server error during list operation" @Failure 503 {object} model.ApiResponse[any] "Too many requests - retry after the given time" @Header 503 {string} Retry-After "Seconds until client should retry" @Router /migration/middleware/ns/{nsId}/objectStorage [get]
func MigrateData ¶ added in v0.3.9
MigrateData godoc @ID MigrateData @Summary Migrate data from source to target (sync by default; async via Prefer: respond-async) @Description By default this API runs synchronously and returns the migration result directly. @Description @Description [Async Operation (opt-in)] @Description 1. Send header `Prefer: respond-async` → Receive 202 Accepted with reqId @Description 2. Poll GET /request/{reqId} to check status @Description 3. Status flow: Handling → Success / Error @Description * Only the "respond-async" preference token is recognized; other tokens (e.g. wait=N) are ignored. @Description * If too many async jobs are already running, this returns 503 instead of 202; retry after the `Retry-After` seconds. @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 Prefer header string false "Set to 'respond-async' to run this migration asynchronously (RFC 7240)" Enums(respond-async) @Param reqBody body transx.DataMigrationModel true "Data migration request (supports plaintext or encrypted with encryptionKeyId)" @Success 200 {object} model.ApiResponse[any] "Migration completed synchronously" @Success 202 {object} model.ApiResponse[model.AsyncJobResponse] "Migration started asynchronously - use GET /request/{reqId} to check status" @Failure 400 {object} model.ApiResponse[any] "Invalid request parameters or decryption failed" @Failure 500 {object} model.ApiResponse[any] "Migration failed" @Failure 503 {object} model.ApiResponse[any] "Too many requests - retry after the given time" @Header 503 {string} Retry-After "Seconds until client should retry" @Router /migration/data [post]
func MigrateInfra ¶
MigrateInfra godoc @ID MigrateInfra @Summary Migrate an infrastructure to the multi-cloud infrastructure (Infra) with defaults (sync by default; async via Prefer: respond-async) @Description Migrate an infrastructure to the multi-cloud infrastructure (Infra) 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-node 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. @Description @Description By default this API runs synchronously. Send header `Prefer: respond-async` to run it @Description asynchronously instead: receive 202 Accepted with a reqId, then poll GET /request/{reqId} @Description (status flow: Handling → Success / Error). Only the "respond-async" token is recognized. @Description @Description **Rate limiting** — Calls to CB-Tumblebug are paced at **~1.6 req/s (one per 625 ms)** to stay @Description under its **2 req/s per-client-IP** limit, and wait up to **8 s** for a slot. If none frees up @Description in time the response is **`503`** with a **`Retry-After`** header in seconds. Those are the @Description defaults; operators tune them via `BEETLE_TUMBLEBUG_RETRIEVAL_REQUESTS_PER_SEC` and `_MAX_WAIT_SEC`. @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 useExisting query bool false "Reuse existing resources (VNet, SSH Key, Security Group) if they already exist, instead of creating new ones (default: true)" @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." @Param Prefer header string false "Set to 'respond-async' to run this migration asynchronously (RFC 7240)" Enums(respond-async) @Success 201 {object} model.ApiResponse[MigrateInfraResponse] "Successfully migrated to the multi-cloud infrastructure" @Success 202 {object} model.ApiResponse[model.AsyncJobResponse] "Migration started asynchronously - use GET /request/{reqId} to check status" @Failure 404 {object} model.ApiResponse[any] @Failure 500 {object} model.ApiResponse[any] @Failure 503 {object} model.ApiResponse[any] "Too many concurrent async jobs, or no pacing slot within the 8 s wait budget; retry after the seconds given in Retry-After" @Router /migration/ns/{nsId}/infra [post]
func MigrateInfraWithDefaults ¶ added in v0.3.1
MigrateInfraWithDefaults godoc @ID MigrateInfraWithDefaults @Summary Migrate an infrastructure to the multi-cloud infrastructure (Infra) with defaults (sync by default; async via Prefer: respond-async) @Description Migrate an infrastructure to the multi-cloud infrastructure (Infra) with defaults. @Description @Description By default this API runs synchronously. Send header `Prefer: respond-async` to run it @Description asynchronously instead: receive 202 Accepted with a reqId, then poll GET /request/{reqId} @Description (status flow: Handling → Success / Error). Only the "respond-async" token is recognized. @Tags [Migration] Infrastructure @Accept json @Produce json @Param nsId path string true "Namespace ID" default(mig01) @Param infraInfo body MigrateInfraWithDefaultsRequest true "Specify the information for the targeted multi-cloud infrastructure (Infra)" @Param X-Request-Id header string false "Unique request ID (auto-generated if not provided). Used for tracking request status and correlating logs." @Param Prefer header string false "Set to 'respond-async' to run this migration asynchronously (RFC 7240)" Enums(respond-async) @Success 201 {object} model.ApiResponse[MigrateInfraWithDefaultsResponse] "Successfully migrated to the multi-cloud infrastructure" @Success 202 {object} model.ApiResponse[model.AsyncJobResponse] "Migration started asynchronously - use GET /request/{reqId} to check status" @Failure 500 {object} model.ApiResponse[any] @Failure 503 {object} model.ApiResponse[any] "Too many concurrent async jobs; retry later or without Prefer: respond-async" @Router /migration/ns/{nsId}/infraWithDefaults [post]
func MigrateNlbs ¶ added in v0.5.3
MigrateNlbs godoc @ID MigrateNlbs @Summary (Preview) Migrate NLBs to a cloud infra @Description Migrate NLBs to the target cloud infra based on recommendation results. @Description @Description [Prerequisites] @Description - The target Namespace (nsId) must exist. @Description - The target Infra (infraId) must exist and have at least one NodeGroup in Running state. @Description - Each `targetNlbList[].targetGroup.nodeGroupId` must reference an existing NodeGroup in the Infra. @Description @Description [Note] Input should be the `targetNlbList` field from the POST /recommendation/infraWithNlb response. @Description Ensure `targetGroup.nodeGroupId` matches the NodeGroup IDs created during infra migration. @Description @Description [Note] All NLBs are attempted independently. Partial success is possible. @Description @Description By default this API runs synchronously. Send header `Prefer: respond-async` to run it @Description asynchronously instead: receive 202 Accepted with a reqId, then poll GET /request/{reqId} @Description (status flow: Handling → Success / Error). Only the "respond-async" token is recognized. @Tags [Migration] Managed Network Load Balancer (NLB) - preview @Accept json @Produce json @Param nsId path string true "Namespace ID" default(mig01) @Param infraId path string true "Infra ID (target infra with NodeGroups already created)" @Param useExisting query bool false "Reuse existing NLB if one targeting the same nodeGroupId already exists, instead of creating a new one (default: true)" @Param request body cloudmodel.RecommendedNlb true "NLB migration request (use targetNlbList[] from /recommendation/infraWithNlb)" @Param X-Request-Id header string false "Unique request ID (auto-generated if not provided)" @Param Prefer header string false "Set to 'respond-async' to run this migration asynchronously (RFC 7240)" Enums(respond-async) @Success 201 {object} model.ApiResponse[cloudmodel.MigratedNlbResult] "NLBs created successfully" @Success 202 {object} model.ApiResponse[model.AsyncJobResponse] "Migration started asynchronously - use GET /request/{reqId} to check status" @Failure 400 {object} model.ApiResponse[any] "Invalid request parameters" @Failure 500 {object} model.ApiResponse[any] "Internal server error during NLB creation" @Failure 503 {object} model.ApiResponse[any] "Too many requests - retry after the given time" @Header 503 {string} Retry-After "Seconds until client should retry" @Router /migration/middleware/ns/{nsId}/infra/{infraId}/nlb [post]
func MigrateObjectStorage ¶ added in v0.4.2
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 @Description By default this API runs synchronously. Send header `Prefer: respond-async` to run it @Description asynchronously instead: receive 202 Accepted with a reqId, then poll GET /request/{reqId} @Description (status flow: Handling → Success / Error). Only the "respond-async" token is recognized. @Tags [Migration] Managed Object Storage @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." @Param Prefer header string false "Set to 'respond-async' to run this migration asynchronously (RFC 7240)" Enums(respond-async) @Success 201 "Created - Object storages created successfully" @Success 202 {object} model.ApiResponse[model.AsyncJobResponse] "Migration started asynchronously - use GET /request/{reqId} to check status" @Failure 400 {object} model.ApiResponse[any] "Invalid request parameters" @Failure 500 {object} model.ApiResponse[any] "Internal server error during object storage creation" @Failure 503 {object} model.ApiResponse[any] "Too many requests - retry after the given time" @Header 503 {string} Retry-After "Seconds until client should retry" @Router /migration/middleware/ns/{nsId}/objectStorage [post]
func PreviewInfra ¶ added in v0.5.1
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 RecommendInfraWithNlbCandidates ¶ added in v0.5.3
RecommendInfraWithNlbCandidates godoc @ID RecommendInfraWithNlbCandidates @Summary (Preview) Recommend infrastructure candidates with NLB for cloud migration @Description Perform NLB-aware infrastructure recommendation and return multiple Pareto-optimal candidates. @Description @Description The recommendation engine: @Description 1. Correlates NLB backend server IPs with source Node IPs @Description 2. Normalizes backend ports via majority vote when ports differ @Description 3. Assigns NLB-related nodes to shared NodeGroups (N:1), unrelated nodes to individual NodeGroups (1:1) @Description 4. Finds ranked compatible spec-image pairs per NodeGroup (representative node for NLB groups) @Description 5. Generates up to `limit` candidates — candidate i uses the i-th ranked pair per NodeGroup @Description 6. Maps source NLB configuration to target cloud NLB model (same for all candidates) @Description @Description [Note] `sourceInfra.nlbs` must be populated (HAProxy frontend-backend pairs from cm-honeybee). @Description @Description [Note] The returned `targetInfra.nodeGroups[].name` values are referenced by `targetNlbList[].targetGroup.nodeGroupId`. @Description Use the same NodeGroup IDs when calling POST /migration/infra so that the NLB migration can reference them immediately. @Description @Description --- @Description ## CSP-Specific NLB Notes @Description @Description AWS: @Description - Port translation supported (e.g., listener 9999 → backend 8086). @Description - DNS endpoint; allow ~5 min for propagation after creation. @Description - [Auto] SG rule for backend port opened from 0.0.0.0/0. @Description @Description Azure: @Description - Port translation supported. DNS + static IP endpoint. @Description - [Auto] Health check timeout omitted (not supported by Azure). @Description @Description GCP: @Description - Port translation NOT supported; traffic arrives at backend VMs on the listener port. @Description - [Auto] Listener port is forced equal to the backend port — clients must connect on the application port (e.g., 8086, not 9999). @Description - IP-only endpoint (no DNS name). @Description @Description IBM: @Description - Port translation supported. @Description - Listener address is assigned asynchronously; re-query if the address is empty after migration. @Description - [Auto] Health check timeout forced strictly less than the interval. @Description --- @Tags [Recommendation] Infrastructure @Accept json @Produce json @Param desiredCsp query string false "Target CSP (e.g., aws, azure, gcp)" Enums(aws,azure,gcp,alibaba,ncp) default(aws) @Param desiredRegion query string false "Target region (e.g., ap-northeast-2)" default(ap-northeast-2) @Param limit query int false "Maximum number of candidates to return" default(5) @Param minMatchRate query number false "Minimum match rate (0-100) for highly-matched classification" default(90.0) @Param request body RecommendInfraWithNlbRequest true "Source infra including NLBs (from cm-honeybee)" @Param X-Request-Id header string false "Unique request ID (auto-generated if not provided)" @Param Prefer header string false "Set to 'respond-async' to run this recommendation asynchronously (RFC 7240)" Enums(respond-async) @Success 200 {object} model.ApiResponse[[]cloudmodel.RecommendedInfra] "NLB-aware recommendation candidates" @Success 202 {object} model.ApiResponse[model.AsyncJobResponse] "Recommendation started asynchronously - use GET /request/{reqId} to check status" @Failure 400 {object} model.ApiResponse[any] "Invalid request" @Failure 500 {object} model.ApiResponse[any] "Internal server error" @Failure 503 {object} model.ApiResponse[any] "Too many requests - retry after the given time" @Header 503 {string} Retry-After "Seconds until client should retry" @Router /recommendation/infraWithNlb [post]
func RecommendK8sControlPlane ¶ added in v0.4.2
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] @Failure 503 {object} model.ApiResponse[any] "Too many requests - retry after the given time" @Header 503 {string} Retry-After "Seconds until client should retry" @Router /recommendation/k8sControlPlane [post]
func RecommendK8sNodeGroup ¶ added in v0.4.2
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] @Failure 503 {object} model.ApiResponse[any] "Too many requests - retry after the given time" @Header 503 {string} Retry-After "Seconds until client should retry" @Router /recommendation/k8sNodeGroup [post]
func RecommendMultiInfraCandidates ¶ added in v0.5.9
RecommendMultiInfraCandidates godoc @ID RecommendMultiInfraCandidates @Summary Recommend the best-match infrastructure per target cloud, for cross-CSP comparison @Description Recommend a single best-effort infrastructure candidate for each of several target CSP/region pairs. @Description @Description Use this API to compare candidate clouds before committing to one; once a target is chosen, @Description use `POST /recommendation/infra` against that single CSP/region to explore multiple candidates. @Description @Description **[Required Parameter: `desiredCspAndRegionPairs`]** 2 to 10 target CSP/region pairs (project scope: 10 supported CSPs). @Description Duplicate pairs are rejected. @Description @Description **[Response]** Always returns exactly one item per requested target, in request order @Description (`len(data) == len(desiredCspAndRegionPairs)`), so items map back to targets via `targetCloud` @Description without needing to be re-sorted or grouped. A target that fails validation or yields no @Description compatible infrastructure still produces one item, with `status` set to `failed` or @Description `nothing-to-recommend` and `targetInfra` left empty. @Description @Description **[Optional Parameter: `minMatchRate`]** Minimum match rate threshold for highly-matched classification (default: 90.0, range: 0-100) @Description @Description [Note] Each target costs roughly as much as one `/recommendation/infra` call; requests with @Description several targets can take a while. `Prefer: respond-async` is strongly recommended. @Tags [Recommendation] Infrastructure @Accept json @Produce json @Param request body RecommendMultiInfraRequest true "Target CSP/region pairs and the source infrastructure to be migrated" @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." @Param Prefer header string false "Set to 'respond-async' to run this recommendation asynchronously (RFC 7240)" Enums(respond-async) @Success 200 {object} model.ApiResponse[[]cloudmodel.RecommendedInfra] "One recommended (or failed/nothing-to-recommend) candidate per target, in request order" @Success 202 {object} model.ApiResponse[model.AsyncJobResponse] "Recommendation started asynchronously - use GET /request/{reqId} to check status" @Failure 400 {object} model.ApiResponse[any] "Invalid request parameters" @Failure 500 {object} model.ApiResponse[any] "Internal server error during recommendation" @Failure 503 {object} model.ApiResponse[any] "Too many concurrent async jobs; retry later or without Prefer: respond-async" @Router /recommendation/multiInfra [post]
func RecommendMultiInfraWithNlbCandidates ¶ added in v0.5.9
RecommendMultiInfraWithNlbCandidates godoc @ID RecommendMultiInfraWithNlbCandidates @Summary (Preview) Recommend the best-match NLB-aware infrastructure per target cloud, for cross-CSP comparison @Description NLB-aware counterpart of `POST /recommendation/multiInfra`. Recommends a single best-effort @Description infrastructure candidate (including NLB mapping) for each of several target CSP/region pairs. @Description @Description Use this API to compare candidate clouds before committing to one; once a target is chosen, @Description use `POST /recommendation/infraWithNlb` against that single CSP/region to explore multiple candidates. @Description @Description **[Required Parameter: `desiredCspAndRegionPairs`]** 2 to 10 target CSP/region pairs (project scope: 10 supported CSPs). @Description Duplicate pairs are rejected. @Description @Description [Note] `sourceInfra.nlbs` must be populated (HAProxy frontend-backend pairs from cm-honeybee). @Description @Description **[Response]** Always returns exactly one item per requested target, in request order @Description (`len(data) == len(desiredCspAndRegionPairs)`), so items map back to targets via `targetCloud` @Description without needing to be re-sorted or grouped. A target that fails validation or yields no @Description compatible infrastructure still produces one item, with `status` set to `failed` or @Description `nothing-to-recommend` and `targetInfra` left empty. @Description @Description **[Optional Parameter: `minMatchRate`]** Minimum match rate threshold for highly-matched classification (default: 90.0, range: 0-100) @Description @Description [Note] Each target costs roughly as much as one `/recommendation/infraWithNlb` call; requests with @Description several targets can take a while. `Prefer: respond-async` is strongly recommended. @Tags [Recommendation] Infrastructure @Accept json @Produce json @Param request body RecommendMultiInfraWithNlbRequest true "Target CSP/region pairs and the source infra including NLBs" @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." @Param Prefer header string false "Set to 'respond-async' to run this recommendation asynchronously (RFC 7240)" Enums(respond-async) @Success 200 {object} model.ApiResponse[[]cloudmodel.RecommendedInfra] "One recommended (or failed/nothing-to-recommend) candidate per target, in request order" @Success 202 {object} model.ApiResponse[model.AsyncJobResponse] "Recommendation started asynchronously - use GET /request/{reqId} to check status" @Failure 400 {object} model.ApiResponse[any] "Invalid request parameters" @Failure 500 {object} model.ApiResponse[any] "Internal server error during recommendation" @Failure 503 {object} model.ApiResponse[any] "Too many concurrent async jobs; retry later or without Prefer: respond-async" @Router /recommendation/multiInfraWithNlb [post]
func RecommendObjectStorage ¶ added in v0.4.1
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 Object Storage @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
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 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" @Failure 503 {object} model.ApiResponse[any] "Too many requests - retry after the given time" @Header 503 {string} Retry-After "Seconds until client should retry" @Router /recommendation/resources/securityGroups [post]
func RecommendVMInfraWithDefaults ¶ added in v0.3.1
RecommendVMInfraWithDefaults godoc @ID RecommendVMInfraWithDefaults @Summary (To be updated) Recommend an appropriate infrastructure (i.e., Infra, multi-cloud infrastructure) with defaults for cloud migration @Description Recommend an appropriate infrastructure (i.e., Infra, 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." @Param Prefer header string false "Set to 'respond-async' to run this recommendation asynchronously (RFC 7240)" Enums(respond-async) @Success 200 {object} model.ApiResponse[RecommendInfraWithDefaultsResponse] "The result of recommended infrastructure" @Success 202 {object} model.ApiResponse[model.AsyncJobResponse] "Recommendation started asynchronously - use GET /request/{reqId} to check status" @Failure 404 {object} model.ApiResponse[any] @Failure 500 {object} model.ApiResponse[any] @Failure 503 {object} model.ApiResponse[any] "Too many concurrent async jobs; retry later or without Prefer: respond-async" @Router /recommendation/infraWithDefaults [post]
func RecommendVNet ¶ added in v0.3.1
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 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" @Failure 503 {object} model.ApiResponse[any] "Too many requests - retry after the given time" @Header 503 {string} Retry-After "Seconds until client should retry" @Router /recommendation/resources/vNet [post]
func RecommendVmInfraCandidates ¶ added in v0.4.7
RecommendVmInfraCandidates godoc @ID RecommendVmInfraCandidates @Summary Recommend multiple infrastructure candidates for cloud migration @Description Recommend best-effort infrastructure (Infra) 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." @Param Prefer header string false "Set to 'respond-async' to run this recommendation asynchronously (RFC 7240)" Enums(respond-async) @Success 200 {object} model.ApiResponse[[]cloudmodel.RecommendedInfra] "Successfully recommended infrastructure candidates" @Success 202 {object} model.ApiResponse[model.AsyncJobResponse] "Recommendation started asynchronously - use GET /request/{reqId} to check status" @Failure 400 {object} model.ApiResponse[any] "Invalid request parameters" @Failure 500 {object} model.ApiResponse[any] "Internal server error during recommendation" @Failure 503 {object} model.ApiResponse[any] "Too many requests - retry after the given time" @Header 503 {string} Retry-After "Seconds until client should retry" @Router /recommendation/infra [post]
func RecommendVmOsImages ¶ added in v0.3.1
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 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
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 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
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
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
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 @Description @Description [Retry Information] @Description - retry.retryable: Whether the failed request can be retried (present only for retriable errors) @Description - retry.retryAfter: Suggested retry delay in seconds @Description - retry.retryReason: Human-readable reason for retry requirement (e.g., "Rate Limit Exceeded") @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
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 @Description @Description [Retry Information] @Description - retry.retryable: Whether the failed request can be retried (present only for retriable errors) @Description - retry.retryAfter: Suggested retry delay in seconds @Description - retry.retryReason: Human-readable reason for retry requirement (e.g., "Rate Limit Exceeded") @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 ScanObjectStorage ¶ added in v0.5.7
ScanObjectStorage godoc @ID ScanObjectStorage @Summary (CB-Tumblebug) Scan cloud account object storage buckets @Description Scan and list all object storage buckets in the specified cloud provider account using provided CSP access credentials via MinIO S3 SDK. @Tags [Minimal Test] @Accept json @Produce json @Param request body ScanObjectStorageRequest true "CSP credentials and target cloud information for bucket scanning" @Param X-Request-Id header string false "Unique request ID" @Success 200 {object} model.ApiResponse[[]ScannedBucketSummary] "List of discovered object storage buckets" @Failure 400 {object} model.ApiResponse[any] "Invalid request parameters or missing credentials" @Failure 500 {object} model.ApiResponse[any] "Failed to list buckets from S3 API" @Router /migration/middleware/objectStorage/scan [post]
func TestAuth ¶ added in v0.5.1
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
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
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
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
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 ValidateInfra ¶ added in v0.5.7
ValidateInfra godoc @ID ValidateInfra @Summary (Preview) Validate a target infrastructure model before migration @Description Runs, without creating or modifying any resource, the same checks @Description migration execution performs immediately before provisioning: @Description @Description - **Naming & referential integrity**: names must be 3-63 alphanumeric/hyphen @Description characters, and internal references must resolve within the submitted model @Description (e.g. a NodeGroup's `securityGroupIds` must match a `name` in `targetSecurityGroupList`). @Description - **Required fields**, which differ by `useExisting`: @Description - `true`: each NodeGroup's `vNetId`, `sshKeyId`, `securityGroupIds` must be set. @Description - `false`: `targetVNet.name`, `targetSshKey.name`, and each security group's `name` must be set. @Description - **Resource name collision / availability** against Tumblebug, which also differs by `useExisting`: @Description - `false`: the VNet/SSH key/security groups to be created must NOT already exist in the @Description namespace (e.g. `targetVNet.name: "vnet-01"` fails if a VNet named `vnet-01` already exists). @Description - `true`: an existing resource must be under the same CSP/region connection the NodeGroup @Description requests (e.g. reusing a VNet provisioned under connection `aws-ap-northeast-2` while the @Description NodeGroup's `connectionName` is `gcp-asia-northeast3` fails); a resource that doesn't exist @Description yet must have enough data alongside it to create it instead (e.g. `targetVNet.cidrBlock`). @Description - **VM spec/image compatibility** per NodeGroup: `specId`, `imageId`, and `connectionName` must @Description be set, `connectionName` must be in `csp-region` format (e.g. `aws-ap-northeast-2`), and the @Description resolved spec/image pair must be compatible for that CSP (e.g. an `x86_64` spec paired with @Description an `arm64` image fails). @Description - **Infra name collision**: `targetInfra.name` must not already exist in the namespace. @Description @Description Always returns HTTP 200: the response body's `valid` field and @Description `issues` list carry the outcome, since a failed check is a normal, @Description successfully-answered result rather than a malformed request. @Description 400 is reserved for request body/parameter errors. @Description @Description Because Tumblebug/CSP state can change afterward, a `valid: true` @Description result is a best-effort snapshot, not a guarantee - the migration @Description API re-runs this same validation immediately before provisioning. @Tags [Validation] Target Cloud Configuration (Preview), [Migration] Infrastructure @Accept json @Produce json @Param nsId path string true "Namespace ID" default(mig01) @Param useExisting query bool false "Validate as if reusing existing resources (VNet, SSH Key, Security Group) instead of creating new ones (default: true); should match the `useExisting` value intended for the actual migration call" @Param infraInfo body ValidateInfraRequest true "The target infrastructure model to validate" @Param X-Request-Id header string false "Unique request ID" @Success 200 {object} model.ApiResponse[validation.ValidationResult] "Validation outcome: valid flag plus zero or more issues" @Failure 400 {object} model.ApiResponse[any] "Invalid request body or parameters" @Router /validation/ns/{nsId}/infra [post]
func ValidateNames ¶ added in v0.5.1
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 CheckSSHReadyResponse ¶ added in v0.5.7
type CheckSSHReadyResponse struct {
Ready bool `json:"ready"` // Overall readiness (true if all nodes are ready)
TotalNodes int `json:"totalNodes"` // Total number of nodes in the infrastructure
ReadyNodes int `json:"readyNodes"` // Number of nodes that are SSH-ready
NodeStatus []NodeSSHStatus `json:"nodeStatus,omitempty"` // Detailed status for each node (only included when option=detail)
Message string `json:"message"` // Summary message
CheckedAt string `json:"checkedAt"` // Timestamp when check was performed
NextAllowedTime string `json:"nextAllowedTime,omitempty"` // Next allowed check time (for rate limiting)
}
CheckSSHReadyResponse represents the response for SSH readiness check
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 InspectObjectStorageRequest ¶ added in v0.5.7
type InspectObjectStorageRequest struct {
Csp string `json:"csp" validate:"required"`
Region string `json:"region,omitempty"`
KeyId string `json:"keyId,omitempty"`
AccessKeyId string `json:"accessKeyId,omitempty"`
SecretAccessKey string `json:"secretAccessKey,omitempty"`
TenantId string `json:"tenantId,omitempty"`
SubscriptionId string `json:"subscriptionId,omitempty"`
S3AccessKey string `json:"s3AccessKey,omitempty"`
S3SecretKey string `json:"s3SecretKey,omitempty"`
SelectedBucketNames []string `json:"selectedBucketNames" validate:"required"`
}
InspectObjectStorageRequest represents request parameters for deep object storage metadata collection
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 NodeSSHStatus ¶ added in v0.5.7
type NodeSSHStatus struct {
ID string `json:"id" example:"node-01"` // Node ID
Name string `json:"name" example:"node-01"` // Node Name
PublicIP string `json:"publicIP" example:"1.2.3.4"` // Public IP address
PrivateIP string `json:"privateIP" example:"10.0.1.10"` // Private IP address
Username string `json:"username" example:"cb-user"` // SSH username
Status string `json:"status" example:"Running"` // Node status (Running, Creating, etc.)
SSHReady bool `json:"sshReady" example:"true"` // Whether SSH port is accessible
SSHPort int `json:"sshPort" example:"22"` // SSH port number
Error string `json:"error,omitempty" example:""` // Error message if SSH check failed
}
NodeSSHStatus represents the SSH readiness status of a single node
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 RecommendInfraWithNlbRequest ¶ added in v0.5.3
type RecommendInfraWithNlbRequest struct {
DesiredCsp string `json:"desiredCsp"` // Target CSP (e.g., "aws")
DesiredRegion string `json:"desiredRegion"` // Target region (e.g., "ap-northeast-2")
SourceInfra onpremmodel.OnpremInfra `json:"sourceInfra" validate:"required"`
}
RecommendInfraWithNlbRequest is the request body for POST /recommendation/infraWithNlb.
type RecommendK8sClusterResponse ¶ added in v0.4.2
type RecommendK8sClusterResponse struct {
tbmodel.K8sClusterDynamicReq
}
type RecommendMultiInfraRequest ¶ added in v0.5.9
type RecommendMultiInfraRequest struct {
DesiredCspAndRegionPairs []cloudmodel.CloudProperty `json:"desiredCspAndRegionPairs" validate:"required,min=2,max=10,dive"`
SourceInfra onpremmodel.OnpremInfra `json:"sourceInfra" validate:"required"`
}
RecommendMultiInfraRequest is the request body for POST /recommendation/multiInfra.
type RecommendMultiInfraWithNlbRequest ¶ added in v0.5.9
type RecommendMultiInfraWithNlbRequest struct {
DesiredCspAndRegionPairs []cloudmodel.CloudProperty `json:"desiredCspAndRegionPairs" validate:"required,min=2,max=10,dive"`
SourceInfra onpremmodel.OnpremInfra `json:"sourceInfra" validate:"required"`
}
RecommendMultiInfraWithNlbRequest is the request body for POST /recommendation/multiInfraWithNlb.
type RecommendObjectStorageRequest ¶ added in v0.4.1
type RecommendObjectStorageRequest struct {
DesiredCloud storagemodel.CloudProperty `json:"desiredCloud" validate:"required"`
SourceObjectStorages []storagemodel.SourceObjectStorageProperty `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
}
type ScanObjectStorageRequest ¶ added in v0.5.7
type ScanObjectStorageRequest struct {
Csp string `json:"csp" validate:"required"`
Region string `json:"region" validate:"required"`
KeyId string `json:"keyId,omitempty"`
AccessKeyId string `json:"accessKeyId,omitempty"`
SecretAccessKey string `json:"secretAccessKey,omitempty"`
TenantId string `json:"tenantId,omitempty"`
SubscriptionId string `json:"subscriptionId,omitempty"`
S3AccessKey string `json:"s3AccessKey,omitempty"`
S3SecretKey string `json:"s3SecretKey,omitempty"`
}
ScanObjectStorageRequest represents request parameters for credential-based object storage bucket scanning
type ScannedBucketSummary ¶ added in v0.5.7
type ScannedBucketSummary struct {
BucketName string `json:"bucketName"`
Region string `json:"region,omitempty"`
CreationTime string `json:"creationTime,omitempty"`
SizeBytes int64 `json:"sizeBytes,omitempty"`
ObjectCount int64 `json:"objectCount,omitempty"`
VersioningEnabled bool `json:"versioningEnabled"`
EncryptionType string `json:"encryptionType,omitempty"`
}
ScannedBucketSummary represents summary info of a discovered bucket
type ValidateInfraRequest ¶ added in v0.5.7
type ValidateInfraRequest struct {
cloudmodel.RecommendedInfra
}