package MainOrder

import (
	"github.com/tidbcloud/qa-PlatformAPIAuto/common"
	"github.com/tidbcloud/qa-gourd/ProductModel"
	"github.com/tidbcloud/qa-gourd/ProductService"
	"github.com/tidbcloud/qa-gourd/handler"
	"strconv"
)

func InitializationParameterConversion(RequestInfo ProductService.E2ECase) {
	common.Envn = handler.APIConfigInfo.Env
	common.HasTiflash = handler.HasTiflash

	common.OrgId = RequestInfo.GetUserInfo().OrgId
	common.ProjectId = RequestInfo.GetUserInfo().ProjectId
	common.TenantEmail = RequestInfo.GetUserInfo().TenantEmail
	common.RunUser = RequestInfo.GetUserInfo().RunUser

	common.Port = RequestInfo.GetClusterInfo().Port
	if RequestInfo.GetClusterInfo().Provider == ProductModel.AWS {
		common.AwsRegion = RequestInfo.GetClusterInfo().Region
	} else {
		common.GcpRegion = RequestInfo.GetClusterInfo().Region
	}
	common.PassWord = RequestInfo.GetClusterInfo().Password
	common.CPU = strconv.Itoa(RequestInfo.GetClusterInfo().CPU)
}
