Interface DeploymentService


  • @Path("/deployment")
    @Consumes({"application/xml","application/json"})
    @Produces({"application/xml","application/json"})
    public interface DeploymentService
    Deployment management
    • Method Detail

      • isDeployed

        @GET
        @Path("exists")
        boolean isDeployed​(@QueryParam("application")
                           java.lang.String applicationId,
                           @QueryParam("environment")
                           java.lang.String environmentId)
        Returns whether or not a udm.Version of the udm.Application that is passed in is already deployed to the udm.Environment.
        Parameters:
        applicationId - The ID of the udm.Application.
        environmentId - The ID of the udm.Environment.
        Returns:
        true if there exists a deployed version of the application on the environment, false otherwise.
      • prepareInitial

        @GET
        @Path("prepare/initial")
        Deployment prepareInitial​(@QueryParam("version")
                                  java.lang.String versionId,
                                  @QueryParam("environment")
                                  java.lang.String environmentId)
        Prepares an initial deployment.
        Parameters:
        versionId - The ID of the udm.Version that is the source of the deployment.
        environmentId - The ID of the udm.Environment that is the target of the deployment.
        Returns:
        A new Deployment object to which you can add deployeds.
        Permission:
        deploy#initial
      • prepareUpdate

        @GET
        @Path("prepare/update")
        Deployment prepareUpdate​(@QueryParam("version")
                                 java.lang.String versionId,
                                 @QueryParam("deployedApplication")
                                 java.lang.String deployedApplicationId)
        Prepares an update deployment.
        Parameters:
        versionId - The ID of the new udm.Version that is the source of the deployment.
        deployedApplicationId - The ID of the udm.DeployedApplication that is to be updated.
        Returns:
        A new Deployment object which contains the updated deployeds.
        Permission:
        deploy#upgrade
      • prepareUndeploy

        @GET
        @Path("prepare/undeploy")
        Deployment prepareUndeploy​(@QueryParam("deployedApplication")
                                   java.lang.String deployedApplicationId)
        Prepares an undeployment.
        Parameters:
        deployedApplicationId - The ID of the udm.DeployedApplication that is to be undeployed.
        Returns:
        A new Deployment object which contains no deployeds (ie. all deployeds of the previous deployment will be deleted).
        Permission:
        deploy#undeploy
      • prepareAutoDeployeds

        @POST
        @Path("prepare/deployeds")
        Deployment prepareAutoDeployeds​(Deployment deployment)
        Prepares all the deployeds for the given deployment. This will keep any previous deployeds present in the deployment object that are already present, unless they cannot be deployed with regards to their tags. It will add all the deployeds that are still missing.

        Also filters out the deployeds that do not have any source attached anymore (deployables that were previously present).

        Parameters:
        deployment - The prepared Deployment parameter object
        Returns:
        An updated Deployment parameter object.
        Permission:
        deploy#initial
      • generateSelectedDeployeds

        @POST
        @Path("generate/selected")
        @Deprecated
        Deployment generateSelectedDeployeds​(@QueryParam("deployables")
                                             java.util.List<java.lang.String> deployableIds,
                                             Deployment deployment)
        Generates only the deployeds for the given deployables in the deployment.

        Try to generate deployeds from each of the deployables to all the matching Containers in the Environment of the Deployment parameter object.

        Parameters:
        deployableIds - The list of IDs of deployables to generate the deployeds for.
        deployment - The prepared Deployment parameter object
        Returns:
        An updated Deployment parameter object.
        Permission:
        deploy#initial
      • generateSelectedDeployeds

        @POST
        @Path("generate/selected/deployables")
        Deployment generateSelectedDeployeds​(SelectedDeployment selectedDeployment)
        Generates only the deployeds for the given deployables in the deployment.

        Try to generate deployeds from each of the deployables to all the matching Containers in the Environment of the Deployment parameter object.

        This request is same as /deployment/generate/selected but does not use URL query parameters avoiding it becoming too long.

        Parameters:
        selectedDeployment - The prepared Deployment parameter object with list of IDs of deployables to generate the deployeds for.
        Returns:
        An updated Deployment parameter object.
        Permission:
        deploy#initial
      • generateSingleDeployed

        @POST
        @Path("generate/single")
        Deployment generateSingleDeployed​(@QueryParam("deployable")
                                          java.lang.String deployableId,
                                          @QueryParam("container")
                                          java.lang.String containerId,
                                          @QueryParam("deployedtype")
                                          com.xebialabs.deployit.plugin.api.reflect.Type deployedType,
                                          Deployment deployment)
        Generates a deployed for the given deployable to the given container in the deployment.

        The deployed should be of the given type (which is optional)

        Parameters:
        deployableId - The ID of the deployable to generate a deployed for
        containerId - The ID of the container to generate a deployed to
        deployedType - (Optional) The type of the deployed to generate
        deployment - The prepared Deployment parameter object
        Returns:
        An updated Deployment parameter object.
        Permission:
        deploy#initial
      • validate

        @POST
        @Path("validate")
        Deployment validate​(@LimitCiTreeDepth(1)
                            Deployment deployment)
        Validates the generated deployment.

        Checks whether all the deployeds that are in the deployment are valid.

        Parameters:
        deployment - The deployment to validate.
        Returns:
        The validated deployment.
      • taskPreviewBlock

        @POST
        @Path("previewblock")
        TaskPreviewBlock taskPreviewBlock​(Deployment deployment)
        Calculate the plan that XL Deploy will execute for the given deployment. A plan consists of one or more nested blocks. Blocks can be sequential, parallel, or a block containing steps. Note: The block returned is not a task yet, and as such can not be skipped or re-ordered.
        Parameters:
        deployment - The deployment to generate the block for.
        Returns:
        The block.
        Permission:
        deploy#initial for initial deployments, deploy#upgrade for upgrades, deploy#remove for undeployments
      • taskPreviewBlock

        @POST
        @Path("previewblock/{blockId}/{stepNr}")
        StepState taskPreviewBlock​(Deployment deployment,
                                   @PathParam("blockId")
                                   java.lang.String blockId,
                                   @PathParam("stepNr")
                                   int stepNr)
        Get details on a step in a step block.
        Parameters:
        deployment - The deployment to generate the block for.
        blockId - The id of the step block to query the steps for.
        stepNr - The number of the step to retrieve.
        Returns:
        The step.
        Permission:
        deploy#initial for initial deployments, deploy#upgrade for upgrades, deploy#remove for undeployments, task#preview_step to see all details about a step
      • createTask

        @POST
        java.lang.String createTask​(Deployment deployment)
        Creates the deployment task.
        Parameters:
        deployment - The fully prepared Deployment parameter object.
        Returns:
        a reference to a Task ID that can be executed by the TaskService.
        Permission:
        deploy#initial for initial deployments, deploy#upgrade for upgrades, deploy#remove for undeployments
      • rollback

        @POST
        @Path("rollback/{taskid}")
        java.lang.String rollback​(@PathParam("taskid")
                                  java.lang.String taskId)
        Rollback a STOPPED or EXECUTED task. Reverting the deployment to the previous state. The task will be set to CANCELLED when it was STOPPED, and DONE when it was EXECUTED.
        Parameters:
        taskId - the ID of the task
        Returns:
        the ID of the new task.
      • effectiveDictionary

        @GET
        @Path("dictionary")
        java.util.Map<java.lang.String,​java.lang.String> effectiveDictionary​(@QueryParam("environment")
                                                                                   java.lang.String environment,
                                                                                   @QueryParam("applicationVersion")
                                                                                   java.lang.String applicationVersion,
                                                                                   @QueryParam("application")
                                                                                   java.lang.String application,
                                                                                   @QueryParam("container")
                                                                                   java.lang.String container)
        Get the effective dictionary for an environment, optionally filtered by application and container. This will return the dictionary that is used when deploying to a specific environment. If an application/applicationVersion is passed, the dictionary is filtered to apply only to deployments of that application. If a container is passed, the dictionary is filtered to apply only to deployeds pointing to that container in the environment.
        Parameters:
        environment - The ID of the environment
        applicationVersion - The ID of the applicationVersion (package) (optional, can be null)
        application - The ID of the application (optional, can be null). This parameter will be ignored if the applicationVersion is provided.
        container - The ID of the container (optional, can be null)
        Returns:
        the entries of the dictionary as it applies to a deployment to that environment