Skip to content

Latest commit

 

History

History
288 lines (208 loc) · 10.2 KB

build-api.md

File metadata and controls

288 lines (208 loc) · 10.2 KB
title space
Build API
API Documentation

Introduction

The Build API allows you to manage deployment packages and create new deployment packages using our build server. You will need the information from the Teamserver API as input for these API calls.

The image below provides a domain model representation of the concepts discussed below and how these are related:

API calls

Retrieve packages

Description

Retrieves all deployment packages that are available for a specific app which the authenticated user has access to as a regular user. These packages can be found if you click Details on an app in the "Nodes overview" screen in the Mendix Platform.

 HTTP Method: GET
 URL: [https://deploy.mendix.com/api/1/apps/<AppId>/packages/ (https://deploy.mendix.com/api/1/apps/<AppId>/packages/)]

Request

Parameter
  • AppId (String) : Subdomain name of an app.
Example
GET /api/ 1 /apps/calc/packages/ HTTP/ 1.1
Host: deploy.mendix.com

Accept: */*
Mendix-Username: richard.ford51 @example .com
Mendix-ApiKey:  26587896 -1cef- 4483 -accf-ad304e2673d6

Output

List of objects with the following key-value pairs:

  • PackageId (String) : Unique identification of the package.
  • Name (String) : Name of the package.
  • Description (String) : Description of the package.
  • Version (String) : Package version. This is also the name of the tag on the project team server.
  • Creator (String) : Uploader or creator of this package.
  • CreationDate (Date) : Date that the package became available in the portal. This can be the upload date or the date that a build was created in the portal.
  • Status (String) : Status of the package. A package is ready to use if the status is 'Succeeded'. Possible values: Succeeded, Queued, Building, Uploading and Failed.
  • Size (Long) : Size of the package in bytes.
Error codes:
HTTP Status Error code Description
400 INVALID_APPID Invalid AppId
Example
[{
     "Name" :  "Main line-1.1.5.9.mda" ,
     "Status" :  "Succeeded" ,
     "Description" :  "Initial app" ,
     "Creator" :  "Richard Ford" ,
     "CreationDate" :  1404739654045 ,
     "Version" :  "1.1.5.9" ,
     "PackageId" :  "4ee10492-6cfc-4582-b825-a9040c0988ad" ,
     "Size" :  1.057138442993164
},{
     "Name" :  "Main line-2.5.4.63.mda" ,
     "Status" :  "Succeeded" ,
     "Description" :  "Add scientific mode" ,
     "Creator" :  "Richard Ford" ,
     "CreationDate" :  1404990271835 ,
     "Version" :  "2.5.4.63" ,
     "PackageId" :  "b3d14e53-2654-4534-b374-9179a69ef3cf" ,
     "Size" :  3.0571174621582031
}]

Retrieve package

Description

Retrieves a specific deployment package that is available for a specific app which the authenticated user has access to as a regular user. This package can be found if you click Details on an app in the "Nodes overview" screen in the Mendix Platform.

HTTP Method: GET
 URL: [https://deploy.mendix.com/api/1/apps/<AppId>/packages/<PackageId> (https://deploy.mendix.com/api/1/apps/<AppId>/packages/<PackageId>)]

Request

Parameters
  • AppId (String) : Subdomain name of an app.
  • PackageId (String) : Id of the deployment package.
Example
GET /api/ 1 /apps/calc/packages/b3d14e53- 2654 - 4534 -b374-9179a69ef3cf HTTP/ 1.1
Host: deploy.mendix.com

Accept: */*
Mendix-Username: richard.ford51 @example .com
Mendix-ApiKey:  26587896 -1cef- 4483 -accf-ad304e2673d6

Output

An object with the following key-value pairs:

  • PackageId (String) : Unique identification of the package.
  • Name (String) : Name of the package.
  • Description (String) : Description of the package.
  • Version (String) : Package version. This is also the name of the tag on the project team server.
  • Creator (String) : Uploader or creator of this package.
  • CreationDate (Date) : Date that the package became available in the portal. This can be the upload date or the date that a build was created in the portal.
  • Status (String) : Status of the package. A package is ready to use if the status is 'Succeeded'. Possible values: Succeeded, Queued, Building, Uploading and Failed.
  • Size (Long) : Size of the package in bytes.
Error codes
HTTP Status Error code Description
400 INVALID_PARAMETERS Not enough parameters given. Please set AppId and PackageId parameters.
404 PACKAGE_NOT_FOUND Package or build job not found
Example
{
     "Name" :  "Main line-2.5.4.63.mda" ,
     "Status" :  "Succeeded" ,
     "Description" :  "Add scientific mode" ,
     "Creator" :  "Richard Ford" ,
     "CreationDate" :  1404990271835 ,
     "Version" :  "2.5.4.63" ,
     "PackageId" :  "b3d14e53-2654-4534-b374-9179a69ef3cf" ,
     "Size" :  3.0571174621582031
}

Delete package

Deletes a specific deployment package that is available for a specific app which the authenticated user has access to as a regular user. This package can be found if you click Details on an app in the "Nodes overview" screen in the Mendix Platform.

 HTTP Method: DELETE
 URL: [https://deploy.mendix.com/api/1/apps/<AppId>/packages/<PackageId> (https://deploy.mendix.com/api/1/apps/<AppId>/packages/<PackageId>)]

Request

Parameters

  • AppId (String) : Subdomain name of an app
  • PackageId (String) : Id of the deployment package
DELETE /api/ 1 /apps/calc/packages/b3d14e53- 2654 - 4534 -b374-9179a69ef3cf HTTP/ 1.1
Host: deploy.mendix.com

Accept: */*
Mendix-Username: richard.ford51 @example .com
Mendix-ApiKey:  26587896 -1cef- 4483 -accf-ad304e2673d6

Error codes

HTTP Status Error code Description
400 INVALID_PARAMETERS Not enough parameters given. Please set AppId and PackageId parameters.
404 PACKAGE_NOT_FOUND Package or build job not found.
409 PACKAGE_IN_USE Package is still in use.

Download package

Downloads a specific deployment package that is available for a specific app which the authenticated user has access to as a regular user. This package can be found if you click Details on an app in the "Nodes overview" screen in the Mendix Platform.

 HTTP Method: GET
 URL: [https://deploy.mendix.com/api/1/apps/<AppId>/packages/<PackageId>/download (https://deploy.mendix.com/api/1/apps/<AppId>/packages/<PackageId>/download)]

Request

Parameters

  • AppId (String) : Subdomain name of an app.
  • PackageId (String) : Id of the deployment package.
GET /api/ 1 /apps/calc/packages/b3d14e53- 2654 - 4534 -b374-9179a69ef3cf/download HTTP/ 1.1
Host: deploy.mendix.com

Accept: */*
Mendix-Username: richard.ford51 @example .com
Mendix-ApiKey:  26587896 -1cef- 4483 -accf-ad304e2673d6

Ouput

Error codes

HTTP Status Error code Description
400 INVALID_PARAMETERS Not enough parameters given. Please set AppId and PackageId parameters.
404 PACKAGE_NOT_FOUND Package or build job not found.
500 BUILD_NOT_SUCCEEDED Build not successful finished.

Start building deployment package

Start the process to build a deployment package, based on the team server project of a specific app which the authenticated user has access to as a regular user. This package can be found if you click Details on an app in the "Nodes overview" screen in the Mendix Platform.

HTTP Method: POST
 URL: [https://deploy.mendix.com/api/1/apps/<AppId>/packages/ (https://deploy.mendix.com/api/1/apps/<AppId>/packages/)]

Request

Parameter
  • AppId (String) : Subdomain name of an app.
Payload

An object with the following key-value pairs:

  • Branch (String) : Name of the branch. This is 'trunk' for the main line or a specific branch name.
  • Revision (Long) : Number of the revision to build a package from.
  • Version (String) : Package version. This will also be the name of the tag on the project team server.
  • Description (String) : Description of the package.
Example
POST /api/ 1 /apps/calc/packages/ HTTP/ 1.1
Host: deploy.mendix.com

Accept: */*
Mendix-Username: richard.ford51 @example .com
Mendix-ApiKey:  26587896 -1cef- 4483 -accf-ad304e2673d6

{
     "Revision" :  63 ,
     "Version" :  "2.5.4" ,
     "Description" :  "Add scientific mode"
}

Output

An object with the following key-value pair:

  • PackageId (String) : Unique identification of the package. This string can be used to get the build status of the package later.

Error codes

HTTP Status Error code Description
400 INVALID_APPID Invalid AppId
400 INVALID_PARAMETERS Not enough parameters given. Please set Revision and Version parameters.
400 INVALID_VERSION The Version parameter does not contain a valid version string. Please provide a version with a major, minor and patch number, like '2.3.5'.
404 APP_NOT_FOUND App not found.
500 BUILD_FAILED Build job failed.
Example
{
     "PackageId" :  "b3d14e53-2654-4534-b374-9179a69ef3cf"
}