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
  • Field Details

    • empty

      public static final DeploymentSpec empty
      The empty deployment spec, specifying no zones or rotation, and defaults for all settings
  • Constructor Details

  • Method Details

    • 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
    • cloudAccount

      public Optional<com.yahoo.config.provision.CloudAccount> cloudAccount()
      Cloud account set on the deployment root; see discussion for athenzService.
    • 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
    • endpoints

      public List<Endpoint> endpoints()
      Returns the application-level endpoints of this, if any
    • 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
    • toMessageString

      public static String toMessageString(Throwable t)
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • deployableHashCode

      public int deployableHashCode()
      Computes a hash of all fields that influence what is deployed with this spec, i.e., not orchestration.