Product Build Lists API

Get a single product build list

Available statuses for product build list:
  • 0 — build complete;
  • 1 — build failed;
  • 2 — build pending;
  • 3 — build started;
  • 4 — build canceled;
  • 5 — build canceling;

GET /api/v1/product_build_lists/:id.json

Parameters:

id
Required Integer identifier of current product build list.

Response:

{
  "product_build_list": {
    "id": "resource id",
    "status": "status code",
    "notified_at": "updated at date and time",
    "time_living": "Max time for building (in minutes)",
    "url": "product build list page",
    "product": {
      "id": "resource id",
      "name": "name",
      "description": "description",
      "main_script": "main script",
      "params": "params for running script",
      "time_living": "Max time for building (in minutes)",
      "autostart_status": "status of autostart ISO builds",
      "url": "url to product page"
    },
    "project": {
      "id": "project id",
      "name": "project name",
      "visibility": "visibility (open/hidden)",
      "fullname": "project fullname",
      "url": "url to project data page",
      "git_url": "path to project git",
      "ssh_url": "path to project git over ssh",
      "maintainer": {
        "id": "user id",
        "uname": "user uname",
        "name": "user name",
        "url": "api user path",
        "email": "user email"
      }
    },
    "arch": {
      "id": "build architecture id",
      "name": "build architecture name"
    },
    "main_script": "main script",
    "params": "params for running script",
    "commit_hash": "commit hash to build",
    "results": [
      {
        "file_name": "file name",
        "size": "file size",
        "url": "file url"
      }
    ],
    "created_at": "created at date and time",
    "updated_at": "updated at date and time",
    "not_delete": "block deleting after finish lifetime",
    "autostarted": "true - if build has been autostarted"
  }
}

Example:

{
  "product_build_list": {
    "id": "1",
    "status": "0",
    "notified_at": "1348168705",
    "time_living": "60",
    "url": "/api/v1/product_build_lists/26.json",
    "product": {
      "id": "1",
      "name": "rosa2012lts_ee",
      "description": "Extended Edition ROSA 2012 Marathon with non-free and restricted",
      "main_script": "MATRIX",
      "params": "lst=libs externalarch=\\\"x86_64\\\" PRODUCTNAME=ROSA.201...",
      "time_living": "60",
      "autostart_status": null,
      "url": "/api/v1/products/10.json"
    },
    "project": {
      "id": 666,
      "name": "evil_tools",
      "visibility": "open",
      "fullname": "abf/evil_tools",
      "url": "/api/v1/projects/666.json",
      "git_url": "https:/ivan@abf.rosalinux.ru/jaroslav_garkin/hwinfo.git",
      "ssh_url": "git@abf.rosalinux.ru:jaroslav_garkin/hwinfo.git",
      "maintainer": {
        "id": 1,
        "name": "Ivan Aivazovsky",
        "uname": "ivan_aivazovsky",
        "url": "/api/v1/users/1.json",
        "email": "ivan.aivazovsky@email.ru "
      }
    },
    "arch": {
      "id": "1",
      "name": "x84_64"
    },
    "main_script": "MATRIX",
    "params": "lst=libs externalarch=\\\"x86_64\\\" PRODUCTNAME=ROSA.201...",
    "commit_hash": "751b0cad9cd1467e735d8c3334ea3cf988995fab",
    "results": [
      {
        "file_name": "abfworker::rpm-worker-859694.log",
        "size": "214310",
        "url": "http://file-store.rosalinux.ru/api/v1/file_stores/3a93e5553490e39b4cd50269d51ad8438b7e20b8"
      },
      {
        "file_name": "archives.tar.gz",
        "size": "2014310",
        "url": "http://file-store.rosalinux.ru/api/v1/file_stores/c28a1e69fe8543afd6977480c225c5243fdce2d5"
      }
    ],
    "created_at": "1348168705",
    "updated_at": "1348168705",
    "not_delete": false,
    "autostarted": false
  }
}

List product build lists

Look at Product build list status.

GET /api/v1/product_build_lists.json

Parameters:

page
Optional Integer - page number of product build lists results list.
per_page
Optional Integer - amount of product build list per one page. Default 20, maximum 100.

Response:

{
  "product_build_lists": [
    {
      "id": "resource id",
      "status": "status code",
      "notified_at": "updated at date and time",
      "time_living": "Max time for building (in minutes)",
      "url": "product build list page"
    }
  ],
  "url": "current url for product build lists page"
}

Example of request url:

/api/v1/product_build_lists.json

Examples of responses:

{
  "product_build_lists": [
    {
      "id": "1",
      "status": "0",
      "notified_at": "1348168705",
      "time_living": "60",
      "url": "/api/v1/product_build_lists/26.json"
    }
  ],
  "url": "/api/v1/product_build_lists.json"
}

List product build lists for a product

Look at Product build list status.

GET /api/v1/products/:product_id/product_build_lists.json

Parameters:

page
Optional Integer - page number of product build lists results list.
per_page
Optional Integer - amount of product build list per one page. Default 20, maximum 100.

Response:

{
  "product_build_lists": [
    {
      "id": "resource id",
      "status": "status code",
      "notified_at": "updated at date and time",
      "time_living": "Max time for building (in minutes)",
      "url": "product build list page"
    }
  ],
  "url": "current url for product build lists page"
}

Example of request url:

/api/v1/products/42/product_build_lists.json

Examples of responses:

{
  "product_build_lists": [
    {
      "id": "1",
      "status": "0",
      "notified_at": "1348168705",
      "time_living": "60",
      "url": "/api/v1/product_build_lists/26.json"
    }
  ],
  "url": "/api/v1/product_build_lists.json"
}

Create product build list

POST /api/v1/product_build_list.json

Input:

product_id
Required Integer identifier of product.
project_id
Optional Integer identifier of project.
commit_hash:
Required String SHA of project commit for which need to run assembly.
arch_id:
Required integer identifier architecture for which need to run assembly.
main_script:
Optional String main script.
params:
Optional String params for running script.
time_living:
Optional Integer Maximum time for building (between 2 and 720 minutes).

Request:

{
  "product_build_list": {
    "product_id": "1",
    "project_id": "100",
    "commit_hash": "751b0cad9cd1467e735d8c3334ea3cf988995fab",
    "arch_id": "1",
    "main_script": "MATRIX",
    "params": "lst=libs externalarch=\\\"x86_64\\\" PRODUCTNAME=ROSA.201...",
    "time_living": "60"
  }
}

Response:

{
  "product_build_list": {
    "id": "product build list id (null if failed)",
    "message": "success or fail message"
  }
}

Example:

{
  "product_build_list": {
    "id": 12,
    "message": "Product build list has been created successfully"
  }
}

Update product build list

By this request you can update product build list. Only not_delete field can be updated and only if build has been completed.

PUT /api/v1/product_build_lists/:id.json

Parameters:

id
Required Integer identifier of current product build list.

Request:

{
  "product_build_list": {
    "not_delete": true
  }
}

Response:

{
  "product_build_list": {
    "id": "product build list id (null if failed)",
    "message": "success or fail message"
  }
}

Example:

{
  "product_build_list": {
    "id": 12,
    "message": "Product build list has been updated successfully"
  }
}

Destroy product build list

By this request you can delete product build list. Only product build list with status build completed (0), build failed (1) or build canceled (4) can be deleted.

DELETE /api/v1/product_build_lists/:id.json

Parameters:

id
Required Integer identifier of current product build list.

Response:

{
  "product_build_list": {
    "id": "product build list id (null if failed)",
    "message": "success or fail message"
  }
}

Example:

{
  "product_build_list": {
    "id": 12,
    "message": "Product build list has been destroyed successfully"
  }
}

Cancel product build list

By this request you can cancel product build list. Only product build list with status build pending (2) or build started (3) can be canceled.

PUT /api/v1/product_build_lists/:id/cancel.json

Parameters:

id
Required Integer identifier of current product build list.

Response:

{
  "product_build_list": {
    "id": "product build list id (null if failed)",
    "message": "success or fail message"
  }
}

Example:

{
  "product_build_list": {
    "id": 12,
    "message": "Product build list has been canceled successfully"
  }
}