From 18f2e3d1189376c646d9d6dd1d1927db680eed77 Mon Sep 17 00:00:00 2001 From: seokho-son Date: Thu, 4 Nov 2021 11:52:07 +0900 Subject: [PATCH 1/2] Provide total number of clouds --- .../register-cloud-interactive.sh | 8 ++-- src/testclient/scripts/testSet.env | 38 +++++++++++++++++-- 2 files changed, 38 insertions(+), 8 deletions(-) diff --git a/src/testclient/scripts/1.configureSpider/register-cloud-interactive.sh b/src/testclient/scripts/1.configureSpider/register-cloud-interactive.sh index f4c169b04..2341b392d 100755 --- a/src/testclient/scripts/1.configureSpider/register-cloud-interactive.sh +++ b/src/testclient/scripts/1.configureSpider/register-cloud-interactive.sh @@ -143,11 +143,11 @@ echo -e " - Tumblebug Server : ${GREEN}${BOLD} $TumblebugServer ${NC}" echo -e " - Spider Server : ${GREEN}${BOLD} $SpiderServer ${NC}" echo "" -INDEXX=${NumCSP} +INDEXX=${TotalNumCSP} echo -e "${BOLD}2) Enabled Clouds and Regions${NC}" for ((cspi = 1; cspi <= INDEXX; cspi++)); do - INDEXY=${NumRegion[$cspi]} + INDEXY=${TotalNumRegion[$cspi]} CSP=${CSPType[$cspi]} echo -e "${GREEN}${BOLD} - [$cspi] Cloud : $CSP (enabled regions : $INDEXY)${NC}" for ((cspj = 1; cspj <= INDEXY; cspj++)); do @@ -179,9 +179,9 @@ done if [ "${INDEX}" == "0" ]; then echo "[Parallel execution for all CSP regions]" - INDEXX=${NumCSP} + INDEXX=${TotalNumCSP} for ((cspi = 1; cspi <= INDEXX; cspi++)); do - INDEXY=${NumRegion[$cspi]} + INDEXY=${TotalNumRegion[$cspi]} CSP=${CSPType[$cspi]} echo "[$cspi] $CSP details" for ((cspj = 1; cspj <= INDEXY; cspj++)); do diff --git a/src/testclient/scripts/testSet.env b/src/testclient/scripts/testSet.env index 1aeaea3b8..14defa926 100644 --- a/src/testclient/scripts/testSet.env +++ b/src/testclient/scripts/testSet.env @@ -9,6 +9,8 @@ AgentInstallOn=no ## Number of CSP types and corresponding regions NumCSP=3 +TotalNumCSP=14 + ## Define sequential test order for cloud types # Note: you can change order by replacing lines (automatically assign continuous numbers starting from 1) IX=0 @@ -53,6 +55,8 @@ CSPType[$IndexTestCloud03]=testcloud03 # AWS (Total: 21 Regions / Recommend: 20 Regions) NumRegion[$IndexAWS]=4 +TotalNumRegion[$IndexAWS]=21 + IY=0 AwsApSoutheast1=$((++IY)) # Location: Asia Pacific (Singapore) AwsCaCentral1=$((++IY)) # Location: Canada (Central) @@ -81,6 +85,8 @@ AwsEuSouth1=$((++IY)) # Location: Europe (Milan) - Opt-In required # Alibaba (Total: 23 Regions / Recommend: 8 Regions) NumRegion[$IndexAlibaba]=2 +TotalNumRegion[$IndexAlibaba]=23 + IY=0 AlibabaApNortheast1=$((++IY)) # Location: Japan (Tokyo) AlibabaApSouth1=$((++IY)) # Location: Mumbai Zone A @@ -111,6 +117,8 @@ AlibabaCnGuangzhou=$((++IY)) # Location: China (Guangzhou) - NEED TO CHECK NETW # GCP (Total: 25 Regions / Recommend: 22 Regions) NumRegion[$IndexGCP]=2 +TotalNumRegion[$IndexGCP]=25 + IY=0 GcpAsiaEast1=$((++IY)) # Location: Changhua County Taiwan GcpEuropeWest3=$((++IY)) # Location: Frankfurt Germany @@ -144,6 +152,8 @@ GcpEuropeCentral2=$((++IY)) # Location: Warsaw, Poland, Europe # Azure (Total: 40 Regions / Recommend: 34 Regions) NumRegion[$IndexAzure]=2 +TotalNumRegion[$IndexAzure]=40 + IY=0 AzureWestus=$((++IY)) # Location: West US AzureEastus=$((++IY)) # Location: East US @@ -176,11 +186,8 @@ AzureUaenorth=$((++IY)) # Location: UAE North AzureSwitzerlandnorth=$((++IY)) # Location: Switzerland North AzureGermanywestcentral=$((++IY)) # Location: Germany West Central AzureNorwayeast=$((++IY)) # Location: Norway East - AzureSouthindia=$((++IY)) # Location: South India (not recommend) ERR: not subscribed by default AzureWestindia=$((++IY)) # Location: West India (not recommend) ERR: not subscribed by default -# Azurejioindiawest - AzureSouthafricawest=$((++IY)) # Location: South Africa West (not recommend) AzureSwitzerlandwest=$((++IY)) # Location: Switzerland West (not recommend) AzureGermanynorth=$((++IY)) # Location: Germany North (not recommend) @@ -194,6 +201,8 @@ AzureAustraliacentral2=$((++IY)) # Location: Australia Central 2 (not recommend. # Openstack (Total: 1 Regions / Recommend: 1 Regions) NumRegion[$IndexOpenstack]=1 +TotalNumRegion[$IndexOpenstack]=1 + IY=0 OpenstackRegion01=$((++IY)) # Location: Korea Daejeon (Internal) @@ -202,6 +211,8 @@ OpenstackRegion01=$((++IY)) # Location: Korea Daejeon (Internal) # NCP (Total: 5 Regions / Recommend: ? Regions / Not tested yet) NumRegion[$IndexNCP]=5 +TotalNumRegion[$IndexNCP]=5 + IY=0 NcpKorea1=$((++IY)) # Location: NCP Korea NcpUsWestern=$((++IY)) # Location: NCP US West @@ -214,6 +225,8 @@ NcpJapan=$((++IY)) # Location: NCP Japan # Cloudit (Total: 1 Regions / Recommend: 1 Regions) NumRegion[$IndexCloudit]=1 +TotalNumRegion[$IndexCloudit]=1 + IY=0 ClouditRegion01=$((++IY)) # Location: Korea Seoul (Internal) @@ -222,6 +235,8 @@ ClouditRegion01=$((++IY)) # Location: Korea Seoul (Internal) # Tencent (Total: 18 Regions / Recommend: 11 Regions) NumRegion[$IndexTencent]=1 +TotalNumRegion[$IndexTencent]=18 + IY=0 TencentApSingapore=$((++IY)) # Location: Singapore TencentApJakarta=$((++IY)) # Location: Jakarta @@ -244,10 +259,11 @@ TencentApHongKong=$((++IY)) # Location: Hong Kong - # KT cloud (Total: 5 Regions / Recommend: n Regions) NumRegion[$IndexKTcloud]=1 +TotalNumRegion[$IndexKTcloud]=5 + IY=0 KTcloudKRcentralA=$((++IY)) # Location: Cheon-an, South Korea KTcloudKRcentralB=$((++IY)) # Location: Cheon-an, South Korea @@ -260,6 +276,8 @@ KTcloudUSwest=$((++IY)) # Location: LA, US # Cloud-Twin (Total: 1 Regions / Recommend: 1 Regions) NumRegion[$IndexCloudTwin]=1 +TotalNumRegion[$IndexCloudTwin]=1 + IY=0 CloudTwinRegion01=$((++IY)) # Location: Korea Daejeon (Internal) @@ -268,6 +286,8 @@ CloudTwinRegion01=$((++IY)) # Location: Korea Daejeon (Internal) # Mock (Total: 1 Regions / Recommend: 1 Regions) NumRegion[$IndexMock]=1 +TotalNumRegion[$IndexMock]=1 + IY=0 MockSeoul=$((++IY)) # Location: Korea Seoul (Virtual) @@ -276,17 +296,27 @@ MockSeoul=$((++IY)) # Location: Korea Seoul (Virtual) # TestCloud01 to emulate cloud using Mock driver (1 Regions) NumRegion[$IndexTestCloud01]=1 +TotalNumRegion[$IndexTestCloud01]=1 + IY=0 TestCloud01Seoul=$((++IY)) # Location: Korea (Seoul) + + # TestCloud02 to emulate cloud using Mock driver (1 Regions) NumRegion[$IndexTestCloud02]=1 +TotalNumRegion[$IndexTestCloud02]=1 + IY=0 TestCloud02Canada=$((++IY)) # Location: Canada (Central) + + # TestCloud03 to emulate cloud using Mock driver (1 Regions) NumRegion[$IndexTestCloud03]=1 +TotalNumRegion[$IndexTestCloud03]=1 + IY=0 TestCloud03Frankfurt=$((++IY)) # Location: Europe (Frankfurt) From e144f163fe7c24b14c540d1b3fbaf067491c455f Mon Sep 17 00:00:00 2001 From: seokho-son Date: Thu, 4 Nov 2021 11:53:06 +0900 Subject: [PATCH 2/2] Set default NS example for mcir --- src/api/rest/server/mcir/image.go | 16 ++++++++-------- src/api/rest/server/mcir/securitygroup.go | 10 +++++----- src/api/rest/server/mcir/sshkey.go | 10 +++++----- src/api/rest/server/mcir/subnet.go | 10 +++++----- src/api/rest/server/mcir/vnet.go | 10 +++++----- 5 files changed, 28 insertions(+), 28 deletions(-) diff --git a/src/api/rest/server/mcir/image.go b/src/api/rest/server/mcir/image.go index a6a421bcc..fe4fb3d05 100644 --- a/src/api/rest/server/mcir/image.go +++ b/src/api/rest/server/mcir/image.go @@ -30,7 +30,7 @@ import ( // @Accept json // @Produce json // @Param registeringMethod query string true "registerWithInfo or registerWithId" -// @Param nsId path string true "Namespace ID" +// @Param nsId path string true "Namespace ID" default(ns01) // @Param imageInfo body mcir.TbImageInfo false "Details for an image object" // @Param imageId body mcir.TbImageReq false "name, connectionName and cspImageId" // @Success 200 {object} mcir.TbImageInfo @@ -93,7 +93,7 @@ func RestPostImage(c echo.Context) error { // @Accept json // @Produce json // @Param imageInfo body mcir.TbImageInfo true "Details for an image object" -// @Param nsId path string true "Namespace ID" +// @Param nsId path string true "Namespace ID" default(ns01) // @Param imageId path string true "Image ID" // @Success 200 {object} mcir.TbImageInfo // @Failure 404 {object} common.SimpleMsg @@ -193,7 +193,7 @@ func RestLookupImageList(c echo.Context) error { // @Tags [MCIR] Image management // @Accept json // @Produce json -// @Param nsId path string true "Namespace ID" +// @Param nsId path string true "Namespace ID" default(ns01) // @Success 200 {object} common.SimpleMsg // @Failure 404 {object} common.SimpleMsg // @Failure 500 {object} common.SimpleMsg @@ -248,7 +248,7 @@ func RestFetchImages(c echo.Context) error { // @Tags [MCIR] Image management // @Accept json // @Produce json -// @Param nsId path string true "Namespace ID" +// @Param nsId path string true "Namespace ID" default(ns01) // @Param imageId path string true "Image ID" // @Success 200 {object} mcir.TbImageInfo // @Failure 404 {object} common.SimpleMsg @@ -270,7 +270,7 @@ type RestGetAllImageResponse struct { // @Tags [MCIR] Image management // @Accept json // @Produce json -// @Param nsId path string true "Namespace ID" +// @Param nsId path string true "Namespace ID" default(ns01) // @Param option query string false "Option" Enums(id) // @Success 200 {object} JSONResult{[DEFAULT]=RestGetAllImageResponse,[ID]=common.IdList} "Different return structures by the given option param" // @Failure 404 {object} common.SimpleMsg @@ -287,7 +287,7 @@ func RestGetAllImage(c echo.Context) error { // @Tags [MCIR] Image management // @Accept json // @Produce json -// @Param nsId path string true "Namespace ID" +// @Param nsId path string true "Namespace ID" default(ns01) // @Param imageId path string true "Image ID" // @Success 200 {object} common.SimpleMsg // @Failure 404 {object} common.SimpleMsg @@ -303,7 +303,7 @@ func RestDelImage(c echo.Context) error { // @Tags [MCIR] Image management // @Accept json // @Produce json -// @Param nsId path string true "Namespace ID" +// @Param nsId path string true "Namespace ID" default(ns01) // @Success 200 {object} common.SimpleMsg // @Failure 404 {object} common.SimpleMsg // @Router /ns/{nsId}/resources/image [delete] @@ -323,7 +323,7 @@ type RestSearchImageRequest struct { // @Tags [MCIR] Image management // @Accept json // @Produce json -// @Param nsId path string true "Namespace ID" +// @Param nsId path string true "Namespace ID" default(ns01) // @Param keywords body RestSearchImageRequest true "Keywords" // @Success 200 {object} RestGetAllImageResponse // @Failure 404 {object} common.SimpleMsg diff --git a/src/api/rest/server/mcir/securitygroup.go b/src/api/rest/server/mcir/securitygroup.go index c69187837..b4a66d817 100644 --- a/src/api/rest/server/mcir/securitygroup.go +++ b/src/api/rest/server/mcir/securitygroup.go @@ -29,7 +29,7 @@ import ( // @Tags [MCIR] Security group management // @Accept json // @Produce json -// @Param nsId path string true "Namespace ID" +// @Param nsId path string true "Namespace ID" default(ns01) // @Param securityGroupReq body mcir.TbSecurityGroupReq true "Details for an securityGroup object" // @Success 200 {object} mcir.TbSecurityGroupInfo // @Failure 404 {object} common.SimpleMsg @@ -85,7 +85,7 @@ func RestPutSecurityGroup(c echo.Context) error { // @Tags [MCIR] Security group management // @Accept json // @Produce json -// @Param nsId path string true "Namespace ID" +// @Param nsId path string true "Namespace ID" default(ns01) // @Param securityGroupId path string true "Security Group ID" // @Success 200 {object} mcir.TbSecurityGroupInfo // @Failure 404 {object} common.SimpleMsg @@ -107,7 +107,7 @@ type RestGetAllSecurityGroupResponse struct { // @Tags [MCIR] Security group management // @Accept json // @Produce json -// @Param nsId path string true "Namespace ID" +// @Param nsId path string true "Namespace ID" default(ns01) // @Param option query string false "Option" Enums(id) // @Success 200 {object} JSONResult{[DEFAULT]=RestGetAllSecurityGroupResponse,[ID]=common.IdList} "Different return structures by the given option param" // @Failure 404 {object} common.SimpleMsg @@ -124,7 +124,7 @@ func RestGetAllSecurityGroup(c echo.Context) error { // @Tags [MCIR] Security group management // @Accept json // @Produce json -// @Param nsId path string true "Namespace ID" +// @Param nsId path string true "Namespace ID" default(ns01) // @Param securityGroupId path string true "Security Group ID" // @Success 200 {object} common.SimpleMsg // @Failure 404 {object} common.SimpleMsg @@ -140,7 +140,7 @@ func RestDelSecurityGroup(c echo.Context) error { // @Tags [MCIR] Security group management // @Accept json // @Produce json -// @Param nsId path string true "Namespace ID" +// @Param nsId path string true "Namespace ID" default(ns01) // @Success 200 {object} common.SimpleMsg // @Failure 404 {object} common.SimpleMsg // @Router /ns/{nsId}/resources/securityGroup [delete] diff --git a/src/api/rest/server/mcir/sshkey.go b/src/api/rest/server/mcir/sshkey.go index 924fae51f..158c7064e 100644 --- a/src/api/rest/server/mcir/sshkey.go +++ b/src/api/rest/server/mcir/sshkey.go @@ -29,7 +29,7 @@ import ( // @Tags [MCIR] Access key management // @Accept json // @Produce json -// @Param nsId path string true "Namespace ID" +// @Param nsId path string true "Namespace ID" default(ns01) // @Param sshKeyInfo body mcir.TbSshKeyReq true "Details for an SSH Key object" // @Success 200 {object} mcir.TbSshKeyInfo // @Failure 404 {object} common.SimpleMsg @@ -81,7 +81,7 @@ func RestPutSshKey(c echo.Context) error { // @Tags [MCIR] Access key management // @Accept json // @Produce json -// @Param nsId path string true "Namespace ID" +// @Param nsId path string true "Namespace ID" default(ns01) // @Param sshKeyId path string true "SSH Key ID" // @Success 200 {object} mcir.TbSshKeyInfo // @Failure 404 {object} common.SimpleMsg @@ -103,7 +103,7 @@ type RestGetAllSshKeyResponse struct { // @Tags [MCIR] Access key management // @Accept json // @Produce json -// @Param nsId path string true "Namespace ID" +// @Param nsId path string true "Namespace ID" default(ns01) // @Param option query string false "Option" Enums(id) // @Success 200 {object} JSONResult{[DEFAULT]=RestGetAllSshKeyResponse,[ID]=common.IdList} "Different return structures by the given option param" // @Failure 404 {object} common.SimpleMsg @@ -120,7 +120,7 @@ func RestGetAllSshKey(c echo.Context) error { // @Tags [MCIR] Access key management // @Accept json // @Produce json -// @Param nsId path string true "Namespace ID" +// @Param nsId path string true "Namespace ID" default(ns01) // @Param sshKeyId path string true "SSH Key ID" // @Success 200 {object} common.SimpleMsg // @Failure 404 {object} common.SimpleMsg @@ -136,7 +136,7 @@ func RestDelSshKey(c echo.Context) error { // @Tags [MCIR] Access key management // @Accept json // @Produce json -// @Param nsId path string true "Namespace ID" +// @Param nsId path string true "Namespace ID" default(ns01) // @Success 200 {object} common.SimpleMsg // @Failure 404 {object} common.SimpleMsg // @Router /ns/{nsId}/resources/sshKey [delete] diff --git a/src/api/rest/server/mcir/subnet.go b/src/api/rest/server/mcir/subnet.go index 5bc4c0b88..fd28a9fa5 100644 --- a/src/api/rest/server/mcir/subnet.go +++ b/src/api/rest/server/mcir/subnet.go @@ -29,7 +29,7 @@ import ( // @Tags [MCIR] Network management // @Accept json // @Produce json -// @Param nsId path string true "Namespace ID" +// @Param nsId path string true "Namespace ID" default(ns01) // @Param subnetReq body mcir.TbSubnetReq true "Details for an Subnet object" // @Success 200 {object} mcir.TbSubnetInfo // @Failure 404 {object} common.SimpleMsg @@ -88,7 +88,7 @@ func RestPutSubnet(c echo.Context) error { // @Tags [MCIR] Network management // @Accept json // @Produce json -// @Param nsId path string true "Namespace ID" +// @Param nsId path string true "Namespace ID" default(ns01) // @Param subnetId path string true "Subnet ID" // @Success 200 {object} mcir.TbSubnetInfo // @Failure 404 {object} common.SimpleMsg @@ -110,7 +110,7 @@ type RestGetAllSubnetResponse struct { // @Tags [MCIR] Network management // @Accept json // @Produce json -// @Param nsId path string true "Namespace ID" +// @Param nsId path string true "Namespace ID" default(ns01) // @Param option query string false "Option" Enums(id) // @Success 200 {object} JSONResult{[DEFAULT]=RestGetAllSubnetResponse,[ID]=common.IdList} "Different return structures by the given option param" // @Failure 404 {object} common.SimpleMsg @@ -128,7 +128,7 @@ func RestGetAllSubnet(c echo.Context) error { // @Tags [MCIR] Network management // @Accept json // @Produce json -// @Param nsId path string true "Namespace ID" +// @Param nsId path string true "Namespace ID" default(ns01) // @Param subnetId path string true "Subnet ID" // @Success 200 {object} common.SimpleMsg // @Failure 404 {object} common.SimpleMsg @@ -145,7 +145,7 @@ func RestDelSubnet(c echo.Context) error { // @Tags [MCIR] Network management // @Accept json // @Produce json -// @Param nsId path string true "Namespace ID" +// @Param nsId path string true "Namespace ID" default(ns01) // @Success 200 {object} common.SimpleMsg // @Failure 404 {object} common.SimpleMsg // @Router /ns/{nsId}/resources/vNet/{vNetId}/subnet [delete] diff --git a/src/api/rest/server/mcir/vnet.go b/src/api/rest/server/mcir/vnet.go index 1c9bd4529..da1522198 100644 --- a/src/api/rest/server/mcir/vnet.go +++ b/src/api/rest/server/mcir/vnet.go @@ -29,7 +29,7 @@ import ( // @Tags [MCIR] Network management // @Accept json // @Produce json -// @Param nsId path string true "Namespace ID" +// @Param nsId path string true "Namespace ID" default(ns01) // @Param vNetReq body mcir.TbVNetReq true "Details for an VNet object" // @Success 200 {object} mcir.TbVNetInfo // @Failure 404 {object} common.SimpleMsg @@ -86,7 +86,7 @@ func RestPutVNet(c echo.Context) error { // @Tags [MCIR] Network management // @Accept json // @Produce json -// @Param nsId path string true "Namespace ID" +// @Param nsId path string true "Namespace ID" default(ns01) // @Param vNetId path string true "VNet ID" // @Success 200 {object} mcir.TbVNetInfo // @Failure 404 {object} common.SimpleMsg @@ -108,7 +108,7 @@ type RestGetAllVNetResponse struct { // @Tags [MCIR] Network management // @Accept json // @Produce json -// @Param nsId path string true "Namespace ID" +// @Param nsId path string true "Namespace ID" default(ns01) // @Param option query string false "Option" Enums(id) // @Success 200 {object} JSONResult{[DEFAULT]=RestGetAllVNetResponse,[ID]=common.IdList} "Different return structures by the given option param" // @Failure 404 {object} common.SimpleMsg @@ -125,7 +125,7 @@ func RestGetAllVNet(c echo.Context) error { // @Tags [MCIR] Network management // @Accept json // @Produce json -// @Param nsId path string true "Namespace ID" +// @Param nsId path string true "Namespace ID" default(ns01) // @Param vNetId path string true "VNet ID" // @Success 200 {object} common.SimpleMsg // @Failure 404 {object} common.SimpleMsg @@ -141,7 +141,7 @@ func RestDelVNet(c echo.Context) error { // @Tags [MCIR] Network management // @Accept json // @Produce json -// @Param nsId path string true "Namespace ID" +// @Param nsId path string true "Namespace ID" default(ns01) // @Success 200 {object} common.SimpleMsg // @Failure 404 {object} common.SimpleMsg // @Router /ns/{nsId}/resources/vNet [delete]