Package com.yahoo.config.application.api
Class DeploymentSpec
- java.lang.Object
-
- com.yahoo.config.application.api.DeploymentSpec
-
public class DeploymentSpec extends Object
Specifies the environments and regions to which an application should be deployed. This may be used both for inspection as part of an application model and to answer queries about deployment from the command line. A main method is included for the latter usage. A deployment consists of a number of steps executed in the order listed in deployment xml, as well as some additional settings. This is immutable.- Author:
- bratseth
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DeploymentSpec.ChangeBlocker
A blocking of changes in a given time windowstatic class
DeploymentSpec.DeclaredTest
A declared production teststatic class
DeploymentSpec.DeclaredZone
A deployment step which is to run deployment in a particular zonestatic class
DeploymentSpec.Delay
A deployment step which is to wait for some time before progressing to the next stepstatic class
DeploymentSpec.DeprecatedElement
Represents a deprecated XML element inDeploymentSpec
, or the deprecated attribute(s) of an element.static class
DeploymentSpec.ParallelSteps
A container for multiple other steps, which are executed in parallelstatic class
DeploymentSpec.RevisionChange
Determines when application changes deploy.static class
DeploymentSpec.RevisionTarget
Determines what application changes to deploy to the instance.static class
DeploymentSpec.Step
A deployment stepstatic class
DeploymentSpec.Steps
A container for several steps, by default in serial orderstatic class
DeploymentSpec.UpgradePolicy
Controls when this application will be upgraded to new Vespa versionsstatic class
DeploymentSpec.UpgradeRollout
Determines when application changes deploy, when there is already an ongoing platform upgrade.
-
Field Summary
Fields Modifier and Type Field Description static DeploymentSpec
empty
The empty deployment spec, specifying no zones or rotation, and defaults for all settings
-
Constructor Summary
Constructors Constructor Description DeploymentSpec(List<DeploymentSpec.Step> steps, Optional<Integer> majorVersion, Optional<com.yahoo.config.provision.AthenzDomain> athenzDomain, Optional<com.yahoo.config.provision.AthenzService> athenzService, List<Endpoint> endpoints, String xmlForm, List<DeploymentSpec.DeprecatedElement> deprecatedElements)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Optional<com.yahoo.config.provision.AthenzDomain>
athenzDomain()
Returns the Athenz domain set on the root tag, if anyOptional<com.yahoo.config.provision.AthenzService>
athenzService()
Returns the Athenz service set on the root tag, if anyint
deployableHashCode()
Computes a hash of all fields that influence what is deployed with this spec, i.e., not orchestration.List<DeploymentSpec.DeprecatedElement>
deprecatedElements()
Returns the deprecated elements used when creating thisList<Endpoint>
endpoints()
Returns the application-level endpoints of this, if anyboolean
equals(Object o)
static DeploymentSpec
fromXml(Reader reader)
Creates a deployment spec from XML.static DeploymentSpec
fromXml(String xmlForm)
Creates a deployment spec from XML.static DeploymentSpec
fromXml(String xmlForm, boolean validate)
Creates a deployment spec from XML.int
hashCode()
Optional<DeploymentInstanceSpec>
instance(com.yahoo.config.provision.InstanceName name)
Returns the instance step containing the given instance nameList<com.yahoo.config.provision.InstanceName>
instanceNames()
Returns the instance names declared in thisList<DeploymentInstanceSpec>
instances()
Returns the step descendants of this which are instancesOptional<Integer>
majorVersion()
Returns the major version this application is pinned to, or empty (default) to allow all major versionsDeploymentInstanceSpec
requireInstance(com.yahoo.config.provision.InstanceName name)
DeploymentInstanceSpec
requireInstance(String name)
List<DeploymentSpec.Step>
steps()
Returns the deployment steps of this in the order they will be performedstatic String
toMessageString(Throwable t)
String
xmlForm()
Returns the XML form of this spec, or null if it was not created by fromXml, nor is empty
-
-
-
Field Detail
-
empty
public static final DeploymentSpec empty
The empty deployment spec, specifying no zones or rotation, and defaults for all settings
-
-
Constructor Detail
-
DeploymentSpec
public DeploymentSpec(List<DeploymentSpec.Step> steps, Optional<Integer> majorVersion, Optional<com.yahoo.config.provision.AthenzDomain> athenzDomain, Optional<com.yahoo.config.provision.AthenzService> athenzService, List<Endpoint> endpoints, String xmlForm, List<DeploymentSpec.DeprecatedElement> deprecatedElements)
-
-
Method Detail
-
majorVersion
public Optional<Integer> majorVersion()
Returns the major version this application is pinned to, or empty (default) to allow all major versions
-
steps
public List<DeploymentSpec.Step> steps()
Returns the deployment steps of this in the order they will be performed
-
athenzDomain
public Optional<com.yahoo.config.provision.AthenzDomain> athenzDomain()
Returns the Athenz domain set on the root tag, if any
-
athenzService
public Optional<com.yahoo.config.provision.AthenzService> athenzService()
Returns the Athenz service set on the root tag, if any
-
xmlForm
public String xmlForm()
Returns the XML form of this spec, or null if it was not created by fromXml, nor is empty
-
instance
public Optional<DeploymentInstanceSpec> instance(com.yahoo.config.provision.InstanceName name)
Returns the instance step containing the given instance name
-
requireInstance
public DeploymentInstanceSpec requireInstance(String name)
-
requireInstance
public DeploymentInstanceSpec requireInstance(com.yahoo.config.provision.InstanceName name)
-
instanceNames
public List<com.yahoo.config.provision.InstanceName> instanceNames()
Returns the instance names declared in this
-
instances
public List<DeploymentInstanceSpec> instances()
Returns the step descendants of this which are instances
-
deprecatedElements
public List<DeploymentSpec.DeprecatedElement> deprecatedElements()
Returns the deprecated elements used when creating this
-
fromXml
public static DeploymentSpec fromXml(Reader reader)
Creates a deployment spec from XML.- Throws:
IllegalArgumentException
- if the XML is invalid
-
fromXml
public static DeploymentSpec fromXml(String xmlForm)
Creates a deployment spec from XML.- Throws:
IllegalArgumentException
- if the XML is invalid
-
fromXml
public static DeploymentSpec fromXml(String xmlForm, boolean validate)
Creates a deployment spec from XML.- Throws:
IllegalArgumentException
- if the XML is invalid
-
deployableHashCode
public int deployableHashCode()
Computes a hash of all fields that influence what is deployed with this spec, i.e., not orchestration.
-
-