resource

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2025 License: Apache-2.0 Imports: 17 Imported by: 1

Documentation

Overview

Package resource is to handle REST API for resource

Package resource is to handle REST API for resource

Package resource is to handle REST API for resource

Package resource is to handle REST API for resource

Package resource is to handle REST API for resource

Package resource is to handle REST API for resource

Package mci is to handle REST API for mci

Package resource is to handle REST API for resource

Package resource is to handle REST API for resource

Package mci is to handle REST API for mci

Package resource is to handle REST API for resource

Package resource is to handle REST API for resource

Package resource is to handle REST API for resource

Package mci is to handle REST API for mci

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateObjectStorage added in v0.11.10

func CreateObjectStorage(c echo.Context) error

RestCreateObjectStorage godoc @ID CreateObjectStorage @Summary Create an object storage (bucket) @Description Create an object storage (bucket) @Description @Description **Important Notes:** @Description - The `objectStorageName` must be globally unique across all existing buckets in the S3 compatible storage. @Description - The bucket namespace is shared by all users of the system. @Tags [Infra Resource] Object Storage Management @Accept xml @Produce xml @Param objectStorageName path string true "Object Storage Name" default(globally-unique-bucket-hctdx3) @Param credential header string true "This represents a credential or an access key ID. The required format is `{csp-region}` (i.e., the connection name)." default(aws-ap-northeast-2) @Success 200 "OK" @Router /resources/objectStorage/{objectStorageName} [put]

func DeleteDataObject added in v0.11.10

func DeleteDataObject(c echo.Context) error

RestDeleteDataObject godoc @ID DeleteDataObject @Summary Delete an object from a bucket @Description Delete an object from a bucket @Tags [Infra Resource] Object Storage Management @Accept xml @Produce xml @Param objectStorageName path string true "Object Storage Name" default(globally-unique-bucket-hctdx3) @Param objectKey path string true "Object Name" default(test-object.txt) @Param credential header string true "This represents a credential or an access key ID. The required format is `{csp-region}` (i.e., the connection name)." default(aws-ap-northeast-2) @Success 204 "No Content" @Router /resources/objectStorage/{objectStorageName}/{objectKey} [delete]

func DeleteMultipleDataObjects added in v0.11.10

func DeleteMultipleDataObjects(c echo.Context) error

RestDeleteMultipleDataObjects godoc @ID DeleteMultipleDataObjects @Summary **Delete** multiple objects from a bucket @Description `Delete` multiple objects from a bucket @Description @Description **Important Notes:** @Description - The request body must contain the list of objects to delete in XML format @Description - The `delete` query parameter must be set to `true` @Description @Description **Request Body Example:** @Description ```xml @Description <?xml version="1.0" encoding="UTF-8"?> @Description <Delete xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> @Description <Object> @Description <Key>test-object1.txt</Key> @Description </Object> @Description <Object> @Description <Key>test-object2.txt</Key> @Description </Object> @Description </Delete> @Description ``` @Description @Description **Actual XML Response Example:** @Description ```xml @Description <?xml version="1.0" encoding="UTF-8"?> @Description <DeleteResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> @Description <Deleted> @Description <Key>test-object1.txt</Key> @Description </Deleted> @Description <Deleted> @Description <Key>test-object2.txt</Key> @Description </Deleted> @Description </DeleteResult> @Description ``` @Tags [Infra Resource] Object Storage Management @Accept xml @Produce xml @Param objectStorageName path string true "Object Storage Name" default(globally-unique-bucket-hctdx3) @Param delete query boolean true "Delete" default(true) enum(true) @Param credential header string true "This represents a credential or an access key ID. The required format is `{csp-region}` (i.e., the connection name)." default(aws-ap-northeast-2) @Param reqBody body Delete true "List of objects to delete" @Success 200 {object} DeleteResult "OK" @Router /resources/objectStorage/{objectStorageName} [post]

func DeleteObjectStorage added in v0.11.10

func DeleteObjectStorage(c echo.Context) error

RestDeleteObjectStorage godoc @ID DeleteObjectStorage @Summary Delete an object storage (bucket) @Description Delete an object storage (bucket) @Tags [Infra Resource] Object Storage Management @Accept xml @Produce xml @Param objectStorageName path string true "Object Storage Name" default(globally-unique-bucket-hctdx3) @Param credential header string true "This represents a credential or an access key ID. The required format is `{csp-region}` (i.e., the connection name)." default(aws-ap-northeast-2) @Success 204 "No Content" @Router /resources/objectStorage/{objectStorageName} [delete]

func DeleteObjectStorageCORS added in v0.11.10

func DeleteObjectStorageCORS(c echo.Context) error

RestDeleteObjectStorageCORS godoc @ID DeleteObjectStorageCORS @Summary Delete CORS configuration of an object storage (bucket) @Description Delete CORS configuration of an object storage (bucket) @Tags [Infra Resource] Object Storage Management @Accept xml @Produce xml @Param objectStorageName path string true "Object Storage Name" default(globally-unique-bucket-hctdx3) @Param credential header string true "This represents a credential or an access key ID. The required format is `{csp-region}` (i.e., the connection name)." default(aws-ap-northeast-2) @Success 204 "No Content" @Router /resources/objectStorage/{objectStorageName}/cors [delete]

func DeleteVersionedObject added in v0.11.10

func DeleteVersionedObject(c echo.Context) error

RestDeleteVersionedObject godoc @ID DeleteVersionedObject @Summary Delete a specific version of an object in an object storage (bucket) @Description Delete a specific version of an object in an object storage (bucket) @Tags [Infra Resource] Object Storage Management @Accept xml @Produce xml @Param objectStorageName path string true "Object Storage Name" default(globally-unique-bucket-hctdx3) @Param objectKey path string true "Object Key" default(test-file.txt) @Param versionId query string true "Version ID" default(yb4PgjnFVD2LfRZHXBjjsHBkQRHlu.TZ) @Param credential header string true "This represents a credential or an access key ID. The required format is `{csp-region}` (i.e., the connection name)." default(aws-ap-northeast-2) @Success 204 "No Content" @Router /resources/objectStorage/{objectStorageName}/versions/{objectKey} [delete]

func ExistObjectStorage added in v0.11.10

func ExistObjectStorage(c echo.Context) error

RestExistObjectStorage godoc @ID ExistObjectStorage @Summary Check existence of an object storage (bucket) @Description Check existence of an object storage (bucket) @Tags [Infra Resource] Object Storage Management @Accept xml @Produce xml @Param objectStorageName path string true "Object Storage Name" default(globally-unique-bucket-hctdx3) @Param credential header string true "This represents a credential or an access key ID. The required format is `{csp-region}` (i.e., the connection name)." default(aws-ap-northeast-2) @Success 200 "OK" @Failure 404 "Not Found" @Router /resources/objectStorage/{objectStorageName} [head]

func ExtractSitesInfoFromMciInfo

func ExtractSitesInfoFromMciInfo(nsId, mciId string) (*model.SitesInfo, error)

func GeneratePresignedDownloadURL added in v0.11.10

func GeneratePresignedDownloadURL(c echo.Context) error

RestGeneratePresignedDownloadURL godoc @ID GeneratePresignedDownloadURL @Summary Generate a presigned URL for downloading an object from a bucket @Description Generate a presigned URL for downloading an object from a bucket @Description @Description **Important Notes:** @Description - The actual response will be XML format with root element `PresignedURLResult` @Description - The `expires` query parameter specifies the expiration time in seconds for the presigned URL (default: 3600 seconds) @Description - The generated presigned URL can be used to download the object directly without further authentication @Description @Description **Actual XML Response Example:** @Description ```xml @Description <?xml version="1.0" encoding="UTF-8"?> @Description <PresignedURLResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> @Description <PresignedURL>https://globally-unique-bucket-hctdx3.s3.dualstack.ap-southeast-2.amazonaws.com/test-file.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIA***EXAMPLE%2F20250904%2Fap-southeast-2%2Fs3%2Faws4_request&X-Amz-Date=20250904T061448Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=***-signature</PresignedURL> @Description <Expires>3600</Expires> @Description <Method>GET</Method> @Description </PresignedURLResult> @Description ``` @Tags [Infra Resource] Object Storage Management @Accept json @Produce json @Param objectStorageName path string true "Object Storage Name" default(globally-unique-bucket-hctdx3) @Param objectKey path string true "Object Name" default(test-object.txt) @Param credential header string true "This represents a credential or an access key ID. The required format is `{csp-region}` (i.e., the connection name)." default(aws-ap-northeast-2) @Param expires query int false "Expiration time in seconds for the presigned URL" default(3600) @Success 200 {object} PresignedURLResult "OK" @Router /resources/objectStorage/presigned/download/{objectStorageName}/{objectKey} [get]

func GeneratePresignedUploadURL added in v0.11.10

func GeneratePresignedUploadURL(c echo.Context) error

RestGeneratePresignedUploadURL godoc @ID GeneratePresignedUploadURL @Summary Generate a presigned URL for uploading an object to a bucket @Description Generate a presigned URL for uploading an object to a bucket @Description @Description **Important Notes:** @Description - The actual response will be XML format with root element `PresignedURLResult` @Description - The `expires` query parameter specifies the expiration time in seconds for the presigned URL (default: 3600 seconds) @Description - The generated presigned URL can be used to upload the object directly without further authentication @Description @Description **Actual XML Response Example:** @Description ```xml @Description <?xml version="1.0" encoding="UTF-8"?> @Description <PresignedURLResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> @Description <PresignedURL>https://globally-unique-bucket-hctdx3.s3.dualstack.ap-southeast-2.amazonaws.com/test-file.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIA***EXAMPLE%2F20250904%2Fap-southeast-2%2Fs3%2Faws4_request&X-Amz-Date=20250904T061448Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=***-signature</PresignedURL> @Description <Expires>3600</Expires> @Description <Method>PUT</Method> @Description </PresignedURLResult> @Description ``` @Tags [Infra Resource] Object Storage Management @Accept json @Produce json @Param objectStorageName path string true "Object Storage Name" default(globally-unique-bucket-hctdx3) @Param objectKey path string true "Object Name" default(test-object.txt) @Param credential header string true "This represents a credential or an access key ID. The required format is `{csp-region}` (i.e., the connection name)." default(aws-ap-northeast-2) @Param expires query int false "Expiration time in seconds for the presigned URL" default(3600) @Success 200 {object} PresignedURLResult "OK" @Router /resources/objectStorage/presigned/upload/{objectStorageName}/{objectKey} [get]

func GetDataObjectInfo added in v0.11.10

func GetDataObjectInfo(c echo.Context) error

RestGetDataObjectInfo godoc @ID GetObjectInfoGetDataObjectInfo @Summary Get an object info from a bucket @Description Get an object info from a bucket @Description @Description **Important Notes:** @Description - The generated `Download file` link in Swagger UI may not work because this API get the object metadata only. @Tags [Infra Resource] Object Storage Management @Accept xml @Produce octet-stream @Param objectStorageName path string true "Object Storage Name" default(globally-unique-bucket-hctdx3) @Param objectKey path string true "Object Name" default(test-object.txt) @Param credential header string true "This represents a credential or an access key ID. The required format is `{csp-region}` (i.e., the connection name)." default(aws-ap-northeast-2) @Success 200 "OK" @Router /resources/objectStorage/{objectStorageName}/{objectKey} [head]

func GetObjectStorage added in v0.11.10

func GetObjectStorage(c echo.Context) error

RestGetObjectStorage godoc @ID GetObjectStorage @Summary Get details of an object storage (bucket) @Description Get details of an object storage (bucket) @Description @Description **Important Notes:** @Description - The actual response will be XML format with root element `ListBucketResult` @Description @Description **Actual XML Response Example:** @Description ```xml @Description <?xml version="1.0" encoding="UTF-8"?> @Description <ListBucketResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> @Description <Name>spider-test-bucket</Name> @Description <Prefix></Prefix> @Description <Marker></Marker> @Description <MaxKeys>1000</MaxKeys> @Description <IsTruncated>false</IsTruncated> @Description </ListBucketResult> @Description ``` @Tags [Infra Resource] Object Storage Management @Accept xml @Produce xml @Param objectStorageName path string true "Object Storage Name" default(globally-unique-bucket-hctdx3) @Param credential header string true "This represents a credential or an access key ID. The required format is `{csp-region}` (i.e., the connection name)." default(aws-ap-northeast-2) @Success 200 {object} ListBucketResult "OK" @Router /resources/objectStorage/{objectStorageName} [get]

func GetObjectStorageCORS added in v0.11.10

func GetObjectStorageCORS(c echo.Context) error

RestGetObjectStorageCORS @ID GetObjectStorageCORS @Summary Get CORS configuration of an object storage (bucket) @Description Get CORS configuration of an object storage (bucket) @Description @Description **Important Notes:** @Description - The actual response will be XML format with root element `CORSConfiguration` @Description @Description **Actual XML Response Example:** @Description ```xml @Description <?xml version="1.0" encoding="UTF-8"?> @Description <CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> @Description <CORSRule> @Description <AllowedOrigin>*</AllowedOrigin> @Description <AllowedMethod>GET</AllowedMethod> @Description <AllowedMethod>PUT</AllowedMethod> @Description <AllowedMethod>POST</AllowedMethod> @Description <AllowedMethod>DELETE</AllowedMethod> @Description <AllowedHeader>*</AllowedHeader> @Description <ExposeHeader>ETag</ExposeHeader> @Description <ExposeHeader>x-amz-server-side-encryption</ExposeHeader> @Description <ExposeHeader>x-amz-request-id</ExposeHeader> @Description <ExposeHeader>x-amz-id-2</ExposeHeader> @Description <MaxAgeSeconds>3000</MaxAgeSeconds> @Description </CORSRule> @Description </CORSConfiguration> @Description ``` @Description @Description **Error Response Example (if CORS not configured):** @Description ```xml @Description <?xml version="1.0" encoding="UTF-8"?> @Description <Error> @Description <Code>NoSuchCORSConfiguration</Code> @Description <Message>The CORS configuration does not exist</Message> @Description <Resource>/example-bucket</Resource> @Description <RequestId>656c76696e6727732072657175657374</RequestId> @Description </Error> @Description ``` @Tags [Infra Resource] Object Storage Management @Accept xml @Produce xml @Param objectStorageName path string true "Object Storage Name" default(globally-unique-bucket-hctdx3) @Param credential header string true "This represents a credential or an access key ID. The required format is `{csp-region}` (i.e., the connection name)." default(aws-ap-northeast-2) @Success 200 {object} CORSConfiguration "OK" @Failure 404 {object} Error "Not Found" @Router /resources/objectStorage/{objectStorageName}/cors [get]

func GetObjectStorageLocation added in v0.11.10

func GetObjectStorageLocation(c echo.Context) error

RestGetObjectStorageLocation godoc @ID GetObjectStorageLocation @Summary Get the location of an object storage (bucket) @Description Get the location of an object storage (bucket) @Description @Description **Important Notes:** @Description - The actual response will be XML format with root element `LocationConstraint` @Description @Description **Actual XML Response Example:** @Description ```xml @Description <?xml version="1.0" encoding="UTF-8"?> @Description <LocationConstraint xmlns="http://s3.amazonaws.com/doc/2006-03-01/">ap-northeast-2</LocationConstraint> @Description ``` @Tags [Infra Resource] Object Storage Management @Accept xml @Produce xml @Param objectStorageName path string true "Object Storage Name" default(globally-unique-bucket-hctdx3) @Param credential header string true "This represents a credential or an access key ID. The required format is `{csp-region}` (i.e., the connection name)." default(aws-ap-northeast-2) @Success 200 {object} LocationConstraint "OK" @Router /resources/objectStorage/{objectStorageName}/location [get]

func GetObjectStorageVersioning added in v0.11.10

func GetObjectStorageVersioning(c echo.Context) error

RestGetObjectStorageVersioning godoc @ID GetObjectStorageVersioning @Summary Get versioning status of an object storage (bucket) @Description Get versioning status of an object storage (bucket) @Description @Description **Important Notes:** @Description - The actual response will be XML format with root element `VersioningConfiguration` @Description @Description **Actual XML Response Example:** @Description ```xml @Description <?xml version="1.0" encoding="UTF-8"?> @Description <VersioningConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> @Description <Status>Enabled</Status> @Description </VersioningConfiguration> @Description ``` @Tags [Infra Resource] Object Storage Management @Accept xml @Produce xml @Param objectStorageName path string true "Object Storage Name" default(globally-unique-bucket-hctdx3) @Param credential header string true "This represents a credential or an access key ID. The required format is `{csp-region}` (i.e., the connection name)." default(aws-ap-northeast-2) @Success 200 {object} VersioningConfiguration "OK" @Router /resources/objectStorage/{objectStorageName}/versioning [get]

func ListObjectStorages added in v0.11.10

func ListObjectStorages(c echo.Context) error

RestListObjectStorages godoc @ID ListObjectStorages @Summary List object storages (buckets) @Description Get the list of all object storages (buckets) @Description @Description **Important Notes:** @Description - The actual response will be XML format with root element `ListAllMyBucketsResult` @Description - The response includes xmlns attribute: `xmlns="http://s3.amazonaws.com/doc/2006-03-01/"` @Description - Swagger UI may show `resource.ListAllMyBucketsResult` due to rendering limitations @Description @Description **Actual XML Response Example:** @Description ```xml @Description <?xml version="1.0" encoding="UTF-8"?> @Description <ListAllMyBucketsResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> @Description <Owner> @Description <ID>aws-ap-northeast-2</ID> @Description <DisplayName>aws-ap-northeast-2</DisplayName> @Description </Owner> @Description <Buckets> @Description </Buckets> @Description </ListAllMyBucketsResult> @Description ``` @Tags [Infra Resource] Object Storage Management @Accept xml @Produce xml @Param credential header string true "This represents a credential or an access key ID. The required format is `{csp-region}` (i.e., the connection name)." default(aws-ap-northeast-2) @Success 200 {object} ListAllMyBucketsResult "OK" @Router /resources/objectStorage [get]

func ListObjectVersions added in v0.11.10

func ListObjectVersions(c echo.Context) error

RestListObjectVersions godoc @ID ListObjectVersions @Summary List object versions in an object storage (bucket) @Description List object versions in an object storage (bucket) @Description @Description **Important Notes:** @Description - The actual response will be XML format with root element `ListVersionsResult` @Description @Description **Actual XML Response Example:** @Description ```xml @Description <?xml version="1.0" encoding="UTF-8"?> @Description <ListVersionsResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> @Description <Name>spider-test-bucket</Name> @Description <Prefix></Prefix> @Description <KeyMarker></KeyMarker> @Description <VersionIdMarker></VersionIdMarker> @Description <NextKeyMarker></NextKeyMarker> @Description <NextVersionIdMarker></NextVersionIdMarker> @Description <MaxKeys>1000</MaxKeys> @Description <IsTruncated>false</IsTruncated> @Description <Version> @Description <Key>test-file.txt</Key> @Description <VersionId>yb4PgjnFVD2LfRZHXBjjsHBkQRHlu.TZ</VersionId> @Description <IsLatest>true</IsLatest> @Description <LastModified>2025-09-04T04:24:12Z</LastModified> @Description <ETag>23228a38faecd0591107818c7281cece</ETag> @Description <Size>23</Size> @Description <StorageClass>STANDARD</StorageClass> @Description <Owner> @Description <ID>aws-config01</ID> @Description <DisplayName>aws-config01</DisplayName> @Description </Owner> @Description </Version> @Description </ListVersionsResult> @Description ``` @Tags [Infra Resource] Object Storage Management @Accept xml @Produce xml @Param objectStorageName path string true "Object Storage Name" default(globally-unique-bucket-hctdx3) @Param credential header string true "This represents a credential or an access key ID. The required format is `{csp-region}` (i.e., the connection name)." default(aws-ap-northeast-2) @Success 200 {object} ListVersionsResult "OK" @Router /resources/objectStorage/{objectStorageName}/versions [get]

func RestCheckK8sNodeGroupsOnK8sCreation

func RestCheckK8sNodeGroupsOnK8sCreation(c echo.Context) error

RestCheckK8sNodeGroupsOnK8sCreation func is a rest api wrapper for GetModelK8sNodeGroupsOnK8sCreation. RestCheckK8sNodeGroupsOnK8sCreation godoc @ID CheckK8sNodeGroupsOnK8sCreation @Summary Check whether nodegroups are required during the K8sCluster creation @Description Check whether nodegroups are required during the K8sCluster creation @Tags [Kubernetes] Cluster Management @Accept json @Produce json @Param providerName query string true "Name of the CSP to retrieve" @Success 200 {object} model.K8sClusterNodeGroupsOnCreation @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @Router /checkK8sNodeGroupsOnK8sCreation [get]

func RestCheckK8sNodeImageDesignation

func RestCheckK8sNodeImageDesignation(c echo.Context) error

RestCheckK8sNodeImageDesignation func is a rest api wrapper for GetK8sNodeImageDesignation. RestCheckK8sNodeImageDesignation godoc @ID CheckK8sNodeImageDesignation @Summary Check whether node image designation is possible to create a K8sCluster @Description Check whether node image designation is possible to create a K8sCluster @Tags [Kubernetes] Cluster Management @Accept json @Produce json @Param providerName query string true "Name of the CSP to retrieve" @Success 200 {object} model.K8sClusterNodeImageDesignation @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @Router /checkK8sNodeImageDesignation [get]

func RestCheckResource

func RestCheckResource(c echo.Context) error

RestCheckResource godoc @ID CheckResource @Summary Check resources' existence @Description Check resources' existence @Tags [Infra Resource] Common Utility @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param resourceType path string true "Resource Type" @Param resourceId path string true "Resource ID" @Success 200 {object} model.SimpleMsg @Failure 404 {object} model.SimpleMsg @Router /ns/{nsId}/checkResource/{resourceType}/{resourceId} [get]

func RestCreateSharedResource

func RestCreateSharedResource(c echo.Context) error

RestCreateSharedResource godoc @ID CreateSharedResource @Summary Create shared resources for MC-Infra @Description Create shared resources for MC-Infra @Tags [Infra Resource] Common Utility @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param option query string true "Option" Enums(all,vnet,sg,sshkey) @Param connectionName query string false "connectionName of cloud for designated resource" default() @Success 200 {object} model.SimpleMsg @Failure 404 {object} model.SimpleMsg @Router /ns/{nsId}/sharedResource [post]

func RestDelAllCustomImage

func RestDelAllCustomImage(c echo.Context) error

RestDelAllCustomImage godoc @ID DelAllCustomImage @Summary Delete all customImages @Description Delete all customImages @Tags [Infra Resource] Image Management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param match query string false "Delete resources containing matched ID-substring only" default() @Success 200 {object} model.IdList @Failure 404 {object} model.SimpleMsg @Router /ns/{nsId}/resources/customImage [delete]

func RestDelAllDataDisk

func RestDelAllDataDisk(c echo.Context) error

RestDelAllDataDisk godoc @ID DelAllDataDisk @Summary Delete all Data Disks @Description Delete all Data Disks @Tags [Infra Resource] Data Disk Management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param match query string false "Delete resources containing matched ID-substring only" default() @Success 200 {object} model.IdList @Failure 404 {object} model.SimpleMsg @Router /ns/{nsId}/resources/dataDisk [delete]

func RestDelAllImage

func RestDelAllImage(c echo.Context) error

RestDelAllImage godoc @ID DelAllImage @Summary Delete all images @Description Delete all images @Tags [Infra Resource] Image Management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(system) @Param match query string false "Delete resources containing matched ID-substring only" default() @Success 200 {object} model.IdList @Failure 404 {object} model.SimpleMsg @Router /ns/{nsId}/resources/image [delete]

func RestDelAllResources

func RestDelAllResources(c echo.Context) error

RestDelAllResources is a common function to handle 'DelAllResources' REST API requests. Dummy functions for Swagger exist in [resource/*.go]

func RestDelAllSecurityGroup

func RestDelAllSecurityGroup(c echo.Context) error

RestDelAllSecurityGroup godoc @ID DelAllSecurityGroup @Summary Delete all Security Groups @Description Delete all Security Groups @Tags [Infra Resource] Security Group Management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param match query string false "Delete resources containing matched ID-substring only" default() @Success 200 {object} model.IdList @Failure 404 {object} model.SimpleMsg @Router /ns/{nsId}/resources/securityGroup [delete]

func RestDelAllSharedResources

func RestDelAllSharedResources(c echo.Context) error

RestDelAllSharedResources godoc @ID DelAllSharedResources @Summary Delete all Default Resource Objects in the given namespace @Description Delete all Default Resource Objects in the given namespace @Tags [Infra Resource] Common Utility @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Success 200 {object} model.IdList @Failure 404 {object} model.SimpleMsg @Router /ns/{nsId}/sharedResources [delete]

func RestDelAllSshKey

func RestDelAllSshKey(c echo.Context) error

RestDelAllSshKey godoc @ID DelAllSshKey @Summary Delete all SSH Keys @Description Delete all SSH Keys @Tags [Infra Resource] Access Key Management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param match query string false "Delete resources containing matched ID-substring only" default() @Success 200 {object} model.IdList @Failure 404 {object} model.SimpleMsg @Router /ns/{nsId}/resources/sshKey [delete]

func RestDelAllVNet

func RestDelAllVNet(c echo.Context) error

RestDelAllVNet godoc @ID DelAllVNet @Summary Delete all VNets @Description Delete all VNets @Tags [Infra Resource] Network Management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param match query string false "Delete resources containing matched ID-substring only" default() @Success 200 {object} model.IdList @Failure 404 {object} model.SimpleMsg @Router /ns/{nsId}/resources/vNet [delete]

func RestDelCustomImage

func RestDelCustomImage(c echo.Context) error

RestDelCustomImage godoc @ID DelCustomImage @Summary Delete customImage @Description Delete customImage @Tags [Infra Resource] Image Management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param customImageId path string true "customImage ID" @Success 200 {object} model.SimpleMsg @Failure 404 {object} model.SimpleMsg @Router /ns/{nsId}/resources/customImage/{customImageId} [delete]

func RestDelDataDisk

func RestDelDataDisk(c echo.Context) error

RestDelDataDisk godoc @ID DelDataDisk @Summary Delete Data Disk @Description Delete Data Disk @Tags [Infra Resource] Data Disk Management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param dataDiskId path string true "Data Disk ID" @Success 200 {object} model.SimpleMsg @Failure 404 {object} model.SimpleMsg @Router /ns/{nsId}/resources/dataDisk/{dataDiskId} [delete]

func RestDelFirewallRules

func RestDelFirewallRules(c echo.Context) error

RestDelFirewallRules godoc @ID DelFirewallRules @Summary Delete specific FirewallRules (Replace with remaining rules) @Description Delete specific FirewallRules: Remove specified rules from the Security Group while keeping other existing rules. @Description This API will remove only the specified rules from the Security Group, leaving all other rules intact. @Description @Description Usage: @Description Use this API to remove specific firewall rules from a Security Group. Only the rules matching the provided criteria will be deleted. @Description - Rules that exactly match the provided Direction, Protocol, Port, and CIDR will be removed. @Description - All other existing rules will remain unchanged. @Description @Description Notes: @Description - "Ports" field supports single port ("22"), port range ("80-100"), and multiple ports/ranges ("22,80-100,443"). @Description - "Protocol" can be TCP, UDP, ICMP, ALL, etc. (as supported by the cloud provider). @Description - "Direction" must be either "inbound" or "outbound". @Description - "CIDR" is the allowed IP range. @Tags [Infra Resource] Security Group Management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param securityGroupId path string true "Security Group ID" @Param firewallRuleReq body model.SecurityGroupUpdateReq true "FirewallRules to delete (only firewallRules field is used)" @Success 200 {object} model.SecurityGroupUpdateResponse "Updated Security Group info after rule deletion" @Failure 404 {object} model.SimpleMsg @Router /ns/{nsId}/resources/securityGroup/{securityGroupId}/rules [delete]

func RestDelImage

func RestDelImage(c echo.Context) error

RestDelImage godoc @ID DelImage @Summary Delete image @Description Delete image @Tags [Infra Resource] Image Management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(system) @Param imageId path string true "Image ID ({providerName}+{regionName}+{cspImageName})" @Success 200 {object} model.SimpleMsg @Failure 404 {object} model.SimpleMsg @Router /ns/{nsId}/resources/image/{imageId} [delete]

func RestDelResource

func RestDelResource(c echo.Context) error

RestDelResource is a common function to handle 'DelResource' REST API requests. Dummy functions for Swagger exist in [resource/*.go]

func RestDelSecurityGroup

func RestDelSecurityGroup(c echo.Context) error

RestDelSecurityGroup godoc @ID DelSecurityGroup @Summary Delete Security Group @Description Delete Security Group @Tags [Infra Resource] Security Group Management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param securityGroupId path string true "Security Group ID" @Success 200 {object} model.SimpleMsg @Failure 404 {object} model.SimpleMsg @Router /ns/{nsId}/resources/securityGroup/{securityGroupId} [delete]

func RestDelSpec

func RestDelSpec(c echo.Context) error

RestDelSpec godoc @ID DelSpec @Summary Delete spec @Description Delete spec @Tags [Infra Resource] Spec Management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(system) @Param specId path string true "Spec ID ({providerName}+{regionName}+{cspSpecName})" @Success 200 {object} model.SimpleMsg @Failure 404 {object} model.SimpleMsg @Router /ns/{nsId}/resources/spec/{specId} [delete]

func RestDelSshKey

func RestDelSshKey(c echo.Context) error

RestDelSshKey godoc @ID DelSshKey @Summary Delete SSH Key @Description Delete SSH Key @Tags [Infra Resource] Access Key Management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param sshKeyId path string true "SSH Key ID" @Success 200 {object} model.SimpleMsg @Failure 404 {object} model.SimpleMsg @Router /ns/{nsId}/resources/sshKey/{sshKeyId} [delete]

func RestDelSubnet

func RestDelSubnet(c echo.Context) error

RestDelSubnet godoc @ID DelSubnet @Summary Delete Subnet (supporting actions: refine, force) @Description Delete Subnet @Description - refine: delete a subnet `object` if there's no resource on CSP or no inforamation on Spider @Description - force: force: delete a subnet `resource` on a CSP regardless of the current resource status (e.g., attempt to delete even if in use) @Tags [Infra Resource] Network Management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param vNetId path string true "VNet ID" @Param subnetId path string true "Subnet ID" @Param action query string false "Action" Enums(refine, force) @Success 200 {object} model.SimpleMsg @Failure 404 {object} model.SimpleMsg @Router /ns/{nsId}/resources/vNet/{vNetId}/subnet/{subnetId} [delete]

func RestDelVNet

func RestDelVNet(c echo.Context) error

RestDelVNet godoc @ID DelVNet @Summary Delete VNet (supporting actions: withsubnet, refine, force) @Description Delete VNet @Description - withsubnets: delete VNet and its subnets @Description - refine: delete information of VNet and its subnets if there's no info/resource in Spider/CSP @Description - force: delete VNet and its subnets regardless of the status of info/resource in Spider/CSP @Tags [Infra Resource] Network Management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param vNetId path string true "VNet ID" @Param action query string false "Action" Enums(withsubnets,refine,force) @Success 200 {object} model.SimpleMsg @Failure 404 {object} model.SimpleMsg @Router /ns/{nsId}/resources/vNet/{vNetId} [delete]

func RestDeleteAllK8sCluster

func RestDeleteAllK8sCluster(c echo.Context) error

RestDeleteAllK8sCluster godoc @ID DeleteAllK8sCluster @Summary Delete all K8sClusters @Description Delete all K8sClusters @Tags [Kubernetes] Cluster Management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param match query string false "Delete resources containing matched ID-substring only" default() @Param option query string false "Option for K8sCluster deletion" Enums(force) @Success 200 {object} model.IdList @Failure 404 {object} model.SimpleMsg @Router /ns/{nsId}/k8sCluster [delete]

func RestDeleteDeregisterSubnet

func RestDeleteDeregisterSubnet(c echo.Context) error

RestDeleteDeregisterSubnet godoc @ID DeleteDeregisterSubnet @Summary Deregister Subnet (created in CSP) @Description Deregister Subnet, which was created in CSP @Tags [Infra Resource] Network Management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param vNetId path string true "VNet ID" @Param subnetId path string true "Subnet ID" @Success 200 {object} model.SimpleMsg @Failure 404 {object} model.SimpleMsg @Router /ns/{nsId}/deregisterCspResource/vNet/{vNetId}/subnet/{subnetId} [delete]

func RestDeleteDeregisterVNet

func RestDeleteDeregisterVNet(c echo.Context) error

RestDeleteDeregisterVNet godoc @ID DeleteDeregisterVNet @Summary Deregister VNet (created in CSP) @Description Deregister the VNet, which was created in CSP @Tags [Infra Resource] Network Management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param vNetId path string true "VNet ID" @Param withSubnets query string false "Delete subnets as well" Enums(true,false) @Success 201 {object} model.VNetInfo @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @Router /ns/{nsId}/deregisterCspResource/vNet/{vNetId} [delete]

func RestDeleteK8sCluster

func RestDeleteK8sCluster(c echo.Context) error

RestDeleteK8sCluster func is a rest api wrapper for DeleteK8sCluster. RestDeleteK8sCluster godoc @ID DeleteK8sCluster @Summary Delete K8sCluster @Description Delete K8sCluster @Tags [Kubernetes] Cluster Management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param k8sClusterId path string true "K8sCluster ID" default(k8scluster01) @Param option query string false "Option for K8sCluster deletion" Enums(force) @Success 200 {object} model.SimpleMsg @Failure 404 {object} model.SimpleMsg @Router /ns/{nsId}/k8sCluster/{k8sClusterId} [delete]

func RestDeleteK8sNodeGroup

func RestDeleteK8sNodeGroup(c echo.Context) error

RestDeleteK8sNodeGroup func is a rest api wrapper for RemoveK8sNodeGroup. RestDeleteK8sNodeGroup godoc @ID DeleteK8sNodeGroup @Summary Remove a K8sNodeGroup @Description Remove a K8sNodeGroup @Tags [Kubernetes] Cluster Management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param k8sClusterId path string true "K8sCluster ID" default(k8scluster01) @Param k8sNodeGroupName path string true "K8sNodeGroup Name" default(k8sng01) @Param option query string false "Option for K8sNodeGroup deletion" Enums(force) @Success 200 {object} model.SimpleMsg @Failure 404 {object} model.SimpleMsg @Router /ns/{nsId}/k8sCluster/{k8sClusterId}/k8sNodeGroup/{k8sNodeGroupName} [delete]

func RestDeleteSiteToSiteVpn

func RestDeleteSiteToSiteVpn(c echo.Context) error

RestDeleteSiteToSiteVpn godoc @ID DeleteSiteToSiteVpn @Summary Delete a site-to-site VPN @Description Delete a site-to-site VPN @Tags [Infra Resource] Site-to-site VPN Management (under development) @Accept json @Produce json-stream @Param nsId path string true "Namespace ID" default(default) @Param mciId path string true "MCI ID" default(mci01) @Param vpnId path string true "VPN ID" default(vpn01) @Success 200 {object} model.SimpleMsg "OK" @Failure 400 {object} model.SimpleMsg "Bad Request" @Failure 500 {object} model.SimpleMsg "Internal Server Error" @Failure 503 {object} model.SimpleMsg "Service Unavailable" @Router /ns/{nsId}/mci/{mciId}/vpn/{vpnId} [delete]

func RestDeleteSqlDB

func RestDeleteSqlDB(c echo.Context) error

RestDeleteSqlDB godoc @ID DeleteSqlDb @Summary Delete a SQL datatbase @Description Delete a SQL datatbase @Tags [Infra Resource] SQL Database Management (under development) @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param sqlDbId path string true "SQL DB ID" default(sqldb01) @Success 200 {object} model.SimpleMsg "OK" @Failure 400 {object} model.SimpleMsg "Bad Request" @Failure 500 {object} model.SimpleMsg "Internal Server Error" @Failure 503 {object} model.SimpleMsg "Service Unavailable" @Router /ns/{nsId}/resources/sqlDb/{sqlDbId} [delete]

func RestFetchImages

func RestFetchImages(c echo.Context) error

RestFetchImages godoc @ID FetchImages @Summary Fetch images for regions of each CSP synchronously @Description Fetch images waiting for completion. @Description @Description **Provider Selection Options:** @Description - `targetProviders`: Specify exact providers to fetch (e.g., ["aws", "gcp"]). When set, only these providers are processed and `excludedProviders` is ignored. @Description - `excludedProviders`: Specify providers to skip (e.g., ["azure"]). Only used when `targetProviders` is not set. @Description - `regionAgnosticProviders`: Providers where images are shared across regions (e.g., ["gcp", "tencent"]). Only one region will be fetched per provider. @Description @Description **Note:** `regionAgnosticProviders` should only contain providers that are also in `targetProviders` (or not excluded). @Tags [Infra Resource] Image Management @Accept json @Produce json @Param fetchOption body model.ImageFetchOption true "Fetch option" @Success 202 {object} resource.FetchImagesAsyncResult @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @Router /fetchImages [post]

func RestFetchImagesAsync

func RestFetchImagesAsync(c echo.Context) error

RestFetchImagesAsync godoc @ID FetchImagesAsync @Summary Fetch images asynchronously @Description Fetch images in the background without waiting for completion. @Description @Description **Provider Selection Options:** @Description - `targetProviders`: Specify exact providers to fetch (e.g., ["aws", "gcp"]). When set, only these providers are processed and `excludedProviders` is ignored. @Description - `excludedProviders`: Specify providers to skip (e.g., ["azure"]). Only used when `targetProviders` is not set. @Description - `regionAgnosticProviders`: Providers where images are shared across regions (e.g., ["gcp", "tencent"]). Only one region will be fetched per provider. @Description @Description **Note:** `regionAgnosticProviders` should only contain providers that are also in `targetProviders` (or not excluded). @Tags [Infra Resource] Image Management @Accept json @Produce json @Param fetchOption body model.ImageFetchOption true "Fetch option" @Success 202 {object} model.SimpleMsg @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @Router /fetchImagesAsync [post]

func RestFetchPrice

func RestFetchPrice(c echo.Context) error

RestFetchPrice godoc @ID FetchPrice @Summary Fetch price from all CSP connections and update the price information for associated specs in the system. @Description Fetch price from all CSP connections and update the price information for associated specs in the system. @Tags [Infra Resource] Spec Management @Accept json @Produce json @Success 200 {object} model.SimpleMsg @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @Router /fetchPrice [post]

func RestFetchSpecs

func RestFetchSpecs(c echo.Context) error

RestFetchSpecs godoc @ID FetchSpecs @Summary Fetch specs from CSPs and register them in the system. @Description Fetch specs from CSPs and register them in the system. @Description @Description **Provider Selection Options:** @Description - `targetProviders`: Specify exact providers to fetch (e.g., ["aws", "gcp"]). When set, only these providers are processed and `excludedProviders` is ignored. @Description - `excludedProviders`: Specify providers to skip (e.g., ["azure"]). Only used when `targetProviders` is not set. @Description - `regionAgnosticProviders`: Providers where specs are shared across regions (e.g., ["gcp", "tencent"]). Only one region will be fetched per provider. @Description @Description **Note:** `regionAgnosticProviders` should only contain providers that are also in `targetProviders` (or not excluded). @Tags [Infra Resource] Spec Management @Accept json @Produce json @Param fetchOption body model.SpecFetchOption true "Fetch option" @Success 202 {object} resource.FetchSpecsAsyncResult @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @Router /fetchSpecs [post]

func RestFilterSpecsByRange

func RestFilterSpecsByRange(c echo.Context) error

RestFilterSpecsByRange godoc @ID FilterSpecsByRange @Summary Filter specs by range @Description Filter specs by range. Use limit field to control the maximum number of results. If limit is 0 or not specified, returns all matching results. @Tags [Infra Resource] Spec Management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(system) @Param specRangeFilter body model.FilterSpecsByRangeRequest false "Filter for range-filtering specs (limit: 0 for all results, >0 for limited results)" @Success 200 {object} RestFilterSpecsResponse @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @Router /ns/{nsId}/resources/filterSpecsByRange [post]

func RestGetAllCustomImage

func RestGetAllCustomImage(c echo.Context) error

RestGetAllCustomImage godoc @ID GetAllCustomImage @Summary List all customImages or customImages' ID @Description List all customImages or customImages' ID @Tags [Infra Resource] Image Management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param option query string false "Option" Enums(id) @Param filterKey query string false "Field key for filtering (ex:guestOS)" @Param filterVal query string false "Field value for filtering (ex: Ubuntu18.04)" @Success 200 {object} JSONResult{[DEFAULT]=RestGetAllCustomImageResponse,[ID]=model.IdList} "Different return structures by the given option param" @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @Router /ns/{nsId}/resources/customImage [get]

func RestGetAllDataDisk

func RestGetAllDataDisk(c echo.Context) error

RestGetAllDataDisk godoc @ID GetAllDataDisk @Summary List all Data Disks or Data Disks' ID @Description List all Data Disks or Data Disks' ID @Tags [Infra Resource] Data Disk Management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param option query string false "Option" Enums(id) @Param filterKey query string false "Field key for filtering (ex: systemLabel)" @Param filterVal query string false "Field value for filtering (ex: Registered from CSP resource)" @Success 200 {object} JSONResult{[DEFAULT]=RestGetAllDataDiskResponse,[ID]=model.IdList} "Different return structures by the given option param" @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @Router /ns/{nsId}/resources/dataDisk [get]

func RestGetAllImage

func RestGetAllImage(c echo.Context) error

RestGetAllImage godoc @ID GetAllImage @Summary List all images or images' ID @Description List all images or images' ID @Tags [Infra Resource] Image Management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(system) @Param option query string false "Option" Enums(id) @Param filterKey query string false "Field key for filtering (ex:guestOS)" @Param filterVal query string false "Field value for filtering (ex: Ubuntu18.04)" @Success 200 {object} JSONResult{[DEFAULT]=model.SearchImageResponse,[ID]=model.IdList} "Different return structures by the given option param" @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @Router /ns/{nsId}/resources/image [get]

func RestGetAllK8sCluster

func RestGetAllK8sCluster(c echo.Context) error

RestGetAllK8sCluster godoc @ID GetAllK8sCluster @Summary List all K8sClusters or K8sClusters' ID @Description List all K8sClusters or K8sClusters' ID @Tags [Kubernetes] Cluster Management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @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-2-vpc)" @Success 200 {object} JSONResult{[DEFAULT]=RestGetAllK8sClusterResponse,[ID]=model.IdList} "Different return structures by the given option param" @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @Router /ns/{nsId}/k8sCluster [get]

func RestGetAllResources

func RestGetAllResources(c echo.Context) error

RestGetAllResources is a common function to handle 'GetAllResources' REST API requests. Dummy functions for Swagger exist in [resource/*.go]

func RestGetAllSecurityGroup

func RestGetAllSecurityGroup(c echo.Context) error

RestGetAllSecurityGroup godoc @ID GetAllSecurityGroup @Summary List all Security Groups or Security Groups' ID @Description List all Security Groups or Security Groups' ID @Tags [Infra Resource] Security Group Management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param option query string false "Option" Enums(id) @Param filterKey query string false "Field key for filtering (ex: systemLabel)" @Param filterVal query string false "Field value for filtering (ex: Registered from CSP resource)" @Success 200 {object} JSONResult{[DEFAULT]=RestGetAllSecurityGroupResponse,[ID]=model.IdList} "Different return structures by the given option param" @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @Router /ns/{nsId}/resources/securityGroup [get]

func RestGetAllSiteToSiteVpn

func RestGetAllSiteToSiteVpn(c echo.Context) error

RestGetAllSiteToSiteVpn godoc @ID GetAllSiteToSiteVpn @Summary Get all site-to-site VPNs @Description Get all site-to-site VPNs @Tags [Infra Resource] Site-to-site VPN Management (under development) @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param mciId path string true "MCI ID" default(mci01) @Param option query string false "Option" Enums(InfoList, IdList) default(IdList) @Success 200 {object} model.VpnInfoList "OK" @Success 200 {object} model.VpnIdList "OK" @Failure 400 {object} model.SimpleMsg "Bad Request" @Failure 500 {object} model.SimpleMsg "Internal Server Error" @Failure 503 {object} model.SimpleMsg "Service Unavailable" @Router /ns/{nsId}/mci/{mciId}/vpn [get]

func RestGetAllSqlDB

func RestGetAllSqlDB(c echo.Context) error

RestGetAllSqlDb godoc @ID GetAllSqlDb @Summary Get all SQL Databases (TBD) @Description Get all SQL Databases (TBD) @Tags [Infra Resource] SQL Database Management (under development) @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param option query string false "Option" Enums(InfoList, IdList) default(IdList) @Success 200 {object} model.VpnInfoList "OK" ///////////// @Success 200 {object} model.VpnIdList "OK" ///////////// @Failure 400 {object} model.SimpleMsg "Bad Request" @Failure 500 {object} model.SimpleMsg "Internal Server Error" @Failure 503 {object} model.SimpleMsg "Service Unavailable" @Router /ns/{nsId}/resources/sqlDb [get]

func RestGetAllSshKey

func RestGetAllSshKey(c echo.Context) error

RestGetAllSshKey godoc @ID GetAllSshKey @Summary List all SSH Keys or SSH Keys' ID @Description List all SSH Keys or SSH Keys' ID @Tags [Infra Resource] Access Key Management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param option query string false "Option" Enums(id) @Param filterKey query string false "Field key for filtering (ex: systemLabel)" @Param filterVal query string false "Field value for filtering (ex: Registered from CSP resource)" @Success 200 {object} JSONResult{[DEFAULT]=RestGetAllSshKeyResponse,[ID]=model.IdList} "Different return structures by the given option param" @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @Router /ns/{nsId}/resources/sshKey [get]

func RestGetAllVNet

func RestGetAllVNet(c echo.Context) error

RestGetAllVNet godoc @ID GetAllVNet @Summary List all VNets or VNets' ID @Description List all VNets or VNets' ID @Tags [Infra Resource] Network Management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @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]=RestGetAllVNetResponse,[ID]=model.IdList} "Different return structures by the given option param" @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @Router /ns/{nsId}/resources/vNet [get]

func RestGetAvailableK8sNodeImage

func RestGetAvailableK8sNodeImage(c echo.Context) error

RestGetAvailableK8sNodeImage func is a rest api wrapper for GetAvailableK8sNodeImage. RestGetAvailableK8sNodeImage godoc @ID GetAvailableK8sNodeImage @Summary (UNDER DEVELOPMENT!!!) Get available kubernetes cluster node image @Description (UNDER DEVELOPMENT!!!) Get available kubernetes cluster node image @Tags [Kubernetes] Cluster Management @Accept json @Produce json @Param providerName query string true "Name of the CSP to retrieve" @Param regionName query string true "Name of region to retrieve" @Success 200 {object} model.K8sClusterNodeImageDetailAvailable @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @Router /availableK8sNodeImage [get]

func RestGetAvailableK8sVersion

func RestGetAvailableK8sVersion(c echo.Context) error

RestGetAvailableK8sVersion func is a rest api wrapper for GetAvailableK8sVersion. RestGetAvailableK8sVersion godoc @ID GetAvailableK8sVersion @Summary Get available kubernetes cluster version @Description Get available kubernetes cluster version @Tags [Kubernetes] Cluster Management @Accept json @Produce json @Param providerName query string true "Name of the CSP to retrieve" @Param regionName query string true "Name of region to retrieve" @Success 200 {object} model.K8sClusterVersionDetailAvailable @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @Router /availableK8sVersion [get]

func RestGetAvailableRegionZonesForSpec added in v0.11.9

func RestGetAvailableRegionZonesForSpec(c echo.Context) error

RestGetAvailableRegionZonesForSpec godoc @ID GetAvailableRegionZonesForSpec @Summary Get available regions and zones for a specific spec @Description Query the availability of a specific spec across all regions/zones @Tags [Infra Resource] Spec Management @Accept json @Produce json @Param availabilityReq body model.GetAvailableRegionZonesRequest true "Spec availability request" @Success 200 {object} model.SpecAvailabilityInfo @Failure 400 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @Router /availableRegionZonesForSpec [post]

func RestGetAvailableRegionZonesForSpecList added in v0.11.9

func RestGetAvailableRegionZonesForSpecList(c echo.Context) error

RestGetAvailableRegionZonesForSpecList godoc @ID GetAvailableRegionZonesForSpecList @Summary Get available regions and zones for multiple specs @Description Query the availability for multiple specs in parallel and return batch results @Tags [Infra Resource] Spec Management @Accept json @Produce json @Param batchAvailabilityReq body model.GetAvailableRegionZonesListRequest true "Batch spec availability request" @Success 200 {object} model.SpecAvailabilityBatchResult @Failure 400 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @Router /availableRegionZonesForSpecList [post]

func RestGetControlK8sCluster

func RestGetControlK8sCluster(c echo.Context) error

RestGetControlK8sCluster godoc @ID GetControlK8sCluster @Summary Control the creation of K8sCluster (continue, withdraw) @Description Control the creation of K8sCluster (continue, withdraw) @Tags [Kubernetes] Cluster Management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param k8sClusterId path string true "K8sCluster ID" default(k8scluster01) @Param action query string true "Action to K8sCluster" Enums(continue, withdraw) @Success 200 {object} model.SimpleMsg @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @Router /ns/{nsId}/control/k8sCluster/{k8sClusterId} [get]

func RestGetCustomImage

func RestGetCustomImage(c echo.Context) error

RestGetCustomImage godoc @ID GetCustomImage @Summary Get customImage @Description Get customImage @Tags [Infra Resource] Image Management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param customImageId path string true "customImage ID" @Success 200 {object} model.ImageInfo @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @Router /ns/{nsId}/resources/customImage/{customImageId} [get]

func RestGetDataDisk

func RestGetDataDisk(c echo.Context) error

RestGetDataDisk godoc @ID GetDataDisk @Summary Get Data Disk @Description Get Data Disk @Tags [Infra Resource] Data Disk Management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param dataDiskId path string true "Data Disk ID" @Success 200 {object} model.DataDiskInfo @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @Router /ns/{nsId}/resources/dataDisk/{dataDiskId} [get]

func RestGetFetchImagesAsyncResult

func RestGetFetchImagesAsyncResult(c echo.Context) error

RestGetFetchImagesAsyncResult godoc @ID GetFetchImagesAsyncResult @Summary Get result of asynchronous image fetching @Description Get detailed results from the last asynchronous image fetch operation @Tags [Infra Resource] Image Management @Accept json @Produce json @Success 200 {object} resource.FetchImagesAsyncResult @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @Router /fetchImagesResult [get]

func RestGetImage

func RestGetImage(c echo.Context) error

RestGetImage godoc @ID GetImage @Summary Get image @Description GetImage returns an image object if there are matched images for the given namespace and imageKey(imageId) @Tags [Infra Resource] Image Management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(system) @Param imageId path string true "(Note: imageId param will be refined in next release, enabled for temporal support) This param accepts several input forms: 1) provider+imageId, 2) provider+region+imageId, 3) imageId. For exact matching, use provider+imageId form." @Success 200 {object} model.ImageInfo @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @Router /ns/{nsId}/resources/image/{imageId} [get]

func RestGetK8sCluster

func RestGetK8sCluster(c echo.Context) error

RestGetK8sCluster func is a rest api wrapper for GetK8sCluster. RestGetK8sCluster godoc @ID GetK8sCluster @Summary Get K8sCluster @Description Get K8sCluster @Tags [Kubernetes] Cluster Management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param k8sClusterId path string true "K8sCluster ID" default(k8scluster01) @Success 200 {object} model.K8sClusterInfo @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @Router /ns/{nsId}/k8sCluster/{k8sClusterId} [get]

func RestGetListSubnet

func RestGetListSubnet(c echo.Context) error

RestGetListSubnet godoc @ID GetAllSubnet @Summary List all subnets @Description List all subnets @Tags [Infra Resource] Network Management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param vNetId path string true "VNet ID" @Success 200 {object} RestGetAllSubnetResponse @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @Router /ns/{nsId}/resources/vNet/{vNetId}/subnet [get]

func RestGetRequestStatusOfSiteToSiteVpn

func RestGetRequestStatusOfSiteToSiteVpn(c echo.Context) error

RestGetRequestStatusOfSiteToSiteVpn godoc @ID GetRequestStatusOfSiteToSiteVpn @Summary Check the status of a specific request by its ID @Description Check the status of a specific request by its ID @Tags [Infra Resource] Site-to-site VPN Management (under development) @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param mciId path string true "MCI ID" default(mci01) @Param vpnId path string true "VPN ID" default(vpn01) @Param requestId path string true "Request ID" @Success 200 {object} model.Response "OK" @Failure 400 {object} model.SimpleMsg "Bad Request" @Failure 500 {object} model.SimpleMsg "Internal Server Error" @Failure 503 {object} model.SimpleMsg "Service Unavailable" @Router /ns/{nsId}/mci/{mciId}/vpn/{vpnId}/request/{requestId} [get]

func RestGetRequiredK8sSubnetCount

func RestGetRequiredK8sSubnetCount(c echo.Context) error

RestGetRequiredK8sSubnetCount func is a rest api wrapper for GetModelK8sRequiredSubnetCount. RestGetRequiredK8sSubnetCount godoc @ID GetRequiredK8sSubnetCount @Summary Get the required subnet count to create a K8sCluster @Description Get the required subnet count to create a K8sCluster @Tags [Kubernetes] Cluster Management @Accept json @Produce json @Param providerName query string true "Name of the CSP to retrieve" @Success 200 {object} model.K8sClusterRequiredSubnetCount @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @Router /requiredK8sSubnetCount [get]

func RestGetResource

func RestGetResource(c echo.Context) error

RestGetResource is a common function to handle 'GetResource' REST API requests. Dummy functions for Swagger exist in [resource/*.go]

func RestGetSecurityGroup

func RestGetSecurityGroup(c echo.Context) error

RestGetSecurityGroup godoc @ID GetSecurityGroup @Summary Get Security Group @Description Get Security Group @Tags [Infra Resource] Security Group Management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param securityGroupId path string true "Security Group ID" @Success 200 {object} model.SecurityGroupInfo @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @Router /ns/{nsId}/resources/securityGroup/{securityGroupId} [get]

func RestGetSiteToSiteVpn

func RestGetSiteToSiteVpn(c echo.Context) error

RestGetSiteToSiteVpn godoc @ID GetSiteToSiteVpn @Summary Get resource info of a site-to-site VPN @Description Get resource info of a site-to-site VPN @Tags [Infra Resource] Site-to-site VPN Management (under development) @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param mciId path string true "MCI ID" default(mci01) @Param vpnId path string true "VPN ID" default(vpn01) @Success 200 {object} model.VpnInfo "OK" @Failure 400 {object} model.SimpleMsg "Bad Request" @Failure 500 {object} model.SimpleMsg "Internal Server Error" @Failure 503 {object} model.SimpleMsg "Service Unavailable" @Router /ns/{nsId}/mci/{mciId}/vpn/{vpnId} [get]

func RestGetSitesInMci

func RestGetSitesInMci(c echo.Context) error

RestGetSitesInMci godoc @ID GetSitesInMci @Summary Get sites in MCI @Description Get sites in MCI @Tags [Infra Resource] Site-to-site VPN Management (under development) @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param mciId path string true "MCI ID" default(mci01) @Success 200 {object} model.SitesInfo "OK" @Failure 400 {object} model.SimpleMsg "Bad Request" @Failure 500 {object} model.SimpleMsg "Internal Server Error" @Failure 503 {object} model.SimpleMsg "Service Unavailable" @Router /ns/{nsId}/mci/{mciId}/site [get]

func RestGetSpec

func RestGetSpec(c echo.Context) error

RestGetSpec godoc @ID GetSpec @Summary Get spec @Description Get spec @Tags [Infra Resource] Spec Management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(system) @Param specId path string true "Spec ID ({providerName}+{regionName}+{cspSpecName})" @Success 200 {object} model.SpecInfo @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @Router /ns/{nsId}/resources/spec/{specId} [get]

func RestGetSqlDB

func RestGetSqlDB(c echo.Context) error

RestGetSqlDB godoc @ID GetSqlDb @Summary Get resource info of a SQL datatbase @Description Get resource info of a SQL datatbase @Tags [Infra Resource] SQL Database Management (under development) @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param sqlDbId path string true "SQL DB ID" default(sqldb01) @Param detail query string false "Resource info by detail (refined, raw)" default(refined) @Success 200 {object} model.SqlDBInfo "OK" @Failure 400 {object} model.SimpleMsg "Bad Request" @Failure 500 {object} model.SimpleMsg "Internal Server Error" @Failure 503 {object} model.SimpleMsg "Service Unavailable" @Router /ns/{nsId}/resources/sqlDb/{sqlDbId} [get]

func RestGetSshKey

func RestGetSshKey(c echo.Context) error

RestGetSshKey godoc @ID GetSshKey @Summary Get SSH Key @Description Get SSH Key @Tags [Infra Resource] Access Key Management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param sshKeyId path string true "SSH Key ID" @Success 200 {object} model.SshKeyInfo @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @Router /ns/{nsId}/resources/sshKey/{sshKeyId} [get]

func RestGetSubnet

func RestGetSubnet(c echo.Context) error

RestGetSubnet godoc @ID GetSubnet @Summary Get Subnet @Description Get Subnet @Tags [Infra Resource] Network Management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param vNetId path string true "VNet ID" @Param subnetId path string true "Subnet ID" @Success 200 {object} model.SubnetInfo @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @Router /ns/{nsId}/resources/vNet/{vNetId}/subnet/{subnetId} [get]

func RestGetVNet

func RestGetVNet(c echo.Context) error

RestGetVNet godoc @ID GetVNet @Summary Get VNet @Description Get VNet @Tags [Infra Resource] Network Management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param vNetId path string true "VNet ID" @Success 200 {object} model.VNetInfo @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @Router /ns/{nsId}/resources/vNet/{vNetId} [get]

func RestGetVmDataDisk

func RestGetVmDataDisk(c echo.Context) error

RestGetVmDataDisk godoc @ID GetVmDataDisk @Summary Get available dataDisks for a VM @Description Get available dataDisks for a VM @Tags [Infra Resource] Data Disk Management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param mciId path string true "MCI ID" default(mci01) @Param vmId path string true "VM ID" default(g1-1) @Success 200 {object} JSONResult{[DEFAULT]=RestGetAllDataDiskResponse,[ID]=model.IdList} "Different return structures by the given option param" @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @Router /ns/{nsId}/mci/{mciId}/vm/{vmId}/dataDisk [get]

func RestLoadAssets

func RestLoadAssets(c echo.Context) error

RestLoadAssets godoc @ID LoadAssets @Summary Load Common Resources from internal asset files @Description Load Common Resources from internal asset files (Spec, Image). By default, Azure images are excluded for faster initialization. Use includeAzure=true to fetch Azure images (may take 40+ minutes). @Tags [Admin] System Configuration @Accept json @Produce json @Param includeAzure query string false "Include Azure images (may take 40+ minutes)" default(false) Enums(true, false) @Success 200 {object} model.IdList @Failure 404 {object} model.SimpleMsg @Router /loadAssets [get]

func RestLookupImage

func RestLookupImage(c echo.Context) error

RestLookupImage godoc @ID LookupImage @Summary Lookup image (for debugging purposes) @Description Lookup image (for debugging purposes) @Tags [Infra Resource] Image Management @Accept json @Produce json @Param lookupImageReq body RestLookupImageRequest true "Specify connectionName, cspImageName" @Success 200 {object} model.SpiderImageInfo @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @Router /lookupImage [post]

func RestLookupImageList

func RestLookupImageList(c echo.Context) error

RestLookupImageList godoc @ID LookupImageList @Summary Lookup image list (for debugging purposes) @Description Lookup image list (for debugging purposes) @Tags [Infra Resource] Image Management @Accept json @Produce json @Param lookupImagesReq body common.TbConnectionName true "Specify connectionName" @Success 200 {object} model.SpiderImageList @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @Router /lookupImages [post]

func RestLookupSpec

func RestLookupSpec(c echo.Context) error

RestLookupSpec godoc @ID LookupSpec @Summary Lookup spec (for debugging purposes) @Description Lookup spec (for debugging purposes) @Tags [Infra Resource] Spec Management @Accept json @Produce json @Param lookupSpecReq body RestLookupSpecRequest true "Specify connectionName & cspSpecNameS" @Success 200 {object} model.SpiderSpecInfo @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @Router /lookupSpec [post]

func RestLookupSpecList

func RestLookupSpecList(c echo.Context) error

RestLookupSpecList godoc @ID LookupSpecList @Summary Lookup spec list (for debugging purposes) @Description Lookup spec list (for debugging purposes) @Tags [Infra Resource] Spec Management @Accept json @Produce json @Param lookupSpecsReq body common.TbConnectionName true "Specify connectionName" @Success 200 {object} model.SpiderSpecList @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @Router /lookupSpecs [post]

func RestPostCmdK8sCluster

func RestPostCmdK8sCluster(c echo.Context) error

RestPostCmdK8sCluster godoc @ID PostCmdK8sCluster @Summary Send a command to specified Container in K8sCluster @Description Send a command to specified Container in K8sCluster @Description [note] This feature is not intended for general use @Description This API is provided as an exceptional and limited function for specific purposes such as migration. @Description Kubernetes resource information required as input for this API is not currently provided, and its availability in the future is uncertain. @Tags [Kubernetes] Cluster's Container Remote Command @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param k8sClusterId path string true "K8sCluster ID" default(k8scluster01) @Param k8sClusterNamespace query string true "Namespace in K8sCluster to apply the command" default(default) @Param k8sClusterPodName query string true "Pod Name in K8sCluster to apply the command" default(mypod) @Param k8sClusterContainerName query string false "Container Name in K8sCluster to apply the command" @Param k8sClusterContainerCmdReq body model.K8sClusterContainerCmdReq true "K8sCluster's Container Command Request" @Param x-request-id header string false "Custom request ID" @Success 200 {object} model.K8sClusterContainerCmdResult @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @Router /ns/{nsId}/cmd/k8sCluster/{k8sClusterId} [post]

func RestPostCustomImage

func RestPostCustomImage(c echo.Context) error

RestPostCustomImage godoc @ID PostCustomImage @Summary Register existing Custom Image in a CSP @Description Register existing Custom Image in a CSP (option=register) @Tags [Infra Resource] Image Management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param option query string true "Option: " Enums(register) @Param customImageRegisterReq body model.CustomImageReq true "Request to Register existing Custom Image in a CSP" @Success 200 {object} model.ImageInfo @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @Router /ns/{nsId}/resources/customImage [post]

func RestPostDataDisk

func RestPostDataDisk(c echo.Context) error

RestPostDataDisk godoc @ID PostDataDisk @Summary Create Data Disk @Description Create Data Disk @Tags [Infra Resource] Data Disk Management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param option query string false "Option: " Enums(register) @Param dataDiskInfo body model.DataDiskReq true "Details for an Data Disk object" @Success 200 {object} model.DataDiskInfo @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @Router /ns/{nsId}/resources/dataDisk [post]

func RestPostFileToK8sCluster

func RestPostFileToK8sCluster(c echo.Context) error

RestPostFileToK8sCluster godoc @ID PostFileToK8sCluster @Summary Transfer a file to specified Container in K8sCluster @Description Transfer a file to specified Container in K8sCluster. The tar command is required in the container. @Description [note] This feature is not intended for general use @Description This API is provided as an exceptional and limited function for specific purposes such as migration. @Description Kubernetes resource information required as input for this API is not currently provided, and its availability in the future is uncertain. @Tags [Kubernetes] Cluster's Container Remote Command @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param k8sClusterId path string true "K8sCluster ID" default(k8scluster01) @Param k8sClusterNamespace query string true "Namespace in K8sCluster to apply the command" default(default) @Param k8sClusterPodName query string true "Pod Name in K8sCluster to apply the command" default(mypod) @Param k8sClusterContainerName query string false "Container Name in K8sCluster to apply the command" @Param path formData string true "Target path where the file will be stored" default(/tmp) @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.K8sClusterContainerCmdResults @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @Router /ns/{nsId}/transferFile/k8sCluster/{k8sClusterId} [post]

func RestPostFirewallRules

func RestPostFirewallRules(c echo.Context) error

RestPostFirewallRules godoc @ID PostFirewallRules @Summary Add new FirewallRules to existing rules @Description Add new FirewallRules: Add the provided firewall rules to the existing rules in the Security Group. @Description This API will only add new rules without deleting or modifying existing ones. @Description If a rule with identical properties already exists, it will be skipped to avoid duplicates. @Description @Description Usage: @Description Use this API to add new firewall rules to a Security Group while preserving existing rules. @Description - Only new rules that don't already exist will be added. @Description - Existing rules remain unchanged. @Description - If an identical rule already exists, it will be skipped. @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, ALL, etc. (as supported by the cloud provider). @Description - "Direction" must be either "inbound" or "outbound". @Description - "CIDR" is the allowed IP range. @Tags [Infra Resource] Security Group Management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param securityGroupId path string true "Security Group ID" @Param firewallRuleReq body model.SecurityGroupUpdateReq true "FirewallRules to add (only firewallRules field is used)" @Success 200 {object} model.SecurityGroupUpdateResponse "Updated Security Group info with added firewall rules" @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @Router /ns/{nsId}/resources/securityGroup/{securityGroupId}/rules [post]

func RestPostImage

func RestPostImage(c echo.Context) error

RestPostImage godoc @ID PostImage @Summary Register image @Description Register image @Tags [Infra Resource] Image Management @Accept json @Produce json @Param action query string true "registeringMethod" Enums(registerWithInfo, registerWithId) @Param nsId path string true "Namespace ID" default(system) @Param imageInfo body model.ImageInfo false "Specify details of a image object (cspResourceName, guestOS, description, ...) manually" @Param imageReq body model.ImageReq false "Specify (name, connectionName, cspImageName) to register an image object automatically" @Param update query boolean false "Force update to existing image object" default(false) @Success 200 {object} model.ImageInfo @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @Router /ns/{nsId}/resources/image [post]

func RestPostK8sCluster

func RestPostK8sCluster(c echo.Context) error

RestPostK8sCluster func is a rest api wrapper for CreateK8sCluster. RestPostK8sCluster godoc @ID PostK8sCluster @Summary Create K8sCluster @Description Create K8sCluster<br>Find details from https://github.com/cloud-barista/cb-tumblebug/discussions/1614 @Tags [Kubernetes] Cluster Management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param option query string false "Option: [required params for register] connectionName, name, cspResourceId" Enums(register) @Param skipVersionCheck query string false "Skip Kubernetes version validation (use for testing with unlisted versions)" default(false) @Param k8sClusterReq body model.K8sClusterReq true "Details of the K8sCluster object" @Success 200 {object} model.K8sClusterInfo @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @Router /ns/{nsId}/k8sCluster [post]

func RestPostK8sClusterDynamic

func RestPostK8sClusterDynamic(c echo.Context) error

RestPostK8sClusterDynamic godoc @ID PostK8sClusterDynamic @Summary Create K8sCluster Dynamically @Description Create K8sCluster Dynamically from common spec and image @Tags [Kubernetes] Cluster Management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param k8sClusterDyanmicReq body model.K8sClusterDynamicReq true "Request body to provision K8sCluster dynamically. <br> Must include specId and imageId info. <br> (ex: {name: k8scluster01, imageId: azure+koreacentral+ubuntu22.04, specId: azure+koreacentral+Standard_B2s}]}) <br> You can use /k8sClusterRecommendNode and /k8sClusterDynamicCheckRequest to get it. <br> Check the guide: https://github.com/cloud-barista/cb-tumblebug/discussions/1913" @Param option query string false "Option for K8sCluster creation" Enums(hold) @Param skipVersionCheck query string false "Skip Kubernetes version validation (use for testing with unlisted versions)" default(false) @Param x-request-id header string false "Custom request ID" @Success 200 {object} model.K8sClusterInfo @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @Router /ns/{nsId}/k8sClusterDynamic [post]

func RestPostK8sClusterDynamicCheckRequest

func RestPostK8sClusterDynamicCheckRequest(c echo.Context) error

RestPostK8sClusterDynamicCheckRequest godoc @ID PostK8sClusterDynamicCheckRequest @Summary Check available ConnectionConfig list for creating K8sCluster Dynamically @Description Check available ConnectionConfig list before create K8sCluster Dynamically from common spec and image @Tags [Kubernetes] Cluster Management @Accept json @Produce json @Param k8sClusterConnectionConfigCandidatesReq body model.K8sClusterConnectionConfigCandidatesReq true "Details for K8sCluster dynamic request information" @Success 200 {object} model.CheckK8sClusterDynamicReqInfo @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @Router /k8sClusterDynamicCheckRequest [post]

func RestPostK8sMultiClusterDynamic added in v0.11.22

func RestPostK8sMultiClusterDynamic(c echo.Context) error

RestPostK8sMultiClusterDynamic godoc @ID PostK8sMultiClusterDynamic @Summary (PoC API. For developers only, and do not use in production.) Create Multiple K8s Clusters Dynamically in Parallel @Description (PoC API. For developers only, and do not use in production.) @Description Create multiple K8sClusters in parallel from common spec and image. @Description If namePrefix is provided, cluster names will be auto-generated as '{namePrefix}-{csp}-{number}' (e.g., 'across-aws-1', 'across-alibaba-2'). @Description @Description If namePrefix is not provided, each cluster must have a name specified. @Description @Description **Example request body:** @Description ```json @Description { @Description "namePrefix": "across", @Description "clusters": [ @Description { @Description "imageId": "default", @Description "specId": "aws+eu-west-2+t3a.xlarge" @Description }, @Description { @Description "nodeGroupName": "ng-1", @Description "imageId": "default", @Description "specId": "azure+germanywestcentral+standard_b4ms" @Description }, @Description { @Description "nodeGroupName": "ng-1", @Description "imageId": "https://www.googleapis.com/compute/v1/projects/ubuntu-os-cloud/global/images/ubuntu-minimal-2204-jammy-v20251120", @Description "specId": "gcp+europe-west9+e2-highmem-4" @Description } @Description ] @Description } @Description ``` @Tags [Kubernetes] Cluster Management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param k8sMultiClusterDynamicReq body model.K8sMultiClusterDynamicReq true "Request body to provision multiple K8sClusters dynamically in parallel. <br> Must include clusters array with specId and imageId info for each cluster. <br> Optional namePrefix will auto-generate cluster names. <br> You can use /k8sClusterRecommendNode and /k8sClusterDynamicCheckRequest to get spec and image info. <br> Check the guide: https://github.com/cloud-barista/cb-tumblebug/discussions/1913" @Param option query string false "Option for K8sCluster creation" Enums(hold) @Param skipVersionCheck query string false "Skip Kubernetes version validation (use for testing with unlisted versions)" default(false) @Param x-request-id header string false "Custom request ID" @Success 200 {object} model.K8sMultiClusterInfo "All clusters created successfully" @Success 207 {object} model.K8sMultiClusterInfo "Multi-Status - Partial success, some clusters created but others failed" @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @Router /ns/{nsId}/k8sMultiClusterDynamic [post]

func RestPostK8sNodeGroup

func RestPostK8sNodeGroup(c echo.Context) error

RestPostK8sNodeGroup func is a rest api wrapper for AddK8sNodeGroup. RestPostK8sNodeGroup godoc @ID PostK8sNodeGroup @Summary Add a K8sNodeGroup @Description Add a K8sNodeGroup @Tags [Kubernetes] Cluster Management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param k8sClusterId path string true "K8sCluster ID" default(k8scluster01) @Param k8sNodeGroupReq body model.K8sNodeGroupReq true "Details of the K8sNodeGroup object" @Success 200 {object} model.K8sClusterInfo @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @Router /ns/{nsId}/k8sCluster/{k8sClusterId}/k8sNodeGroup [post]

func RestPostK8sNodeGroupDynamic

func RestPostK8sNodeGroupDynamic(c echo.Context) error

RestPostK8sNodeGroupDynamic godoc @ID PostK8sNodeGroupDynamic @Summary Create K8sNodeGroup Dynamically @Description Create K8sNodeGroup Dynamically from common spec and image @Tags [Kubernetes] Cluster Management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param k8sClusterId path string true "K8sCluster ID" default(k8scluster01) @Param k8sNodeGroupDynamicReq body model.K8sNodeGroupDynamicReq true "Request body to provision K8sNodeGroup dynamically. <br> Must include specId and imageId info. <br> (ex: {name: k8sng01, imageId: azure+koreacentral+ubuntu22.04, specId: azure+koreacentral+Standard_B2s}]}) <br> You can use /k8sClusterRecommendNode and /k8sClusterDynamicCheckRequest to get it. <br> Check the guide: https://github.com/cloud-barista/cb-tumblebug/discussions/1913" @Param x-request-id header string false "Custom request ID" @Success 200 {object} model.K8sNodeGroupInfo @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @Router /ns/{nsId}/k8sCluster/{k8sClusterId}/k8sNodeGroupDynamic [post]

func RestPostRegisterSubnet

func RestPostRegisterSubnet(c echo.Context) error

RestPostRegisterSubnet godoc @ID PostRegisterSubnet @Summary Register Subnet (created in CSP) @Description Register Subnet, which was created in CSP @Tags [Infra Resource] Network Management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param vNetId path string true "VNet ID" @Param subnetReq body model.RegisterSubnetReq true "Details for an Subnet object" @Success 200 {object} model.SubnetInfo @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @Router /ns/{nsId}/registerCspResource/vNet/{vNetId}/subnet [post]

func RestPostRegisterVNet

func RestPostRegisterVNet(c echo.Context) error

RestPostRegisterVNet godoc @ID PostRegisterVNet @Summary Register VNet (created in CSP) @Description Register the VNet, which was created in CSP @Tags [Infra Resource] Network Management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param vNetRegisterReq body model.RegisterVNetReq true "Inforamation required to register the VNet created externally" @Success 201 {object} model.VNetInfo @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @Router /ns/{nsId}/registerCspResource/vNet [post]

func RestPostSecurityGroup

func RestPostSecurityGroup(c echo.Context) error

RestPostSecurityGroup godoc @ID PostSecurityGroup @Summary Create Security Group @Description Create Security Group @Tags [Infra Resource] Security Group Management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param option query string false "Option: [required params for register] connectionName, name, vNetId, cspResourceId" Enums(register) @Param securityGroupReq body model.SecurityGroupReq true "Details for an securityGroup object" @Success 200 {object} model.SecurityGroupInfo @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @Router /ns/{nsId}/resources/securityGroup [post]

func RestPostSiteToSiteVpn

func RestPostSiteToSiteVpn(c echo.Context) error

RestPostSiteToSiteVpn godoc @ID PostSiteToSiteVpn @Summary Create a site-to-site VPN @Description Create a site-to-site VPN @Description @Description The supported CSP sets are as follows: @Description @Description - AWS and one of CSPs in Azure, GCP, Alibaba, Tencent, and IBM @Description @Description - Note: It will take about `15 ~ 45 minutes`. @Tags [Infra Resource] Site-to-site VPN Management (under development) @Accept json @Produce json-stream @Param nsId path string true "Namespace ID" default(default) @Param mciId path string true "MCI ID" default(mci01) @Param vpnReq body model.RestPostVpnRequest true "Sites info for VPN configuration" @Param action query string false "Action" Enums(retry) @Success 200 {object} model.SimpleMsg "OK" @Failure 400 {object} model.SimpleMsg "Bad Request" @Failure 500 {object} model.SimpleMsg "Internal Server Error" @Failure 503 {object} model.SimpleMsg "Service Unavailable" @Router /ns/{nsId}/mci/{mciId}/vpn [post]

func RestPostSpec

func RestPostSpec(c echo.Context) error

RestPostSpec godoc @ID PostSpec @Summary Register spec @Description Register spec @Tags [Infra Resource] Spec Management @Accept json @Produce json @Param action query string true "registeringMethod" Enums(registerWithInfo, registerWithCspResourceId) @Param nsId path string true "Namespace ID" default(system) @Param specInfo body model.SpecInfo false "Specify details of a spec object (vCPU, memoryGiB, ...) manually" @Param specReq body model.SpecReq false "Specify n(ame, connectionName, cspSpecName) to register a spec object automatically" @Param update query boolean false "Force update to existing spec object" default(false) @Success 200 {object} model.SpecInfo @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @Router /ns/{nsId}/resources/spec [post]

func RestPostSqlDB

func RestPostSqlDB(c echo.Context) error

RestPostSqlDB godoc @ID PostSqlDb @Summary Create a SQL Databases @Description Create a SQL Databases @Description @Description Supported CSPs: AWS, Azure, GCP, NCP @Description - Note - `connectionName` example: aws-ap-northeast-2, azure-koreacentral, gcp-asia-northeast3, ncp-kr @Description @Description - Note - Please check the `requiredCSPResource` property which includes CSP specific values. @Description @Description - Note - You can find the API usage examples on this link, https://github.com/cloud-barista/mc-terrarium/discussions/110 @Description @Tags [Infra Resource] SQL Database Management (under development) @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param sqlDbReq body model.RestPostSqlDBRequest true "Request body to create a SQL database" @Param action query string false "Action" Enums(retry) @Success 200 {object} model.SqlDBInfo "OK" @Failure 400 {object} model.SimpleMsg "Bad Request" @Failure 500 {object} model.SimpleMsg "Internal Server Error" @Failure 503 {object} model.SimpleMsg "Service Unavailable" @Router /ns/{nsId}/resources/sqlDb [post]

func RestPostSshKey

func RestPostSshKey(c echo.Context) error

RestPostSshKey godoc @ID PostSshKey @Summary Create SSH Key @Description Create SSH Key @Tags [Infra Resource] Access Key Management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param option query string false "Option: [required params for register] connectionName, name, cspResourceId, fingerprint, username, publicKey, privateKey" Enums(register) @Param sshKeyInfo body model.SshKeyReq true "Details for an SSH Key object" @Success 200 {object} model.SshKeyInfo @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @Router /ns/{nsId}/resources/sshKey [post]

func RestPostSubnet

func RestPostSubnet(c echo.Context) error

RestPostSubnet godoc @ID PostSubnet @Summary Create Subnet @Description Create Subnet @Tags [Infra Resource] Network Management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param vNetId path string true "VNet ID" @Param subnetReq body model.SubnetReq true "Details for an Subnet object" @Success 200 {object} model.SubnetInfo @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @Router /ns/{nsId}/resources/vNet/{vNetId}/subnet [post]

func RestPostVNet

func RestPostVNet(c echo.Context) error

RestPostVNet godoc @ID PostVNet @Summary Create VNet @Description Create a new VNet @Tags [Infra Resource] Network Management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param vNetReq body model.VNetReq false "Details for an VNet object" @Success 201 {object} model.VNetInfo @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @Router /ns/{nsId}/resources/vNet [post]

func RestPostVmDataDisk

func RestPostVmDataDisk(c echo.Context) error

RestPostVmDataDisk godoc @ID PostVmDataDisk @Summary Provisioning (Create and attach) dataDisk @Description Provisioning (Create and attach) dataDisk @Tags [Infra Resource] Data Disk Management @Accept json @Produce json @Param dataDiskInfo body model.DataDiskVmReq true "Details for an Data Disk object" @Param nsId path string true "Namespace ID" default(default) @Param mciId path string true "MCI ID" default(mci01) @Param vmId path string true "VM ID" default(g1-1) @Success 200 {object} model.VmInfo @Failure 404 {object} model.SimpleMsg @Router /ns/{nsId}/mci/{mciId}/vm/{vmId}/dataDisk [post]

func RestPutChangeK8sNodeGroupAutoscaleSize

func RestPutChangeK8sNodeGroupAutoscaleSize(c echo.Context) error

RestPutChangeK8sNodeGroupAutoscaleSize func is a rest api wrapper for ChangeK8sNodeGroupAutoscaleSize. RestPutChangeK8sNodeGroupAutoscaleSize godoc @ID PutChangeK8sNodeGroupAutoscaleSize @Summary Change a K8sNodeGroup's Autoscale Size @Description Change a K8sNodeGroup's Autoscale Size @Tags [Kubernetes] Cluster Management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param k8sClusterId path string true "K8sCluster ID" default(k8scluster01) @Param k8sNodeGroupName path string true "K8sNodeGroup Name" default(k8sng01) @Param changeK8sNodeGroupAutoscaleSizeReq body model.ChangeK8sNodeGroupAutoscaleSizeReq true "Details of the ChangeK8sNodeGroupAutoscaleSizeReq object" @Success 200 {object} model.ChangeK8sNodeGroupAutoscaleSizeRes @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @Router /ns/{nsId}/k8sCluster/{k8sClusterId}/k8sNodeGroup/{k8sNodeGroupName}/autoscaleSize [put]

func RestPutDataDisk

func RestPutDataDisk(c echo.Context) error

RestPutDataDisk godoc @ID PutDataDisk @Summary Upsize Data Disk @Description Upsize Data Disk @Tags [Infra Resource] Data Disk Management @Accept json @Produce json @Param dataDiskUpsizeReq body model.DataDiskUpsizeReq true "Request body to upsize the dataDisk" @Param nsId path string true "Namespace ID" default(default) @Param dataDiskId path string true "DataDisk ID" @Success 200 {object} model.DataDiskInfo @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @Router /ns/{nsId}/resources/dataDisk/{dataDiskId} [put]

func RestPutImage

func RestPutImage(c echo.Context) error

RestPutImage godoc @ID PutImage @Summary Update image @Description Update image @Tags [Infra Resource] Image Management @Accept json @Produce json @Param imageInfo body model.ImageInfo true "Details for an image object" @Param nsId path string true "Namespace ID" default(system) @Param imageId path string true "Image ID ({providerName}+{regionName}+{cspImageName})" @Success 200 {object} model.ImageInfo @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @Router /ns/{nsId}/resources/image/{imageId} [put]

func RestPutK8sCluster

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

// RestPutK8sCluster godoc // @ID PutK8sCluster // @Summary Update K8sCluster // @Description Update K8sCluster // @Tags [Kubernetes] Cluster Management // @Accept json // @Produce json // @Param nsId path string true "Namespace ID" default(default) // @Param k8sClusterId path string true "K8sCluster ID" default(k8scluster01) // @Param k8sClusterInfo body model.K8sClusterInfo true "Details of the K8sCluster object" // @Success 200 {object} model.K8sClusterInfo // @Failure 404 {object} model.SimpleMsg // @Failure 500 {object} model.SimpleMsg // @Router /ns/{nsId}/k8sCluster/{k8sClusterId} [put]

func RestPutSecurityGroup

func RestPutSecurityGroup(c echo.Context) error

RestPutSecurityGroup godoc @ID PutSecurityGroup @Summary Update Security Group (Synchronize Firewall Rules) @Description Update Security Group: Synchronize the firewall rules of the specified Security Group to match the requested list exactly. @Description This API will add missing rules and delete extra rules so that the 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 a Security Group. The rules in the request body will become the only rules in the 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. @Tags [Infra Resource] Security Group Management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param securityGroupId path string true "Security Group ID" @Param securityGroupInfo body model.SecurityGroupUpdateReq true "Details for an securityGroup object (only firewallRules field is used for update)" @Success 200 {object} model.SecurityGroupUpdateResponse "Updated Security Group info with synchronized firewall rules" @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @Router /ns/{nsId}/resources/securityGroup/{securityGroupId} [put]

func RestPutSetK8sNodeGroupAutoscaling

func RestPutSetK8sNodeGroupAutoscaling(c echo.Context) error

RestPutSetK8sNodeGroupAutoscaling func is a rest api wrapper for SetK8sNodeGroupAutoscaling. RestPutSetK8sNodeGroupAutoscaling godoc @ID PutSetK8sNodeGroupAutoscaling @Summary Set a K8sNodeGroup's Autoscaling On/Off @Description Set a K8sNodeGroup's Autoscaling On/Off @Tags [Kubernetes] Cluster Management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param k8sClusterId path string true "K8sCluster ID" default(k8scluster01) @Param k8sNodeGroupName path string true "K8sNodeGroup Name" default(k8sng01) @Param setK8sNodeGroupAutoscalingReq body model.SetK8sNodeGroupAutoscalingReq true "Details of the SetK8sNodeGroupAutoscalingReq object" @Success 200 {object} model.SetK8sNodeGroupAutoscalingRes @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @Router /ns/{nsId}/k8sCluster/{k8sClusterId}/k8sNodeGroup/{k8sNodeGroupName}/onAutoscaling [put]

func RestPutSpec

func RestPutSpec(c echo.Context) error

RestPutSpec godoc @ID PutSpec @Summary Update spec @Description Update spec @Tags [Infra Resource] Spec Management @Accept json @Produce json @Param specInfo body model.SpecInfo true "Details for an spec object" @Param nsId path string true "Namespace ID" default(system) @Param specId path string true "Spec ID ({providerName}+{regionName}+{cspSpecName})" @Success 200 {object} model.SpecInfo @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @Router /ns/{nsId}/resources/spec/{specId} [put]

func RestPutSshKey

func RestPutSshKey(c echo.Context) error

RestPutSshKey godoc @ID PutSshKey @Summary Update SSH Key @Description Update SSH Key @Tags [Infra Resource] Access Key Management @Accept json @Produce json @Param sshKeyInfo body model.SshKeyInfo true "Details for an SSH Key object" @Param nsId path string true "Namespace ID" default(default) @Param sshKeyId path string true "SshKey ID" @Success 200 {object} model.SshKeyInfo @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @Router /ns/{nsId}/resources/sshKey/{sshKeyId} [put]

func RestPutUpgradeK8sCluster

func RestPutUpgradeK8sCluster(c echo.Context) error

RestPutUpgradeK8sCluster func is a rest api wrapper for UpgradeK8sCluster. RestPutUpgradeK8sCluster godoc @ID PutUpgradeK8sCluster @Summary Upgrade a K8sCluster's version @Description Upgrade a K8sCluster's version @Tags [Kubernetes] Cluster Management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(default) @Param k8sClusterId path string true "K8sCluster ID" default(k8scluster01) @Param skipVersionCheck query string false "Skip Kubernetes version validation (use for testing with unlisted versions)" default(false) @Param upgradeK8sClusterReq body model.UpgradeK8sClusterReq true "Details of the UpgradeK8sClusterReq object" @Success 200 {object} model.SimpleMsg @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @Router /ns/{nsId}/k8sCluster/{k8sClusterId}/upgrade [put]

func RestPutVmDataDisk

func RestPutVmDataDisk(c echo.Context) error

RestPutVmDataDisk godoc @ID PutVmDataDisk @Summary Attach/Detach available dataDisk @Description Attach/Detach available dataDisk @Tags [Infra Resource] Data Disk Management @Accept json @Produce json @Param attachDetachDataDiskReq body model.AttachDetachDataDiskReq false "Request body to attach/detach dataDisk" @Param nsId path string true "Namespace ID" default(default) @Param mciId path string true "MCI ID" default(mci01) @Param vmId path string true "VM ID" default(g1-1) @Param option query string true "Option for MCI" Enums(attach, detach) @Param force query string false "Force to attach/detach even if VM info is not matched" Enums(true, false) @Success 200 {object} model.VmInfo @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @Router /ns/{nsId}/mci/{mciId}/vm/{vmId}/dataDisk [put]

func RestRecommendK8sNode

func RestRecommendK8sNode(c echo.Context) error

RestRecommendK8sNode godoc @ID RecommendK8sNode @Summary Recommend K8sCluster's Node plan (filter and priority) @Description Recommend K8sCluster's Node plan (filter and priority) Find details from https://github.com/cloud-barista/cb-tumblebug/discussions/1234 @Tags [Kubernetes] Cluster Management @Accept json @Produce json @Param recommendSpecReq body model.RecommendSpecReq false "Recommend K8sCluster's Node plan (filter and priority)" @Success 200 {object} []model.SpecInfo @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @Router /k8sClusterRecommendNode [post]

func RestSearchImage

func RestSearchImage(c echo.Context) error

RestSearchImage godoc @ID SearchImage @Summary Search image @Description Search image @Tags [MC-Infra] MCI Provisioning and Management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(system) @Param customImage query boolean false "Search custom images (snapshots) only" default(false) @Param condition body model.SearchImageRequest true "condition" @Success 200 {object} model.SearchImageResponse @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @Router /ns/{nsId}/resources/searchImage [post]

func RestSearchImageOptions

func RestSearchImageOptions(c echo.Context) error

RestSearchImageOptions godoc @ID SearchImageOptions @Get available image search request options @Description Get all available options for image search fields @Tags [MC-Infra] MCI Provisioning and Management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(system) @Success 200 {object} model.SearchImageRequestOptions @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @Router /ns/{nsId}/resources/searchImageOptions [get]

func RestTestAddObjectAssociation

func RestTestAddObjectAssociation(c echo.Context) error

RestTestAddObjectAssociation is a REST API call handling function to test "model.UpdateAssociatedObjectList" function with "add" argument.

func RestTestDeleteObjectAssociation

func RestTestDeleteObjectAssociation(c echo.Context) error

RestTestDeleteObjectAssociation is a REST API call handling function to test "model.UpdateAssociatedObjectList" function with "delete" argument.

func RestTestGetAssociatedObjectCount

func RestTestGetAssociatedObjectCount(c echo.Context) error

RestTestGetAssociatedObjectCount is a REST API call handling function to test "model.GetAssociatedObjectCount" function.

func RestUpdateExistingSpecListByAvailableRegionZones added in v0.11.9

func RestUpdateExistingSpecListByAvailableRegionZones(c echo.Context) error

RestUpdateExistingSpecListByAvailableRegionZones godoc @ID UpdateExistingSpecListByAvailableRegionZones @Summary Clean up unavailable specs from database @Description Query all specs for a specific provider across all regions, check their availability, and remove specs that are not available in their respective regions @Tags [Infra Resource] Spec Management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(system) @Param cleanupReq body model.UpdateSpecListByAvailabilityRequest true "Spec cleanup request" @Success 200 {object} model.SpecCleanupResult @Failure 400 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @Router /ns/{nsId}/updateExistingSpecListByAvailableRegionZones [post]

func RestUpdateImagesFromAsset

func RestUpdateImagesFromAsset(c echo.Context) error

RestUpdateImagesFromAsset godoc @ID UpdateImagesFromAsset @Summary Update images from cloudimage.csv asset file @Description Update image information based on the cloudimage.csv asset file @Tags [Infra Resource] Image Management @Accept json @Produce json @Success 202 {object} resource.FetchImagesAsyncResult @Failure 404 {object} model.SimpleMsg @Failure 500 {object} model.SimpleMsg @Router /updateImagesFromAsset [post]

func SetObjectStorageCORS added in v0.11.10

func SetObjectStorageCORS(c echo.Context) error

RestSetObjectStorageCORS godoc @ID SetObjectStorageCORS @Summary Set CORS configuration of an object storage (bucket) @Description Set CORS configuration of an object storage (bucket) @Description @Description **Important Notes:** @Description - The CORS configuration must be provided in the request body in XML format. @Description - The actual request body should have root element `CORSConfiguration` @Description @Description **Actual XML Request Body Example:** @Description ```xml @Description <?xml version="1.0" encoding="UTF-8"?> @Description <CORSConfiguration> @Description <CORSRule> @Description <AllowedOrigin>https://example.com</AllowedOrigin> @Description <AllowedOrigin>https://app.example.com</AllowedOrigin> @Description <AllowedMethod>GET</AllowedMethod> @Description <AllowedMethod>PUT</AllowedMethod> @Description <AllowedHeader>Content-Type</AllowedHeader> @Description <AllowedHeader>Authorization</AllowedHeader> @Description <ExposeHeader>ETag</ExposeHeader> @Description <MaxAgeSeconds>1800</MaxAgeSeconds> @Description </CORSRule> @Description <CORSRule> @Description <AllowedOrigin>*</AllowedOrigin> @Description <AllowedMethod>GET</AllowedMethod> @Description <MaxAgeSeconds>300</MaxAgeSeconds> @Description </CORSRule> @Description </CORSConfiguration> @Description ``` @Tags [Infra Resource] Object Storage Management @Accept xml @Produce xml @Param objectStorageName path string true "Object Storage Name" default(globally-unique-bucket-hctdx3) @Param credential header string true "This represents a credential or an access key ID. The required format is `{csp-region}` (i.e., the connection name)." default(aws-ap-northeast-2) @Param reqBody body CORSConfiguration true "CORS Configuration in XML format" @Success 200 "OK" @Router /resources/objectStorage/{objectStorageName}/cors [put]

func SetObjectStorageVersioning added in v0.11.10

func SetObjectStorageVersioning(c echo.Context) error

RestSetObjectStorageVersioning godoc @ID SetObjectStorageVersioning @Summary Set versioning status of an object storage (bucket) @Description Set versioning status of an object storage (bucket) @Description @Description **Important Notes:** @Description - The request body must be XML format with root element `VersioningConfiguration` @Description - The `Status` field can be either `Enabled` or `Suspended` @Description @Description **Request Body Example:** @Description ```xml @Description <?xml version="1.0" encoding="UTF-8"?> @Description <VersioningConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> @Description <Status>Enabled</Status> @Description </VersioningConfiguration> @Description ``` @Tags [Infra Resource] Object Storage Management @Accept xml @Produce xml @Param objectStorageName path string true "Object Storage Name" default(globally-unique-bucket-hctdx3) @Param credential header string true "This represents a credential or an access key ID. The required format is `{csp-region}` (i.e., the connection name)." default(aws-ap-northeast-2) @Param reqBody body VersioningConfiguration true "Versioning Configuration" @Success 200 "OK" @Router /resources/objectStorage/{objectStorageName}/versioning [put]

Types

type Bucket added in v0.11.10

type Bucket struct {
	Name         string `xml:"Name" json:"name" example:"spider-test-bucket"`
	CreationDate string `xml:"CreationDate" json:"creationDate" example:"2025-09-04T04:18:06Z"`
}

Bucket represents a single bucket in S3 bucket list response

type Buckets added in v0.11.10

type Buckets struct {
	Bucket []Bucket `xml:"Bucket" json:"bucket"`
}

Buckets represents the collection of buckets in S3 bucket list response

type CORSConfiguration added in v0.11.10

type CORSConfiguration struct {
	// The xmlns attribute will be set to "http://s3.amazonaws.com/doc/2006-03-01/"
	// Xmlns string `xml:"xmlns,attr" json:"-" example:"http://s3.amazonaws.com/doc/2006-03-01/"`
	CORSRule []CORSRule `xml:"CORSRule" json:"corsRule"`
}

type CORSRule added in v0.11.10

type CORSRule struct {
	AllowedOrigin []string `xml:"AllowedOrigin" json:"allowedOrigin" example:"*"`
	AllowedMethod []string `xml:"AllowedMethod" json:"allowedMethod" example:"GET"`
	AllowedHeader []string `xml:"AllowedHeader" json:"allowedHeader" example:"*"`
	ExposeHeader  []string `xml:"ExposeHeader" json:"exposeHeader" example:"ETag"`
	MaxAgeSeconds int      `xml:"MaxAgeSeconds" json:"maxAgeSeconds" example:"3000"`
}

type Delete added in v0.11.10

type Delete struct {
	Object []Object `xml:"Object" json:"object"`
}

type DeleteResult added in v0.11.10

type DeleteResult struct {
	// The xmlns attribute will be set to "http://s3.amazonaws.com/doc/2006-03-01/"
	// Xmlns string `xml:"xmlns,attr" json:"-" example:"http://s3.amazonaws.com/doc/2006-03-01/"`
	Deleted []Object `xml:"Deleted" json:"deleted"`
}

type Error added in v0.11.10

type Error struct {
	Code      string `xml:"Code" json:"code" example:"NoSuchCORSConfiguration"`
	Message   string `xml:"Message" json:"message" example:"The CORS configuration does not exist"`
	Resource  string `xml:"Resource" json:"resource" example:"/example-bucket"`
	RequestId string `xml:"RequestId" json:"requestId" example:"656c76696e6727732072657175657374"`
}

type JSONResult

type JSONResult struct {
}

JSONResult is a dummy struct for Swagger annotations.

type ListAllMyBucketsResult added in v0.11.10

type ListAllMyBucketsResult struct {
	// The xmlns attribute will be set to "http://s3.amazonaws.com/doc/2006-03-01/"
	// Xmlns string `xml:"xmlns,attr" json:"-" example:"http://s3.amazonaws.com/doc/2006-03-01/"`
	// Owner information for the S3 account
	Owner Owner `xml:"Owner" json:"owner"`
	// Collection of buckets
	Buckets Buckets `xml:"Buckets" json:"buckets"`
}

ListAllMyBucketsResult represents the response structure for S3 ListAllMyBuckets operation

The actual XML response will have the following structure: - Root element: ListAllMyBucketsResult - Namespace: xmlns="http://s3.amazonaws.com/doc/2006-03-01/" - Contains Owner and Buckets elements

Example XML response: ```xml <?xml version="1.0" encoding="UTF-8"?> <ListAllMyBucketsResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/">

<Owner>
  <ID>aws-ap-northeast-2</ID>
  <DisplayName>aws-ap-northeast-2</DisplayName>
</Owner>
<Buckets>
</Buckets>

</ListAllMyBucketsResult> ```

Note: The xmlns attribute and root element name may not be accurately represented in Swagger UI due to XML rendering limitations.

type ListBucketResult added in v0.11.10

type ListBucketResult struct {
	// The xmlns attribute will be set to "http://s3.amazonaws.com/doc/2006-03-01/"
	// Xmlns string `xml:"xmlns,attr" json:"-" example:"http://s3.amazonaws.com/doc/2006-03-01/"`
	Name        string `xml:"Name" json:"name" example:"spider-test-bucket"`
	Prefix      string `xml:"Prefix" json:"prefix" example:""`
	Marker      string `xml:"Marker" json:"marker" example:""`
	MaxKeys     int    `xml:"MaxKeys" json:"maxKeys" example:"1000"`
	IsTruncated bool   `xml:"IsTruncated" json:"isTruncated" example:"false"`
}

Note: The xmlns attribute and root element name may not be accurately represented in Swagger UI due to XML rendering limitations.

type ListVersionsResult added in v0.11.10

type ListVersionsResult struct {
	// The xmlns attribute will be set to "http://s3.amazonaws.com/doc/2006-03-01/"
	// Xmlns string `xml:"xmlns,attr" json:"-" example:"http://s3.amazonaws.com/doc/2006-03-01/"`
	Name                string  `xml:"Name" json:"name" example:"spider-test-bucket"`
	Prefix              string  `xml:"Prefix" json:"prefix" example:""`
	KeyMarker           string  `xml:"KeyMarker" json:"keyMarker" example:""`
	VersionIdMarker     string  `xml:"VersionIdMarker" json:"versionIdMarker" example:""`
	NextKeyMarker       string  `xml:"NextKeyMarker" json:"nextKeyMarker" example:""`
	NextVersionIdMarker string  `xml:"NextVersionIdMarker" json:"nextVersionIdMarker" example:""`
	MaxKeys             int     `xml:"MaxKeys" json:"maxKeys" example:"1000"`
	IsTruncated         bool    `xml:"IsTruncated" json:"isTruncated" example:"false"`
	Version             Version `xml:"Version" json:"version"`
}

type LocationConstraint added in v0.11.10

type LocationConstraint struct {
}

type Object added in v0.11.10

type Object struct {
	Key string `xml:"Key" json:"key" example:"test-object.txt"`
}

type Owner added in v0.11.10

type Owner struct {
	ID          string `xml:"ID" json:"id" example:"aws-ap-northeast-2"`
	DisplayName string `xml:"DisplayName" json:"displayName" example:"aws-ap-northeast-2"`
}

========== Resource APIs: Object Storage ========== Owner represents the owner information in S3 bucket list response

type PresignedURLResult added in v0.11.10

type PresignedURLResult struct {
	PresignedURL string `` /* 358-byte string literal not displayed */
	Expires      int    `xml:"Expires" json:"expires" example:"3600"`
	Method       string `xml:"Method" json:"method" example:"GET"`
}

type RestFilterSpecsResponse

type RestFilterSpecsResponse struct {
	Spec []model.SpecInfo `json:"spec"`
}

RestFilterSpecsResponse is Response structure for RestFilterSpecs

type RestGetAllCustomImageResponse

type RestGetAllCustomImageResponse struct {
	CustomImage []model.ImageInfo `json:"customImage"`
}

Response structure for RestGetAllCustomImage

type RestGetAllDataDiskResponse

type RestGetAllDataDiskResponse struct {
	DataDisk []model.DataDiskInfo `json:"dataDisk"`
}

Response struct for RestGetAllDataDisk

type RestGetAllK8sClusterResponse

type RestGetAllK8sClusterResponse struct {
	K8sCluster []model.K8sClusterInfo `json:"K8sClusterInfo"`
}

Response structure for RestGetAllK8sCluster

type RestGetAllSecurityGroupResponse

type RestGetAllSecurityGroupResponse struct {
	SecurityGroup []model.SecurityGroupInfo `json:"securityGroup"`
}

Response structure for RestGetAllSecurityGroup

type RestGetAllSshKeyResponse

type RestGetAllSshKeyResponse struct {
	SshKey []model.SshKeyInfo `json:"sshKey"`
}

Response struct for RestGetAllSshKey

type RestGetAllSubnetResponse

type RestGetAllSubnetResponse struct {
	SubnetInfoList []model.SubnetInfo `json:"subnetInfoList"`
}

Response structure for RestGetAllSubnet

type RestGetAllVNetResponse

type RestGetAllVNetResponse struct {
	VNet []model.VNetInfo `json:"vNet"`
}

Response structure for RestGetAllVNet

type RestLookupImageRequest

type RestLookupImageRequest struct {
	ConnectionName string `json:"connectionName"`
	CspImageName   string `json:"cspImageName"`
}

Request structure for RestLookupImage

type RestLookupSpecRequest

type RestLookupSpecRequest struct {
	ConnectionName string `json:"connectionName"`
	CspResourceId  string `json:"cspResourceId"`
}

Request structure for RestLookupSpec

type Version added in v0.11.10

type Version struct {
	Key          string `xml:"Key" json:"key" example:"test-file.txt"`
	VersionId    string `xml:"VersionId" json:"versionId" example:"yb4PgjnFVD2LfRZHXBjjsHBkQRHlu.TZ"`
	IsLatest     bool   `xml:"IsLatest" json:"isLatest" example:"true"`
	LastModified string `xml:"LastModified" json:"lastModified" example:"2025-09-04T04:24:12Z"`
	ETag         string `xml:"ETag" json:"etag" example:"23228a38faecd0591107818c7281cece"`
	Size         int    `xml:"Size" json:"size" example:"23"`
	StorageClass string `xml:"StorageClass" json:"storageClass" example:"STANDARD"`
	Owner        Owner  `xml:"Owner" json:"owner"`
}

type VersioningConfiguration added in v0.11.10

type VersioningConfiguration struct {
	// The xmlns attribute will be set to "http://s3.amazonaws.com/doc/2006-03-01/"
	// Xmlns string `xml:"xmlns,attr" json:"-" example:"http://s3.amazonaws.com/doc/2006-03-01/"`
	Status string `xml:"Status" json:"status" example:"Enabled"`
}

Jump to

Keyboard shortcuts

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