api

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2018 License: MIT Imports: 11 Imported by: 2

Documentation

Index

Constants

View Source
const (
	// OsUbuntu1604 image
	OsUbuntu1604 = "UbuntuServer_16.04"
	// OsWindows2016 image
	OsWindows2016 = "WindowsServer_2016"
)
View Source
const (
	// DefaultVMName is default VM name
	DefaultVMName = "accVM"
	// DefaultGeneratorCode specifies the source generator of the cluster template.
	DefaultGeneratorCode = "oe-engine"
	// DefaultVnet specifies default vnet address space
	DefaultVnet = "10.0.0.0/16"
	// DefaultSubnet specifies default subnet
	DefaultSubnet = "10.0.0.0/24"
	// DefaultOsDiskType specifies default OS disk type
	DefaultOsDiskType = "Premium_LRS"
	// DefaultPackageBaseURL specifies default package base URL
	DefaultPackageBaseURL = "https://oe.azureedge.net/data"
	// DefaultLinuxImage specifies default Linux OS image
	DefaultLinuxImage = OsUbuntu1604
	// DefaultWindowsImage specifies default Linux OS image
	DefaultWindowsImage = OsWindows2016
)

Variables

View Source
var AllowedLocations = []string{
	"eastus",
	"westeurope",
}

AllowedLocations provides supported azure regions

View Source
var AllowedOsDiskTypes = []string{
	"Premium_LRS",
	"StandardSSD_LRS",
	"Standard_LRS",
}

AllowedOsDiskTypes provides supported OS disk types

View Source
var AllowedVMSizes = []string{
	"Standard_DC2s",
	"Standard_DC4s",
}

AllowedVMSizes provides supported VM sizes

View Source
var OsImageMap = map[string]OSImage{
	OsUbuntu1604: {
		Publisher: "Canonical",
		Offer:     "confidential-compute-preview",
		SKU:       "16.04-LTS",
		Version:   "latest",
		IsWindows: false,
	},
	OsWindows2016: {
		Publisher: "MicrosoftWindowsServer",
		Offer:     "confidential-compute-preview",
		SKU:       "acc-windows-server-2016-datacenter",
		Version:   "latest",
		IsWindows: true,
	},
}

OsImageMap contains supported OS images

Functions

func GetAllowedLocations

func GetAllowedLocations() string

GetAllowedLocations returns allowed locations

func GetAllowedVMSizes

func GetAllowedVMSizes() string

GetAllowedVMSizes returns allowed sizes for VM

func GetOSImageNames

func GetOSImageNames() string

GetOSImageNames returns allowed and default OS image name

func GetOSImageReferences

func GetOSImageReferences() string

GetOSImageReferences returns image references

func GetOsDiskTypes

func GetOsDiskTypes() string

GetOsDiskTypes returns allowed and default OS disk types

func GetVMPlans

func GetVMPlans() string

GetVMPlans returns VM plans

Types

type Apiloader

type Apiloader struct {
}

Apiloader represents the object that loads api model

func (*Apiloader) DeserializeOpenEnclave

func (a *Apiloader) DeserializeOpenEnclave(contents []byte, validate, isUpdate bool) (*OpenEnclave, error)

DeserializeOpenEnclave loads an ACS Cluster API Model, validates it, and returns the unversioned representation

func (*Apiloader) LoadOpenEnclave

func (a *Apiloader) LoadOpenEnclave(contents []byte, validate, isUpdate bool) (*OpenEnclave, error)

LoadOpenEnclave loads and validates an OE API Model

func (*Apiloader) LoadOpenEnclaveFromFile

func (a *Apiloader) LoadOpenEnclaveFromFile(jsonFile string, validate, isUpdate bool) (*OpenEnclave, error)

LoadOpenEnclaveFromFile loads an OE API Model from a JSON file

func (*Apiloader) SerializeOpenEnclave

func (a *Apiloader) SerializeOpenEnclave(oe *OpenEnclave) ([]byte, error)

SerializeOpenEnclave takes an unversioned container service and returns the bytes

type CustomNodesDNS

type CustomNodesDNS struct {
	DNSServer string `json:"dnsServer,omitempty"`
}

CustomNodesDNS represents the Search Domain when the custom vnet for a custom DNS as a nameserver.

type CustomSearchDomain

type CustomSearchDomain struct {
	Name          string `json:"name,omitempty"`
	RealmUser     string `json:"realmUser,omitempty"`
	RealmPassword string `json:"realmPassword,omitempty"`
}

CustomSearchDomain represents the Search Domain when the custom vnet has a windows server DNS as a nameserver.

type DiagnosticsProfile

type DiagnosticsProfile struct {
	Enabled             bool   `json:"enabled"`
	StorageAccountName  string `json:"storageAccountName"`
	IsNewStorageAccount bool   `json:"isNewStorageAccount"`
}

DiagnosticsProfile contains settings to on/off boot diagnostics collection in RD Host

type KeyVaultCertificate

type KeyVaultCertificate struct {
	CertificateURL   string `json:"certificateUrl,omitempty"`
	CertificateStore string `json:"certificateStore,omitempty"`
}

KeyVaultCertificate specifies a certificate to install On Linux, the certificate file is placed under the /var/lib/waagent directory with the file name <UppercaseThumbprint>.crt for the X509 certificate file and <UppercaseThumbprint>.prv for the private key. Both of these files are .pem formatted. On windows the certificate will be saved in the specified store.

type KeyVaultID

type KeyVaultID struct {
	ID string `json:"id,omitempty"`
}

KeyVaultID specifies a key vault

type KeyVaultSecrets

type KeyVaultSecrets struct {
	SourceVault       *KeyVaultID           `json:"sourceVault,omitempty"`
	VaultCertificates []KeyVaultCertificate `json:"vaultCertificates,omitempty"`
}

KeyVaultSecrets specifies certificates to install on the pool of machines from a given key vault the key vault specified must have been granted read permissions to CRP

type LinuxProfile

type LinuxProfile struct {
	AdminUsername string `json:"adminUsername"`
	AdminPassword string `json:"adminPassword"`
	SSH           struct {
		PublicKeys []PublicKey `json:"publicKeys"`
	} `json:"ssh"`
	Secrets            []KeyVaultSecrets   `json:"secrets,omitempty"`
	ScriptRootURL      string              `json:"scriptroot,omitempty"`
	CustomSearchDomain *CustomSearchDomain `json:"customSearchDomain,omitempty"`
	CustomNodesDNS     *CustomNodesDNS     `json:"CustomNodesDNS,omitempty"`
}

LinuxProfile represents the linux parameters passed to the cluster

func (*LinuxProfile) HasCustomNodesDNS

func (l *LinuxProfile) HasCustomNodesDNS() bool

HasCustomNodesDNS returns true if the customer specified a dns server

func (*LinuxProfile) HasSearchDomain

func (l *LinuxProfile) HasSearchDomain() bool

HasSearchDomain returns true if the customer specified secrets to install

func (*LinuxProfile) HasSecrets

func (l *LinuxProfile) HasSecrets() bool

HasSecrets returns true if the customer specified secrets to install

type MasterProfile

type MasterProfile struct {
	VMName            string `json:"vmName"`
	OSImageName       string `json:"osImageName"`
	OSDiskType        string `json:"osDiskType"`
	VMSize            string `json:"vmSize"`
	VnetResourceGroup string `json:"vnetResourceGroup,omitempty"`
	VnetName          string `json:"vnetName,omitempty"`
	VnetAddress       string `json:"vnetAddress,omitempty"`
	SubnetName        string `json:"subnetName,omitempty"`
	SubnetAddress     string `json:"subnetAddress,omitempty"`
}

MasterProfile represents the definition of the master cluster

func (*MasterProfile) IsCustomVNET

func (m *MasterProfile) IsCustomVNET() bool

IsCustomVNET returns true if the customer brought their own VNET

type OSImage

type OSImage struct {
	Publisher string
	Offer     string
	SKU       string
	Version   string
	IsWindows bool
}

OSImage represents Azure OS Image

type OSType

type OSType string

OSType represents OS types of agents

type OpenEnclave

type OpenEnclave struct {
	Location       string      `json:"location"`
	OeSdkExcluded  bool        `json:"oeSdkExcluded"`
	PackageBaseURL string      `json:"packageBaseURL"`
	Properties     *Properties `json:"properties,omitempty"`
}

OpenEnclave complies with the ARM model of resource definition in a JSON template.

type Properties

type Properties struct {
	MasterProfile      *MasterProfile      `json:"masterProfile,omitempty"`
	LinuxProfile       *LinuxProfile       `json:"linuxProfile,omitempty"`
	WindowsProfile     *WindowsProfile     `json:"windowsProfile,omitempty"`
	DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"`
}

Properties represents the ACS cluster definition

func (*Properties) IsLinux

func (p *Properties) IsLinux() bool

IsLinux returns true for Linux VM

func (*Properties) IsWindows

func (p *Properties) IsWindows() bool

IsWindows returns true for Windows VM

func (*Properties) Validate

func (a *Properties) Validate(isUpdate bool) error

Validate implements APIObject

type PublicKey

type PublicKey struct {
	KeyData string `json:"keyData"`
}

PublicKey represents an SSH key for LinuxProfile

type WindowsProfile

type WindowsProfile struct {
	AdminUsername         string            `json:"adminUsername"`
	AdminPassword         string            `json:"adminPassword"`
	SSHPubKey             string            `json:"sshPublicKey"`
	ImageVersion          string            `json:"imageVersion"`
	WindowsImageSourceURL string            `json:"windowsImageSourceURL"`
	WindowsPublisher      string            `json:"windowsPublisher"`
	WindowsOffer          string            `json:"windowsOffer"`
	WindowsSku            string            `json:"windowsSku"`
	Secrets               []KeyVaultSecrets `json:"secrets,omitempty"`
}

WindowsProfile represents the windows parameters passed to the cluster

func (*WindowsProfile) HasCustomImage

func (w *WindowsProfile) HasCustomImage() bool

HasCustomImage returns true if there is a custom windows os image url specified

func (*WindowsProfile) HasSecrets

func (w *WindowsProfile) HasSecrets() bool

HasSecrets returns true if the customer specified secrets to install

func (*WindowsProfile) Validate

func (w *WindowsProfile) Validate(orchestratorType string) error

Validate ensures that the WindowsProfile is valid

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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