当前位置: 首页>>代码示例>>Golang>>正文


Golang Role.OSVirtualHardDisk方法代码示例

本文整理汇总了Golang中github.com/Azure/azure-sdk-for-go/management/virtualmachine.Role.OSVirtualHardDisk方法的典型用法代码示例。如果您正苦于以下问题:Golang Role.OSVirtualHardDisk方法的具体用法?Golang Role.OSVirtualHardDisk怎么用?Golang Role.OSVirtualHardDisk使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在github.com/Azure/azure-sdk-for-go/management/virtualmachine.Role的用法示例。


在下文中一共展示了Role.OSVirtualHardDisk方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1: ConfigureDeploymentFromExistingOSDisk

// ConfigureDeploymentFromExistingOSDisk configures VM Role to deploy from an
// existing disk. 'label' is optional.
func ConfigureDeploymentFromExistingOSDisk(role *vm.Role, osDiskName, label string) error {
	role.OSVirtualHardDisk = &vm.OSVirtualHardDisk{
		DiskName:  osDiskName,
		DiskLabel: label,
	}
	return nil
}
开发者ID:Zordrak,项目名称:terraform,代码行数:9,代码来源:deployment.go

示例2: ConfigureDeploymentFromPlatformImage

// ConfigureDeploymentFromPlatformImage configures VM Role to deploy from a
// platform image. See osimage package for methods to retrieve a list of the
// available platform images. "label" is optional.
func ConfigureDeploymentFromPlatformImage(
	role *vm.Role,
	imageName string,
	mediaLink string,
	label string) error {
	if role == nil {
		return fmt.Errorf(errParamNotSpecified, "role")
	}

	role.OSVirtualHardDisk = &vm.OSVirtualHardDisk{
		SourceImageName: imageName,
		MediaLink:       mediaLink,
	}
	return nil
}
开发者ID:Zordrak,项目名称:terraform,代码行数:18,代码来源:deployment.go

示例3: ConfigureDeploymentFromRemoteImage

// ConfigureDeploymentFromRemoteImage configures VM Role to deploy from a remote
// image source. "remoteImageSourceURL" can be any publically accessible URL to
// a VHD file, including but not limited to a SAS Azure Storage blob url. "os"
// needs to be either "Linux" or "Windows". "label" is optional.
func ConfigureDeploymentFromRemoteImage(
	role *vm.Role,
	remoteImageSourceURL string,
	os string,
	newDiskName string,
	destinationVhdStorageURL string,
	label string) error {
	if role == nil {
		return fmt.Errorf(errParamNotSpecified, "role")
	}

	role.OSVirtualHardDisk = &vm.OSVirtualHardDisk{
		RemoteSourceImageLink: remoteImageSourceURL,
		MediaLink:             destinationVhdStorageURL,
		DiskName:              newDiskName,
		OS:                    os,
		DiskLabel:             label,
	}
	return nil
}
开发者ID:Zordrak,项目名称:terraform,代码行数:24,代码来源:deployment.go


注:本文中的github.com/Azure/azure-sdk-for-go/management/virtualmachine.Role.OSVirtualHardDisk方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。