From efc6c73d848b72f177f7a9ebae7dc9755a8ac55b Mon Sep 17 00:00:00 2001 From: powerkimhub Date: Thu, 9 May 2024 18:03:48 +0900 Subject: [PATCH] Rename ID_TRANSFORM_MODE Attribute to IDTransformMode --- api-runtime/common-runtime/ClusterManager.go | 4 ++-- api-runtime/common-runtime/DiskManager.go | 4 ++-- api-runtime/common-runtime/KeyPairManager.go | 4 ++-- api-runtime/common-runtime/MyImageManager.go | 4 ++-- api-runtime/common-runtime/NLBManager.go | 4 ++-- .../common-runtime/SecurityGroupManager.go | 4 ++-- api-runtime/common-runtime/VMManager.go | 4 ++-- api-runtime/common-runtime/VPC-SubnetManager.go | 10 +++++----- api-runtime/rest-runtime/ClusterRest.go | 10 +++++----- api-runtime/rest-runtime/DiskRest.go | 8 ++++---- api-runtime/rest-runtime/KeyPairRest.go | 8 ++++---- api-runtime/rest-runtime/MyImageRest.go | 8 ++++---- api-runtime/rest-runtime/NLBRest.go | 8 ++++---- api-runtime/rest-runtime/SecurityGroupRest.go | 8 ++++---- api-runtime/rest-runtime/VMRest.go | 8 ++++---- api-runtime/rest-runtime/VPC-SubnetRest.go | 16 ++++++++-------- setup.env | 2 +- 17 files changed, 57 insertions(+), 57 deletions(-) diff --git a/api-runtime/common-runtime/ClusterManager.go b/api-runtime/common-runtime/ClusterManager.go index 3d88ebc48..de61f7629 100644 --- a/api-runtime/common-runtime/ClusterManager.go +++ b/api-runtime/common-runtime/ClusterManager.go @@ -301,7 +301,7 @@ func registerNodeGroupList(connectionName string, info *cres.ClusterInfo) error // (5) insert spiderIID // (6) create userIID // (7) set used Resources's userIID -func CreateCluster(connectionName string, rsType string, reqInfo cres.ClusterInfo, ID_TRANSFORM_MODE string) (*cres.ClusterInfo, error) { +func CreateCluster(connectionName string, rsType string, reqInfo cres.ClusterInfo, IDTransformMode string) (*cres.ClusterInfo, error) { cblog.Info("call CreateCluster()") // check empty and trim user inputs @@ -425,7 +425,7 @@ func CreateCluster(connectionName string, rsType string, reqInfo cres.ClusterInf } spUUID := "" - if GetID_MGMT(ID_TRANSFORM_MODE) == "ON" { // Use IID Management + if GetID_MGMT(IDTransformMode) == "ON" { // Use IID Management // (2) generate SP-XID and create reqIID, driverIID // ex) SP-XID {"vm-01-9m4e2mr0ui3e8a215n4g"} // diff --git a/api-runtime/common-runtime/DiskManager.go b/api-runtime/common-runtime/DiskManager.go index b6ee53200..43d2edc44 100644 --- a/api-runtime/common-runtime/DiskManager.go +++ b/api-runtime/common-runtime/DiskManager.go @@ -128,7 +128,7 @@ func RegisterDisk(connectionName string, zoneId string, userIID cres.IID) (*cres // (4) create spiderIID: {reqNameID, "driverNameID:driverSystemID"} // (5) insert spiderIID // (6) create userIID -func CreateDisk(connectionName string, rsType string, reqInfo cres.DiskInfo, ID_TRANSFORM_MODE string) (*cres.DiskInfo, error) { +func CreateDisk(connectionName string, rsType string, reqInfo cres.DiskInfo, IDTransformMode string) (*cres.DiskInfo, error) { cblog.Info("call CreateDisk()") // check empty and trim user inputs @@ -179,7 +179,7 @@ func CreateDisk(connectionName string, rsType string, reqInfo cres.DiskInfo, ID_ } spUUID := "" - if GetID_MGMT(ID_TRANSFORM_MODE) == "ON" { // Use IID Management + if GetID_MGMT(IDTransformMode) == "ON" { // Use IID Management // (2) generate SP-XID and create reqIID, driverIID // ex) SP-XID {"vm-01-9m4e2mr0ui3e8a215n4g"} // diff --git a/api-runtime/common-runtime/KeyPairManager.go b/api-runtime/common-runtime/KeyPairManager.go index 2ee72abda..88fa613d8 100644 --- a/api-runtime/common-runtime/KeyPairManager.go +++ b/api-runtime/common-runtime/KeyPairManager.go @@ -128,7 +128,7 @@ func RegisterKey(connectionName string, userIID cres.IID) (*cres.KeyPairInfo, er // (4) create spiderIID: {reqNameID, "driverNameID:driverSystemID"} // (5) insert spiderIID // (6) create userIID -func CreateKey(connectionName string, rsType string, reqInfo cres.KeyPairReqInfo, ID_TRANSFORM_MODE string) (*cres.KeyPairInfo, error) { +func CreateKey(connectionName string, rsType string, reqInfo cres.KeyPairReqInfo, IDTransformMode string) (*cres.KeyPairInfo, error) { cblog.Info("call CreateKey()") // check empty and trim user inputs @@ -178,7 +178,7 @@ func CreateKey(connectionName string, rsType string, reqInfo cres.KeyPairReqInfo } spUUID := "" - if GetID_MGMT(ID_TRANSFORM_MODE) == "ON" { // Use IID Management + if GetID_MGMT(IDTransformMode) == "ON" { // Use IID Management // (2) generate SP-XID and create reqIID, driverIID // ex) SP-XID {"vm-01-9m4e2mr0ui3e8a215n4g"} // diff --git a/api-runtime/common-runtime/MyImageManager.go b/api-runtime/common-runtime/MyImageManager.go index 8070a441b..93e26a4d1 100644 --- a/api-runtime/common-runtime/MyImageManager.go +++ b/api-runtime/common-runtime/MyImageManager.go @@ -127,7 +127,7 @@ func RegisterMyImage(connectionName string, userIID cres.IID) (*cres.MyImageInfo // (4) create spiderIID: {reqNameID, "driverNameID:driverSystemID"} // (5) insert spiderIID // (6) create userIID -func SnapshotVM(connectionName string, rsType string, reqInfo cres.MyImageInfo, ID_TRANSFORM_MODE string) (*cres.MyImageInfo, error) { +func SnapshotVM(connectionName string, rsType string, reqInfo cres.MyImageInfo, IDTransformMode string) (*cres.MyImageInfo, error) { cblog.Info("call SnapshotVM()") // check empty and trim user inputs @@ -178,7 +178,7 @@ func SnapshotVM(connectionName string, rsType string, reqInfo cres.MyImageInfo, } spUUID := "" - if GetID_MGMT(ID_TRANSFORM_MODE) == "ON" { // Use IID Management + if GetID_MGMT(IDTransformMode) == "ON" { // Use IID Management // (2) generate SP-XID and create reqIID, driverIID // ex) SP-XID {"vm-01-9m4e2mr0ui3e8a215n4g"} // diff --git a/api-runtime/common-runtime/NLBManager.go b/api-runtime/common-runtime/NLBManager.go index e84e288cf..0ce4c9044 100644 --- a/api-runtime/common-runtime/NLBManager.go +++ b/api-runtime/common-runtime/NLBManager.go @@ -278,7 +278,7 @@ func RegisterNLB(connectionName string, vpcUserID string, userIID cres.IID) (*cr // (4) create spiderIID: {reqNameID, "driverNameID:driverSystemID"} // (5) insert spiderIID // (6) create userIID -func CreateNLB(connectionName string, rsType string, reqInfo cres.NLBInfo, ID_TRANSFORM_MODE string) (*cres.NLBInfo, error) { +func CreateNLB(connectionName string, rsType string, reqInfo cres.NLBInfo, IDTransformMode string) (*cres.NLBInfo, error) { cblog.Info("call CreateNLB()") // check empty and trim user inputs @@ -368,7 +368,7 @@ func CreateNLB(connectionName string, rsType string, reqInfo cres.NLBInfo, ID_TR } spUUID := "" - if GetID_MGMT(ID_TRANSFORM_MODE) == "ON" { // Use IID Management + if GetID_MGMT(IDTransformMode) == "ON" { // Use IID Management // (2) generate SP-XID and create reqIID, driverIID // ex) SP-XID {"vm-01-9m4e2mr0ui3e8a215n4g"} // diff --git a/api-runtime/common-runtime/SecurityGroupManager.go b/api-runtime/common-runtime/SecurityGroupManager.go index 221a0daf8..fb6acc4c4 100644 --- a/api-runtime/common-runtime/SecurityGroupManager.go +++ b/api-runtime/common-runtime/SecurityGroupManager.go @@ -269,7 +269,7 @@ func RegisterSecurity(connectionName string, vpcUserID string, userIID cres.IID) // (4) create spiderIID: {reqNameID, "driverNameID:driverSystemID"} // (5) insert spiderIID // (6) create userIID -func CreateSecurity(connectionName string, rsType string, reqInfo cres.SecurityReqInfo, ID_TRANSFORM_MODE string) (*cres.SecurityInfo, error) { +func CreateSecurity(connectionName string, rsType string, reqInfo cres.SecurityReqInfo, IDTransformMode string) (*cres.SecurityInfo, error) { cblog.Info("call CreateSecurity()") // check empty and trim user inputs @@ -347,7 +347,7 @@ func CreateSecurity(connectionName string, rsType string, reqInfo cres.SecurityR } spUUID := "" - if GetID_MGMT(ID_TRANSFORM_MODE) == "ON" { // Use IID Management + if GetID_MGMT(IDTransformMode) == "ON" { // Use IID Management // (2) generate SP-XID and create reqIID, driverIID // ex) SP-XID {"vm-01-9m4e2mr0ui3e8a215n4g"} // diff --git a/api-runtime/common-runtime/VMManager.go b/api-runtime/common-runtime/VMManager.go index fbbaf503b..8c0b68f75 100644 --- a/api-runtime/common-runtime/VMManager.go +++ b/api-runtime/common-runtime/VMManager.go @@ -342,7 +342,7 @@ func RegisterVM(connectionName string, userIID cres.IID) (*cres.VMInfo, error) { // (5) create spiderIID: {reqNameID, "driverNameID:driverSystemID"} // (6) insert spiderIID // (7) create userIID -func StartVM(connectionName string, rsType string, reqInfo cres.VMReqInfo, ID_TRANSFORM_MODE string) (*cres.VMInfo, error) { +func StartVM(connectionName string, rsType string, reqInfo cres.VMReqInfo, IDTransformMode string) (*cres.VMInfo, error) { cblog.Info("call StartVM()") // check empty and trim user inputs @@ -454,7 +454,7 @@ func StartVM(connectionName string, rsType string, reqInfo cres.VMReqInfo, ID_TR } spUUID := "" - if GetID_MGMT(ID_TRANSFORM_MODE) == "ON" { // Use IID Management + if GetID_MGMT(IDTransformMode) == "ON" { // Use IID Management // (3) generate SP-XID and create reqIID, driverIID // ex) SP-XID {"vm-01-9m4e2mr0ui3e8a215n4g"} // diff --git a/api-runtime/common-runtime/VPC-SubnetManager.go b/api-runtime/common-runtime/VPC-SubnetManager.go index 0ca6c31bc..9d3a9ab2d 100644 --- a/api-runtime/common-runtime/VPC-SubnetManager.go +++ b/api-runtime/common-runtime/VPC-SubnetManager.go @@ -306,7 +306,7 @@ func UnregisterSubnet(connectionName string, vpcName string, nameId string) (boo // (4) create spiderIID: {reqNameID, "driverNameID:driverSystemID"} // (5) insert spiderIID // (6) create userIID -func CreateVPC(connectionName string, rsType string, reqInfo cres.VPCReqInfo, ID_TRANSFORM_MODE string) (*cres.VPCInfo, error) { +func CreateVPC(connectionName string, rsType string, reqInfo cres.VPCReqInfo, IDTransformMode string) (*cres.VPCInfo, error) { cblog.Info("call CreateVPC()") // check empty and trim user inputs @@ -378,7 +378,7 @@ func CreateVPC(connectionName string, rsType string, reqInfo cres.VPCReqInfo, ID } spUUID := "" - if GetID_MGMT(ID_TRANSFORM_MODE) == "ON" { // Use IID Management + if GetID_MGMT(IDTransformMode) == "ON" { // Use IID Management // (2) generate SP-XID and create reqIID, driverIID // ex) SP-XID {"vm-01-9m4e2mr0ui3e8a215n4g"} // @@ -413,7 +413,7 @@ func CreateVPC(connectionName string, rsType string, reqInfo cres.VPCReqInfo, ID subnetInfoList := []cres.SubnetInfo{} for _, info := range reqInfo.SubnetInfoList { subnetUUID := "" - if GetID_MGMT(ID_TRANSFORM_MODE) == "ON" { // Use IID Management + if GetID_MGMT(IDTransformMode) == "ON" { // Use IID Management subnetUUID, err = iidm.New(connectionName, rsSubnet, info.IId.NameId) if err != nil { cblog.Error(err) @@ -748,7 +748,7 @@ func GetVPC(connectionName string, rsType string, nameID string) (*cres.VPCInfo, // (1) check exist(NameID) // (2) create Resource // (3) insert IID -func AddSubnet(connectionName string, rsType string, vpcName string, reqInfo cres.SubnetInfo, ID_TRANSFORM_MODE string) (*cres.VPCInfo, error) { +func AddSubnet(connectionName string, rsType string, vpcName string, reqInfo cres.SubnetInfo, IDTransformMode string) (*cres.VPCInfo, error) { cblog.Info("call AddSubnet()") // check empty and trim user inputs @@ -799,7 +799,7 @@ func AddSubnet(connectionName string, rsType string, vpcName string, reqInfo cre } subnetUUID := "" - if GetID_MGMT(ID_TRANSFORM_MODE) == "ON" { // Use IID Management + if GetID_MGMT(IDTransformMode) == "ON" { // Use IID Management subnetUUID, err = iidm.New(connectionName, rsType, reqInfo.IId.NameId) if err != nil { cblog.Error(err) diff --git a/api-runtime/rest-runtime/ClusterRest.go b/api-runtime/rest-runtime/ClusterRest.go index cbee37875..9d97b04e4 100644 --- a/api-runtime/rest-runtime/ClusterRest.go +++ b/api-runtime/rest-runtime/ClusterRest.go @@ -105,10 +105,10 @@ func UnregisterCluster(c echo.Context) error { } type ClusterReq struct { - NameSpace string - ConnectionName string - ID_TRANSFORM_MODE string // ON | OFF, default is ON - ReqInfo struct { + NameSpace string + ConnectionName string + IDTransformMode string // ON | OFF, default is ON + ReqInfo struct { // (1) Cluster Info Name string Version string @@ -169,7 +169,7 @@ func CreateCluster(c echo.Context) error { } // Call common-runtime API - result, err := cmrt.CreateCluster(req.ConnectionName, rsCluster, reqInfo, req.ID_TRANSFORM_MODE) + result, err := cmrt.CreateCluster(req.ConnectionName, rsCluster, reqInfo, req.IDTransformMode) if err != nil { return echo.NewHTTPError(http.StatusInternalServerError, err.Error()) } diff --git a/api-runtime/rest-runtime/DiskRest.go b/api-runtime/rest-runtime/DiskRest.go index c6c582bf3..95b78be76 100644 --- a/api-runtime/rest-runtime/DiskRest.go +++ b/api-runtime/rest-runtime/DiskRest.go @@ -80,9 +80,9 @@ func UnregisterDisk(c echo.Context) error { } type DiskReq struct { - ConnectionName string - ID_TRANSFORM_MODE string // ON | OFF, default is ON - ReqInfo struct { + ConnectionName string + IDTransformMode string // ON | OFF, default is ON + ReqInfo struct { Name string Zone string @@ -109,7 +109,7 @@ func CreateDisk(c echo.Context) error { } // Call common-runtime API - result, err := cmrt.CreateDisk(req.ConnectionName, rsDisk, reqInfo, req.ID_TRANSFORM_MODE) + result, err := cmrt.CreateDisk(req.ConnectionName, rsDisk, reqInfo, req.IDTransformMode) if err != nil { return echo.NewHTTPError(http.StatusInternalServerError, err.Error()) } diff --git a/api-runtime/rest-runtime/KeyPairRest.go b/api-runtime/rest-runtime/KeyPairRest.go index f6e28e6a9..98edc46ae 100644 --- a/api-runtime/rest-runtime/KeyPairRest.go +++ b/api-runtime/rest-runtime/KeyPairRest.go @@ -107,9 +107,9 @@ func CreateKey(c echo.Context) error { cblog.Info("call CreateKey()") var req struct { - ConnectionName string - ID_TRANSFORM_MODE string // ON | OFF, default is ON - ReqInfo struct { + ConnectionName string + IDTransformMode string // ON | OFF, default is ON + ReqInfo struct { Name string } } @@ -124,7 +124,7 @@ func CreateKey(c echo.Context) error { } // Call common-runtime API - result, err := cmrt.CreateKey(req.ConnectionName, rsKey, reqInfo, req.ID_TRANSFORM_MODE) + result, err := cmrt.CreateKey(req.ConnectionName, rsKey, reqInfo, req.IDTransformMode) if err != nil { return echo.NewHTTPError(http.StatusInternalServerError, err.Error()) } diff --git a/api-runtime/rest-runtime/MyImageRest.go b/api-runtime/rest-runtime/MyImageRest.go index 501d7ed90..41edf8177 100644 --- a/api-runtime/rest-runtime/MyImageRest.go +++ b/api-runtime/rest-runtime/MyImageRest.go @@ -79,9 +79,9 @@ func UnregisterMyImage(c echo.Context) error { } type MyImageReq struct { - ConnectionName string - ID_TRANSFORM_MODE string // ON | OFF, default is ON - ReqInfo struct { + ConnectionName string + IDTransformMode string // ON | OFF, default is ON + ReqInfo struct { Name string SourceVM string @@ -105,7 +105,7 @@ func SnapshotVM(c echo.Context) error { } // Call common-runtime API - result, err := cmrt.SnapshotVM(req.ConnectionName, rsMyImage, reqInfo, req.ID_TRANSFORM_MODE) + result, err := cmrt.SnapshotVM(req.ConnectionName, rsMyImage, reqInfo, req.IDTransformMode) if err != nil { return echo.NewHTTPError(http.StatusInternalServerError, err.Error()) } diff --git a/api-runtime/rest-runtime/NLBRest.go b/api-runtime/rest-runtime/NLBRest.go index 1cf046618..0e959e36b 100644 --- a/api-runtime/rest-runtime/NLBRest.go +++ b/api-runtime/rest-runtime/NLBRest.go @@ -104,9 +104,9 @@ func UnregisterNLB(c echo.Context) error { } type NLBReq struct { - ConnectionName string - ID_TRANSFORM_MODE string // ON | OFF, default is ON - ReqInfo struct { + ConnectionName string + IDTransformMode string // ON | OFF, default is ON + ReqInfo struct { Name string VPCName string Type string // PUBLIC(V) | INTERNAL @@ -163,7 +163,7 @@ func CreateNLB(c echo.Context) error { reqInfo.HealthChecker = healthChecker // Call common-runtime API - result, err := cmrt.CreateNLB(req.ConnectionName, rsNLB, reqInfo, req.ID_TRANSFORM_MODE) + result, err := cmrt.CreateNLB(req.ConnectionName, rsNLB, reqInfo, req.IDTransformMode) if err != nil { return echo.NewHTTPError(http.StatusInternalServerError, err.Error()) } diff --git a/api-runtime/rest-runtime/SecurityGroupRest.go b/api-runtime/rest-runtime/SecurityGroupRest.go index 548fb4863..47f9e1fc2 100644 --- a/api-runtime/rest-runtime/SecurityGroupRest.go +++ b/api-runtime/rest-runtime/SecurityGroupRest.go @@ -80,9 +80,9 @@ func UnregisterSecurity(c echo.Context) error { } type securityGroupCreateReq struct { - ConnectionName string - ID_TRANSFORM_MODE string // ON | OFF, default is ON - ReqInfo struct { + ConnectionName string + IDTransformMode string // ON | OFF, default is ON + ReqInfo struct { Name string VPCName string Direction string @@ -123,7 +123,7 @@ func CreateSecurity(c echo.Context) error { } // Call common-runtime API - result, err := cmrt.CreateSecurity(req.ConnectionName, rsSG, reqInfo, req.ID_TRANSFORM_MODE) + result, err := cmrt.CreateSecurity(req.ConnectionName, rsSG, reqInfo, req.IDTransformMode) if err != nil { return echo.NewHTTPError(http.StatusInternalServerError, err.Error()) } diff --git a/api-runtime/rest-runtime/VMRest.go b/api-runtime/rest-runtime/VMRest.go index e7190dd77..20dd4526c 100644 --- a/api-runtime/rest-runtime/VMRest.go +++ b/api-runtime/rest-runtime/VMRest.go @@ -105,9 +105,9 @@ func StartVM(c echo.Context) error { cblog.Info("call StartVM()") var req struct { - ConnectionName string - ID_TRANSFORM_MODE string // ON | OFF, default is ON - ReqInfo struct { + ConnectionName string + IDTransformMode string // ON | OFF, default is ON + ReqInfo struct { Name string ImageType string ImageName string @@ -171,7 +171,7 @@ func StartVM(c echo.Context) error { } // Call common-runtime API - result, err := cmrt.StartVM(req.ConnectionName, rsVM, reqInfo, req.ID_TRANSFORM_MODE) + result, err := cmrt.StartVM(req.ConnectionName, rsVM, reqInfo, req.IDTransformMode) if err != nil { return echo.NewHTTPError(http.StatusInternalServerError, err.Error()) } diff --git a/api-runtime/rest-runtime/VPC-SubnetRest.go b/api-runtime/rest-runtime/VPC-SubnetRest.go index afaf9a941..8461ae3f6 100644 --- a/api-runtime/rest-runtime/VPC-SubnetRest.go +++ b/api-runtime/rest-runtime/VPC-SubnetRest.go @@ -134,9 +134,9 @@ func UnregisterVPC(c echo.Context) error { } type vpcCreateReq struct { - ConnectionName string - ID_TRANSFORM_MODE string // ON | OFF, default is ON - ReqInfo struct { + ConnectionName string + IDTransformMode string // ON | OFF, default is ON + ReqInfo struct { Name string IPv4_CIDR string SubnetInfoList []struct { @@ -182,7 +182,7 @@ func CreateVPC(c echo.Context) error { } // Call common-runtime API - result, err := cmrt.CreateVPC(req.ConnectionName, rsVPC, reqInfo, req.ID_TRANSFORM_MODE) + result, err := cmrt.CreateVPC(req.ConnectionName, rsVPC, reqInfo, req.IDTransformMode) if err != nil { return echo.NewHTTPError(http.StatusInternalServerError, err.Error()) } @@ -335,9 +335,9 @@ func AddSubnet(c echo.Context) error { cblog.Info("call AddSubnet()") var req struct { - ConnectionName string - ID_TRANSFORM_MODE string // ON | OFF, default is ON - ReqInfo struct { + ConnectionName string + IDTransformMode string // ON | OFF, default is ON + ReqInfo struct { Name string Zone string IPv4_CIDR string @@ -352,7 +352,7 @@ func AddSubnet(c echo.Context) error { reqSubnetInfo := cres.SubnetInfo{IId: cres.IID{req.ReqInfo.Name, ""}, IPv4_CIDR: req.ReqInfo.IPv4_CIDR, Zone: req.ReqInfo.Zone} // Call common-runtime API - result, err := cmrt.AddSubnet(req.ConnectionName, rsSubnet, c.Param("VPCName"), reqSubnetInfo, req.ID_TRANSFORM_MODE) + result, err := cmrt.AddSubnet(req.ConnectionName, rsSubnet, c.Param("VPCName"), reqSubnetInfo, req.IDTransformMode) if err != nil { return echo.NewHTTPError(http.StatusInternalServerError, err.Error()) } diff --git a/setup.env b/setup.env index c0ecae879..65dd3c234 100644 --- a/setup.env +++ b/setup.env @@ -21,7 +21,7 @@ export PLUGIN_SW=OFF ## If the value is OFF, Spider does not perform ID transformation. # default: ON -export ID_TRANSFORM_MODE=ON +export IDTransformMode=ON # root path of cb-log export CBLOG_ROOT=$CBSPIDER_ROOT