Follow a tag pattern of the app's image repository: a new digest is deployed (with approval where the environment asks for it).
PUT
/api/v1/projects/{project}/environments/{environment}/apps/{app}/image-policy
const url = 'https://example.com/api/v1/projects/example/environments/example/apps/example/image-policy';const options = { method: 'PUT', headers: {'Content-Type': 'application/json'}, body: '{"repository":"example","pattern":"semver:^1.2","enabled":true,"intervalSecs":1}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://example.com/api/v1/projects/example/environments/example/apps/example/image-policy \ --header 'Content-Type: application/json' \ --data '{ "repository": "example", "pattern": "semver:^1.2", "enabled": true, "intervalSecs": 1 }'Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”project
required
string
Project name
environment
required
string
Environment short name
app
required
string
App name
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
repository
The repository to watch; the app’s current image repository when unset.
string | null
pattern
required
string
Example
semver:^1.2enabled
boolean
intervalSecs
integer format: int32
Responses
Section titled “Responses”Media typeapplication/json
object
repository
required
string
pattern
required
semver:<range>, tag:<glob> or a tag.
string
enabled
required
boolean
intervalSecs
required
integer format: int32
nextCheckAt
required
string
lastCheckedAt
string | null
lastTag
string | null
lastDigest
string | null
lastError
string | null
failures
required
Failed checks in a row.
integer format: int32
lastRun
The run the policy started last.
string | null format: uuid
Examplegenerated
{ "repository": "example", "pattern": "example", "enabled": true, "intervalSecs": 1, "nextCheckAt": "example", "lastCheckedAt": "example", "lastTag": "example", "lastDigest": "example", "lastError": "example", "failures": 1, "lastRun": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"}The app builds from Git
Media typeapplication/json
Problem Details body.
object
code
required
Stable machine-readable code, e.g. forbidden.
string
title
required
Short human readable title.
string
status
required
HTTP status.
integer format: int32
detail
Details, if safe to expose.
string | null
Example
{ "code": "forbidden"}Media typeapplication/json
Problem Details body.
object
code
required
Stable machine-readable code, e.g. forbidden.
string
title
required
Short human readable title.
string
status
required
HTTP status.
integer format: int32
detail
Details, if safe to expose.
string | null
Example
{ "code": "forbidden"}