latestOpenAPI 3.0.02026-08-10221235717.8 KB

e21ad140ec3c

public
AutomationRule

Create a new Automation Rule for an Environment.

Items marked as deprecated are still supported (however not recommended) for use and are incompatible with properties of the latest api version. In particular an error is raised if images_filter (deprecated) and artefacts_filter are used in the same payload. The same is true for exclude_images_filter (deprecated) and exclude_artefacts_filter. match and update_to are still supported but will trigger an error if combined with match_ref.

post/orgs/{orgId}/apps/{appId}/envs/{envId}/rules

Path parameters

orgIdstring required

The Organization ID

appIdstring required

The Application ID

envIdstring required

The Environment ID

Request body

activeboolean

Whether the rule will be processed or not.

artefacts_filterstring[]

A list of artefact names to be processed by the rule. If the array is empty, it implies include all. If exclude_artefacts_filter is true, this list describes the artefacts to exclude.

exclude_artefacts_filterboolean

Whether the artefacts specified in artefacts_filter should be excluded (true) or included (false) in the automation rule.

exclude_images_filterboolean

DEPRECATED: Whether the images specified in images_filter should be excluded (true) or included (false) in the automation rule.

images_filterstring[]

DEPRECATED: A list of image IDs to be processed by the rule. If the array is empty, it implies include all. If exclude_images_filter is true, this list describes images to exclude.

matchstring

DEPRECATED: A regular expression applied to the branch or tag name depending on the value of update_to. Defaults to match all if omitted or empty.

match_refstring

A regular expression applied to the ref of a new artefact version. Defaults to match all if omitted or empty.

typestring required

Specifies the type of event. Currently, only updates to either branches or tags are supported. Must be "update".

update_tostring

DEPRECATED: Specifies whether the update occurs on commit to branch or creation of tag. Must be one of "branch" or "tag".

Example request

{
  "active": true,
  "artefacts_filter": [
    "http://registry.org/sample-service"
  ],
  "images_filter": [
    "sample-service"
  ],
  "match": "^pr-[0-9]+-.*$",
  "match_ref": "^refs/heads/pr-[0-9]+-.*$",
  "type": "update",
  "update_to": "branch"
}

Response

The Automation Rule that was created.

activeboolean required

Whether the rule will be processed or not.

artefacts_filterstring[] required

A list of artefact names to be processed by the rule. If the array is empty, it implies include all. If exclude_artefacts_filter is true, this list describes the artefacts to exclude.

created_atstring date-time required

The timestamp in UTC of when the Automation Rule was created.

exclude_artefacts_filterboolean required

Whether the artefacts specified in artefacts_filter should be excluded (true) or included (false) in the automation rule.

exclude_images_filterboolean required

DEPRECATED: Whether the images specified in images_filter should be excluded (true) or included (false) in the automation rule.

idstring required

The unique ID for this rule.

images_filterstring[] required

DEPRECATED: A list of image IDs to be processed by the rule. If the array is empty, it implies include all. If exclude_images_filter is true, this list describes images to exclude.

matchstring required

DEPRECATED: A regular expression applied to the branch or tag name depending on the value of update_to. Defaults to match all if omitted or empty.

match_refstring required

A regular expression applied to the ref of a new artefact version. Defaults to match all if omitted or empty.

typestring required

Specifies the type of event. Currently, only updates to either branches or tags are supported. Must be "update".

update_tostring required

DEPRECATED: Specifies whether the update occurs on commit to branch or creation of tag. Must be one of "branch" or "tag".

updated_atstring date-time required

The timestamp in UTC of when the Automation Rule was updated.

Example response

{
  "active": true,
  "artefacts_filter": [
    "http://registry.org/sample-service"
  ],
  "created_at": "2020-06-22T09:37:23.523Z",
  "id": "923486d012f20324",
  "images_filter": [
    "sample-service"
  ],
  "match": "^pr-[0-9]+-.*$",
  "match_ref": "^refs/heads/pr-[0-9]+-.*$",
  "type": "update",
  "update_to": "branch",
  "updated_at": "2020-06-22T09:37:23.523Z"
}