template

package
v1.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 18, 2019 License: MPL-2.0, MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const BasicTemplate = `` /* 5060-byte string literal not displayed */
View Source
const KeyVault = `` /* 1663-byte string literal not displayed */

Template to deploy a KeyVault.

This template is still hard-coded unlike the ARM templates used for VMs for a couple of reasons.

  1. The SDK defines no types for a Key Vault
  2. The Key Vault template is relatively simple, and is static.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessPolicies

type AccessPolicies struct {
	ObjectId    *string      `json:"objectId,omitempty"`
	TenantId    *string      `json:"tenantId,omitempty"`
	Permissions *Permissions `json:"permissions,omitempty"`
}

type DataDiskUnion added in v1.2.2

type DataDiskUnion struct {
	Lun          *int                           `json:"lun,omitempty"`
	BlobURI      *string                        `json:"blobUri,omitempty"`
	Name         *string                        `json:"name,omitempty"`
	Vhd          *compute.VirtualHardDisk       `json:"vhd,omitempty"`
	Image        *compute.VirtualHardDisk       `json:"image,omitempty"`
	Caching      compute.CachingTypes           `json:"caching,omitempty"`
	CreateOption compute.DiskCreateOptionTypes  `json:"createOption,omitempty"`
	DiskSizeGB   *int32                         `json:"diskSizeGB,omitempty"`
	ManagedDisk  *compute.ManagedDiskParameters `json:"managedDisk,omitempty"`
}

type OSDiskUnion added in v1.0.3

type OSDiskUnion struct {
	OsType       compute.OperatingSystemTypes      `json:"osType,omitempty"`
	OsState      compute.OperatingSystemStateTypes `json:"osState,omitempty"`
	BlobURI      *string                           `json:"blobUri,omitempty"`
	Name         *string                           `json:"name,omitempty"`
	Vhd          *compute.VirtualHardDisk          `json:"vhd,omitempty"`
	Image        *compute.VirtualHardDisk          `json:"image,omitempty"`
	Caching      compute.CachingTypes              `json:"caching,omitempty"`
	CreateOption compute.DiskCreateOptionTypes     `json:"createOption,omitempty"`
	DiskSizeGB   *int32                            `json:"diskSizeGB,omitempty"`
	ManagedDisk  *compute.ManagedDiskParameters    `json:"managedDisk,omitempty"`
}

type Parameters

type Parameters struct {
	Type         *string `json:"type"`
	DefaultValue *string `json:"defaultValue,omitempty"`
}

/////////////////////////////////////////////// Template > Parameters

type Permissions

type Permissions struct {
	Keys    *[]string `json:"keys,omitempty"`
	Secrets *[]string `json:"secrets,omitempty"`
}

type Plan added in v1.2.2

type Plan struct {
	Name          *string `json:"name"`
	Product       *string `json:"product"`
	Publisher     *string `json:"publisher"`
	PromotionCode *string `json:"promotionCode,omitempty"`
}

type Properties

type Properties struct {
	AccessPolicies               *[]AccessPolicies                   `json:"accessPolicies,omitempty"`
	AddressSpace                 *network.AddressSpace               `json:"addressSpace,omitempty"`
	DiagnosticsProfile           *compute.DiagnosticsProfile         `json:"diagnosticsProfile,omitempty"`
	DNSSettings                  *network.PublicIPAddressDNSSettings `json:"dnsSettings,omitempty"`
	EnabledForDeployment         *string                             `json:"enabledForDeployment,omitempty"`
	EnabledForTemplateDeployment *string                             `json:"enabledForTemplateDeployment,omitempty"`
	HardwareProfile              *compute.HardwareProfile            `json:"hardwareProfile,omitempty"`
	IPConfigurations             *[]network.IPConfiguration          `json:"ipConfigurations,omitempty"`
	NetworkProfile               *compute.NetworkProfile             `json:"networkProfile,omitempty"`
	OsProfile                    *compute.OSProfile                  `json:"osProfile,omitempty"`
	PublicIPAllocatedMethod      *network.IPAllocationMethod         `json:"publicIPAllocationMethod,omitempty"`
	Sku                          *Sku                                `json:"sku,omitempty"`
	//StorageProfile3              *compute.StorageProfile             `json:"storageProfile,omitempty"`
	StorageProfile *StorageProfileUnion    `json:"storageProfile,omitempty"`
	Subnets        *[]network.Subnet       `json:"subnets,omitempty"`
	SecurityRules  *[]network.SecurityRule `json:"securityRules,omitempty"`
	TenantId       *string                 `json:"tenantId,omitempty"`
	Value          *string                 `json:"value,omitempty"`
}

/////////////////////////////////////////////// Template > Resource > Properties

type Resource

type Resource struct {
	ApiVersion *string             `json:"apiVersion"`
	Name       *string             `json:"name"`
	Type       *string             `json:"type"`
	Location   *string             `json:"location,omitempty"`
	DependsOn  *[]string           `json:"dependsOn,omitempty"`
	Plan       *Plan               `json:"plan,omitempty"`
	Properties *Properties         `json:"properties,omitempty"`
	Tags       *map[string]*string `json:"tags,omitempty"`
	Resources  *[]Resource         `json:"resources,omitempty"`
}

/////////////////////////////////////////////// Template > Resource

type Sku

type Sku struct {
	Family *string `json:"family,omitempty"`
	Name   *string `json:"name,omitempty"`
}

type StorageProfileUnion added in v1.0.3

type StorageProfileUnion struct {
	ImageReference *compute.ImageReference `json:"imageReference,omitempty"`
	OsDisk         *OSDiskUnion            `json:"osDisk,omitempty"`
	DataDisks      *[]DataDiskUnion        `json:"dataDisks,omitempty"`
}

Union of the StorageProfile and ImageStorageProfile types.

type Template

type Template struct {
	Schema         *string                `json:"$schema"`
	ContentVersion *string                `json:"contentVersion"`
	Parameters     *map[string]Parameters `json:"parameters"`
	Variables      *map[string]string     `json:"variables"`
	Resources      *[]Resource            `json:"resources"`
}

/////////////////////////////////////////////// Template

type TemplateBuilder

type TemplateBuilder struct {
	// contains filtered or unexported fields
}

func NewTemplateBuilder

func NewTemplateBuilder(template string) (*TemplateBuilder, error)

func (*TemplateBuilder) BuildLinux

func (s *TemplateBuilder) BuildLinux(sshAuthorizedKey string) error

func (*TemplateBuilder) BuildWindows

func (s *TemplateBuilder) BuildWindows(keyVaultName, winRMCertificateUrl string) error

func (*TemplateBuilder) SetAdditionalDisks added in v1.2.2

func (s *TemplateBuilder) SetAdditionalDisks(diskSizeGB []int32, isManaged bool, cachingType compute.CachingTypes) error

func (*TemplateBuilder) SetCustomData

func (s *TemplateBuilder) SetCustomData(customData string) error

func (*TemplateBuilder) SetImageUrl

func (s *TemplateBuilder) SetImageUrl(imageUrl string, osType compute.OperatingSystemTypes, cachingType compute.CachingTypes) error

func (*TemplateBuilder) SetManagedDiskUrl added in v1.0.3

func (s *TemplateBuilder) SetManagedDiskUrl(managedImageId string, storageAccountType compute.StorageAccountTypes, cachingType compute.CachingTypes) error

func (*TemplateBuilder) SetManagedMarketplaceImage added in v1.0.3

func (s *TemplateBuilder) SetManagedMarketplaceImage(location, publisher, offer, sku, version, imageID string, storageAccountType compute.StorageAccountTypes, cachingType compute.CachingTypes) error

func (*TemplateBuilder) SetMarketPlaceImage

func (s *TemplateBuilder) SetMarketPlaceImage(publisher, offer, sku, version string, cachingType compute.CachingTypes) error

func (*TemplateBuilder) SetNetworkSecurityGroup added in v1.4.5

func (s *TemplateBuilder) SetNetworkSecurityGroup(ipAddresses []string, port int) error

func (*TemplateBuilder) SetOSDiskSizeGB

func (s *TemplateBuilder) SetOSDiskSizeGB(diskSizeGB int32) error

func (*TemplateBuilder) SetPlanInfo added in v1.2.2

func (s *TemplateBuilder) SetPlanInfo(name, product, publisher, promotionCode string) error

func (*TemplateBuilder) SetPrivateVirtualNetworkWithPublicIp added in v1.2.2

func (s *TemplateBuilder) SetPrivateVirtualNetworkWithPublicIp(virtualNetworkResourceGroup, virtualNetworkName, subnetName string) error

func (*TemplateBuilder) SetSharedGalleryImage added in v1.3.2

func (s *TemplateBuilder) SetSharedGalleryImage(location, imageID string, cachingType compute.CachingTypes) error

func (*TemplateBuilder) SetTags

func (s *TemplateBuilder) SetTags(tags *map[string]*string) error

func (*TemplateBuilder) SetVirtualNetwork

func (s *TemplateBuilder) SetVirtualNetwork(virtualNetworkResourceGroup, virtualNetworkName, subnetName string) error

func (*TemplateBuilder) ToJSON

func (s *TemplateBuilder) ToJSON() (*string, error)

type TemplateParameter

type TemplateParameter struct {
	Value string `json:"value"`
}

type TemplateParameters

type TemplateParameters struct {
	AdminUsername              *TemplateParameter `json:"adminUsername,omitempty"`
	AdminPassword              *TemplateParameter `json:"adminPassword,omitempty"`
	DnsNameForPublicIP         *TemplateParameter `json:"dnsNameForPublicIP,omitempty"`
	KeyVaultName               *TemplateParameter `json:"keyVaultName,omitempty"`
	KeyVaultSecretValue        *TemplateParameter `json:"keyVaultSecretValue,omitempty"`
	ObjectId                   *TemplateParameter `json:"objectId,omitempty"`
	NicName                    *TemplateParameter `json:"nicName,omitempty"`
	OSDiskName                 *TemplateParameter `json:"osDiskName,omitempty"`
	PublicIPAddressName        *TemplateParameter `json:"publicIPAddressName,omitempty"`
	StorageAccountBlobEndpoint *TemplateParameter `json:"storageAccountBlobEndpoint,omitempty"`
	SubnetName                 *TemplateParameter `json:"subnetName,omitempty"`
	TenantId                   *TemplateParameter `json:"tenantId,omitempty"`
	VirtualNetworkName         *TemplateParameter `json:"virtualNetworkName,omitempty"`
	NsgName                    *TemplateParameter `json:"nsgName,omitempty"`
	VMSize                     *TemplateParameter `json:"vmSize,omitempty"`
	VMName                     *TemplateParameter `json:"vmName,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL