applyspec

package
v0.0.0-...-3fc8308 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2015 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NetworkSpecTypeDynamic = "dynamic"
)

Variables

This section is empty.

Functions

func NewConcreteV1Service

func NewConcreteV1Service(fs boshsys.FileSystem, specFilePath string) concreteV1Service

Types

type ApplySpec

type ApplySpec interface {
	Jobs() []models.Job
	Packages() []models.Package
	MaxLogFileSize() string
}

type DefaultNetworkDelegate

type DefaultNetworkDelegate interface {
	GetDefaultNetwork() (boshsettings.Network, error)
}

type JobSpec

type JobSpec struct {
	Name             *string           `json:"name"`
	Release          string            `json:"release"`
	Template         string            `json:"template"`
	Version          string            `json:"version"`
	Sha1             string            `json:"sha1"`
	BlobstoreID      string            `json:"blobstore_id"`
	JobTemplateSpecs []JobTemplateSpec `json:"templates"`
}

func (*JobSpec) JobTemplateSpecsAsJobs

func (s *JobSpec) JobTemplateSpecsAsJobs() []models.Job

type JobTemplateSpec

type JobTemplateSpec struct {
	Name        string `json:"name"`
	Version     string `json:"version"`
	Sha1        string `json:"sha1"`
	BlobstoreID string `json:"blobstore_id"`
}

func (*JobTemplateSpec) AsJob

func (s *JobTemplateSpec) AsJob() models.Job

type LoggingSpec

type LoggingSpec struct {
	MaxLogFileSize string `json:"max_log_file_size"`
}

type NetworkSpec

type NetworkSpec struct {
	// Instead of explicitly specifying all network fields,
	// keep original hash that Director sent because
	// Director will later fetch current apply spec via get_state
	// and use absolute equality to determine network changes.
	//
	// Ideally we would explicitly call out fields (like in 40276d6 commit)
	// and Director would check for equivalence instead of absolute hash equality.
	Fields map[string]interface{}
}

func (NetworkSpec) IsDynamic

func (s NetworkSpec) IsDynamic() bool

func (NetworkSpec) MarshalJSON

func (s NetworkSpec) MarshalJSON() ([]byte, error)

func (NetworkSpec) PopulateIPInfo

func (s NetworkSpec) PopulateIPInfo(ip, netmask, gateway string) NetworkSpec

func (*NetworkSpec) UnmarshalJSON

func (s *NetworkSpec) UnmarshalJSON(data []byte) error

type PackageSpec

type PackageSpec struct {
	Name        string `json:"name"`
	Version     string `json:"version"`
	Sha1        string `json:"sha1"`
	BlobstoreID string `json:"blobstore_id"`
}

func (*PackageSpec) AsPackage

func (s *PackageSpec) AsPackage() models.Package

type PropertiesSpec

type PropertiesSpec struct {
	LoggingSpec LoggingSpec `json:"logging"`
}

type RenderedTemplatesArchiveSpec

type RenderedTemplatesArchiveSpec struct {
	Sha1        string `json:"sha1"`
	BlobstoreID string `json:"blobstore_id"`
}

func (RenderedTemplatesArchiveSpec) AsSource

type V1ApplySpec

type V1ApplySpec struct {
	PropertiesSpec    PropertiesSpec         `json:"properties"`
	JobSpec           JobSpec                `json:"job"`
	PackageSpecs      map[string]PackageSpec `json:"packages"`
	ConfigurationHash string                 `json:"configuration_hash"`
	NetworkSpecs      map[string]NetworkSpec `json:"networks"`
	ResourcePoolSpecs interface{}            `json:"resource_pool"`
	Deployment        string                 `json:"deployment"`

	// Since default value of int is 0 use pointer
	// to indicate that state does not have an assigned index
	// (json.Marshal will result in null instead of 0).
	Index *int `json:"index"`

	PersistentDisk     int         `json:"persistent_disk"`
	PersistentDiskPool interface{} `json:"persistent_disk_pool"`

	RenderedTemplatesArchiveSpec RenderedTemplatesArchiveSpec `json:"rendered_templates_archive"`
}

func (V1ApplySpec) Jobs

func (s V1ApplySpec) Jobs() []models.Job

Jobs returns a list of pre-rendered job templates extracted from a single tarball provided by BOSH director.

func (V1ApplySpec) MaxLogFileSize

func (s V1ApplySpec) MaxLogFileSize() string

func (V1ApplySpec) Packages

func (s V1ApplySpec) Packages() []models.Package

type V1Service

type V1Service interface {
	// Error will only be returned if Set() was used and Get() cannot retrieve saved copy.
	// New empty spec will be returned if Set() was never used.
	Get() (V1ApplySpec, error)

	Set(V1ApplySpec) error

	PopulateDynamicNetworks(V1ApplySpec, boshsettings.Settings) (V1ApplySpec, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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