GET /api/v1/assets
Retrieve data for all the assets in the Bonsai Asset Index. Results are paginated, with pagination controlled via the "start" and "items" params. If there are remaining pages to be retrieved, the payload will include a "next" URL.

Examples

GET https://bonsai.sensu.io/api/v1/assets
{
"start": 0,
"total": 2,
"next": "https://bonsai-asset-index.com/api/v1/assets?start=10",
"assets": [
    {
        "name": "gofullstack/acms-admin-wildcard-redirect",
        "description": "Average CMS Wildcard Admin Redirect WordPress Plugin",
        "url": "https://bonsai-asset-index.com/api/v1/assets/gofullstack/acms-admin-wildcard-redirect",
        "github_url": "https://github.com/gofullstack/acms-admin-wildcard-redirect",
        "download_url": "https://bonsai-asset-index.com/assets/gofullstack/acms-admin-wildcard-redirect/download",
        "builds": []
    },
    {
        "name": "demillir/maruku",
        "description": "A pure-Ruby Markdown-superset interpreter (Official Repo).",
        "url": "https://bonsai-asset-index.com/api/v1/assets/demillir/maruku",
        "github_url": "https://github.com/demillir/maruku",
        "download_url": "https://bonsai-asset-index.com/assets/demillir/maruku/download",
        "versions": [
          "0.1.1-20181030": {
            "assets": [
              {
                "platform": "linux",
                "arch": "x86_64",
                "version": "0.1.1-20181030",
                "asset_sha": "6f2121a6c8690f229e9cb962d8d71f60851684284755d4cdba4e77ef7ba20c03283795c4fccb9d6ac8308b248f2538bf7497d6467de0cf9e9f0814625b4c6f91",
                "asset_url": "http://srv2:3000/f60851684284755d4cdba4e77ef7ba2/test_asset-v0.1-20181030-linux-x86_64.tar.gz",
                "last_modified": "2019-01-01 12:00:00"
              },
              {
                "platform": "alpine",
                "arch": "x86_64",
                "version": "v0.1-20181030",
                "asset_sha": null,
                "asset_url": null,
                "last_modified": null
              }
            ]
          }
        ]
    }
]
}

Params

Param name Description
start
optional

zero-based index of the starting asset (default is 0)

Validations:

  • Must be a Integer

items
optional

zero-based index of the starting asset (default is 10, max is 100)

Validations:

  • Must be a Integer


GET /api/v1/assets/:username/:id
Retrieve data for a single asset, identified by a username and repo ID.

Examples

GET https://bonsai.sensu.io/api/v1/assets/demillir/maruku
{
  "name": "demillir/maruku",
  "description": "A pure-Ruby Markdown-superset interpreter (Official Repo).",
  "url": "https://bonsai-asset-index.com/api/v1/assets/demillir/maruku",
  "github_url": "https://github.com/demillir/maruku",
  "download_url": "https://bonsai-asset-index.com/assets/demillir/maruku/download",
  "versions": [
    "0.1.1-20181030": {
      "assets": [
        {
          "platform": "linux",
          "arch": "x86_64",
          "version": "0.1.1-20181022",
          "asset_sha": "6f2121a6c8690f229e9cb962d8d71f60851684284755d4cdba4e77ef7ba20c03283795c4fccb9d6ac8308b248f2538bf7497d6467de0cf9e9f0814625b4c6f91",
          "asset_url": "http://srv2:3000/api/v1/assets/demillir/maruku/0.1.1-20181030/linux/x86_64/release_asset",
          "last_modified": "2019-01-01 12:00:00"
        },
        {
          "platform": "alpine",
          "arch": "x86_64",
          "version": "0.1.1-20181030",
          "asset_sha": null,
          "asset_url": null,
          "last_modified": null
        }
      ]
    }
  ]
}

Params

Param name Description
username
required

Bonsai Asset Index user name of the asset owner

Validations:

  • Must be a String

id
required

Bonsai Asset Index asset name

Validations:

  • Must be a String


PUT /api/v1/assets/recompile/:username/:id
Recompile assets in the Bonsai Asset Index. This endpoint functions for authenticated users (via API auth), and authorized users (site owner, admin). Requires a header tag of X-Ops-Userid with the username of the authenticated user. Responds with either success or error.

Examples

GET https://bonsai.sensu.io/api/v1/assets/recompile/demillir/maruku/
{'message'=>'Please wait a minute or so for the repository releases to be recompiled, then refresh this page to see the updates.'}

Params

Param name Description
username
required

Bonsai Asset Index user name of the asset owner

Validations:

  • Must be a String

id
required

Bonsai Asset Index asset name

Validations:

  • Must be a String


PUT /api/v1/assets/:username/:id
Update data for a single asset, identified by a username and repo ID. Currently limited to just updating tags. The authentication headers consists of the following params: 'X-Ops-Userid' => "username" where username is the owner of the asset or the site admin. This is required as authentication for each request. Authentication headers example: "X-Ops-Userid": "username",

Errors

Code Description
401 You are not authorized to update this asset.

Examples

PUT https://bonsai.sensu.io/api/v1/assets/demillir/maruku

Params

Param name Description
username
required

Bonsai Asset Index user name of the asset owner

Validations:

  • Must be a String

id
required

Bonsai Asset Index asset name

Validations:

  • Must be a String

extension
required

Validations:

  • Must be a Hash

extension[tag_tokens]
optional

String of comma seperated tags

Validations:

  • Must be a String