Internet Explorer is no longer supported. Many things will still work, but your experience will be degraded and some things won't function. Please use a modern browser such as Edge, Chrome, or Firefox.

Update Application Endpoint

view on GitHub

The Update Application is an endpoint in BuildMaster's Application Management API that can update properties of an existing application and return an ApplicationInfo object confirming the updated application.

Request

To update an existing application, simply POST to the URL with an appropriate API Key and a ApplicationInfo object as the request body.

POST /api/applications/update

Querystring parameters may be used for ApplicationInfo object properties instead of the Body

POST /api/applications/update?«ApplicationInfo-properties»

Updating an application with an ApplicationInfo body requires the name (e.g. myApp) and an additional property to be updated (e.g. allowIssues to true):

POST /api/applications/update
{
    "name": "myApp"
    "allowIssues": true
}

Deactivating an application with an ApplicationInfo body requires the name (e.g. myApp) and the active property be set to false.

POST /api/applications/update
{
    "name": "myApp"
    "active": false
}

Moving an application to a new group with an ApplicationInfo body requires the name (e.g. myApp) and the groupName property be set to the group name (e.g. myGroup). If the application currently belongs to a group it will be changed.

If the application does not currently belong to a group, the new group name will be assigned. The group must currently exist in the BuildMaster instance or the request will return a 400 error (Application group not found).

POST /api/applications/update
{
    "name": "myApp"
    "groupName": myGroup
}

Note: To move all applications in one group to another, use this Move All Applications script.

Updating an application with querystring parameters requires the name (e.g. myApp) and an additional property to be updated (e.g. allowIssues to true):

POST /api/applications/update?name=myApp&allowIssues=true

Response

A successful (200) response body will contain an ApplicationInfo object. For example, to update an application named myApp, setting allowIssues to true, the request would return this:

POST /api/applications/update

{
    "id":1,
    "name":"myApp",
    "active":true,
    "buildNumberScheme":"Sequential",
    "releaseUsage":"Required",
    "allowIssues":true
}
Response Details
200 (Success) body will contain a ApplicationInfo Object
400 (Invalid Input) indicates invalid or missing properties on the ApplicationInfo Object; the body will provide some details as text
403 (Unauthorized API Key) indicates a missing, unknown, or unauthorized API Key; the body will be empty
500 (Server Error) indicates an unexpected error; the body will contain the message and stack trace, and this will also be logged

Sample Usage Scripts

Move All Applications in Group (Powershell)

This script will move all applications in the group DevelopmentGroup to the group ProductionGroup.

$baseUrl = "https://proget.corp.local"
$apiKey = "a1b2c3d4e5"
$sourceGroup = "DevelopmentGroup"
$targetGroup = "ProductionGroup"

$headers = @{"X-ApiKey" = $apiKey}
$getListEndpoint = "$baseUrl/api/applications/list"
$updateGroupEndpoint = "$baseUrl/api/applications/update"

function Get-ApplicationList {
    $response = Invoke-RestMethod -Uri $getListEndpoint -Method POST -Headers $headers
    return $response
}

function Update-ApplicationGroup($appName, $targetGroup) {
    $updateParams = @{
        name = $appName
        groupName = $targetGroup
    }

    $updateResponse = Invoke-RestMethod -Uri $updateGroupEndpoint -Method POST -Headers $headers -Body $updateParams
    return $updateResponse
}

$applicationList = Get-ApplicationList
foreach ($app in $applicationList) {
    if ($app.groupName -eq $sourceGroup) {
        Write-Host "Updating $($app.name) from $($app.groupName) to $($targetGroup)..."
        Update-ApplicationGroup -appName $app.name -targetGroup $targetGroup
        Write-Host "Update complete."
    }
}