infra

package
v0.12.19 Latest Latest
Warning

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

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

Documentation

Overview

Package infra is to handle REST API for infra

Package infra is to handle REST API for infra

Package infra is to handle REST API for infra

Package infra is to handle REST API for infra

Package infra is to handle REST API for infra

Package infra is to handle REST API for infra

Package infra is to handle REST API for infra

Package infra is to handle REST API for infra

Package infra is to handle REST API for infra

Package infra is to handle REST API for scheduled jobs

Package infra is to handle REST API for infra

Package infra is to handle REST API for infra

Package infra is to handle REST API for infra operations

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RestAddNLBNodes added in v0.12.6

func RestAddNLBNodes(c echo.Context) error

RestAddNLBNodes godoc @ID AddNLBNodes @Summary Add nodes to NLB @Description Add nodes to NLB @Tags [Infra Resource] NLB Management (for developer) @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param infraId path string true "Infra ID" default(infra01) @Param nlbId path string true "NLB ID" default(g1) @Param nlbAddRemoveNodeReq body model.NLBAddRemoveNodeReq true "nodes to add to NLB" @Success 200 {object} model.NLBInfo @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @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)" @Router /ns/{nsId}/infra/{infraId}/nlb/{nlbId}/node [post]

func RestAnalyzeProvisioningRisk added in v0.11.3

func RestAnalyzeProvisioningRisk(c echo.Context) error

RestAnalyzeProvisioningRisk godoc @ID AnalyzeProvisioningRisk @Summary Analyze Provisioning Risk for Spec and Image Combination @Description Evaluate the likelihood of provisioning failure based on historical data for a specific node specification and image combination. @Description This endpoint provides intelligent risk assessment to help prevent deployment failures: @Description @Description **Risk Analysis Factors:** @Description - Historical failure rate for the node specification @Description - Image-specific compatibility with the spec @Description - Recent failure patterns and trends @Description - Cross-reference of spec+image combination success rates @Description @Description **Risk Levels:** @Description - `high`: Very likely to fail (>80% failure rate or image-specific failures) @Description - `medium`: Moderate risk (50-80% failure rate or mixed results) @Description - `low`: Low risk (<50% failure rate or no previous failures) @Description - `unknown`: Insufficient data for analysis @Description @Description **Recommended Actions by Risk Level:** @Description - **High Risk**: Consider alternative specs or images, verify CSP quotas and permissions @Description - **Medium Risk**: Proceed with caution, have backup plans ready @Description - **Low Risk**: Safe to proceed with normal deployment @Description @Description **Integration Points:** @Description - Automatically called during Infra review process @Description - Can be used in CI/CD pipelines for deployment validation @Description - Helpful for capacity planning and resource selection @Tags [Admin] Provisioning History and Analytics @Accept json @Produce json @Param specId path string true "node Specification ID (format: provider+region+spec_name)" @Param cspImageName query string true "CSP-specific image name/ID to analyze compatibility" @Success 200 {object} object{riskLevel=string,riskMessage=string,analysis=object} "Risk analysis result with level, message, and detailed analysis" @Failure 400 {object} model.SimpleMsg "Invalid parameters or missing required query parameters" @Failure 500 {object} model.SimpleMsg "Internal server error during risk analysis" @Param x-request-id header string false "Custom request ID for tracking" @Router /provisioning/risk/{specId} [get]

func RestAnalyzeProvisioningRiskDetailed added in v0.11.3

func RestAnalyzeProvisioningRiskDetailed(c echo.Context) error

RestAnalyzeProvisioningRiskDetailed godoc @ID AnalyzeProvisioningRiskDetailed @Summary Analyze Detailed Provisioning Risk with Spec and Image Breakdown @Description Provides comprehensive risk analysis with separate assessments for node specification and image risks, plus actionable recommendations. @Description This endpoint offers enhanced risk analysis by separating spec-level and image-level risk factors: @Description @Description **Risk Analysis Breakdown:** @Description - **Spec Risk**: Analyzes whether the node specification itself has compatibility or resource issues @Description - **Image Risk**: Evaluates the track record of the specific image with this spec @Description - **Overall Risk**: Combines both factors to determine the primary risk source @Description - **Recommendations**: Provides actionable guidance based on risk analysis @Description @Description **Spec Risk Factors:** @Description - Number of different images that failed with this spec (indicates spec-level issues) @Description - Overall failure rate across all images @Description - Success/failure ratio with various images @Description @Description **Image Risk Factors:** @Description - Previous success/failure history of this specific image with this spec @Description - Whether this is a new, untested combination @Description @Description **Recommendation Types:** @Description - Change node specification (when spec is the primary risk factor) @Description - Try different image (when image is the primary risk factor) @Description - Monitor deployment closely (for new combinations or medium risk) @Description - Proceed with confidence (for low-risk combinations) @Tags [Admin] Provisioning History and Analytics @Accept json @Produce json @Param specId query string true "node specification ID (e.g., 'gcp+europe-north1+f1-micro')" @Param cspImageName query string true "CSP-specific image name (e.g., 'ami-0c02fb55956c7d316' for AWS)" @Success 200 {object} model.RiskAnalysis "Detailed risk analysis with spec, image, and overall risk assessments plus recommendations" @Failure 400 {object} model.SimpleMsg "Bad Request - Missing or invalid parameters" @Failure 500 {object} model.SimpleMsg "Internal Server Error" @Param x-request-id header string false "Custom request ID for tracking" @Router /tumblebug/provisioning/risk/detailed [get]

func RestCancelExecutionTask added in v0.12.3

func RestCancelExecutionTask(c echo.Context) error

RestCancelExecutionTask godoc @ID CancelExecutionTask @Summary Cancel an execution task @Description Cancel a running execution task by task ID. This will send a cancellation signal to the task and update the node command status. @Tags [MC-Infra] Infra Remote Command @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param infraId path string true "Infra ID" default(infra01) @Param taskId path string true "Task ID" @Param body body model.CancelTaskRequest false "Optional cancellation reason" @Success 200 {object} model.CancelTaskResponse @Failure 400 {object} model.SimpleMsg @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @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)" @Router /ns/{nsId}/cmd/infra/{infraId}/task/{taskId}/cancel [post]

func RestCheckInfra added in v0.12.6

func RestCheckInfra(c echo.Context) error

func RestCheckNode added in v0.12.6

func RestCheckNode(c echo.Context) error

func RestClearAllNodeCommandStatus added in v0.12.6

func RestClearAllNodeCommandStatus(c echo.Context) error

RestClearAllNodeCommandStatus godoc @ID ClearAllNodeCommandStatus @Summary Clear all command status records for a node @Description Delete all command status records for a node @Tags [MC-Infra] Infra Remote Command @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param infraId path string true "Infra ID" default(infra01) @Param nodeId path string true "Node ID" default(g1-1) @Param x-request-id header string false "Custom request ID" @Success 200 {object} model.SimpleMsg @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @Param x-credential-holder header string false "Credential holder ID for selecting which credentials to use (default: system default holder)" @Router /ns/{nsId}/infra/{infraId}/node/{nodeId}/commandStatusAll [delete]

func RestDelAllInfra added in v0.12.6

func RestDelAllInfra(c echo.Context) error

RestDelAllInfra godoc @ID DelAllInfra @Summary Delete all Infras @Description Delete all Infras @Tags [MC-Infra] Infra Provisioning and Management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param option query string false "Option for delete all Infras (support force object delete, terminate before delete)" Enums(force, terminate) @Success 200 {object} model.SimpleMsg @Failure 404 {object} model.SimpleMsg @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)" @Router /ns/{nsId}/infra [delete]

func RestDelAllInfraPolicy added in v0.12.6

func RestDelAllInfraPolicy(c echo.Context) error

RestDelAllInfraPolicy godoc @ID DelAllInfraPolicy @Summary Delete all Infra policies @Description Delete all Infra policies @Tags [MC-Infra] Infra Orchestration Management (WIP) @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Success 200 {object} model.SimpleMsg @Failure 404 {object} model.SimpleMsg @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)" @Router /ns/{nsId}/policy/infra [delete]

func RestDelAllNLB

func RestDelAllNLB(c echo.Context) error

RestDelAllNLB godoc @ID DelAllNLB @Summary Delete all NLBs @Description Delete all NLBs @Tags [Infra Resource] NLB Management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param infraId path string true "Infra ID" default(infra01) @Param match query string false "Delete resources containing matched ID-substring only" default() @Success 200 {object} model.IdList @Failure 404 {object} model.SimpleMsg @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)" @Router /ns/{nsId}/infra/{infraId}/nlb [delete]

func RestDelInfra added in v0.12.6

func RestDelInfra(c echo.Context) error

RestDelInfra godoc @ID DelInfra @Summary Delete Infra @Description Delete Infra @Tags [MC-Infra] Infra Provisioning and Management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param infraId path string true "Infra ID" default(infra01) @Param option query string false "Option for delete Infra (support force delete)" Enums(terminate,force) @Success 200 {object} model.IdList @Failure 404 {object} model.SimpleMsg @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)" @Router /ns/{nsId}/infra/{infraId} [delete]

func RestDelInfraNode added in v0.12.6

func RestDelInfraNode(c echo.Context) error

RestDelInfraNode godoc @ID DelInfraNode @Summary Delete node in specified Infra @Description Delete node in specified Infra @Tags [MC-Infra] Infra Provisioning and Management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param infraId path string true "Infra ID" default(infra01) @Param nodeId path string true "Node ID" default(g1-1) @Param option query string false "Option for delete node (support force delete)" Enums(force) @Success 200 {object} model.SimpleMsg @Failure 404 {object} model.SimpleMsg @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)" @Router /ns/{nsId}/infra/{infraId}/node/{nodeId} [delete]

func RestDelInfraPolicy added in v0.12.6

func RestDelInfraPolicy(c echo.Context) error

DelInfraPolicy godoc @ID DelInfraPolicy @Summary Delete Infra Policy @Description Delete Infra Policy @Tags [MC-Infra] Infra Orchestration Management (WIP) @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param infraId path string true "Infra ID" default(infra01) @Success 200 {object} model.SimpleMsg @Failure 404 {object} model.SimpleMsg @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)" @Router /ns/{nsId}/policy/infra/{infraId} [delete]

func RestDelNLB

func RestDelNLB(c echo.Context) error

RestDelNLB godoc @ID DelNLB @Summary Delete NLB @Description Delete NLB @Tags [Infra Resource] NLB Management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param infraId path string true "Infra ID" default(infra01) @Param nlbId path string true "NLB ID" @Success 200 {object} model.SimpleMsg @Failure 404 {object} model.SimpleMsg @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)" @Router /ns/{nsId}/infra/{infraId}/nlb/{nlbId} [delete]

func RestDeleteAllInfraDynamicTemplate added in v0.12.6

func RestDeleteAllInfraDynamicTemplate(c echo.Context) error

RestDeleteAllInfraDynamicTemplate godoc @ID DeleteAllInfraDynamicTemplate @Summary Delete all Infra Dynamic Templates @Description Delete all Infra Dynamic Templates in a namespace. @Tags [MC-Infra] Infra Template Management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Success 200 {object} model.SimpleMsg "All templates deleted successfully" @Failure 500 {object} model.SimpleMsg "Internal error" @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)" @Router /ns/{nsId}/template/infra [delete]

func RestDeleteInfraDynamicTemplate added in v0.12.6

func RestDeleteInfraDynamicTemplate(c echo.Context) error

RestDeleteInfraDynamicTemplate godoc @ID DeleteInfraDynamicTemplate @Summary Delete an Infra Dynamic Template @Description Delete a specific Infra Dynamic Template. @Tags [MC-Infra] Infra Template Management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param templateId path string true "Template ID" @Success 200 {object} model.SimpleMsg "Template deleted successfully" @Failure 404 {object} model.SimpleMsg "Template not found" @Failure 500 {object} model.SimpleMsg "Internal error" @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)" @Router /ns/{nsId}/template/infra/{templateId} [delete]

func RestDeleteNodeCommandStatus added in v0.12.6

func RestDeleteNodeCommandStatus(c echo.Context) error

RestDeleteNodeCommandStatus godoc @ID DeleteNodeCommandStatus @Summary Delete a specific command status by index for a node @Description Delete a specific command status record by index for a node @Tags [MC-Infra] Infra Remote Command @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param infraId path string true "Infra ID" default(infra01) @Param nodeId path string true "Node ID" default(g1-1) @Param index path int true "Command Index" default(1) @Param x-request-id header string false "Custom request ID" @Success 200 {object} model.SimpleMsg @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @Param x-credential-holder header string false "Credential holder ID for selecting which credentials to use (default: system default holder)" @Router /ns/{nsId}/infra/{infraId}/node/{nodeId}/commandStatus/{index} [delete]

func RestDeleteNodeCommandStatusByCriteria added in v0.12.6

func RestDeleteNodeCommandStatusByCriteria(c echo.Context) error

RestDeleteNodeCommandStatusByCriteria godoc @ID DeleteNodeCommandStatusByCriteria @Summary Delete multiple command status records by criteria for a node @Description Delete multiple command status records for a node based on filtering criteria @Tags [MC-Infra] Infra Remote Command @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param infraId path string true "Infra ID" default(infra01) @Param nodeId path string true "Node ID" default(g1-1) @Param status query []string false "Filter by command execution status (can specify multiple)" Enums(Queued,Handling,Completed,Failed,Timeout) @Param xRequestId query string false "Filter by X-Request-ID" @Param commandContains query string false "Filter commands containing this text" @Param startTimeFrom query string false "Filter commands started from this time (RFC3339 format)" @Param startTimeTo query string false "Filter commands started until this time (RFC3339 format)" @Param indexFrom query int false "Filter commands from this index (inclusive)" @Param indexTo query int false "Filter commands to this index (inclusive)" @Param x-request-id header string false "Custom request ID" @Success 200 {object} model.SimpleMsg @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @Param x-credential-holder header string false "Credential holder ID for selecting which credentials to use (default: system default holder)" @Router /ns/{nsId}/infra/{infraId}/node/{nodeId}/commandStatus [delete]

func RestDeleteNodeSshHostKey added in v0.12.6

func RestDeleteNodeSshHostKey(c echo.Context) error

RestDeleteNodeSshHostKey godoc @ID DeleteNodeSshHostKey @Summary Reset SSH host key for a node @Description Reset the stored SSH host key for a specific node. This should be used when the node's host key has legitimately changed (e.g., after node recreation) and you trust the new key. The next SSH connection will store the new host key (TOFU). @Tags [MC-Infra] Infra Remote Command @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param infraId path string true "Infra ID" default(infra01) @Param nodeId path string true "Node ID" default(g1-1) @Success 200 {object} model.SimpleMsg @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @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)" @Router /ns/{nsId}/infra/{infraId}/node/{nodeId}/sshHostKey [delete]

func RestDeleteProvisioningLog added in v0.11.3

func RestDeleteProvisioningLog(c echo.Context) error

RestDeleteProvisioningLog godoc @ID DeleteProvisioningLog @Summary Delete Provisioning History Log @Description Remove all provisioning history data for a specific node specification. @Description This operation permanently deletes historical failure and success records: @Description @Description **Warning**: This action is irreversible and will remove: @Description - All failure and success statistics @Description - Historical error messages and troubleshooting data @Description - Risk analysis baseline for future deployments @Description - Failure pattern analysis data @Description @Description **When to Use:** @Description - **Data Cleanup**: Remove outdated or irrelevant provisioning history @Description - **Fresh Start**: Clear history after infrastructure changes that resolve previous issues @Description - **Privacy Compliance**: Remove logs containing sensitive error information @Description - **Storage Management**: Clean up logs to manage kvstore space @Description @Description **Impact on System:** @Description - Future risk analysis for this spec will have no historical baseline @Description - Infra review process will not show historical warnings for this spec @Description - Provisioning reliability metrics will be reset to zero @Tags [Admin] Provisioning History and Analytics @Accept json @Produce json @Param specId path string true "node Specification ID to delete history for (format: provider+region+spec_name)" @Success 200 {object} model.SimpleMsg "Provisioning history successfully deleted" @Success 204 "No provisioning history found to delete" @Failure 400 {object} model.SimpleMsg "Invalid specification ID format" @Failure 500 {object} model.SimpleMsg "Internal server error while deleting provisioning history" @Param x-request-id header string false "Custom request ID for tracking" @Router /provisioning/log/{specId} [delete]

func RestDeleteScheduleRegisterCspResources added in v0.11.16

func RestDeleteScheduleRegisterCspResources(c echo.Context) error

RestDeleteScheduleRegisterCspResources godoc @ID DeleteScheduleRegisterCspResources @Summary Stop and delete scheduled job @Description Stop and permanently delete a scheduled CSP resource registration job @Description @Description **Warning:** This operation is irreversible! @Description - Job will be stopped immediately @Description - All job data and execution history will be deleted @Description - Cannot be recovered after deletion @Description @Description **Alternatives:** @Description - To temporarily stop: Use `/pause` endpoint instead @Description - To keep history: Set `enabled: false` via PUT endpoint @Tags [Job Scheduler] (WIP) CSP Resource Registration @Accept json @Produce json @Param jobId path string true "Job ID" @Success 200 {object} model.SimpleMsg @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @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)" @Router /registerCspResources/schedule/{jobId} [delete]

func RestDeleteScheduleRegisterCspResourcesAll added in v0.11.16

func RestDeleteScheduleRegisterCspResourcesAll(c echo.Context) error

RestDeleteScheduleRegisterCspResourcesAll godoc @ID DeleteScheduleRegisterCspResourcesAll @Summary Delete ALL scheduled jobs @Description ⚠️ **DANGER: This operation deletes ALL scheduled jobs in the system!** @Description @Description **⚠️ CRITICAL WARNINGS:** @Description - This will PERMANENTLY DELETE **ALL** scheduled jobs across all namespaces @Description - All job execution history will be lost @Description - This operation is IRREVERSIBLE and cannot be undone @Description - Use with EXTREME CAUTION in production environments @Description @Description **Use Cases:** @Description - Cleaning up test/development environments @Description - Emergency shutdown of all scheduled operations @Description - System maintenance or reset @Description @Description **Safer Alternatives:** @Description - Delete individual jobs: Use `DELETE /registerCspResources/schedule/{jobId}` @Description - Temporarily stop all jobs: Pause each job individually via `/pause` endpoint @Description - Disable without deleting: Update each job with `enabled: false` @Description @Description **Response Information:** @Description - Returns the count of deleted jobs @Description - Returns 200 even if no jobs were found (count will be 0) @Tags [Job Scheduler] (WIP) CSP Resource Registration @Accept json @Produce json @Success 200 {object} model.SimpleMsg "Successfully deleted all jobs (message includes count)" @Failure 500 {object} model.SimpleMsg @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)" @Router /registerCspResources/schedule [delete]

func RestDeregisterInfraNode added in v0.12.6

func RestDeregisterInfraNode(c echo.Context) error

RestDeregisterInfraNode godoc @ID DeregisterInfraNode @Summary Deregister node in specified Infra @Description Deregister node from Spider and TB without deleting the actual CSP resource @Tags [MC-Infra] Infra Provisioning and Management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param infraId path string true "Infra ID" default(infra01) @Param nodeId path string true "Node ID" default(g1-1) @Success 200 {object} model.SimpleMsg @Failure 404 {object} model.SimpleMsg @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)" @Router /ns/{nsId}/deregisterResource/infra/{infraId}/node/{nodeId} [delete]

func RestGetAllBenchmark

func RestGetAllBenchmark(c echo.Context) error

RestGetAllBenchmark godoc @ID GetAllBenchmark @Summary Run Infra benchmark for all performance metrics and return results @Description Run Infra benchmark for all performance metrics and return results @Tags [MC-Infra] Infra Performance Benchmarking (WIP) @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param infraId path string true "Infra ID" default(infra01) @Param hostIP body RestGetAllBenchmarkRequest true "Host IP address to benchmark" @Success 200 {object} model.BenchmarkInfoArray @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @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)" @Router /ns/{nsId}/benchmarkAll/infra/{infraId} [post]

func RestGetAllInfra added in v0.12.6

func RestGetAllInfra(c echo.Context) error

RestGetAllInfra godoc @ID GetAllInfra @Summary List all Infras or Infras' ID @Description List all Infras or Infras' ID @Tags [MC-Infra] Infra Provisioning and Management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param option query string false "Option" Enums(id, simple, status) @Success 200 {object} JSONResult{[DEFAULT]=RestGetAllInfraResponse,[SIMPLE]=RestGetAllInfraResponse,[ID]=model.IdList,[STATUS]=RestGetAllInfraStatusResponse} "Different return structures by the given option param" @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @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)" @Router /ns/{nsId}/infra [get]

func RestGetAllInfraDynamicTemplate added in v0.12.6

func RestGetAllInfraDynamicTemplate(c echo.Context) error

RestGetAllInfraDynamicTemplate godoc @ID GetAllInfraDynamicTemplate @Summary List all Infra Dynamic Templates @Description List all Infra Dynamic Templates in a namespace. @Description Optionally filter by keyword matching against template name or description (case-insensitive). @Tags [MC-Infra] Infra Template Management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param filterKeyword query string false "Keyword to filter templates by name or description" @Success 200 {object} model.InfraDynamicTemplateListResponse "List of templates" @Failure 500 {object} model.SimpleMsg "Internal error" @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)" @Router /ns/{nsId}/template/infra [get]

func RestGetAllInfraPolicy added in v0.12.6

func RestGetAllInfraPolicy(c echo.Context) error

RestGetAllInfraPolicy godoc @ID GetAllInfraPolicy @Summary List all Infra policies @Description List all Infra policies @Tags [MC-Infra] Infra Orchestration Management (WIP) @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Success 200 {object} RestGetAllInfraPolicyResponse @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @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)" @Router /ns/{nsId}/policy/infra [get]

func RestGetAllNLB

func RestGetAllNLB(c echo.Context) error

RestGetAllNLB godoc @ID GetAllNLB @Summary List all NLBs or NLBs' ID @Description List all NLBs or NLBs' ID @Tags [Infra Resource] NLB Management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param infraId path string true "Infra ID" default(infra01) @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)" @Success 200 {object} JSONResult{[DEFAULT]=RestGetAllNLBResponse,[ID]=model.IdList} "Different return structures by the given option param" @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @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)" @Router /ns/{nsId}/infra/{infraId}/nlb [get]

func RestGetBastionNodes

func RestGetBastionNodes(c echo.Context) error

RestGetBastionNodes godoc @ID GetBastionNodes @Summary Get bastion nodes for a node @Description Get bastion nodes for a node @Tags [MC-Infra] Infra Remote Command @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param infraId path string true "Infra ID" default(infra01) @Param targetNodeId path string true "Target Node ID" default(g1-1) @Success 200 {object} []model.BastionNode @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @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)" @Router /ns/{nsId}/infra/{infraId}/node/{targetNodeId}/bastion [get]

func RestGetBenchmark

func RestGetBenchmark(c echo.Context) error

RestGetBenchmark godoc @ID GetBenchmark @Summary Run Infra benchmark for a single performance metric and return results @Description Run Infra benchmark for a single performance metric and return results @Tags [MC-Infra] Infra Performance Benchmarking (WIP) @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param infraId path string true "Infra ID" default(infra01) @Param hostIP body RestGetBenchmarkRequest true "Host IP address to benchmark" @Param action query string true "Benchmark Action to Infra" Enums(install, init, cpus, cpum, memR, memW, fioR, fioW, dbR, dbW, rtt, mrtt, clean) @Success 200 {object} model.BenchmarkInfoArray @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @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)" @Router /ns/{nsId}/benchmark/infra/{infraId} [post]

func RestGetBenchmarkLatency

func RestGetBenchmarkLatency(c echo.Context) error

RestGetLatencyBenchmark godoc @ID GetLatencyBenchmark @Summary Run Infra benchmark for network latency @Description Run Infra benchmark for network latency @Tags [MC-Infra] Infra Performance Benchmarking (WIP) @Accept json @Produce json @Param nsId path string true "Namespace ID" default(system) @Param infraId path string true "Infra ID" default(probe) @Success 200 {object} model.BenchmarkInfoArray @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @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)" @Router /ns/{nsId}/benchmarkLatency/infra/{infraId} [get]

func RestGetCmdInfraStream added in v0.12.6

func RestGetCmdInfraStream(c echo.Context) error

RestGetCmdInfraStream godoc @ID GetCmdInfraStream @Summary Stream real-time command execution logs via SSE @Description Subscribe to Server-Sent Events (SSE) for real-time command execution logs. @Description Use the xRequestId returned from POST /ns/{nsId}/cmd/infra/{infraId}?async=true to connect. @Description Events: CommandStatus (status transitions), CommandLog (stdout/stderr lines), CommandDone (terminal). @Tags [MC-Infra] Infra Remote Command @Produce text/event-stream @Param nsId path string true "Namespace ID" default(default) @Param infraId path string true "Infra ID" default(infra01) @Param xRequestId query string true "Request ID from async command execution" @Success 200 {object} model.CommandStreamEvent "SSE stream of command events" @Failure 400 {object} model.SimpleMsg "Missing xRequestId" @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)" @Router /ns/{nsId}/stream/cmd/infra/{infraId} [get]

func RestGetControlInfra added in v0.12.6

func RestGetControlInfra(c echo.Context) error

RestGetControlInfra godoc @ID GetControlInfra @Summary Control the lifecycle of Infra @Description Control the lifecycle of an Infra. Actions fall into three groups: @Description @Description **Lifecycle (normal operation):** @Description - `suspend` / `resume` / `reboot`: power-cycle every Node. @Description - `terminate`: terminate every Node (Infra metadata is kept; call DELETE to remove). @Description - `refine`: delete Nodes whose status is `Failed` or `Undefined` from Infra metadata @Description (no CSP-side termination is issued for those Nodes). @Description @Description **Hold gate (only valid right after `POST /infra` with option=hold):** @Description - `continue`: signal the holding goroutine to proceed with provisioning. @Description - `withdraw`: signal the holding goroutine to cancel provisioning. @Description - These actions only work while a holding goroutine is alive in memory. @Description After a server restart they will fail; use `reconcile`/`abort` instead. @Description @Description **Crash recovery (Infra stuck after server restart or partial failure):** @Description - `reconcile`: forward-recover. For each transient Node, query Spider for the real @Description CSP status and absorb CSP-side orphan VMs (created before the crash but not @Description recorded in TB). Nodes that cannot be matched on the CSP are marked `Failed` @Description so a subsequent `refine` can remove them. No new Spider create calls are issued. @Description - `abort`: backward-recover. Force-terminate every non-final Node in parallel @Description (with orphan rescue) and sweep any `Failed` remnants via `refine`. The final @Description DELETE call is left to the operator. @Tags [MC-Infra] Infra Provisioning and Management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param infraId path string true "Infra ID" default(infra01) @Param action query string true "Action to apply to the Infra" Enums(suspend, resume, reboot, terminate, refine, continue, withdraw, reconcile, abort) @Param force query string false "Force control to skip checking controllable status" Enums(false, true) @Success 200 {object} model.SimpleMsg @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @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)" @Router /ns/{nsId}/control/infra/{infraId} [get]

func RestGetControlInfraNode added in v0.12.6

func RestGetControlInfraNode(c echo.Context) error

RestGetControlInfraNode godoc @ID GetControlInfraNode @Summary Control the lifecycle of node (suspend, resume, reboot, terminate) @Description Control the lifecycle of node (suspend, resume, reboot, terminate) @Tags [MC-Infra] Infra Provisioning and Management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param infraId path string true "Infra ID" default(infra01) @Param nodeId path string true "Node ID" default(g1-1) @Param action query string true "Action to Infra" Enums(suspend, resume, reboot, terminate) @Param force query string false "Force control to skip checking controllable status" Enums(false, true) @Success 200 {object} model.SimpleMsg @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @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)" @Router /ns/{nsId}/control/infra/{infraId}/node/{nodeId} [get]

func RestGetExecutionTask added in v0.12.3

func RestGetExecutionTask(c echo.Context) error

RestGetExecutionTask godoc @ID GetExecutionTask @Summary Get a specific execution task @Description Get detailed information about a specific execution task by taskId @Tags [MC-Infra] Infra Remote Command @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param infraId path string true "Infra ID" default(infra01) @Param taskId path string true "Task ID (format: xRequestId:nodeId:index)" @Success 200 {object} model.ExecutionTaskListResponse @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @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)" @Router /ns/{nsId}/cmd/infra/{infraId}/task/{taskId} [get]

func RestGetInfra added in v0.12.6

func RestGetInfra(c echo.Context) error

RestGetInfra godoc @ID GetInfra @Summary Get Infra object (option: status, accessInfo, nodeId) @Description Get Infra object (option: status, accessInfo, nodeId) @Tags [MC-Infra] Infra Provisioning and Management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param infraId path string true "Infra ID" default(infra01) @Param option query string false "Option" Enums(default, id, status, accessinfo) @Param filterKey query string false "(For option=id) Field key for filtering (ex: connectionName)" @Param filterVal query string false "(For option=id) Field value for filtering (ex: aws-ap-northeast-2)" @Param accessInfoOption query string false "(For option=accessinfo) accessInfoOption (showSshKey)" @success 200 {object} JSONResult{[DEFAULT]=model.InfraInfo,[ID]=model.IdList,[STATUS]=model.InfraStatusInfo,[AccessInfo]=model.InfraAccessInfo} "Different return structures by the given action param" @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @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)" @Router /ns/{nsId}/infra/{infraId} [get]

func RestGetInfraAssociatedResources added in v0.12.6

func RestGetInfraAssociatedResources(c echo.Context) error

RestGetInfraAssociatedResources godoc @ID GetInfraAssociatedResources @Summary Get associated resource ID list for a given Infra @Description Get associated resource ID list for a given Infra (VNet, Subnet, SecurityGroup, SSHKey, etc.) @Tags [MC-Infra] Infra Provisioning and Management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param infraId path string true "Infra ID" default(infra01) @Success 200 {object} model.InfraAssociatedResourceList @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @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)" @Router /ns/{nsId}/infra/{infraId}/associatedResources [get]

func RestGetInfraCluster added in v0.12.6

func RestGetInfraCluster(c echo.Context) error

RestGetInfraCluster godoc @ID GetInfraCluster @Summary Get implicit cluster in a specified Infra @Description Get a single implicit cluster synthesized at query-time from NodeGroups/Nodes in a specified Infra @Tags [MC-Infra] Infra Provisioning and Management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param infraId path string true "Infra ID" default(infra01) @Param clusterId path string true "Cluster ID" default(vnet01) @Success 200 {object} model.InfraClusterInfo @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @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)" @Router /ns/{nsId}/infra/{infraId}/cluster/{clusterId} [get]

func RestGetInfraClusters added in v0.12.6

func RestGetInfraClusters(c echo.Context) error

RestGetInfraClusters godoc @ID GetInfraClusters @Summary List implicit clusters in a specified Infra @Description List implicit clusters synthesized at query-time from NodeGroups/Nodes in a specified Infra @Tags [MC-Infra] Infra Provisioning and Management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param infraId path string true "Infra ID" default(infra01) @Success 200 {object} model.InfraClusterList @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @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)" @Router /ns/{nsId}/infra/{infraId}/cluster [get]

func RestGetInfraDynamicTemplate added in v0.12.6

func RestGetInfraDynamicTemplate(c echo.Context) error

RestGetInfraDynamicTemplate godoc @ID GetInfraDynamicTemplate @Summary Get an Infra Dynamic Template @Description Retrieve a specific Infra Dynamic Template by ID. @Tags [MC-Infra] Infra Template Management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param templateId path string true "Template ID" @Success 200 {object} model.InfraDynamicTemplateInfo "Template information" @Failure 404 {object} model.SimpleMsg "Template not found" @Failure 500 {object} model.SimpleMsg "Internal error" @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)" @Router /ns/{nsId}/template/infra/{templateId} [get]

func RestGetInfraExecutionTasks added in v0.12.6

func RestGetInfraExecutionTasks(c echo.Context) error

RestGetInfraExecutionTasks godoc @ID GetInfraExecutionTasks @Summary List execution tasks for an Infra @Description List all running and completed execution tasks for a specific Infra. These tasks can be cancelled if still in progress. The task list is based on persistent node command status records. @Tags [MC-Infra] Infra Remote Command @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param infraId path string true "Infra ID" default(infra01) @Param status query string false "Filter by command status (Queued, Handling, Completed, Failed, Timeout, Cancelled, Interrupted). If not specified, returns all statuses." Enums(Queued, Handling, Completed, Failed, Timeout, Cancelled, Interrupted) @Success 200 {object} model.ExecutionTaskListResponse @Failure 500 {object} model.SimpleMsg @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)" @Router /ns/{nsId}/cmd/infra/{infraId}/task [get]

func RestGetInfraGroupIds added in v0.12.6

func RestGetInfraGroupIds(c echo.Context) error

RestGetInfraGroupIds godoc @ID GetInfraGroupIds @Summary List NodeGroup IDs in a specified Infra @Description List NodeGroup IDs in a specified Infra @Tags [MC-Infra] Infra Provisioning and Management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param infraId path string true "Infra ID" default(infra01) @Success 200 {object} model.IdList @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @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)" @Router /ns/{nsId}/infra/{infraId}/nodegroup [get]

func RestGetInfraGroupNodes added in v0.12.6

func RestGetInfraGroupNodes(c echo.Context) error

RestGetInfraGroupNodes godoc @ID GetInfraGroupNodes @Summary List nodes with a NodeGroup label in a specified Infra @Description List nodes with a NodeGroup label in a specified Infra @Tags [MC-Infra] Infra Provisioning and Management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param infraId path string true "Infra ID" default(infra01) @Param nodegroupId path string true "nodeGroup ID" default(g1) @Param option query string false "Option" Enums(id) @Success 200 {object} model.IdList @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @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)" @Router /ns/{nsId}/infra/{infraId}/nodegroup/{nodegroupId} [get]

func RestGetInfraHandlingCommandCount added in v0.12.6

func RestGetInfraHandlingCommandCount(c echo.Context) error

RestGetInfraHandlingCommandCount godoc @ID GetInfraHandlingCommandCount @Summary Get count of currently handling commands for all nodes in Infra @Description Get the number of commands currently in 'Handling' status for all nodes in an Infra. Returns per-node counts and total count. @Tags [MC-Infra] Infra Remote Command @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param infraId path string true "Infra ID" default(infra01) @Param x-request-id header string false "Custom request ID" @Success 200 {object} model.InfraHandlingCommandCountResponse @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @Param x-credential-holder header string false "Credential holder ID for selecting which credentials to use (default: system default holder)" @Router /ns/{nsId}/infra/{infraId}/handlingCount [get]

func RestGetInfraNode added in v0.12.6

func RestGetInfraNode(c echo.Context) error

RestGetInfraNode godoc @ID GetInfraNode @Summary Get node in specified Infra @Description Get node in specified Infra @Tags [MC-Infra] Infra Provisioning and Management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param infraId path string true "Infra ID" default(infra01) @Param nodeId path string true "Node ID" default(g1-1) @Param option query string false "Option for Infra" Enums(default, status, idsInDetail, accessinfo) @Param accessInfoOption query string false "(For option=accessinfo) accessInfoOption (showSshKey)" @success 200 {object} JSONResult{[DEFAULT]=model.NodeInfo,[STATUS]=model.NodeStatusInfo,[IDNAME]=model.IdNameInDetailInfo} "Different return structures by the given option param" @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @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)" @Router /ns/{nsId}/infra/{infraId}/node/{nodeId} [get]

func RestGetInfraPolicy added in v0.12.6

func RestGetInfraPolicy(c echo.Context) error

RestGetInfraPolicy godoc @ID GetInfraPolicy @Summary Get Infra Policy @Description Get Infra Policy @Tags [MC-Infra] Infra Orchestration Management (WIP) @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param infraId path string true "Infra ID" default(infra01) @Success 200 {object} model.InfraPolicyInfo @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @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)" @Router /ns/{nsId}/policy/infra/{infraId} [get]

func RestGetInfraReqFromInfra added in v0.12.6

func RestGetInfraReqFromInfra(c echo.Context) error

RestGetInfraReqFromInfra godoc @ID GetInfraReqFromInfra @Summary Extract Infra creation request configuration from an existing Infra @Description Reconstruct an Infra dynamic creation request body from an existing Infra's information. @Description Returns a dynamic request format where networking resources (vNet, subnet, SG, sshKey) @Description are auto-created, making it easy to clone or recreate a similar Infra configuration. @Description @Description **Template Option:** @Description When the `template` query parameter is provided, the extracted configuration is @Description saved as a reusable Infra Dynamic Template with the given name. @Tags [MC-Infra] Infra Provisioning and Management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param infraId path string true "Infra ID" default(infra01) @Param template query string false "If provided, save the extracted config as a template with this name" @Success 200 {object} JSONResult{[DEFAULT]=model.InfraDynamicReq,[TEMPLATE]=model.InfraDynamicTemplateInfo} "Without template param: extracted Infra config / With template param: created template info" @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @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)" @Router /ns/{nsId}/infra/{infraId}/configCopy [get]

func RestGetMonitorData

func RestGetMonitorData(c echo.Context) error

RestGetMonitorData godoc @ID GetMonitorData @Summary Get monitoring data of specified Infra for specified monitoring metric (cpu, memory, disk, network) @Description Get monitoring data of specified Infra for specified monitoring metric (cpu, memory, disk, network) @Tags [MC-Infra] Infra Resource Monitor (for developer) @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param infraId path string true "Infra ID" default(infra01) @Param metric path string true "Metric type: cpu, memory, disk, network" @Success 200 {object} model.MonResultSimpleResponse @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @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)" @Router /ns/{nsId}/monitoring/infra/{infraId}/metric/{metric} [get]

func RestGetNLB

func RestGetNLB(c echo.Context) error

RestGetNLB godoc @ID GetNLB @Summary Get NLB @Description Get NLB @Tags [Infra Resource] NLB Management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param infraId path string true "Infra ID" default(infra01) @Param nlbId path string true "NLB ID" default(g1) @Success 200 {object} model.NLBInfo @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @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)" @Router /ns/{nsId}/infra/{infraId}/nlb/{nlbId} [get]

func RestGetNLBHealth

func RestGetNLBHealth(c echo.Context) error

RestGetNLBHealth godoc @ID GetNLBHealth @Summary Get NLB Health @Description Get NLB Health @Tags [Infra Resource] NLB Management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param infraId path string true "Infra ID" default(infra01) @Param nlbId path string true "NLB ID" default(g1) @Success 200 {object} model.NLBInfo @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @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)" @Router /ns/{nsId}/infra/{infraId}/nlb/{nlbId}/healthz [get]

func RestGetNLBSupport added in v0.12.19

func RestGetNLBSupport(c echo.Context) error

RestGetNLBSupport godoc @ID GetNLBSupport @Summary Get CSP support information for NLB health checker features @Description Get CSP support information for NLB health checker configuration fields (customHealthCheckerInterval, customHealthCheckerTimeout, customHealthCheckerThreshold). @Description A false value means the CSP does not support a custom value for that field (e.g., AWS TCP NLB does not support custom timeout). @Description If cspType query parameter is provided, returns support information for that specific CSP. @Description If cspType is not provided, returns support information for all CSPs. @Tags [Infra Resource] NLB Management @Accept json @Produce json @Param cspType query string false "CSP Type" Enums(aws, gcp, azure, alibaba, tencent, ibm, openstack, ncp, nhn, kt) @Success 200 {object} model.NLBSupportResponse "OK" @Failure 400 {object} model.SimpleMsg "Bad Request" @Failure 500 {object} model.SimpleMsg "Internal Server Error" @Param x-request-id header string false "Custom request ID for tracking" @Router /nlb/support [get]

func RestGetNodeCommandStatus added in v0.12.6

func RestGetNodeCommandStatus(c echo.Context) error

RestGetNodeCommandStatus godoc @ID GetNodeCommandStatus @Summary Get a specific command status by index for a node @Description Get a specific command status record by index for a node @Tags [MC-Infra] Infra Remote Command @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param infraId path string true "Infra ID" default(infra01) @Param nodeId path string true "Node ID" default(g1-1) @Param index path int true "Command Index" default(1) @Param x-request-id header string false "Custom request ID" @Success 200 {object} model.CommandStatusInfo @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @Param x-credential-holder header string false "Credential holder ID for selecting which credentials to use (default: system default holder)" @Router /ns/{nsId}/infra/{infraId}/node/{nodeId}/commandStatus/{index} [get]

func RestGetNodeHandlingCommandCount added in v0.12.6

func RestGetNodeHandlingCommandCount(c echo.Context) error

RestGetNodeHandlingCommandCount godoc @ID GetNodeHandlingCommandCount @Summary Get count of currently handling commands for a node @Description Get the number of commands currently in 'Handling' status for a specific node. Optimized for frequent polling. @Tags [MC-Infra] Infra Remote Command @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param infraId path string true "Infra ID" default(infra01) @Param nodeId path string true "Node ID" default(g1-1) @Param x-request-id header string false "Custom request ID" @Success 200 {object} model.HandlingCommandCountResponse @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @Param x-credential-holder header string false "Credential holder ID for selecting which credentials to use (default: system default holder)" @Router /ns/{nsId}/infra/{infraId}/node/{nodeId}/handlingCount [get]

func RestGetNodeSshHostKey added in v0.12.6

func RestGetNodeSshHostKey(c echo.Context) error

RestGetNodeSshHostKey godoc @ID GetNodeSshHostKey @Summary Get SSH host key information for a node @Description Get the stored SSH host key information for a specific node. This is used for TOFU (Trust On First Use) verification. @Tags [MC-Infra] Infra Remote Command @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param infraId path string true "Infra ID" default(infra01) @Param nodeId path string true "Node ID" default(g1-1) @Success 200 {object} model.SshHostKeyInfo @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @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)" @Router /ns/{nsId}/infra/{infraId}/node/{nodeId}/sshHostKey [get]

func RestGetProvisioningLog added in v0.11.3

func RestGetProvisioningLog(c echo.Context) error

RestGetProvisioningLog godoc @ID GetProvisioningLog @Summary Get Provisioning History Log for node Specification @Description Retrieve detailed provisioning history for a specific node specification including success/failure patterns and risk analysis. @Description This endpoint provides comprehensive insights into provisioning reliability: @Description @Description **Historical Data Includes:** @Description - Success and failure counts with timestamps @Description - CSP-specific error messages and failure patterns @Description - Image compatibility tracking across different attempts @Description - Failure rate analysis and risk assessment @Description - Regional and provider-specific reliability metrics @Description @Description **Use Cases:** @Description - **Pre-deployment Risk Assessment**: Check if a spec has historical failures before creating Infra @Description - **Troubleshooting**: Analyze failure patterns to identify root causes @Description - **Capacity Planning**: Understand reliability patterns for different specs and regions @Description - **Cost Optimization**: Avoid specs with high failure rates that waste resources @Description @Description **Response Details:** @Description - `failureCount`: Total number of provisioning failures @Description - `successCount`: Number of successes (only tracked after failures occur) @Description - `failureImages`: List of CSP images that failed with this spec @Description - `successImages`: List of CSP images that succeeded with this spec @Description - `failureMessages`: Detailed error messages from CSP @Description - `lastUpdated`: Timestamp of most recent provisioning attempt @Tags [Admin] Provisioning History and Analytics @Accept json @Produce json @Param specId path string true "node Specification ID (format: provider+region+spec_name, e.g., aws+ap-northeast-2+t2.micro)" @Success 200 {object} model.ProvisioningLog "Provisioning history log with success/failure statistics and detailed analytics" @Success 204 "No provisioning history found for the specified node specification" @Failure 400 {object} model.SimpleMsg "Invalid specification ID format or missing required parameters" @Failure 500 {object} model.SimpleMsg "Internal server error while retrieving provisioning history" @Param x-request-id header string false "Custom request ID for tracking" @Router /provisioning/log/{specId} [get]

func RestGetScheduleRegisterCspResourcesList added in v0.11.16

func RestGetScheduleRegisterCspResourcesList(c echo.Context) error

RestGetScheduleRegisterCspResourcesList godoc @ID GetScheduleRegisterCspResourcesList @Summary List all scheduled CSP resource registration jobs @Description Get a list of all scheduled CSP resource registration jobs (jobs are not scoped to namespaces) @Tags [Job Scheduler] (WIP) CSP Resource Registration @Accept json @Produce json @Success 200 {object} model.ScheduleJobListResponse @Failure 500 {object} model.SimpleMsg @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)" @Router /registerCspResources/schedule [get]

func RestGetScheduleRegisterCspResourcesStatus added in v0.11.16

func RestGetScheduleRegisterCspResourcesStatus(c echo.Context) error

RestGetScheduleRegisterCspResourcesStatus godoc @ID GetScheduleRegisterCspResourcesStatus @Summary Get scheduled job status @Description Get the current status of a specific scheduled CSP resource registration job @Description @Description **Response Fields Explanation:** @Description - `status`: Current job state (Scheduled/Executing/Stopped) @Description - `enabled`: Whether job is active (can be paused with false) @Description - `executionCount`: Total number of executions attempted @Description - `successCount`: Number of successful executions @Description - `failureCount`: Number of failed executions @Description - `consecutiveFailures`: Current streak of failures (resets on success) @Description - `autoDisabled`: True if job was auto-disabled due to 5+ consecutive failures @Description - `lastExecutedAt`: Timestamp of most recent execution @Description - `nextExecutionAt`: Scheduled time for next execution @Description - `lastError`: Error message from most recent failure (empty if success) @Description - `lastResult`: Result message from most recent execution @Description @Description **Monitoring Recommendations:** @Description - Check `consecutiveFailures` - alert if >= 3 @Description - Monitor `autoDisabled` - requires manual intervention if true @Description - Compare `successCount` vs `failureCount` for reliability metrics @Tags [Job Scheduler] (WIP) CSP Resource Registration @Accept json @Produce json @Param jobId path string true "Job ID" @Success 200 {object} model.ScheduleJobStatus @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @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)" @Router /registerCspResources/schedule/{jobId} [get]

func RestListNodeCommandStatus added in v0.12.6

func RestListNodeCommandStatus(c echo.Context) error

RestListNodeCommandStatus godoc @ID ListNodeCommandStatus @Summary List command status records for a node with filtering @Description List command status records for a node with various filtering options @Tags [MC-Infra] Infra Remote Command @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param infraId path string true "Infra ID" default(infra01) @Param nodeId path string true "Node ID" default(g1-1) @Param status query []string false "Filter by command execution status (can specify multiple)" Enums(Queued,Handling,Completed,Failed,Timeout) @Param xRequestId query string false "Filter by X-Request-ID" @Param commandContains query string false "Filter commands containing this text" @Param startTimeFrom query string false "Filter commands started from this time (RFC3339 format)" @Param startTimeTo query string false "Filter commands started until this time (RFC3339 format)" @Param indexFrom query int false "Filter commands from this index (inclusive)" @Param indexTo query int false "Filter commands to this index (inclusive)" @Param limit query int false "Limit the number of results returned" default(50) @Param offset query int false "Number of results to skip" default(0) @Param x-request-id header string false "Custom request ID" @Success 200 {object} model.CommandStatusListResponse @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @Param x-credential-holder header string false "Credential holder ID for selecting which credentials to use (default: system default holder)" @Router /ns/{nsId}/infra/{infraId}/node/{nodeId}/commandStatus [get]

func RestPostBuildAgnosticImage added in v0.11.14

func RestPostBuildAgnosticImage(c echo.Context) error

RestPostBuildAgnosticImage godoc @ID PostBuildAgnosticImage @Summary Build agnostic custom images by creating Infra, executing commands, and taking snapshots @Description Creates an Infra infrastructure, executes post-deployment commands, creates snapshots from each nodegroup, and optionally cleans up the Infra. This is a complete workflow for building CSP-agnostic custom images. @Tags [Infra Resource] Image Management @Accept json @Produce json @Param buildReq body model.BuildAgnosticImageReq true "Request body to build agnostic images" @Param nsId path string true "Namespace ID" default(default) @Success 200 {object} model.BuildAgnosticImageResult @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @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)" @Router /ns/{nsId}/buildAgnosticImage [post]

func RestPostCmdInfra added in v0.12.6

func RestPostCmdInfra(c echo.Context) error

RestPostCmdInfra godoc @ID PostCmdInfra @Summary Send a command to specified Infra @Description Send a command to specified Infra. Use query parameters to target specific nodeGroup or node. @Description When async=true, returns immediately with xRequestId and streams results via SSE at GET /stream/ns/{nsId}/cmd/infra/{infraId}?xRequestId={xRequestId} @Tags [MC-Infra] Infra Remote Command @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param infraId path string true "Infra ID" default(infra01) @Param infraCmdReq body model.InfraCmdReq true "Infra Command Request" @Param nodeGroupId query string false "nodeGroupId to apply the command only for nodes in nodeGroup of Infra" default(g1) @Param nodeId query string false "nodeId to apply the command only for a node in Infra" default(g1-1) @Param labelSelector query string false "Target node Label selector query. Example: sys.id=g1-1,role=worker" @Param async query string false "If true, execute asynchronously and return xRequestId for SSE streaming" default(false) @Param x-request-id header string false "Custom request ID" @Success 200 {object} model.InfraSshCmdResultForAPI @Success 202 {object} map[string]string "Async mode: returns xRequestId" @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @Param x-credential-holder header string false "Credential holder ID for selecting which credentials to use (default: system default holder)" @Router /ns/{nsId}/cmd/infra/{infraId} [post]

func RestPostDownloadFileFromInfraNode added in v0.12.6

func RestPostDownloadFileFromInfraNode(c echo.Context) error

RestPostDownloadFileFromInfraNode godoc @ID PostDownloadFileFromInfraNode @Summary Download a file from a node in Infra @Description Download a file from a specific node in Infra via SCP through bastion host. @Description The file size should be less than 200MB. @Tags [MC-Infra] Infra Remote Command @Accept json @Produce application/octet-stream,json @Param nsId path string true "Namespace ID" default(default) @Param infraId path string true "Infra ID" default(infra01) @Param nodeId path string true "Node ID" default(g1-1) @Param fileDownloadReq body model.FileDownloadReq true "File download request" @Param x-request-id header string false "Custom request ID" @Success 200 {file} file "Downloaded file" @Failure 400 {object} model.SimpleMsg "Invalid request" @Failure 500 {object} model.SimpleMsg "Internal Server Error" @Param x-credential-holder header string false "Credential holder ID for selecting which credentials to use (default: system default holder)" @Router /ns/{nsId}/downloadFile/infra/{infraId}/node/{nodeId} [post]

func RestPostFileAndCmdToInfra added in v0.12.6

func RestPostFileAndCmdToInfra(c echo.Context) error

RestPostFileAndCmdToInfra godoc @ID PostFileAndCmdToInfra @Summary Transfer a file to Infra and optionally execute a command after transfer @Description Transfer a file to all targeted nodes in Infra via SCP, then optionally run a shell command on each node where the transfer succeeded. @Description Useful for deploying files directly to privileged locations (e.g., nginx document root) in a single API call. @Description Example: upload index.html to /tmp and run "sudo mv /tmp/index.html /var/www/html/" as the post-transfer command. @Description The file size should be less than 50MB. @Tags [MC-Infra] Infra Remote Command @Accept multipart/form-data @Produce json @Param nsId path string true "Namespace ID" default(default) @Param infraId path string true "Infra ID" default(infra01) @Param nodeGroupId query string false "NodeGroup ID to limit file transfer scope to nodes in a nodeGroup" @Param nodeId query string false "Node ID to limit file transfer scope to a single node" @Param path formData string true "Target directory path on the node where the file will be stored" default(/tmp) @Param file formData file true "The file to be uploaded (Max 50MB)" @Param command formData string false "Shell command to execute on each node after successful file transfer (e.g., sudo mv /tmp/index.html /var/www/html/)" @Param x-request-id header string false "Custom request ID" @Param x-credential-holder header string false "Credential holder ID for selecting which credentials to use (default: system default holder)" @Success 200 {object} model.InfraFileTransferAndCmdResultForAPI @Failure 400 {object} model.SimpleMsg "Invalid request" @Failure 500 {object} model.SimpleMsg "Internal Server Error" @Router /ns/{nsId}/transferFileAndCmd/infra/{infraId} [post]

func RestPostFileToInfra added in v0.12.6

func RestPostFileToInfra(c echo.Context) error

RestPostFileToInfra godoc @ID PostFileToInfra @Summary Transfer a file to specified Infra @Description Transfer a file to specified Infra to the specified path. @Description The file size should be less than 10MB. @Description Not for gerneral file transfer but for specific purpose (small configuration files). @Tags [MC-Infra] Infra Remote Command @Accept multipart/form-data @Produce json @Param nsId path string true "Namespace ID" default(default) @Param infraId path string true "Infra ID" default(infra01) @Param nodeGroupId query string false "nodeGroupId to apply the file transfer only for nodes in nodeGroup of Infra" default(g1) @Param nodeId query string false "nodeId to apply the file transfer only for a node in Infra" default(g1-1) @Param path formData string true "Target path where the file will be stored" default(/home/cb-user/) @Param file formData file true "The file to be uploaded (Max 10MB)" @Param x-request-id header string false "Custom request ID" @Success 200 {object} model.InfraSshCmdResultForAPI @Failure 400 {object} model.SimpleMsg "Invalid request" @Failure 500 {object} model.SimpleMsg "Internal Server Error" @Param x-credential-holder header string false "Credential holder ID for selecting which credentials to use (default: system default holder)" @Router /ns/{nsId}/transferFile/infra/{infraId} [post]

func RestPostInfra added in v0.12.6

func RestPostInfra(c echo.Context) error

RestPostInfra godoc @ID PostInfra @Summary Create Infra (Multi-Cloud Infrastructure) @Description Create Infra with detailed node specifications and resource configuration. @Description This endpoint creates a complete multi-cloud infrastructure by: @Description 1. **node Provisioning**: Creates nodes across multiple cloud providers using predefined specs and images @Description 2. **Resource Management**: Automatically handles VPC/VNet, security groups, SSH keys, and network configuration @Description 3. **Status Tracking**: Monitors node creation progress and handles failures based on policy settings @Description 4. **Post-Deployment**: Optionally installs monitoring agents and executes custom commands @Description @Description **Key Features:** @Description - Multi-cloud node deployment with heterogeneous configurations @Description - Automatic resource dependency management (VPC → Security Group → node) @Description - Built-in failure handling with configurable policies (continue/rollback/refine) @Description - Optional CB-Dragonfly monitoring agent installation @Description - Post-deployment command execution support @Description - Real-time status updates and progress tracking @Description @Description **node Lifecycle:** @Description 1. Creating → Running (successful deployment) @Description 2. Creating → Failed (deployment error, handled by failure policy) @Description 3. Running → Terminated (manual or policy-driven cleanup) @Description @Description **Failure Policies:** @Description - `continue`: Keep successful nodes, mark failed ones for later refinement @Description - `rollback`: Delete entire Infra if any node fails (all-or-nothing) @Description - `refine`: Automatically clean up failed nodes, keep successful ones @Description @Description **Resource Requirements:** @Description - Valid node specifications (must exist in system namespace) @Description - Valid images (must be available in target CSP regions) @Description - Sufficient CSP quotas and permissions @Description - Network connectivity between components @Tags [MC-Infra] Infra Provisioning and Management @Accept json @Produce json @Param nsId path string true "Namespace ID for resource isolation" default(default) @Param infraReq body model.InfraReq true "Infra creation request with node specifications, networking, and deployment options" @Success 200 {object} model.InfraInfo "Created Infra information with node details, status, and resource mapping" @Failure 400 {object} model.SimpleMsg "Invalid request parameters or missing required fields" @Failure 404 {object} model.SimpleMsg "Namespace not found or specified resources unavailable" @Failure 409 {object} model.SimpleMsg "Infra name already exists in namespace" @Failure 500 {object} model.SimpleMsg "Internal server error during Infra creation or CSP communication failure" @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)" @Router /ns/{nsId}/infra [post]

func RestPostInfraDynamic added in v0.12.6

func RestPostInfraDynamic(c echo.Context) error

RestPostInfraDynamic godoc @ID PostInfraDynamic @Summary Create Infra Dynamically with Intelligent Resource Selection @Description Create multi-cloud infrastructure dynamically using common specifications and images with automatic resource discovery and optimization. @Description This is the **recommended approach** for Infra creation, providing simplified configuration with powerful automation: @Description @Description **Dynamic Resource Creation:** @Description 1. **Automatic Resource Discovery**: Validates and selects optimal node specifications and images from common namespace @Description 2. **Intelligent Network Setup**: Creates VNets, subnets, security groups, and SSH keys automatically per provider @Description 3. **Cross-Cloud Orchestration**: Coordinates node provisioning across multiple cloud providers simultaneously @Description 4. **Dependency Management**: Handles resource creation order and inter-dependencies automatically @Description 5. **Failure Recovery**: Implements configurable failure policies for robust deployment @Description @Description **Key Advantages Over Static Infra:** @Description - **Simplified Configuration**: Use common spec/image IDs instead of provider-specific resources @Description - **Automatic Resource Management**: No need to pre-create VNets, security groups, or SSH keys @Description - **Multi-Cloud Optimization**: Intelligent placement and configuration across providers @Description - **Built-in Best Practices**: Security groups, network isolation, and access controls applied automatically @Description - **Scalable Architecture**: Supports large-scale deployments with optimized resource utilization @Description @Description **Configuration Process:** @Description 1. **Resource Discovery**: Use `/recommendSpec` to find suitable node specifications @Description 2. **Image Selection**: Use system namespace to discover compatible images @Description 3. **Request Validation**: Use `/infraDynamicCheckRequest` to validate configuration before deployment @Description 4. **Optional Preview**: Use `/infraDynamicReview` to estimate costs and review configuration @Description 5. **Deployment**: Submit Infra dynamic request with failure policy and deployment options @Description @Description **Failure Policies (PolicyOnPartialFailure):** @Description - **`continue`** (default): Create Infra with successful nodes, failed nodes remain for manual refinement @Description - **`rollback`**: Delete entire Infra if any node fails (all-or-nothing deployment) @Description - **`refine`**: Automatically clean up failed nodes, keep successful ones (recommended for large deployments) @Description @Description **Deployment Options:** @Description - **`hold`**: Create Infra object but hold node provisioning for manual approval @Description - **Normal**: Proceed with immediate node provisioning after resource creation @Description @Description **Multi-Cloud Example Configuration:** @Description ```json @Description { @Description "name": "multi-cloud-web-tier", @Description "description": "Web application across AWS, Azure, and GCP", @Description "policyOnPartialFailure": "refine", @Description "nodeGroups": [ @Description { @Description "name": "aws-web-servers", @Description "nodeGroupSize": "3", @Description "specId": "aws+us-east-1+t3.medium", @Description "imageId": "ami-0abcdef1234567890", @Description "rootDiskSize": "100", @Description "label": {"tier": "web", "provider": "aws"} @Description }, @Description { @Description "name": "azure-api-servers", @Description "nodeGroupSize": "2", @Description "specId": "azure+eastus+Standard_B2s", @Description "imageId": "Canonical:0001-com-ubuntu-server-jammy:22_04-lts", @Description "label": {"tier": "api", "provider": "azure"} @Description } @Description ] @Description } @Description ``` @Description @Description **Performance Considerations:** @Description - node provisioning occurs in parallel across providers @Description - Network resources are created concurrently where possible @Description - Large deployments (>10 nodes) automatically use optimized batching @Description - Built-in rate limiting prevents CSP API throttling @Description @Description **Monitoring and Post-Deployment:** @Description - Optional CB-Dragonfly monitoring agent installation @Description - Custom post-deployment command execution @Description - Real-time status tracking and progress updates @Description - Automatic resource labeling and metadata management @Tags [MC-Infra] Infra Provisioning and Management @Accept json @Produce json @Param nsId path string true "Namespace ID for resource organization and isolation" default(default) @Param infraReq body model.InfraDynamicReq true "Dynamic Infra request with common specifications. Must include specId and imageId for each node group. See description for detailed example." @Param option query string false "Deployment option: 'hold' to create Infra without immediate node provisioning" Enums(hold) @Param x-request-id header string false "Custom request ID for tracking and correlation across API calls" @Param x-credential-holder header string false "Credential holder ID to select which credentials to use for provisioning (default: system default holder)" @Success 200 {object} model.InfraInfo "Successfully created Infra with node deployment status, resource mappings, and configuration details" @Failure 400 {object} model.SimpleMsg "Invalid request format, missing required fields, or unsupported configuration" @Failure 404 {object} model.SimpleMsg "Namespace not found, specified specs/images unavailable, or CSP resources inaccessible" @Failure 409 {object} model.SimpleMsg "Infra name already exists or resource naming conflicts detected" @Failure 500 {object} model.SimpleMsg "Internal deployment error, CSP API failures, or resource creation timeouts" @Router /ns/{nsId}/infraDynamic [post]

func RestPostInfraDynamicCheckRequest added in v0.12.6

func RestPostInfraDynamicCheckRequest(c echo.Context) error

RestPostInfraDynamicCheckRequest godoc @ID PostInfraDynamicCheckRequest @Summary (Deprecated) Check Resource Availability for Dynamic Infra Creation @Description **⚠️ DEPRECATED: This endpoint is deprecated and will be removed in a future version. Please use `/infraDynamicReview` instead for comprehensive validation and cost estimation.** @Description @Description Validate resource availability and discover optimal connection configurations before creating Infra dynamically. @Description This endpoint provides comprehensive resource validation and connection discovery for Infra planning: @Description @Description **Resource Validation Process:** @Description 1. **Specification Analysis**: Validates that requested common specs exist and are accessible @Description 2. **Provider Discovery**: Identifies available cloud providers and regions for each specification @Description 3. **Connectivity Assessment**: Tests connection configurations and CSP API accessibility @Description 4. **Quota Verification**: Checks available quotas and resource limits where possible @Description 5. **Compatibility Matrix**: Generates matrix of viable spec-provider-region combinations @Description @Description **Connection Configuration Discovery:** @Description - **Available Providers**: Lists all configured cloud providers (AWS, Azure, GCP, etc.) @Description - **Active Regions**: Shows available regions per provider with connectivity status @Description - **Specification Mapping**: Maps common specs to provider-specific instance types @Description - **Image Compatibility**: Validates image availability across different providers/regions @Description - **Network Capabilities**: Identifies supported network features and configurations @Description @Description **Pre-Deployment Validation:** @Description - **Resource Existence**: Confirms all specified resources exist in system namespace @Description - **Permission Verification**: Validates CSP credentials and required permissions @Description - **API Connectivity**: Tests connection to CSP APIs and service endpoints @Description - **Dependency Resolution**: Identifies any missing dependencies or prerequisites @Description @Description **Optimization Recommendations:** @Description - **Cost-Effective Regions**: Suggests regions with lower pricing for specified resources @Description - **Performance Optimization**: Recommends regions with better network performance @Description - **Availability Zone**: Identifies optimal AZ distribution for high availability @Description - **Resource Bundling**: Suggests efficient resource combinations and groupings @Description @Description **Output Information:** @Description - **Connection Candidates**: List of viable connection configurations @Description - **Provider Capabilities**: Detailed capabilities matrix per provider @Description - **Resource Status**: Real-time availability status for each requested resource @Description - **Recommendation Summary**: Actionable recommendations for optimal deployment @Description @Description **Use Cases:** @Description - Pre-validate Infra configuration before expensive deployment operations @Description - Discover optimal provider/region combinations for cost or performance @Description - Troubleshoot resource availability issues during Infra planning @Description - Generate connection configuration templates for standardized deployments @Description - Assess infrastructure capacity and planning constraints @Description @Description **Integration Workflow:** @Description 1. Use this endpoint to validate and discover connection options @Description 2. Review recommendations and adjust specifications if needed @Description 3. Use `/infraDynamicReview` for detailed cost estimation and final validation @Description 4. Proceed with `/infraDynamic` using validated configuration @Tags [MC-Infra] Infra Provisioning and Management @Accept json @Produce json @Param infraReq body model.InfraConnectionConfigCandidatesReq true "Resource check request containing common specifications to validate" @Success 200 {object} model.CheckInfraDynamicReqInfo "Resource availability matrix with connection candidates, provider capabilities, and optimization recommendations" @Failure 400 {object} model.SimpleMsg "Invalid request format or malformed specification identifiers" @Failure 404 {object} model.SimpleMsg "Specified common specifications not found in system namespace" @Failure 500 {object} model.SimpleMsg "CSP connectivity issues or internal validation service errors" @Deprecated @Param x-request-id header string false "Custom request ID for tracking" @Router /infraDynamicCheckRequest [post]

func RestPostInfraDynamicFromTemplate added in v0.12.6

func RestPostInfraDynamicFromTemplate(c echo.Context) error

RestPostInfraDynamicFromTemplate godoc @ID PostInfraDynamicFromTemplate @Summary Create Infra from a Template @Description Create a new Infra by applying an Infra Dynamic Template. @Description The template provides the base node configuration, and the apply request @Description allows overriding the Infra name and description. @Description @Description **Override Behavior (Phase 1):** @Description - `name` (required): Name for the new Infra @Description - `description` (optional): Overrides the template's description @Description - All other configuration (specs, images, nodegroups) comes from the template @Tags [MC-Infra] Infra Provisioning and Management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param templateId path string true "Template ID to apply" @Param applyReq body model.TemplateApplyReq true "Template apply request with Infra name and optional description" @Param option query string false "Deployment option: 'hold' to create Infra without immediate node provisioning" Enums(hold) @Param x-request-id header string false "Custom request ID for tracking" @Success 200 {object} model.InfraInfo "Successfully created Infra from template" @Failure 400 {object} model.SimpleMsg "Invalid request format" @Failure 404 {object} model.SimpleMsg "Template or namespace not found" @Failure 500 {object} model.SimpleMsg "Internal deployment error" @Param x-credential-holder header string false "Credential holder ID for selecting which credentials to use (default: system default holder)" @Router /ns/{nsId}/infra/template/{templateId} [post]

func RestPostInfraDynamicNodeGroupNodeReview added in v0.12.6

func RestPostInfraDynamicNodeGroupNodeReview(c echo.Context) error

RestPostInfraDynamicNodeGroupNodeReview godoc @ID PostInfraDynamicNodeGroupNodeReview @Summary Review node Dynamic Addition Request for Existing Infra @Description Review and validate a node dynamic addition request for an existing Infra before actual provisioning. @Description This endpoint provides comprehensive validation for adding new nodes to existing Infras without actually creating resources. @Description It checks resource availability, validates specifications and images, estimates costs, and provides detailed recommendations. @Description @Description **Key Features:** @Description - Validates node specification and image against CSP availability @Description - Checks compatibility with existing Infra configuration @Description - Provides cost estimation for the new node addition @Description - Identifies potential configuration issues and warnings @Description - Recommends optimization strategies @Description - Non-invasive validation (no resources are created) @Description @Description **Review Status:** @Description - `Ready`: node can be added successfully @Description - `Warning`: node can be added but with configuration warnings @Description - `Error`: Critical errors prevent node addition @Description @Description **Infra Integration Validation:** @Description - Ensures target Infra exists and is in a compatible state @Description - Validates network integration possibilities @Description - Checks resource naming conflicts @Description - Verifies security group and SSH key compatibility @Description @Description **Use Cases:** @Description - Pre-validation before expensive node addition operations @Description - Cost estimation for scaling decisions @Description - Configuration optimization before deployment @Description - Risk assessment for node addition to existing infrastructure @Tags [MC-Infra] Infra Provisioning and Management @Accept json @Produce json @Param nsId path string true "Namespace ID containing the target Infra" default(default) @Param infraId path string true "Infra ID to which the node will be added" default(infra01) @Param nodeGroupReq body model.CreateNodeGroupDynamicReq true "Request body to review node dynamic addition. Must include specId and imageId info. (ex: {name: web-servers, specId: aws+ap-northeast-2+t2.small, imageId: aws+ap-northeast-2+ubuntu22.04, nodeGroupSize: 2})" @Param x-request-id header string false "Custom request ID for tracking" @Param x-credential-holder header string false "Credential holder ID to select which credentials to use for review (default: system default holder)" @Success 200 {object} model.ReviewNodeGroupDynamicReqInfo "Comprehensive node addition review result with validation status, cost estimation, and recommendations" @Failure 400 {object} model.SimpleMsg "Invalid request format or parameters" @Failure 404 {object} model.SimpleMsg "Target Infra not found or namespace not found" @Failure 500 {object} model.SimpleMsg "Internal server error during validation" @Router /ns/{nsId}/infra/{infraId}/nodeGroupDynamicReview [post]

func RestPostInfraDynamicReview added in v0.12.6

func RestPostInfraDynamicReview(c echo.Context) error

RestPostInfraDynamicReview godoc @ID PostInfraDynamicReview @Summary Review and Validate Infra Dynamic Request @Description Review and validate Infra dynamic request comprehensively before actual provisioning. @Description This endpoint performs comprehensive validation of Infra dynamic creation requests without actually creating resources. @Description It checks resource availability, validates specifications and images, estimates costs, and provides detailed recommendations. @Description @Description **Key Features:** @Description - Validates all node specifications and images against CSP availability @Description - Provides cost estimation (including partial estimates when some costs are unknown) @Description - Identifies potential configuration issues and warnings @Description - Recommends optimization strategies @Description - Shows provider and region distribution @Description - Non-invasive validation (no resources are created) @Description @Description **Review Status:** @Description - `Ready`: All nodes can be created successfully @Description - `Warning`: nodes can be created but with configuration warnings @Description - `Error`: Critical errors prevent Infra creation @Description @Description **Use Cases:** @Description - Pre-validation before expensive Infra creation @Description - Cost estimation and planning @Description - Configuration optimization @Description - Multi-cloud resource planning @Tags [MC-Infra] Infra Provisioning and Management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param infraReq body model.InfraDynamicReq true "Request body to review Infra dynamic provisioning. Must include specId and imageId info of each node request. Same format as /infraDynamic endpoint. (ex: {name: infra01, nodeGroups: [{imageId: aws+ap-northeast-2+ubuntu22.04, specId: aws+ap-northeast-2+t2.small}]})" @Param option query string false "Option for Infra creation review (same as actual creation)" Enums(hold) @Param x-request-id header string false "Custom request ID for tracking" @Param x-credential-holder header string false "Credential holder ID to select which credentials to use for review (default: system default holder)" @Success 200 {object} model.ReviewInfraDynamicReqInfo "Comprehensive review result with validation status, cost estimation, and recommendations" @Failure 400 {object} model.SimpleMsg "Invalid request format or parameters" @Failure 404 {object} model.SimpleMsg "Namespace not found or invalid" @Failure 500 {object} model.SimpleMsg "Internal server error during validation" @Router /ns/{nsId}/infraDynamicReview [post]

func RestPostInfraDynamicTemplate added in v0.12.6

func RestPostInfraDynamicTemplate(c echo.Context) error

RestPostInfraDynamicTemplate godoc @ID PostInfraDynamicTemplate @Summary Create an Infra Dynamic Template @Description Create a reusable Infra Dynamic Template. Templates store Infra dynamic creation @Description request configurations that can be applied later to create Infras with consistent settings. @Description @Description **Template Contents:** @Description - node specifications (specId, imageId) for each nodegroup @Description - NodeGroup sizing and naming @Description - Network and disk configuration @Description - Post-deployment commands @Description - Monitoring agent options @Description @Description Templates can be created manually or extracted from existing Infras. @Tags [MC-Infra] Infra Template Management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param templateReq body model.InfraDynamicTemplateReq true "Infra Dynamic Template request" @Success 200 {object} model.InfraDynamicTemplateInfo "Successfully created template" @Failure 400 {object} model.SimpleMsg "Invalid request format or template name" @Failure 409 {object} model.SimpleMsg "Template already exists" @Failure 500 {object} model.SimpleMsg "Internal error" @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)" @Router /ns/{nsId}/template/infra [post]

func RestPostInfraNode added in v0.12.6

func RestPostInfraNode(c echo.Context) error

RestPostInfraNode godoc @ID PostInfraNode @Summary Add Homogeneous node NodeGroup to Existing Infra @Description Create and add a group of identical virtual machines (nodegroup) to an existing Infra using detailed specifications. @Description This endpoint provides precise control over node configuration and placement within existing infrastructure: @Description @Description **NodeGroup Creation Process:** @Description 1. **Infra Integration**: Validates target Infra exists and can accommodate new nodes @Description 2. **Resource Validation**: Verifies all specified resources (specs, images, networks) exist and are accessible @Description 3. **Homogeneous Deployment**: Creates multiple identical nodes with consistent configuration @Description 4. **Network Integration**: Integrates new nodes with existing Infra networking and security policies @Description 5. **Group Management**: Establishes nodegroup for collective management and operations @Description @Description **Detailed Configuration Control:** @Description - **Specific Resource References**: Uses exact resource IDs rather than common specifications @Description - **Network Placement**: Precise control over VNet, subnet, and security group assignment @Description - **Storage Configuration**: Detailed disk configuration including type, size, and performance tiers @Description - **Instance Customization**: Full control over node specifications, images, and metadata @Description - **Security Settings**: Explicit security group and SSH key configuration @Description @Description **NodeGroup Benefits:** @Description - **Collective Operations**: Perform operations on entire nodegroup simultaneously @Description - **Homogeneous Scaling**: All nodes in nodegroup share identical configuration @Description - **Simplified Management**: Single configuration template for multiple nodes @Description - **Consistent Naming**: Automatic sequential naming (e.g., web-1, web-2, web-3) @Description - **Group Policies**: Apply scaling, monitoring, and lifecycle policies at nodegroup level @Description @Description **Use Cases:** @Description - **Application Tiers**: Deploy multiple instances of web servers, application servers, or databases @Description - **Load Distribution**: Create multiple identical nodes for load balancing scenarios @Description - **High Availability**: Deploy redundant instances across availability zones @Description - **Batch Processing**: Create worker nodes for distributed computing workloads @Description - **Development Environments**: Provision identical development or testing instances @Description @Description **Configuration Requirements:** @Description - **Resource IDs**: Must specify exact resource identifiers (not common specs) @Description - **Network Configuration**: VNet, subnet, and security group must exist and be compatible @Description - **SSH Keys**: Must specify valid SSH key pairs for access management @Description - **Image Compatibility**: Specified image must be available in target region @Description - **Quota Validation**: Sufficient CSP quotas must be available for all requested nodes @Description @Description **NodeGroup Size Considerations:** @Description - **Small Groups (1-5 nodes)**: Fast deployment, minimal resource contention @Description - **Medium Groups (6-20 nodes)**: Optimized parallel deployment with resource batching @Description - **Large Groups (21+ nodes)**: Advanced deployment strategies to avoid CSP rate limits @Description - **Resource Limits**: Respects CSP quotas and CB-Tumblebug configuration limits @Description @Description **Post-Deployment Integration:** @Description - NodeGroup becomes integral part of parent Infra @Description - All nodes inherit Infra-level monitoring and management policies @Description - Can be scaled out further or individual nodes can be managed separately @Description - Supports all standard CB-Tumblebug node lifecycle operations @Tags [MC-Infra] Infra Provisioning and Management @Accept json @Produce json @Param nsId path string true "Namespace ID containing the target Infra" default(default) @Param infraId path string true "Infra ID to which the node nodegroup will be added" default(infra01) @Param nodeGroupReq body model.CreateNodeGroupReq true "Detailed node nodegroup specification including exact resource IDs, networking, and scaling parameters" @Success 200 {object} model.InfraInfo "Updated Infra information including newly created node nodegroup with individual node details and status" @Failure 400 {object} model.SimpleMsg "Invalid node request, missing required resources, or configuration conflicts" @Failure 404 {object} model.SimpleMsg "Target Infra not found, specified resources unavailable, or namespace inaccessible" @Failure 409 {object} model.SimpleMsg "NodeGroup name conflicts, resource allocation conflicts, or Infra state incompatible with expansion" @Failure 500 {object} model.SimpleMsg "node provisioning failed, network configuration error, or CSP API communication failure" @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)" @Router /ns/{nsId}/infra/{infraId}/node [post]

func RestPostInfraNodeGroupDynamic added in v0.12.6

func RestPostInfraNodeGroupDynamic(c echo.Context) error

RestPostInfraNodeGroupDynamic godoc @ID PostInfraNodeGroupDynamic @Summary Add node Dynamically to Existing Infra @Description Dynamically add new virtual machines to an existing Infra using common specifications and automated resource management. @Description This endpoint provides elastic scaling capabilities for running Infras: @Description @Description **Dynamic node Addition Process:** @Description 1. **Infra Validation**: Verifies target Infra exists and is in a valid state for expansion @Description 2. **Resource Discovery**: Resolves common spec and image to provider-specific resources @Description 3. **Network Integration**: Automatically configures new nodes to use existing Infra network resources @Description 4. **NodeGroup Management**: Creates new nodegroups or expands existing ones based on configuration @Description 5. **Status Synchronization**: Updates Infra status and metadata to reflect new node additions @Description @Description **Integration with Existing Infrastructure:** @Description - **Network Reuse**: New nodes automatically join existing VNets and security groups @Description - **SSH Key Sharing**: Uses existing SSH keys for consistent access management @Description - **Monitoring Integration**: New nodes inherit monitoring configuration from parent Infra @Description - **Label Propagation**: Applies Infra-level labels and policies to new nodes @Description - **Resource Consistency**: Maintains naming conventions and resource organization @Description @Description **Scaling Scenarios:** @Description - **Horizontal Scaling**: Add more instances to handle increased workload @Description - **Multi-Region Expansion**: Deploy nodes in new regions while maintaining Infra cohesion @Description - **Provider Diversification**: Add nodes from different cloud providers for redundancy @Description - **Workload Specialization**: Deploy nodes with different specifications for specific tasks @Description @Description **Configuration Requirements:** @Description - `specId`: Must specify valid node specification from system namespace @Description - `imageId`: Must specify valid image compatible with target provider/region @Description - `name`: Becomes nodegroup name; nodes will be named with sequential suffixes @Description - `nodeGroupSize`: Number of identical nodes to create (default: 1) @Description @Description **Network and Security:** @Description - New nodes automatically inherit security group rules from existing Infra @Description - Network connectivity to existing nodes is established automatically @Description - Firewall rules and access policies are applied consistently @Description - SSH access is configured using existing key pairs @Description @Description **Example Use Cases:** @Description - Scale out web tier during traffic spikes @Description - Add GPU instances for machine learning workloads @Description - Deploy edge nodes in additional geographic regions @Description - Add specialized storage or database nodes to existing application stack @Description @Description **Post-Addition Operations:** @Description - New nodes are immediately available for standard Infra operations @Description - Can be individually managed or grouped with existing nodegroups @Description - Monitoring and logging are automatically configured @Description - Application deployment and configuration management can proceed immediately @Tags [MC-Infra] Infra Provisioning and Management @Accept json @Produce json @Param nsId path string true "Namespace ID containing the target Infra" default(default) @Param infraId path string true "Infra ID to which new nodes will be added" default(infra01) @Param nodeGroupReq body model.CreateNodeGroupDynamicReq true "NodeGroup dynamic request specifying specId, imageId, and scaling parameters" @Param x-credential-holder header string false "Credential holder ID to select which credentials to use for provisioning (default: system default holder)" @Success 200 {object} model.InfraInfo "Updated Infra information including newly added nodes and current status" @Failure 400 {object} model.SimpleMsg "Invalid node request or incompatible configuration parameters" @Failure 404 {object} model.SimpleMsg "Target Infra not found or specified resources unavailable" @Failure 409 {object} model.SimpleMsg "NodeGroup name conflicts or Infra in incompatible state" @Failure 500 {object} model.SimpleMsg "node creation failed or network integration error" @Param x-request-id header string false "Custom request ID for tracking" @Router /ns/{nsId}/infra/{infraId}/nodeGroupDynamic [post]

func RestPostInfraNodeGroupScaleOut added in v0.12.6

func RestPostInfraNodeGroupScaleOut(c echo.Context) error

RestPostInfraNodeGroupScaleOut godoc @ID PostInfraNodeGroupScaleOut @Summary Scale Out Existing NodeGroup in Infra @Description Horizontally scale an existing node nodegroup by adding more identical instances for increased capacity. @Description This endpoint provides elastic scaling capabilities for running application tiers: @Description @Description **Scale-Out Process:** @Description 1. **NodeGroup Validation**: Verifies target nodegroup exists and is in scalable state @Description 2. **Template Replication**: Uses existing node configuration as template for new instances @Description 3. **Resource Allocation**: Ensures sufficient CSP quotas and network resources @Description 4. **Parallel Deployment**: Deploys multiple new nodes simultaneously for faster scaling @Description 5. **Integration**: Seamlessly integrates new nodes into existing nodegroup and Infra @Description @Description **Configuration Inheritance:** @Description - **node Specifications**: New nodes inherit exact specifications from existing nodegroup members @Description - **Network Settings**: Automatically placed in same VNet, subnet, and security groups @Description - **SSH Keys**: Use same SSH key pairs for consistent access management @Description - **Monitoring**: Inherit monitoring agent configuration and policies @Description - **Labels and Metadata**: Propagate all labels and metadata from parent nodegroup @Description @Description **Scaling Scenarios:** @Description - **Traffic Spikes**: Quickly add capacity during high-demand periods @Description - **Seasonal Scaling**: Scale out for predictable demand increases @Description - **Performance Optimization**: Add instances to reduce per-node resource utilization @Description - **Geographic Expansion**: Scale existing workloads to handle broader user base @Description - **Fault Tolerance**: Increase redundancy by adding more instances @Description @Description **Intelligent Scaling:** @Description - **Sequential Naming**: New nodes follow established naming pattern (e.g., web-4, web-5, web-6) @Description - **Load Distribution**: New nodes are distributed optimally across availability zones @Description - **Resource Efficiency**: Reuses existing network and security infrastructure @Description - **Minimal Disruption**: Scaling occurs without affecting existing node operations @Description - **Consistent Configuration**: Ensures all nodes in nodegroup remain homogeneous @Description @Description **Operational Benefits:** @Description - **Zero Downtime**: Existing nodes continue running during scale-out operation @Description - **Immediate Availability**: New nodes are ready for traffic as soon as deployment completes @Description - **Unified Management**: All nodes (old and new) managed through single nodegroup @Description - **Policy Consistency**: All scaling and management policies apply uniformly @Description - **Monitoring Integration**: New nodes automatically included in existing monitoring dashboards @Description @Description **Scale-Out Considerations:** @Description - **CSP Quotas**: Verifies sufficient instance, network, and storage quotas @Description - **Region Capacity**: Ensures target region has capacity for requested instance types @Description - **Network Limits**: Validates that VNet can accommodate additional nodes @Description - **Cost Impact**: Additional nodes incur proportional CSP billing costs @Description - **Application Readiness**: Applications should be designed to handle additional instances @Description @Description **Post-Scale Operations:** @Description - New nodes immediately participate in nodegroup operations @Description - Can be individually managed while maintaining nodegroup membership @Description - Support for further scaling operations (scale-out or scale-in) @Description - Ready for application deployment and load balancer integration @Description @Description **Best Practices:** @Description - Monitor application performance before and after scaling @Description - Ensure load balancers are configured to include new instances @Description - Verify application clustering and session management handle new instances @Description - Consider database connection limits and other resource constraints @Tags [MC-Infra] Infra Provisioning and Management @Accept json @Produce json @Param nsId path string true "Namespace ID containing the target Infra and nodegroup" default(default) @Param infraId path string true "Infra ID containing the nodegroup to scale" default(infra01) @Param nodegroupId path string true "NodeGroup ID to scale out (must exist and contain at least one node)" default(g1) @Param nodeGroupReq body model.ScaleOutNodeGroupReq true "Scale-out request specifying the number of additional nodes to create" @Success 200 {object} model.InfraInfo "Updated Infra information with scaled nodegroup showing all nodes including newly added instances" @Failure 400 {object} model.SimpleMsg "Invalid scale-out request, insufficient quotas, or invalid node count" @Failure 404 {object} model.SimpleMsg "Target Infra or nodegroup not found, or namespace inaccessible" @Failure 409 {object} model.SimpleMsg "NodeGroup in incompatible state for scaling or resource conflicts detected" @Failure 500 {object} model.SimpleMsg "node provisioning failed, network configuration error, or CSP capacity limitations" @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)" @Router /ns/{nsId}/infra/{infraId}/nodegroup/{nodegroupId} [post]

func RestPostInfraNodeSnapshot added in v0.12.6

func RestPostInfraNodeSnapshot(c echo.Context) error

RestPostInfraNodeSnapshot godoc @ID PostInfraNodeSnapshot @Summary Snapshot node and create a Custom Image Object using the Snapshot @Description Snapshot node and create a Custom Image Object using the Snapshot @Tags [Infra Resource] Image Management @Accept json @Produce json @Param snapshotReq body model.SnapshotReq true "Request body to create node snapshot" @Param nsId path string true "Namespace ID" default(default) @Param infraId path string true "Infra ID" default(infra01) @Param nodeId path string true "Node ID" default(g1-1) @Success 200 {object} model.ImageInfo @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @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)" @Router /ns/{nsId}/infra/{infraId}/node/{nodeId}/snapshot [post]

func RestPostInfraPolicy added in v0.12.6

func RestPostInfraPolicy(c echo.Context) error

RestPostInfraPolicy godoc @ID PostInfraPolicy @Summary Create Infra Automation policy @Description Create Infra Automation policy @Tags [MC-Infra] Infra Orchestration Management (WIP) @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param infraId path string true "Infra ID" default(infra01) @Param infraPolicyReq body model.InfraPolicyReq true "Details for an Infra automation policy request" @Success 200 {object} model.InfraPolicyInfo @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @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)" @Router /ns/{nsId}/policy/infra/{infraId} [post]

func RestPostInfraSnapshot added in v0.12.6

func RestPostInfraSnapshot(c echo.Context) error

RestPostInfraSnapshot godoc @ID PostInfraSnapshot @Summary Create snapshots for all nodegroups in Infra (one node per nodegroup in parallel) @Description Create snapshots for the first running node in each nodegroup of an Infra in parallel @Tags [Infra Resource] Image Management @Accept json @Produce json @Param snapshotReq body model.SnapshotReq true "Request body to create Infra snapshots" @Param nsId path string true "Namespace ID" default(default) @Param infraId path string true "Infra ID" default(infra01) @Success 200 {object} model.InfraSnapshotResult @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @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)" @Router /ns/{nsId}/infra/{infraId}/snapshot [post]

func RestPostInstallBenchmarkAgentToInfra added in v0.12.6

func RestPostInstallBenchmarkAgentToInfra(c echo.Context) error

RestPostInstallBenchmarkAgentToInfra godoc @ID PostInstallBenchmarkAgentToInfra @Summary Install the benchmark agent to specified Infra @Description Install the benchmark agent to specified Infra @Tags [MC-Infra] Infra Performance Benchmarking (WIP) @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param infraId path string true "Infra ID" default(infra01) @Param infraCmdReq body model.InfraCmdReq true "Infra Command Request" @Param option query string false "Option for checking update" Enums(update) @Success 200 {object} model.InfraSshCmdResult @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @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)" @Router /ns/{nsId}/installBenchmarkAgent/infra/{infraId} [post]

func RestPostInstallMonitorAgentToInfra added in v0.12.6

func RestPostInstallMonitorAgentToInfra(c echo.Context) error

RestPostInstallMonitorAgentToInfra godoc @ID PostInstallMonitorAgentToInfra @Summary Install monitoring agent (CB-Dragonfly agent) to Infra @Description Install monitoring agent (CB-Dragonfly agent) to Infra @Tags [MC-Infra] Infra Resource Monitor (for developer) @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param infraId path string true "Infra ID" default(infra01) @Param infraInfo body model.InfraCmdReq true "Details for an Infra object" @Success 200 {object} model.AgentInstallContentWrapper @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @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)" @Router /ns/{nsId}/monitoring/install/infra/{infraId} [post]

func RestPostMcNLB

func RestPostMcNLB(c echo.Context) error

RestPostMcNLB godoc @ID PostMcNLB @Summary Create a special purpose Infra for NLB and depoly and setting SW NLB @Description Create a special purpose Infra for NLB and depoly and setting SW NLB @Tags [Infra Resource] NLB Management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param infraId path string true "Infra ID" default(infra01) @Param nlbReq body model.NLBReq true "Details of the NLB object" @Success 200 {object} model.McNlbInfo @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @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)" @Router /ns/{nsId}/infra/{infraId}/mcSwNlb [post]

func RestPostNLB

func RestPostNLB(c echo.Context) error

RestPostNLB godoc @ID PostNLB @Summary Create NLB @Description Create NLB @Tags [Infra Resource] NLB Management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param infraId path string true "Infra ID" default(infra01) @Param option query string false "Option: [required params for register] connectionName, name, cspResourceId" Enums(register) @Param nlbReq body model.NLBReq true "Details of the NLB object" @Success 200 {object} model.NLBInfo @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @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)" @Router /ns/{nsId}/infra/{infraId}/nlb [post]

func RestPostRegisterCSPNativeNode added in v0.12.6

func RestPostRegisterCSPNativeNode(c echo.Context) error

RestPostRegisterCSPNativeNode godoc @ID PostRegisterCSPNativeNode @Summary Register Existing CSP nodes into Cloud-Barista Infra @Description Import and register pre-existing virtual machines from cloud service providers into CB-Tumblebug management. @Description This endpoint allows you to bring existing CSP resources under CB-Tumblebug control without recreating them: @Description @Description **Registration Process:** @Description 1. **Discovery**: Validates that the specified node exists in the target CSP @Description 2. **Metadata Import**: Retrieves node configuration, network settings, and current status @Description 3. **Resource Mapping**: Creates CB-Tumblebug resource objects that reference the existing CSP resources @Description 4. **Status Synchronization**: Aligns CB-Tumblebug status with actual CSP node state @Description 5. **Management Integration**: Enables CB-Tumblebug operations on the registered nodes @Description @Description **Supported node States:** @Description - Running nodes (most common use case) @Description - Stopped nodes (will be registered with current state) @Description - nodes with attached storage and network interfaces @Description @Description **Resource Compatibility:** @Description - node must exist in a supported CSP (AWS, Azure, GCP, etc.) @Description - Network resources (VPC, subnets, security groups) will be discovered and mapped @Description - Storage volumes and attached disks will be registered automatically @Description - SSH keys and security configurations will be imported @Description @Description **Post-Registration Capabilities:** @Description - Standard CB-Tumblebug node lifecycle operations (start, stop, terminate) @Description - Monitoring agent installation (if CB-Dragonfly is configured) @Description - Command execution and automation @Description - Integration with other CB-Tumblebug Infras @Description @Description **Important Notes:** @Description - Registration does not modify the existing node configuration @Description - Original CSP billing and resource management still applies @Description - CB-Tumblebug provides additional management layer and automation @Description - Ensure proper CSP credentials and permissions are configured @Tags [MC-Infra] Infra Provisioning and Management @Accept json @Produce json @Param nsId path string true "Namespace ID for organizing registered resources" default(default) @Param infraReq body model.InfraReq true "Infra registration request containing existing CSP node IDs and connection details" @Success 200 {object} model.InfraInfo "Registered Infra information with imported node details and current status" @Failure 400 {object} model.SimpleMsg "Invalid request format or missing required CSP node identifiers" @Failure 404 {object} model.SimpleMsg "Specified nodes not found in target CSP or namespace doesn't exist" @Failure 409 {object} model.SimpleMsg "node already registered or Infra name conflicts" @Failure 500 {object} model.SimpleMsg "CSP communication error or registration process failure" @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)" @Router /ns/{nsId}/registerCspNode [post]

func RestPostScheduleRegisterCspResources added in v0.11.16

func RestPostScheduleRegisterCspResources(c echo.Context) error

RestPostScheduleRegisterCspResources godoc @ID PostScheduleRegisterCspResources @Summary Create scheduled CSP resource registration job @Description Create a scheduled job to periodically register CSP-native resources (vNet, securityGroup, sshKey, node) into CB-Tumblebug @Description @Description **Resource Registration Behavior:** @Description This job registers CSP-native resources based on the `connectionName` field: @Description - If `connectionName` is specified: Registers resources from the **specified connection only** @Description - If `connectionName` is empty or omitted: Registers resources from **all available connections** @Description @Description **Usage Examples:** @Description - Single connection: `{"jobType": "registerCspResources", "nsId": "default", "intervalSeconds": 60, "connectionName": "aws-ap-northeast-2", "infraNamePrefix": "infra-01"}` @Description - All connections: `{"jobType": "registerCspResources", "nsId": "default", "intervalSeconds": 60, "connectionName": "", "infraNamePrefix": "infra-all"}` or `{"jobType": "registerCspResources", "nsId": "default", "intervalSeconds": 60, "infraNamePrefix": "infra-all"}` @Description @Description **Job Status Values:** @Description - `Scheduled`: Job is scheduled and waiting for the next execution time @Description - `Executing`: Job is currently running the task @Description - `Stopped`: Job has been stopped and deleted @Description @Description **Job Lifecycle:** @Description 1. Create job (this API) → Status: `Scheduled`, **executes immediately** @Description 2. First execution starts → Status: `Executing` @Description 3. Execution completes → Status: `Scheduled` (waits for interval) @Description 4. After interval → Status: `Executing` (cycles back to step 3) @Description 5. Pause job → `enabled: false`, Status: `Scheduled` (no execution) @Description 6. Resume job → `enabled: true`, Status: `Scheduled` (resumes execution) @Description 7. Delete job → Status: `Stopped`, job removed permanently @Description @Description **Failure Handling:** @Description - Tracks `successCount`, `failureCount`, `consecutiveFailures` @Description - Auto-disables after 5 consecutive failures (`autoDisabled: true`) @Description - Auto-recovers when next execution succeeds @Description @Description **Timeout Protection:** @Description - Default execution timeout: 30 minutes @Description - Jobs exceeding timeout are marked as failed @Description - Server restart during execution marks job as interrupted @Description @Description **Duplicate Prevention:** @Description - System checks for existing jobs with same configuration @Description - Configuration uniqueness based on: jobType + nsId + connectionName + infraNamePrefix + option + infraFlag @Description - Returns 409 Conflict if duplicate job exists with existing job ID @Tags [Job Scheduler] (WIP) CSP Resource Registration @Accept json @Produce json @Param scheduleRequest body model.ScheduleJobRequest true "Schedule job request (nsId must be specified in request body)" @Success 200 {object} model.ScheduleJobStatus @Failure 400 {object} model.SimpleMsg @Failure 409 {object} model.SimpleMsg "Duplicate job already exists" @Failure 422 {object} model.SimpleMsg "Invalid registration options" @Failure 500 {object} model.SimpleMsg @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)" @Router /registerCspResources/schedule [post]

func RestPostSpecImagePairReview added in v0.12.0

func RestPostSpecImagePairReview(c echo.Context) error

RestPostSpecImagePairReview godoc @ID PostSpecImagePairReview @Summary Review Spec and Image Pair Compatibility @Description Validate whether a spec and image pair is compatible for node provisioning. @Description This lightweight API checks: @Description - Spec availability in DB and CSP @Description - Image availability in DB and CSP (auto-registers if found in CSP but not in DB) @Description - Cost estimation based on spec @Description @Description **Use Cases:** @Description - Quick validation before node creation @Description - Pre-check for dynamic provisioning @Description - Verify custom image IDs entered by user @Tags [MC-Infra] Infra Provisioning and Management @Accept json @Produce json @Param specImagePair body model.SpecImagePairReviewReq true "Spec and Image pair to review" @Param x-request-id header string false "Custom request ID for tracking" @Success 200 {object} model.SpecImagePairReviewResult "Review result with validation status and details" @Failure 400 {object} model.SimpleMsg "Invalid request format" @Failure 500 {object} model.SimpleMsg "Internal server error" @Param x-credential-holder header string false "Credential holder ID for selecting which credentials to use (default: system default holder)" @Router /specImagePairReview [post]

func RestPostSystemInfra added in v0.12.6

func RestPostSystemInfra(c echo.Context) error

RestPostSystemInfra godoc @ID PostSystemInfra @Summary Create System Infra for CB-Tumblebug Internal Operations @Description Create specialized Infra instances for CB-Tumblebug system operations and infrastructure probing. @Description This endpoint provisions system-level infrastructure that supports CB-Tumblebug's internal functions: @Description @Description **System Infra Types:** @Description - `probe`: Creates lightweight nodes for network connectivity testing and CSP capability discovery @Description - `monitor`: Deploys monitoring infrastructure for system health and performance tracking @Description - `test`: Provisions test environments for validating CSP integrations and features @Description @Description **Probe Infra Features:** @Description - **Connectivity Testing**: Validates network paths between different CSP regions @Description - **Latency Measurement**: Measures inter-region and inter-provider network performance @Description - **Feature Discovery**: Tests CSP-specific capabilities and service availability @Description - **Resource Validation**: Verifies that CB-Tumblebug can successfully provision resources @Description @Description **System Namespace:** @Description - All system Infras are created in the special `system` namespace @Description - Isolated from user workloads and regular Infra operations @Description - Managed automatically by CB-Tumblebug internal processes @Description - May be used for background maintenance and monitoring tasks @Description @Description **Automatic Configuration:** @Description - Uses optimized node specifications for system tasks (typically minimal resources) @Description - Automatically selects appropriate regions and providers based on probe requirements @Description - Configures necessary network access and security policies @Description - Deploys with minimal attack surface and security hardening @Description @Description **Lifecycle Management:** @Description - System Infras may be automatically created, updated, or destroyed by CB-Tumblebug @Description - Typically short-lived for specific system tasks @Description - Resource cleanup is handled automatically @Description - Status and results are logged for system administrators @Description @Description **Use Cases:** @Description - Infrastructure health checks and validation @Description - Performance benchmarking across cloud providers @Description - Automated testing of new CSP integrations @Description - Network topology discovery and optimization @Tags [MC-Infra] Infra Provisioning and Management @Accept json @Produce json @Param option query string false "System Infra type: 'probe' for connectivity testing, 'monitor' for system monitoring" Enums(probe,monitor,test) @Param infraReq body model.InfraDynamicReq false "Optional Infra configuration. If not provided, system defaults will be used" @Success 200 {object} model.InfraInfo "Created system Infra with specialized configuration and status" @Failure 400 {object} model.SimpleMsg "Invalid system option or malformed request" @Failure 403 {object} model.SimpleMsg "Insufficient permissions for system Infra creation" @Failure 500 {object} model.SimpleMsg "System Infra creation failed or CSP integration error" @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)" @Router /systemInfra [post]

func RestPostVpnHealthCheck added in v0.12.6

func RestPostVpnHealthCheck(c echo.Context) error

RestPostVpnHealthCheck godoc @ID PostVpnHealthCheck @Summary Check the health of a site-to-site VPN by bidirectional ping test @Description Perform a bidirectional ping test on a site-to-site VPN using existing Infra nodes and return the results. @Description @Description It finds nodes that belong to the VPN's two sites and runs ping tests @Description in both directions (site1→site2 and site2→site1) via private IP. @Description The VPN is considered healthy only when both directions succeed. @Description @Description A retry strategy is used with configurable interval and max attempts @Description (default: 15s interval, 20 attempts). @Tags [Infra Resource] Site-to-site VPN Management (preview) @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param infraId path string true "Infra ID" default(infra01) @Param vpnId path string true "VPN ID" default(vpn01) @Param healthCheckReq body model.VpnHealthCheckRequest true "Health check options" @Success 200 {object} model.VpnHealthCheckResponse "OK" @Failure 400 {object} model.SimpleMsg "Bad Request" @Failure 404 {object} model.SimpleMsg "Not Found" @Failure 500 {object} model.SimpleMsg "Internal Server Error" @Param x-request-id header string false "Custom request ID for tracking" @Router /ns/{nsId}/infra/{infraId}/vpn/{vpnId}/health [post]

func RestPutInfraAssociatedSecurityGroups added in v0.12.6

func RestPutInfraAssociatedSecurityGroups(c echo.Context) error

RestPutInfraAssociatedSecurityGroups godoc @ID PutInfraAssociatedSecurityGroups @Summary Update all Security Groups associated with a given Infra @Description Update all Security Groups associated with a given Infra. The firewall rules of all Security Groups will be synchronized to match the requested set. @Tags [MC-Infra] Infra Provisioning and Management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param infraId path string true "Infra ID" default(infra01) @Param securityGroupInfo body model.SecurityGroupUpdateReq true "Details for SecurityGroup update (only firewallRules field is used for update)" @Success 200 {array} model.SecurityGroupInfo "Updated Security Group info list with synchronized firewall rules" @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @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)" @Router /ns/{nsId}/infra/{infraId}/associatedSecurityGroups [put] @Summary Update all Security Groups associated with a given Infra (Synchronize Firewall Rules) @Description Update all Security Groups associated with a given Infra. The firewall rules of all associated Security Groups will be synchronized to match the requested set. @Description @Description This API will add missing rules and delete extra rules so that each Security Group's rules become identical to the requested set. @Description Only firewall rules are updated; other metadata (name, description, etc.) is not changed. @Description @Description Usage: @Description Use this API to update (synchronize) the firewall rules of all Security Groups associated with the specified Infra. The rules in the request body will become the only rules in each Security Group after the operation. @Description - All existing rules not present in the request will be deleted. @Description - All rules in the request that do not exist will be added. @Description - If a rule exists but differs in CIDR or port range, it will be replaced. @Description - Special protocols (ICMP, etc.) are handled in the same way. @Description @Description Notes: @Description - "Ports" field supports single port ("22"), port range ("80-100"), and multiple ports/ranges ("22,80-100,443"). @Description - The valid port number range is 0 to 65535 (inclusive). @Description - "Protocol" can be TCP, UDP, ICMP, etc. (as supported by the cloud provider). @Description - "Direction" must be either "inbound" or "outbound". @Description - "CIDR" is the allowed IP range. @Description - All existing rules not in the request (including default ICMP, etc.) will be deleted. @Description - Metadata (name, description, etc.) is not changed. @Success 200 {object} model.RestWrapperSecurityGroupUpdateResponse "Updated Security Group info list with synchronized firewall rules"

func RestPutInfraDynamicTemplate added in v0.12.6

func RestPutInfraDynamicTemplate(c echo.Context) error

RestPutInfraDynamicTemplate godoc @ID PutInfraDynamicTemplate @Summary Update an Infra Dynamic Template @Description Update an existing Infra Dynamic Template. @Tags [MC-Infra] Infra Template Management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param templateId path string true "Template ID" @Param templateReq body model.InfraDynamicTemplateReq true "Infra Dynamic Template request" @Success 200 {object} model.InfraDynamicTemplateInfo "Updated template information" @Failure 400 {object} model.SimpleMsg "Invalid request format" @Failure 404 {object} model.SimpleMsg "Template not found" @Failure 500 {object} model.SimpleMsg "Internal error" @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)" @Router /ns/{nsId}/template/infra/{templateId} [put]

func RestPutInfraPolicy added in v0.12.6

func RestPutInfraPolicy(c echo.Context) error
function RestPutInfraPolicy not yet implemented

// RestPutInfraPolicy godoc // @ID PutInfraPolicy // @Summary Update Infra Policy // @Description Update Infra Policy // @Tags [MC-Infra] Infra Orchestration Management (WIP) // @Accept json // @Produce json // @Param infraInfo body InfraPolicyInfo true "Details for an Infra Policy object" // @Success 200 {object} InfraPolicyInfo // @Failure 404 {object} model.SimpleMsg // @Failure 500 {object} model.SimpleMsg // @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)" // @Router /ns/{nsId}/policy/infra/{infraId} [put]

func RestPutMonitorAgentStatusInstalled

func RestPutMonitorAgentStatusInstalled(c echo.Context) error

RestPutMonitorAgentStatusInstalled godoc @ID PutMonitorAgentStatusInstalled @Summary Set monitoring agent (CB-Dragonfly agent) installation status installed (for Windows node only) @Description Set monitoring agent (CB-Dragonfly agent) installation status installed (for Windows node only) @Tags [MC-Infra] Infra Resource Monitor (for developer) @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param infraId path string true "Infra ID" default(infra01) @Param nodeId path string true "Node ID" default(node01) @Success 200 {object} model.NodeInfo @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @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)" @Router /ns/{nsId}/monitoring/status/infra/{infraId}/node/{nodeId} [put]

func RestPutNLB

func RestPutNLB(c echo.Context) error
function RestPutNLB not yet implemented

// RestPutNLB godoc // @ID PutNLB // @Summary Update NLB // @Description Update NLB // @Tags [Infra Resource] NLB Management // @Accept json // @Produce json // @Param nsId path string true "Namespace ID" default(default) // @Param infraId path string true "Infra ID" default(infra01) // @Param nlbId path string true "NLB ID" default(g1) // @Param nlbInfo body model.NLBInfo true "Details of the NLB object" // @Success 200 {object} model.NLBInfo // @Failure 404 {object} model.SimpleMsg // @Failure 500 {object} model.SimpleMsg // @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)" // @Router /ns/{nsId}/infra/{infraId}/nlb/{nlbId} [put]

func RestPutScheduleRegisterCspResources added in v0.11.16

func RestPutScheduleRegisterCspResources(c echo.Context) error

RestPutScheduleRegisterCspResources godoc @ID PutScheduleRegisterCspResources @Summary Update scheduled job configuration @Description Update the configuration of a scheduled CSP resource registration job (interval, enabled status) @Description @Description **Updatable Fields:** @Description - `intervalSeconds`: Change execution frequency (minimum 10 seconds) @Description - `enabled`: Enable (true) or disable (false) the job @Description @Description **Usage Examples:** @Description - Change interval: `{"intervalSeconds": 30}` (30 seconds) @Description - Pause job: `{"enabled": false}` @Description - Resume job: `{"enabled": true}` @Description - Change both: `{"intervalSeconds": 10, "enabled": true}` @Description @Description **Note:** For simpler pause/resume operations, consider using dedicated `/pause` and `/resume` endpoints @Tags [Job Scheduler] (WIP) CSP Resource Registration @Accept json @Produce json @Param jobId path string true "Job ID" @Param updateRequest body model.UpdateScheduleJobRequest true "Update schedule job request" @Success 200 {object} model.ScheduleJobStatus @Failure 400 {object} model.SimpleMsg @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @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)" @Router /registerCspResources/schedule/{jobId} [put]

func RestPutScheduleRegisterCspResourcesPause added in v0.11.16

func RestPutScheduleRegisterCspResourcesPause(c echo.Context) error

RestPutScheduleRegisterCspResourcesPause godoc @ID PutScheduleRegisterCspResourcesPause @Summary Pause a scheduled job @Description Temporarily pause a scheduled job without deleting it. The job can be resumed later. @Description This sets enabled=false and preserves all job state and execution history. @Tags [Job Scheduler] (WIP) CSP Resource Registration @Accept json @Produce json @Param jobId path string true "Job ID" @Success 200 {object} model.ScheduleJobStatus @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @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)" @Router /registerCspResources/schedule/{jobId}/pause [put]

func RestPutScheduleRegisterCspResourcesResume added in v0.11.16

func RestPutScheduleRegisterCspResourcesResume(c echo.Context) error

RestPutScheduleRegisterCspResourcesResume godoc @ID PutScheduleRegisterCspResourcesResume @Summary Resume a paused scheduled job @Description Resume a previously paused scheduled job to continue periodic execution. @Description This sets enabled=true and restarts the job scheduler. @Tags [Job Scheduler] (WIP) CSP Resource Registration @Accept json @Produce json @Param jobId path string true "Job ID" @Success 200 {object} model.ScheduleJobStatus @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @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)" @Router /registerCspResources/schedule/{jobId}/resume [put]

func RestRecommendAlternativeNodeConfig added in v0.12.14

func RestRecommendAlternativeNodeConfig(c echo.Context) error

RestRecommendAlternativeNodeConfig godoc @ID RecommendAlternativeNodeConfig @Summary Recommend alternative node configurations in a target CSP/region @Description Given a nodegroup configuration (source spec + image), find the best-matching @Description spec and image combinations in a target CSP/region. @Description Per-field match policies (required / preferred / open) give fine-grained control over @Description which attributes must match exactly, which may vary within a tolerance, and which are ignored. @Description Similarity scores (0–100) are computed from "preferred" fields only. @Tags [MC-Infra] Infra Provisioning and Management @Accept json @Produce json @Param recommendAlternativeNodeConfigReq body model.RecommendAlternativeNodeConfigReq true "Source nodegroup config and target CSP/region with match criteria" @Param x-request-id header string false "Custom request ID for tracking" @Success 200 {object} model.RecommendAlternativeNodeConfigResponse @Failure 400 {object} model.SimpleMsg @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @Router /recommendAlternativeNodeConfig [post]

func RestRecommendSpec added in v0.11.4

func RestRecommendSpec(c echo.Context) error

RestRecommendSpec godoc @ID RecommendSpec @Summary Recommend specs for configuring an infrastructure (filter and priority) @Description Recommend specs for configuring an infrastructure (filter and priority) @Description Find details from https://github.com/cloud-barista/cb-tumblebug/discussions/1234 @Description Get available options by /recommendSpecOptions for filtering and prioritizing specs in RecommendSpec API @Tags [MC-Infra] Infra Provisioning and Management @Accept json @Produce json @Param recommendSpecReq body model.RecommendSpecReq false "Conditions for recommending specs (filter and priority)" @Param x-request-id header string false "Custom request ID for tracking" @Param x-credential-holder header string false "Credential holder ID to filter specs by the holder's available providers (default: system default holder which shows all providers)" @Success 200 {object} []model.SpecInfo @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @Router /recommendSpec [post]

func RestRecommendSpecOptions added in v0.11.9

func RestRecommendSpecOptions(c echo.Context) error

RestRecommendSpecOptions godoc @ID RecommendSpecOptions @Summary Get options for RecommendSpec API @Description Get available options for filtering and prioritizing specs in RecommendSpec API @Tags [MC-Infra] Infra Provisioning and Management @Accept json @Produce json @Success 200 {object} model.RecommendSpecRequestOptions @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @Param x-request-id header string false "Custom request ID for tracking" @Router /recommendSpecOptions [get]

func RestRecordProvisioningEvent added in v0.11.3

func RestRecordProvisioningEvent(c echo.Context) error

RestRecordProvisioningEvent godoc @ID RecordProvisioningEvent @Summary Record Manual Provisioning Event @Description Manually record a provisioning success or failure event for historical tracking and analysis. @Description This endpoint allows external systems or manual processes to contribute to provisioning history: @Description @Description **Use Cases:** @Description - **External Provisioning Tools**: Record events from non-CB-Tumblebug provisioning systems @Description - **Manual Testing**: Log results from manual deployment tests @Description - **Migration**: Import historical data from other systems @Description - **Integration**: Connect with CI/CD pipelines for comprehensive tracking @Description @Description **Event Types:** @Description - **Success Events**: Only recorded if previous failures exist for the spec @Description - **Failure Events**: Always recorded to build failure pattern database @Description @Description **Data Quality:** @Description - Provide accurate timestamps for proper chronological analysis @Description - Include detailed error messages for failure events @Description - Use consistent spec ID and image name formats @Description @Description **Impact on System:** @Description - Contributes to risk analysis algorithms @Description - Affects future Infra review recommendations @Description - Builds historical baseline for reliability metrics @Tags [Admin] Provisioning History and Analytics @Accept json @Produce json @Param provisioningEvent body model.ProvisioningEvent true "Provisioning event details with success/failure information" @Success 200 {object} model.SimpleMsg "Provisioning event successfully recorded" @Failure 400 {object} model.SimpleMsg "Invalid event data or missing required fields" @Failure 500 {object} model.SimpleMsg "Internal server error while recording event" @Param x-request-id header string false "Custom request ID for tracking" @Router /provisioning/event [post]

func RestRemoveBastionNodes

func RestRemoveBastionNodes(c echo.Context) error

RestRemoveBastionNodes godoc @ID RemoveBastionNodes @Summary Remove a bastion node from all vNets @Description Remove a bastion node from all vNets @Tags [MC-Infra] Infra Remote Command @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param infraId path string true "Infra ID" default(infra01) @Param bastionNodeId path string true "Bastion Node ID" default(g1-1) @Success 200 {object} model.SimpleMsg @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @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)" @Router /ns/{nsId}/infra/{infraId}/bastion/{bastionNodeId} [delete]

func RestRemoveBastionNodesWithInfra added in v0.12.6

func RestRemoveBastionNodesWithInfra(c echo.Context) error

RestRemoveBastionNodesWithInfra godoc @ID RemoveBastionNodesWithInfra @Summary Remove a bastion node (cross-Infra) from all vNets @Description Remove a specific cross-Infra bastion from all vNets of the target Infra @Tags [MC-Infra] Infra Remote Command @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param infraId path string true "Target Infra ID" default(infra01) @Param bastionInfraId path string true "Bastion Infra ID" @Param bastionNodeId path string true "Bastion Node ID" @Success 200 {object} model.SimpleMsg @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @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)" @Router /ns/{nsId}/infra/{infraId}/bastion/{bastionInfraId}/{bastionNodeId} [delete]

func RestRemoveBastionNodesWithNs added in v0.12.5

func RestRemoveBastionNodesWithNs(c echo.Context) error

RestRemoveBastionNodesWithNs godoc @ID RemoveBastionNodesWithNs @Summary Remove a bastion node (cross-namespace) from all vNets @Description Remove a specific cross-namespace bastion from all vNets of the target Infra @Tags [MC-Infra] Infra Remote Command @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param infraId path string true "Target Infra ID" default(infra01) @Param bastionNsId path string true "Bastion Namespace ID" @Param bastionInfraId path string true "Bastion Infra ID" @Param bastionNodeId path string true "Bastion Node ID" @Success 200 {object} model.SimpleMsg @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @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)" @Router /ns/{nsId}/infra/{infraId}/bastion/{bastionNsId}/{bastionInfraId}/{bastionNodeId} [delete]

func RestRemoveNLBNodes added in v0.12.6

func RestRemoveNLBNodes(c echo.Context) error

RestRemoveNLBNodes godoc @ID RemoveNLBNodes @Summary Delete nodes from NLB @Description Delete nodes from NLB @Tags [Infra Resource] NLB Management (for developer) @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param infraId path string true "Infra ID" default(infra01) @Param nlbId path string true "NLB ID" default(g1) @Param nlbAddRemoveNodeReq body model.NLBAddRemoveNodeReq true "Select nodes to remove from NLB" @Success 200 {object} model.SimpleMsg @Failure 404 {object} model.SimpleMsg @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)" @Router /ns/{nsId}/infra/{infraId}/nlb/{nlbId}/node [delete]

func RestSetBastionNodes

func RestSetBastionNodes(c echo.Context) error

RestSetBastionNodes godoc @ID SetBastionNodes @Summary Set bastion nodes for a node @Description Set bastion nodes for a node @Tags [MC-Infra] Infra Remote Command @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param infraId path string true "Infra ID" default(infra01) @Param targetNodeId path string true "Target Node ID" default(g1-1) @Param bastionNodeId path string true "Bastion Node ID" default(g1-1) @Success 200 {object} model.SimpleMsg @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @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)" @Router /ns/{nsId}/infra/{infraId}/node/{targetNodeId}/bastion/{bastionNodeId} [put]

func RestSetBastionNodesWithInfra added in v0.12.6

func RestSetBastionNodesWithInfra(c echo.Context) error

RestSetBastionNodesWithInfra godoc @ID SetBastionNodesWithInfra @Summary Set bastion nodes for a node using a bastion from another Infra (same namespace) @Description Set bastion nodes for a target node, specifying a bastion node that belongs to a different Infra within the same namespace (cross-Infra bastion). This allows, for example, an AWS node to serve as a bastion for an OpenStack node. @Tags [MC-Infra] Infra Remote Command @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param infraId path string true "Target Infra ID" default(infra01) @Param targetNodeId path string true "Target Node ID" default(g1-1) @Param bastionInfraId path string true "Bastion Infra ID (may differ from target Infra)" default(infra-bastion) @Param bastionNodeId path string true "Bastion Node ID" default(g1-1) @Success 200 {object} model.SimpleMsg @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @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)" @Router /ns/{nsId}/infra/{infraId}/node/{targetNodeId}/bastion/{bastionInfraId}/{bastionNodeId} [put]

func RestSetBastionNodesWithNs added in v0.12.5

func RestSetBastionNodesWithNs(c echo.Context) error

RestSetBastionNodesWithNs godoc @ID SetBastionNodesWithNs @Summary Set bastion nodes for a node using a bastion from a different namespace and Infra @Description Set bastion nodes for a target node, specifying a bastion node that belongs to a different namespace and Infra (cross-namespace bastion). This allows, for example, a node in a shared-services namespace to act as a bastion for nodes in other namespaces. @Tags [MC-Infra] Infra Remote Command @Accept json @Produce json @Param nsId path string true "Target Namespace ID" default(default) @Param infraId path string true "Target Infra ID" default(infra01) @Param targetNodeId path string true "Target Node ID" default(g1-1) @Param bastionNsId path string true "Bastion Namespace ID (may differ from target namespace)" default(ns-bastion) @Param bastionInfraId path string true "Bastion Infra ID" default(infra-bastion) @Param bastionNodeId path string true "Bastion Node ID" default(g1-1) @Success 200 {object} model.SimpleMsg @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @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)" @Router /ns/{nsId}/infra/{infraId}/node/{targetNodeId}/bastion/{bastionNsId}/{bastionInfraId}/{bastionNodeId} [put]

Types

type JSONResult

type JSONResult struct {
}

JSONResult is a dummy struct for Swagger annotations.

type RestGetAllBenchmarkRequest

type RestGetAllBenchmarkRequest struct {
	Host string `json:"host"`
}

Request struct for RestGetAllBenchmark

type RestGetAllInfraPolicyResponse added in v0.12.6

type RestGetAllInfraPolicyResponse struct {
	InfraPolicy []model.InfraPolicyInfo `json:"infraPolicy"`
}

Response structure for RestGetAllInfraPolicy

type RestGetAllInfraResponse added in v0.12.6

type RestGetAllInfraResponse struct {
	Infra []model.InfraInfo `json:"infra"`
}

RestGetAllInfraResponse is a response structure for RestGetAllInfra

type RestGetAllInfraStatusResponse added in v0.12.6

type RestGetAllInfraStatusResponse struct {
	Infra []model.InfraStatusInfo `json:"infra"`
}

RestGetAllInfraStatusResponse is a response structure for RestGetAllInfraStatus

type RestGetAllNLBResponse

type RestGetAllNLBResponse struct {
	NLB []model.NLBInfo `json:"nlb"`
}

Response structure for RestGetAllNLB

type RestGetBenchmarkRequest

type RestGetBenchmarkRequest struct {
	Host string `json:"host"`
}

type RestPostInfraRecommendResponse added in v0.12.6

type RestPostInfraRecommendResponse struct {
	//VmReq          []VmRecommendReq    `json:"nodeReq"`
	NodeRecommend  []model.NodeRecommendInfo `json:"nodeRecommend"`
	PlacementAlgo  string                    `json:"placementAlgo"`
	PlacementParam []model.KeyValue          `json:"placementParam"`
}

Jump to

Keyboard shortcuts

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