Package com.yahoo.config.application.api
Class DeploymentSpec
java.lang.Object
com.yahoo.config.application.api.DeploymentSpec
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
Modifier and TypeClassDescriptionstatic class
A blocking of changes in a given time windowstatic class
A declared production teststatic class
A deployment step which is to run deployment in a particular zonestatic class
A deployment step which is to wait for some time before progressing to the next stepstatic class
Represents a deprecated XML element inDeploymentSpec
, or the deprecated attribute(s) of an element.static class
A container for multiple other steps, which are executed in parallelstatic enum
Determines when application changes deploy.static enum
Determines what application changes to deploy to the instance.static class
A deployment stepstatic class
A container for several steps, by default in serial orderstatic enum
Controls when this application will be upgraded to new Vespa versionsstatic enum
Determines when application changes deploy, when there is already an ongoing platform upgrade. -
Field Summary
Modifier and TypeFieldDescriptionstatic final DeploymentSpec
The empty deployment spec, specifying no zones or rotation, and defaults for all settings -
Constructor Summary
ConstructorDescriptionDeploymentSpec
(List<DeploymentSpec.Step> steps, Optional<Integer> majorVersion, Optional<com.yahoo.config.provision.AthenzDomain> athenzDomain, Optional<com.yahoo.config.provision.AthenzService> athenzService, Map<com.yahoo.config.provision.CloudName, com.yahoo.config.provision.CloudAccount> cloudAccounts, Optional<Duration> hostTTL, List<Endpoint> endpoints, String xmlForm, List<DeploymentSpec.DeprecatedElement> deprecatedElements) -
Method Summary
Modifier and TypeMethodDescriptionOptional<com.yahoo.config.provision.AthenzDomain>
Returns the Athenz domain set on the root tag, if anyOptional<com.yahoo.config.provision.AthenzService>
Returns the Athenz service set on the root tag, if anyOptional<com.yahoo.config.provision.AthenzService>
athenzService
(com.yahoo.config.provision.InstanceName instance, com.yahoo.config.provision.Environment environment, com.yahoo.config.provision.RegionName region) The most specific Athenz service for the given arguments.bcp()
Deprecated.returns Bcp.empty().com.yahoo.config.provision.CloudAccount
cloudAccount
(com.yahoo.config.provision.CloudName cloud, com.yahoo.config.provision.InstanceName instance, com.yahoo.config.provision.zone.ZoneId zone) The most specific Cloud account for the given arguments.Map<com.yahoo.config.provision.CloudName,
com.yahoo.config.provision.CloudAccount> int
Computes a hash of all fields that influence what is deployed with this spec, i.e., not orchestration.Returns the deprecated elements used when creating thisReturns the application-level endpoints of this, if anyboolean
static DeploymentSpec
Creates a deployment spec from XML.static DeploymentSpec
Creates a deployment spec from XML.static DeploymentSpec
Creates a deployment spec from XML.int
hashCode()
hostTTL
(com.yahoo.config.provision.InstanceName instance, com.yahoo.config.provision.Environment environment, com.yahoo.config.provision.RegionName region) Additional host time-to-live for this application.instance
(com.yahoo.config.provision.InstanceName name) Returns the instance step containing the given instance nameList<com.yahoo.config.provision.InstanceName>
Returns the instance names declared in thisReturns the step descendants of this which are instancesboolean
isEmpty()
Returns the major version this application is pinned to, or empty (default) to allow all major versionsrequireInstance
(com.yahoo.config.provision.InstanceName name) requireInstance
(String name) steps()
Returns the deployment steps of this in the order they will be performedstatic String
xmlForm()
Returns the XML form of this spec, or null if it was not created by fromXml, nor is emptycom.yahoo.config.provision.ZoneEndpoint
zoneEndpoint
(com.yahoo.config.provision.InstanceName instance, com.yahoo.config.provision.zone.ZoneId zone, com.yahoo.config.provision.ClusterSpec.Id cluster) Returns the most specific zone endpoint, where specificity is given, in decreasing order: 1.
-
Field Details
-
empty
The empty deployment spec, specifying no zones or rotation, and defaults for all settings
-
-
Constructor Details
-
DeploymentSpec
public DeploymentSpec(List<DeploymentSpec.Step> steps, Optional<Integer> majorVersion, Optional<com.yahoo.config.provision.AthenzDomain> athenzDomain, Optional<com.yahoo.config.provision.AthenzService> athenzService, Map<com.yahoo.config.provision.CloudName, com.yahoo.config.provision.CloudAccount> cloudAccounts, Optional<Duration> hostTTL, List<Endpoint> endpoints, String xmlForm, List<DeploymentSpec.DeprecatedElement> deprecatedElements)
-
-
Method Details
-
isEmpty
public boolean isEmpty() -
majorVersion
Returns the major version this application is pinned to, or empty (default) to allow all major versions -
steps
Returns the deployment steps of this in the order they will be performed -
athenzDomain
Returns the Athenz domain set on the root tag, if any -
athenzService
Returns the Athenz service set on the root tag, if any -
athenzService
public Optional<com.yahoo.config.provision.AthenzService> athenzService(com.yahoo.config.provision.InstanceName instance, com.yahoo.config.provision.Environment environment, com.yahoo.config.provision.RegionName region) The most specific Athenz service for the given arguments. -
cloudAccount
public com.yahoo.config.provision.CloudAccount cloudAccount(com.yahoo.config.provision.CloudName cloud, com.yahoo.config.provision.InstanceName instance, com.yahoo.config.provision.zone.ZoneId zone) The most specific Cloud account for the given arguments. -
cloudAccounts
public Map<com.yahoo.config.provision.CloudName,com.yahoo.config.provision.CloudAccount> cloudAccounts() -
hostTTL
public Optional<Duration> hostTTL(com.yahoo.config.provision.InstanceName instance, com.yahoo.config.provision.Environment environment, com.yahoo.config.provision.RegionName region) Additional host time-to-live for this application. Requires a custom cloud account to be set. This also applies only to zones with dynamic provisioning, and is then the time hosts are allowed remain empty, before being deprovisioned. This is useful for applications which frequently deploy to, e.g., test and staging zones, and want to avoid the delay of having to provision hosts. -
zoneEndpoint
public com.yahoo.config.provision.ZoneEndpoint zoneEndpoint(com.yahoo.config.provision.InstanceName instance, com.yahoo.config.provision.zone.ZoneId zone, com.yahoo.config.provision.ClusterSpec.Id cluster) Returns the most specific zone endpoint, where specificity is given, in decreasing order: 1. The given instance has declared a zone endpoint for the cluster, for the given region. 2. The given instance has declared a universal zone endpoint for the cluster. 3. The application has declared a zone endpoint for the cluster, for the given region. 4. The application has declared a universal zone endpoint for the cluster. 5. None of the above apply, and the default of a publicly visible endpoint is used. -
bcp
Deprecated.returns Bcp.empty(). -
xmlForm
Returns the XML form of this spec, or null if it was not created by fromXml, nor is empty -
instance
Returns the instance step containing the given instance name -
requireInstance
-
requireInstance
-
instanceNames
Returns the instance names declared in this -
instances
Returns the step descendants of this which are instances -
endpoints
Returns the application-level endpoints of this, if any -
deprecatedElements
Returns the deprecated elements used when creating this -
fromXml
Creates a deployment spec from XML.- Throws:
IllegalArgumentException
- if the XML is invalid
-
fromXml
Creates a deployment spec from XML.- Throws:
IllegalArgumentException
- if the XML is invalid
-
fromXml
Creates a deployment spec from XML.- Throws:
IllegalArgumentException
- if the XML is invalid
-
toMessageString
-
equals
-
hashCode
public int hashCode() -
deployableHashCode
public int deployableHashCode()Computes a hash of all fields that influence what is deployed with this spec, i.e., not orchestration.
-