func (this *VsphereMicroBoshController) Post() { vsphereNetWork := entity.NewVsphereNetWork(this.GetString("ip"), this.GetString("netMask"), this.GetString("gateWay"), this.GetString("dns"), this.GetString("vlanName"), ) vsphereNetworkId, _ := this.GetInt64("vsphereNetworkId", 0) vsphereNetWork.Id = vsphereNetworkId vsphereResource := entity.NewVsphereResource(this.GetString("persistentDisk"), this.GetString("ram"), this.GetString("disk"), this.GetString("cpu"), ) vsphereResourceId, _ := this.GetInt64("vsphereResourceId", 0) vsphereResource.Id = vsphereResourceId vsphereVcenter := entity.NewVsphereVcenter(this.GetString("userName"), this.GetString("passwd"), this.GetString("host"), this.GetString("dataCenterName"), this.GetString("vmFolder"), this.GetString("templateFolder"), this.GetString("diskPath"), this.GetString("dataStore"), this.GetString("clustersName"), ) vsphereVcenterId, _ := this.GetInt64("vsphereVcenterId", 0) vsphereVcenter.Id = vsphereVcenterId vsphere := entity.NewVsphereMicro(this.GetString("name"), vsphereNetWork, vsphereResource, vsphereVcenter) vsphereMicroId, _ := this.GetInt64("vsphereMicroId", 0) vsphere.Id = vsphereMicroId vsphere.VsphereResourceId = vsphereResourceId this.CommitData(vsphere) this.Get() }
vsphere.VsphereNetWork.Update() vsphere.VsphereResource.Update() vsphere.VsphereVcenter.Update() vsphereMicro = vsphere } var vsphereMicro entity.VsphereMicro = entity.NewVsphereMicro("micro01", entity.NewVsphereNetWork("10.10.170.12", "255.255.255.0", "10.10.170.254", "10.10.170.2", "VM Network"), entity.NewVsphereResource("16384", "4096", "16384", "2"), entity.NewVsphereVcenter("administrator", "P@ssw0rd", "10.10.90.233", "vCenter", "vm_folder", "template_folder", "boshdeployer", "datastore1302", "vCluster"), )