public class DeploymentSpec extends Object
Modifier and Type | Class and Description |
---|---|
static class |
DeploymentSpec.ChangeBlocker
A blocking of changes in a given time window
|
static class |
DeploymentSpec.DeclaredZone
A deployment step which is to run deployment in a particular zone
|
static class |
DeploymentSpec.Delay
A deployment step which is to wait for some time before progressing to the next step
|
static class |
DeploymentSpec.ParallelZones
A deployment step which is to run deployment to multiple zones in parallel
|
static class |
DeploymentSpec.Step
A deployment step
|
static class |
DeploymentSpec.UpgradePolicy
Controls when this application will be upgraded to new Vespa versions
|
Modifier and Type | Field and Description |
---|---|
private List<DeploymentSpec.ChangeBlocker> |
changeBlockers |
static DeploymentSpec |
empty
The empty deployment spec, specifying no zones or rotation, and defaults for all settings
|
private Optional<String> |
globalServiceId |
private List<DeploymentSpec.Step> |
steps |
private DeploymentSpec.UpgradePolicy |
upgradePolicy |
private String |
xmlForm |
Constructor and Description |
---|
DeploymentSpec(Optional<String> globalServiceId,
DeploymentSpec.UpgradePolicy upgradePolicy,
List<DeploymentSpec.ChangeBlocker> changeBlockers,
List<DeploymentSpec.Step> steps) |
DeploymentSpec(Optional<String> globalServiceId,
DeploymentSpec.UpgradePolicy upgradePolicy,
List<DeploymentSpec.ChangeBlocker> changeBlockers,
List<DeploymentSpec.Step> steps,
String xmlForm) |
Modifier and Type | Method and Description |
---|---|
boolean |
canChangeRevisionAt(Instant instant)
Returns whether an application revision change can occur at the given instant
|
boolean |
canUpgradeAt(Instant instant)
Returns whether upgrade can occur at the given instant
|
List<DeploymentSpec.ChangeBlocker> |
changeBlocker()
Returns time windows where upgrades are disallowed
|
private static List<DeploymentSpec.Step> |
completeSteps(List<DeploymentSpec.Step> steps)
Adds missing required steps and reorders steps to a permissible order
|
private void |
ensureUnique(DeploymentSpec.DeclaredZone zone,
Set<DeploymentSpec.DeclaredZone> zones) |
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.
|
Optional<String> |
globalServiceId()
Returns the ID of the service to expose through global routing, if present
|
boolean |
includes(com.yahoo.config.provision.Environment environment,
Optional<com.yahoo.config.provision.RegionName> region)
Returns whether this deployment spec specifies the given zone, either implicitly or explicitly
|
static void |
main(String[] args)
This may be invoked by a continuous build
|
private static DeploymentSpec.DeclaredZone |
remove(com.yahoo.config.provision.Environment environment,
List<DeploymentSpec.Step> steps)
Removes the first occurrence of a deployment step to the given environment and returns it.
|
List<DeploymentSpec.Step> |
steps()
Returns the deployment steps of this in the order they will be performed
|
static String |
toMessageString(Throwable t) |
DeploymentSpec.UpgradePolicy |
upgradePolicy()
Returns the upgrade policy of this, which is defaultPolicy if none is specified
|
private void |
validateTotalDelay(List<DeploymentSpec.Step> steps)
Throw an IllegalArgumentException if the total delay exceeds 24 hours
|
private void |
validateZones(List<DeploymentSpec.Step> steps)
Throw an IllegalArgumentException if any production zone is declared multiple times
|
String |
xmlForm()
Returns the XML form of this spec, or null if it was not created by fromXml, nor is empty
|
List<DeploymentSpec.DeclaredZone> |
zones()
Returns all the DeclaredZone deployment steps in the order they are declared
|
public static final DeploymentSpec empty
private final DeploymentSpec.UpgradePolicy upgradePolicy
private final List<DeploymentSpec.ChangeBlocker> changeBlockers
private final List<DeploymentSpec.Step> steps
private final String xmlForm
public DeploymentSpec(Optional<String> globalServiceId, DeploymentSpec.UpgradePolicy upgradePolicy, List<DeploymentSpec.ChangeBlocker> changeBlockers, List<DeploymentSpec.Step> steps)
public DeploymentSpec(Optional<String> globalServiceId, DeploymentSpec.UpgradePolicy upgradePolicy, List<DeploymentSpec.ChangeBlocker> changeBlockers, List<DeploymentSpec.Step> steps, String xmlForm)
private void validateTotalDelay(List<DeploymentSpec.Step> steps)
private void validateZones(List<DeploymentSpec.Step> steps)
private void ensureUnique(DeploymentSpec.DeclaredZone zone, Set<DeploymentSpec.DeclaredZone> zones)
private static List<DeploymentSpec.Step> completeSteps(List<DeploymentSpec.Step> steps)
private static DeploymentSpec.DeclaredZone remove(com.yahoo.config.provision.Environment environment, List<DeploymentSpec.Step> steps)
public Optional<String> globalServiceId()
public DeploymentSpec.UpgradePolicy upgradePolicy()
public boolean canUpgradeAt(Instant instant)
public boolean canChangeRevisionAt(Instant instant)
public List<DeploymentSpec.ChangeBlocker> changeBlocker()
public List<DeploymentSpec.Step> steps()
public List<DeploymentSpec.DeclaredZone> zones()
public String xmlForm()
public boolean includes(com.yahoo.config.provision.Environment environment, Optional<com.yahoo.config.provision.RegionName> region)
public static DeploymentSpec fromXml(Reader reader)
IllegalArgumentException
- if the XML is invalidpublic static DeploymentSpec fromXml(String xmlForm)
IllegalArgumentException
- if the XML is invalidpublic static DeploymentSpec fromXml(String xmlForm, boolean validate)
IllegalArgumentException
- if the XML is invalidpublic static void main(String[] args)
Copyright © 2017. All rights reserved.