func (manager *FakeServiceManager) CreateDiskOnCloudProvider(
	name string,
	sizeGb int64,
	tagsStr string,
	diskType string,
	zone string) (*Disk, error) {
	manager.createDiskCalled = true

	switch t := manager.targetAPI; t {
	case targetStable:
		diskTypeURI := gceComputeAPIEndpoint + "projects/" + fmt.Sprintf(diskTypeURITemplateSingleZone, manager.gceProjectID, zone, diskType)
		diskToCreateV1 := &compute.Disk{
			Name:        name,
			SizeGb:      sizeGb,
			Description: tagsStr,
			Type:        diskTypeURI,
		}
		manager.diskToCreateStable = diskToCreateV1
		manager.zonalDisks[zone] = diskToCreateV1.Name
		return nil, nil
	case targetBeta:
		diskTypeURI := gceComputeAPIEndpoint + "projects/" + fmt.Sprintf(diskTypeURITemplateSingleZone, manager.gceProjectID, zone, diskType)
		diskToCreateBeta := &computebeta.Disk{
			Name:        name,
			SizeGb:      sizeGb,
			Description: tagsStr,
			Type:        diskTypeURI,
		}
		manager.diskToCreateBeta = diskToCreateBeta
		manager.zonalDisks[zone] = diskToCreateBeta.Name
		return nil, nil
	case targetAlpha:
		diskTypeURI := gceComputeAPIEndpointBeta + "projects/" + fmt.Sprintf(diskTypeURITemplateSingleZone, manager.gceProjectID, zone, diskType)
		diskToCreateAlpha := &computealpha.Disk{
			Name:        name,
			SizeGb:      sizeGb,
			Description: tagsStr,
			Type:        diskTypeURI,
		}
		manager.diskToCreateAlpha = diskToCreateAlpha
		manager.zonalDisks[zone] = diskToCreateAlpha.Name
		return nil, nil
	default:
		return nil, fmt.Errorf("unexpected type: %T", t)
	}
}
/**
 * Upon disk creation, disk info is stored in FakeServiceManager
 * to be used by other tested methods.
 */
Upon disk creation, disk info is stored in FakeServiceManager
to be used by other tested methods.
/ ** * Upon disk creation disk info is stored in FakeServiceManager * to be used by other tested methods . * /
func (manager *FakeServiceManager) CreateDiskOnCloudProvider(
	name string,
	sizeGb int64,
	tagsStr string,
	diskType string,
	zone string) (*Disk, error) {
	manager.createDiskCalled = true
	switch t := manager.targetAPI; t {
	case targetStable:
		diskTypeURI := gceComputeAPIEndpoint + "projects/" + fmt.Sprintf(diskTypeURITemplateSingleZone, manager.gceProjectID, zone, diskType)
		diskToCreateV1 := &compute.Disk{
			Name:        name,
			SizeGb:      sizeGb,
			Description: tagsStr,
			Type:        diskTypeURI,
		}
		manager.diskToCreateStable = diskToCreateV1
		manager.zonalDisks[zone] = diskToCreateV1.Name
		return nil, nil
	case targetBeta:
		diskTypeURI := gceComputeAPIEndpoint + "projects/" + fmt.Sprintf(diskTypeURITemplateSingleZone, manager.gceProjectID, zone, diskType)
		diskToCreateBeta := &computebeta.Disk{
			Name:        name,
			SizeGb:      sizeGb,
			Description: tagsStr,
			Type:        diskTypeURI,
		}
		manager.diskToCreateBeta = diskToCreateBeta
		manager.zonalDisks[zone] = diskToCreateBeta.Name
		return nil, nil
	case targetAlpha:
		diskTypeURI := gceComputeAPIEndpointBeta + "projects/" + fmt.Sprintf(diskTypeURITemplateSingleZone, manager.gceProjectID, zone, diskType)
		diskToCreateAlpha := &computealpha.Disk{
			Name:        name,
			SizeGb:      sizeGb,
			Description: tagsStr,
			Type:        diskTypeURI,
		}
		manager.diskToCreateAlpha = diskToCreateAlpha
		manager.zonalDisks[zone] = diskToCreateAlpha.Name
		return nil, nil
	default:
		return nil, fmt.Errorf("unexpected type: %T", t)
	}
}
func ( manager * FakeServiceManager ) CreateDiskOnCloudProvider ( name string , sizeGb int64 , tagsStr string , diskType string , zone string ) ( * Disk , error ) { manager . createDiskCalled = true switch t := manager . targetAPI ; t { case targetStable : diskTypeURI := gceComputeAPIEndpoint + " " + fmt . Sprintf ( diskTypeURITemplateSingleZone , manager . gceProjectID , zone , diskType ) diskToCreateV1 := & compute . Disk { Name : name , SizeGb : sizeGb , Description : tagsStr , Type : diskTypeURI , } manager . diskToCreateStable = diskToCreateV1 manager . zonalDisks [ zone ] = diskToCreateV1 . Name return nil , nil case targetBeta : diskTypeURI := gceComputeAPIEndpoint + " " + fmt . Sprintf ( diskTypeURITemplateSingleZone , manager . gceProjectID , zone , diskType ) diskToCreateBeta := & computebeta . Disk { Name : name , SizeGb : sizeGb , Description : tagsStr , Type : diskTypeURI , } manager . diskToCreateBeta = diskToCreateBeta manager . zonalDisks [ zone ] = diskToCreateBeta . Name return nil , nil case targetAlpha : diskTypeURI := gceComputeAPIEndpointBeta + " " + fmt . Sprintf ( diskTypeURITemplateSingleZone , manager . gceProjectID , zone , diskType ) diskToCreateAlpha := & computealpha . Disk { Name : name , SizeGb : sizeGb , Description : tagsStr , Type : diskTypeURI , } manager . diskToCreateAlpha = diskToCreateAlpha manager . zonalDisks [ zone ] = diskToCreateAlpha . Name return nil , nil default : return nil , fmt . Errorf ( " " , t ) } }
Upon disk creation, disk info is stored in FakeServiceManager
to be used by other tested methods.
Upon disk creation disk info is stored in FakeServiceManager to be used by other tested methods .