BuildApi

All URIs are relative to *https://ci.appveyor.com/api*

Method HTTP request Description
cancelBuild DELETE /builds/{accountName}/{projectSlug}/{buildVersion} Cancel build
getBuildArtifact GET /buildjobs/{jobId}/artifacts/{artifactFileName} Download build artifact
getBuildArtifacts GET /buildjobs/{jobId}/artifacts Get build artifacts
getBuildLog GET /buildjobs/{jobId}/log Download build log
startBuild POST /builds Start build of branch most recent commit

cancelBuild

cancelBuild(accountName, projectSlug, buildVersion)

Cancel build

Example

// Import classes:
//import name.kevinlocke.appveyor.ApiClient;
//import name.kevinlocke.appveyor.ApiException;
//import name.kevinlocke.appveyor.Configuration;
//import name.kevinlocke.appveyor.auth.*;
//import name.kevinlocke.appveyor.api.BuildApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure API key authorization: apiToken
ApiKeyAuth apiToken = (ApiKeyAuth) defaultClient.getAuthentication("apiToken");
apiToken.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiToken.setApiKeyPrefix("Token");

BuildApi apiInstance = new BuildApi();
String accountName = "accountName_example"; // String | AppVeyor account name (`accountName` property of `UserAccount`)
String projectSlug = "projectSlug_example"; // String | Project Slug
String buildVersion = "buildVersion_example"; // String | Build Version (`version` property of `Build`)
try {
    apiInstance.cancelBuild(accountName, projectSlug, buildVersion);
} catch (ApiException e) {
    System.err.println("Exception when calling BuildApi#cancelBuild");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
accountName String AppVeyor account name (`accountName` property of `UserAccount`)
projectSlug String Project Slug
buildVersion String Build Version (`version` property of `Build`)

Return type

null (empty response body)

Authorization

apiToken

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json, application/xml

getBuildArtifact

File getBuildArtifact(jobId, artifactFileName)

Download build artifact

Example

// Import classes:
//import name.kevinlocke.appveyor.ApiException;
//import name.kevinlocke.appveyor.api.BuildApi;


BuildApi apiInstance = new BuildApi();
String jobId = "jobId_example"; // String | Build ID (`jobId` property of `BuildJob`)
String artifactFileName = "artifactFileName_example"; // String | File name (or path) of a build artifact file. Corresponds to the `fileName` property of `ArtifactModel`. URL-encoding of slashes in parameter values is optional.
try {
    File result = apiInstance.getBuildArtifact(jobId, artifactFileName);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling BuildApi#getBuildArtifact");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
jobId String Build ID (`jobId` property of `BuildJob`)
artifactFileName String File name (or path) of a build artifact file. Corresponds to the `fileName` property of `ArtifactModel`. URL-encoding of slashes in parameter values is optional.

Return type

File

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/octet-stream

getBuildArtifacts

List<ArtifactModel> getBuildArtifacts(jobId)

Get build artifacts

Example

// Import classes:
//import name.kevinlocke.appveyor.ApiException;
//import name.kevinlocke.appveyor.api.BuildApi;


BuildApi apiInstance = new BuildApi();
String jobId = "jobId_example"; // String | Build ID (`jobId` property of `BuildJob`)
try {
    List<ArtifactModel> result = apiInstance.getBuildArtifacts(jobId);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling BuildApi#getBuildArtifacts");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
jobId String Build ID (`jobId` property of `BuildJob`)

Return type

List<ArtifactModel>

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json, application/xml

getBuildLog

File getBuildLog(jobId)

Download build log

Example

// Import classes:
//import name.kevinlocke.appveyor.ApiException;
//import name.kevinlocke.appveyor.api.BuildApi;


BuildApi apiInstance = new BuildApi();
String jobId = "jobId_example"; // String | Build ID (`jobId` property of `BuildJob`)
try {
    File result = apiInstance.getBuildLog(jobId);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling BuildApi#getBuildLog");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
jobId String Build ID (`jobId` property of `BuildJob`)

Return type

File

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/octet-stream

startBuild

Build startBuild(body)

Start build of branch most recent commit

Example

// Import classes:
//import name.kevinlocke.appveyor.ApiClient;
//import name.kevinlocke.appveyor.ApiException;
//import name.kevinlocke.appveyor.Configuration;
//import name.kevinlocke.appveyor.auth.*;
//import name.kevinlocke.appveyor.api.BuildApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure API key authorization: apiToken
ApiKeyAuth apiToken = (ApiKeyAuth) defaultClient.getAuthentication("apiToken");
apiToken.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiToken.setApiKeyPrefix("Token");

BuildApi apiInstance = new BuildApi();
BuildStartRequest body = new BuildStartRequest(); // BuildStartRequest | 
try {
    Build result = apiInstance.startBuild(body);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling BuildApi#startBuild");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
body BuildStartRequest

Return type

Build

Authorization

apiToken

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json, application/xml