Package com.yahoo.config.application.api
Class DeploymentSpec
- java.lang.Object
-
- com.yahoo.config.application.api.DeploymentSpec
-
public class DeploymentSpec extends java.lang.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.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.ParallelZones
A deployment step which is to run deployment to multiple zones in parallelstatic class
DeploymentSpec.Step
A deployment stepstatic class
DeploymentSpec.UpgradePolicy
Controls when this application will be upgraded to new Vespa versions
-
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(java.util.Optional<java.lang.String> globalServiceId, DeploymentSpec.UpgradePolicy upgradePolicy, java.util.Optional<java.lang.Integer> majorVersion, java.util.List<DeploymentSpec.ChangeBlocker> changeBlockers, java.util.List<DeploymentSpec.Step> steps, java.lang.String xmlForm, java.util.Optional<com.yahoo.config.provision.AthenzDomain> athenzDomain, java.util.Optional<com.yahoo.config.provision.AthenzService> athenzService, Notifications notifications, java.util.List<Endpoint> endpoints)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Optional<com.yahoo.config.provision.AthenzDomain>
athenzDomain()
Returns the athenz domain if configuredjava.util.Optional<com.yahoo.config.provision.AthenzService>
athenzService(com.yahoo.config.provision.Environment environment, com.yahoo.config.provision.RegionName region)
Returns the athenz service for environment/region if configuredboolean
canChangeRevisionAt(java.time.Instant instant)
Returns whether an application revision change can occur at the given instantboolean
canUpgradeAt(java.time.Instant instant)
Returns whether upgrade can occur at the given instantjava.util.List<DeploymentSpec.ChangeBlocker>
changeBlocker()
Returns time windows where upgrades are disallowedjava.util.List<Endpoint>
endpoints()
Returns the rotations configurationboolean
equals(java.lang.Object o)
static DeploymentSpec
fromXml(java.io.Reader reader)
Creates a deployment spec from XML.static DeploymentSpec
fromXml(java.lang.String xmlForm)
Creates a deployment spec from XML.static DeploymentSpec
fromXml(java.lang.String xmlForm, boolean validate)
Creates a deployment spec from XML.java.util.Optional<java.lang.String>
globalServiceId()
Returns the ID of the service to expose through global routing, if presentint
hashCode()
boolean
includes(com.yahoo.config.provision.Environment environment, java.util.Optional<com.yahoo.config.provision.RegionName> region)
Returns whether this deployment spec specifies the given zone, either implicitly or explicitlystatic void
main(java.lang.String[] args)
This may be invoked by a continuous buildjava.util.Optional<java.lang.Integer>
majorVersion()
Returns the major version this application is pinned to, or empty (default) to allow all major versionsNotifications
notifications()
Returns the notification configurationjava.util.List<DeploymentSpec.Step>
steps()
Returns the deployment steps of this in the order they will be performedstatic java.lang.String
toMessageString(java.lang.Throwable t)
DeploymentSpec.UpgradePolicy
upgradePolicy()
Returns the upgrade policy of this, which is defaultPolicy if none is specifiedjava.lang.String
xmlForm()
Returns the XML form of this spec, or null if it was not created by fromXml, nor is emptyjava.util.List<DeploymentSpec.DeclaredZone>
zones()
Returns all the DeclaredZone deployment steps in the order they are declared
-
-
-
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(java.util.Optional<java.lang.String> globalServiceId, DeploymentSpec.UpgradePolicy upgradePolicy, java.util.Optional<java.lang.Integer> majorVersion, java.util.List<DeploymentSpec.ChangeBlocker> changeBlockers, java.util.List<DeploymentSpec.Step> steps, java.lang.String xmlForm, java.util.Optional<com.yahoo.config.provision.AthenzDomain> athenzDomain, java.util.Optional<com.yahoo.config.provision.AthenzService> athenzService, Notifications notifications, java.util.List<Endpoint> endpoints)
-
-
Method Detail
-
globalServiceId
public java.util.Optional<java.lang.String> globalServiceId()
Returns the ID of the service to expose through global routing, if present
-
upgradePolicy
public DeploymentSpec.UpgradePolicy upgradePolicy()
Returns the upgrade policy of this, which is defaultPolicy if none is specified
-
majorVersion
public java.util.Optional<java.lang.Integer> majorVersion()
Returns the major version this application is pinned to, or empty (default) to allow all major versions
-
canUpgradeAt
public boolean canUpgradeAt(java.time.Instant instant)
Returns whether upgrade can occur at the given instant
-
canChangeRevisionAt
public boolean canChangeRevisionAt(java.time.Instant instant)
Returns whether an application revision change can occur at the given instant
-
changeBlocker
public java.util.List<DeploymentSpec.ChangeBlocker> changeBlocker()
Returns time windows where upgrades are disallowed
-
steps
public java.util.List<DeploymentSpec.Step> steps()
Returns the deployment steps of this in the order they will be performed
-
zones
public java.util.List<DeploymentSpec.DeclaredZone> zones()
Returns all the DeclaredZone deployment steps in the order they are declared
-
notifications
public Notifications notifications()
Returns the notification configuration
-
endpoints
public java.util.List<Endpoint> endpoints()
Returns the rotations configuration
-
xmlForm
public java.lang.String xmlForm()
Returns the XML form of this spec, or null if it was not created by fromXml, nor is empty
-
includes
public boolean includes(com.yahoo.config.provision.Environment environment, java.util.Optional<com.yahoo.config.provision.RegionName> region)
Returns whether this deployment spec specifies the given zone, either implicitly or explicitly
-
fromXml
public static DeploymentSpec fromXml(java.io.Reader reader)
Creates a deployment spec from XML.- Throws:
java.lang.IllegalArgumentException
- if the XML is invalid
-
fromXml
public static DeploymentSpec fromXml(java.lang.String xmlForm)
Creates a deployment spec from XML.- Throws:
java.lang.IllegalArgumentException
- if the XML is invalid
-
fromXml
public static DeploymentSpec fromXml(java.lang.String xmlForm, boolean validate)
Creates a deployment spec from XML.- Throws:
java.lang.IllegalArgumentException
- if the XML is invalid
-
toMessageString
public static java.lang.String toMessageString(java.lang.Throwable t)
-
athenzDomain
public java.util.Optional<com.yahoo.config.provision.AthenzDomain> athenzDomain()
Returns the athenz domain if configured
-
athenzService
public java.util.Optional<com.yahoo.config.provision.AthenzService> athenzService(com.yahoo.config.provision.Environment environment, com.yahoo.config.provision.RegionName region)
Returns the athenz service for environment/region if configured
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
main
public static void main(java.lang.String[] args)
This may be invoked by a continuous build
-
-