You are viewing version 2.26 of the documentation, which is no longer maintained. For up-to-date documentation, see the latest version.

Tasks

Posts to the tasks api create new tasks in Spinnaker.
  • Path: tasks
  • Method: Post
  • Package: spinnaker.http.authz

The following rego function can be leveraged in any task to determine what task type is being created:

    createsTaskOfType(tasktype){
        input.method="POST"
        input.path=["tasks"]
        input.body.job[_].type=tasktype
    }

Keys

Key Type Description
input.body object The contents of this field will depend on the task type. It corresponds to the payload body being posted to the spinnaker API for that task. If your policy needs to conditionally enable/disable a task based off a property being configured by that task, the value you need will likely be in this object.
input.method string The HTTP method by which the API is being called. When createing a task this is ‘POST’.
input.path[] string The API path of the job. When creating a new task this is the array ["tasks"].

input.user

This object provides information about the user performing the action. This can be used to restrict actions by role. See input.user for more information.

Task Types


Task Type: createApplication

A policy call is made for this type anytime a user attmpts to create a new application.

Task Type: deleteManifest

Policy controls whether or not a deleteManifest that is triggered from outside a spinnaker pipeline (e.g. from the ‘Clusters’ tab of an application) can run.

Task Type: deployManifest

Policy controls whether or not a deployManifest that is triggered from outside a spinnaker pipeline (e.g. from the ‘Clusters’ tab of an application’s ‘edit’ action) can run.

Task Type: scaleManifest

Policy controls whether or not a scaleManifest that is triggered from outside a spinnaker pipeline (e.g. from the ‘Clusters’ tab of an application’s ‘edit’ action) can run.

Task Type: undoRolloutManifest

Policy controls whether or not a rollback that is triggered from outside a spinnaker pipeline (e.g. from the ‘Clusters’ tab of an application) can run.

Task Type: updateApplication

A policy call is made for this type anytime a user attmpts to edit an existing application.

Task Type: upsertProject

A policy call is made for this type anytime a user attmpts to create a new project or edit an existing one.


Last modified July 28, 2021: (f3a804d)