github.phpd.cn/hashicorp/packer@v1.3.2/builder/azure/common/template/template.go (about)

     1  package template
     2  
     3  import (
     4  	"github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-04-01/compute"
     5  	"github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-01-01/network"
     6  )
     7  
     8  /////////////////////////////////////////////////
     9  // Template
    10  type Template struct {
    11  	Schema         *string                `json:"$schema"`
    12  	ContentVersion *string                `json:"contentVersion"`
    13  	Parameters     *map[string]Parameters `json:"parameters"`
    14  	Variables      *map[string]string     `json:"variables"`
    15  	Resources      *[]Resource            `json:"resources"`
    16  }
    17  
    18  /////////////////////////////////////////////////
    19  // Template > Parameters
    20  type Parameters struct {
    21  	Type         *string `json:"type"`
    22  	DefaultValue *string `json:"defaultValue,omitempty"`
    23  }
    24  
    25  /////////////////////////////////////////////////
    26  // Template > Resource
    27  type Resource struct {
    28  	ApiVersion *string             `json:"apiVersion"`
    29  	Name       *string             `json:"name"`
    30  	Type       *string             `json:"type"`
    31  	Location   *string             `json:"location,omitempty"`
    32  	DependsOn  *[]string           `json:"dependsOn,omitempty"`
    33  	Plan       *Plan               `json:"plan,omitempty"`
    34  	Properties *Properties         `json:"properties,omitempty"`
    35  	Tags       *map[string]*string `json:"tags,omitempty"`
    36  	Resources  *[]Resource         `json:"resources,omitempty"`
    37  }
    38  
    39  type Plan struct {
    40  	Name          *string `json:"name"`
    41  	Product       *string `json:"product"`
    42  	Publisher     *string `json:"publisher"`
    43  	PromotionCode *string `json:"promotionCode,omitempty"`
    44  }
    45  
    46  type OSDiskUnion struct {
    47  	OsType       compute.OperatingSystemTypes      `json:"osType,omitempty"`
    48  	OsState      compute.OperatingSystemStateTypes `json:"osState,omitempty"`
    49  	BlobURI      *string                           `json:"blobUri,omitempty"`
    50  	Name         *string                           `json:"name,omitempty"`
    51  	Vhd          *compute.VirtualHardDisk          `json:"vhd,omitempty"`
    52  	Image        *compute.VirtualHardDisk          `json:"image,omitempty"`
    53  	Caching      compute.CachingTypes              `json:"caching,omitempty"`
    54  	CreateOption compute.DiskCreateOptionTypes     `json:"createOption,omitempty"`
    55  	DiskSizeGB   *int32                            `json:"diskSizeGB,omitempty"`
    56  	ManagedDisk  *compute.ManagedDiskParameters    `json:"managedDisk,omitempty"`
    57  }
    58  
    59  type DataDiskUnion struct {
    60  	Lun          *int                           `json:"lun,omitempty"`
    61  	BlobURI      *string                        `json:"blobUri,omitempty"`
    62  	Name         *string                        `json:"name,omitempty"`
    63  	Vhd          *compute.VirtualHardDisk       `json:"vhd,omitempty"`
    64  	Image        *compute.VirtualHardDisk       `json:"image,omitempty"`
    65  	Caching      compute.CachingTypes           `json:"caching,omitempty"`
    66  	CreateOption compute.DiskCreateOptionTypes  `json:"createOption,omitempty"`
    67  	DiskSizeGB   *int32                         `json:"diskSizeGB,omitempty"`
    68  	ManagedDisk  *compute.ManagedDiskParameters `json:"managedDisk,omitempty"`
    69  }
    70  
    71  // Union of the StorageProfile and ImageStorageProfile types.
    72  type StorageProfileUnion struct {
    73  	ImageReference *compute.ImageReference `json:"imageReference,omitempty"`
    74  	OsDisk         *OSDiskUnion            `json:"osDisk,omitempty"`
    75  	DataDisks      *[]DataDiskUnion        `json:"dataDisks,omitempty"`
    76  }
    77  
    78  /////////////////////////////////////////////////
    79  // Template > Resource > Properties
    80  type Properties struct {
    81  	AccessPolicies               *[]AccessPolicies                   `json:"accessPolicies,omitempty"`
    82  	AddressSpace                 *network.AddressSpace               `json:"addressSpace,omitempty"`
    83  	DiagnosticsProfile           *compute.DiagnosticsProfile         `json:"diagnosticsProfile,omitempty"`
    84  	DNSSettings                  *network.PublicIPAddressDNSSettings `json:"dnsSettings,omitempty"`
    85  	EnabledForDeployment         *string                             `json:"enabledForDeployment,omitempty"`
    86  	EnabledForTemplateDeployment *string                             `json:"enabledForTemplateDeployment,omitempty"`
    87  	HardwareProfile              *compute.HardwareProfile            `json:"hardwareProfile,omitempty"`
    88  	IPConfigurations             *[]network.IPConfiguration          `json:"ipConfigurations,omitempty"`
    89  	NetworkProfile               *compute.NetworkProfile             `json:"networkProfile,omitempty"`
    90  	OsProfile                    *compute.OSProfile                  `json:"osProfile,omitempty"`
    91  	PublicIPAllocatedMethod      *network.IPAllocationMethod         `json:"publicIPAllocationMethod,omitempty"`
    92  	Sku                          *Sku                                `json:"sku,omitempty"`
    93  	//StorageProfile3              *compute.StorageProfile             `json:"storageProfile,omitempty"`
    94  	StorageProfile *StorageProfileUnion `json:"storageProfile,omitempty"`
    95  	Subnets        *[]network.Subnet    `json:"subnets,omitempty"`
    96  	TenantId       *string              `json:"tenantId,omitempty"`
    97  	Value          *string              `json:"value,omitempty"`
    98  }
    99  
   100  type AccessPolicies struct {
   101  	ObjectId    *string      `json:"objectId,omitempty"`
   102  	TenantId    *string      `json:"tenantId,omitempty"`
   103  	Permissions *Permissions `json:"permissions,omitempty"`
   104  }
   105  
   106  type Permissions struct {
   107  	Keys    *[]string `json:"keys,omitempty"`
   108  	Secrets *[]string `json:"secrets,omitempty"`
   109  }
   110  
   111  type Sku struct {
   112  	Family *string `json:"family,omitempty"`
   113  	Name   *string `json:"name,omitempty"`
   114  }