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
Nested ClassesModifier and TypeClassDescriptionstatic classA blocking of changes in a given time windowstatic classA declared production teststatic classA deployment step which is to run deployment in a particular zonestatic classA deployment step which is to wait for some time before progressing to the next stepstatic classRepresents a deprecated XML element inDeploymentSpec, or the deprecated attribute(s) of an element.static classstatic classA container for multiple other steps, which are executed in parallelstatic enumDetermines when application changes deploy.static enumDetermines what application changes to deploy to the instance.static classA deployment stepstatic classA container for several steps, by default in serial orderstatic enumControls when this application will be upgraded to new Vespa versionsstatic enumDetermines when application changes deploy, when there is already an ongoing platform upgrade. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final DeploymentSpecThe empty deployment spec, specifying no zones or rotation, and defaults for all settings -
Constructor Summary
ConstructorsConstructorDescriptionDeploymentSpec(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, DeploymentSpec.DevSpec devSpec) -
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.com.yahoo.config.provision.CloudAccountcloudAccount(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> Set<com.yahoo.config.provision.Environment>Returns the set of unique environments concerned by this deployment specintComputes 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 anybooleanstatic DeploymentSpecCreates a deployment spec from XML.static DeploymentSpecCreates a deployment spec from XML.static DeploymentSpecCreates a deployment spec from XML.inthashCode()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 instancesbooleanisEmpty()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 performedcom.yahoo.config.provision.Tagstags(com.yahoo.config.provision.InstanceName instance, com.yahoo.config.provision.Environment environment) static StringxmlForm()Returns the XML form of this spec, or null if it was not created by fromXml, nor is emptycom.yahoo.config.provision.ZoneEndpointzoneEndpoint(com.yahoo.config.provision.InstanceName instance, com.yahoo.config.provision.zone.ZoneId zone, com.yahoo.config.provision.ClusterSpec.Id cluster, boolean useNonPublicEndpointForTest) Returns the most specific zone endpoint, where specificity is given, in decreasing order: 1.com.yahoo.config.provision.ZoneEndpointzoneEndpoint(com.yahoo.config.provision.InstanceName instance, com.yahoo.config.provision.Zone zone, com.yahoo.config.provision.ClusterSpec.Id cluster, boolean useNonPublicEndpointForTest)
-
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, DeploymentSpec.DevSpec devSpec)
-
-
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 -
concernedEnvironments
Returns the set of unique environments concerned by this deployment spec -
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() -
tags
public com.yahoo.config.provision.Tags tags(com.yahoo.config.provision.InstanceName instance, com.yahoo.config.provision.Environment environment) -
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 zone, com.yahoo.config.provision.ClusterSpec.Id cluster, boolean useNonPublicEndpointForTest) -
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, boolean useNonPublicEndpointForTest) 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. -
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.
-