Retention - Update
Updates the project's retention settings.
PATCH https://dev.azure.com/{organization}/{project}/_apis/build/retention?api-version=7.1-preview.1
URI Parameters
Name | In | Required | Type | Description |
---|---|---|---|---|
organization
|
path | True |
string |
The name of the Azure DevOps organization. |
project
|
path | True |
string |
Project ID or project name |
api-version
|
query | True |
string |
Version of the API to use. This should be set to '7.1-preview.1' to use this version of the api. |
Request Body
Name | Type | Description |
---|---|---|
artifactsRetention | ||
pullRequestRunRetention | ||
retainRunsPerProtectedBranch | ||
runRetention |
Responses
Name | Type | Description |
---|---|---|
200 OK |
successful operation |
Security
oauth2
Type:
oauth2
Flow:
accessCode
Authorization URL:
https://app.vssps.visualstudio.com/oauth2/authorize&response_type=Assertion
Token URL:
https://app.vssps.visualstudio.com/oauth2/token?client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer&grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer
Scopes
Name | Description |
---|---|
vso.build_execute | Grants the ability to access build artifacts, including build results, definitions, and requests, and the ability to queue a build, update build properties, and the ability to receive notifications about build events via service hooks. |
Definitions
Name | Description |
---|---|
Project |
Contains the settings for the retention rules. |
Retention |
Contains the minimum, maximum, and current value for a retention setting. |
Update |
Contains members for updating the retention settings values. All fields are optional. |
Update |
ProjectRetentionSetting
Contains the settings for the retention rules.
Name | Type | Description |
---|---|---|
purgeArtifacts |
The rules for artifact retention. Artifacts can not live longer than a run, so will be overridden by a shorter run purge setting. |
|
purgePullRequestRuns |
The rules for pull request pipeline run retention. |
|
purgeRuns |
The rules for pipeline run retention. |
|
retainRunsPerProtectedBranch |
The rules for retaining runs per protected branch. |
RetentionSetting
Contains the minimum, maximum, and current value for a retention setting.
Name | Type | Description |
---|---|---|
max |
integer |
|
min |
integer |
|
value |
integer |
UpdateProjectRetentionSettingModel
Contains members for updating the retention settings values. All fields are optional.
Name | Type | Description |
---|---|---|
artifactsRetention | ||
pullRequestRunRetention | ||
retainRunsPerProtectedBranch | ||
runRetention |
UpdateRetentionSettingModel
Name | Type | Description |
---|---|---|
value |
integer |
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for