Build Configuration Versions API

A build configuration version represents versions of Packer templates and other associated configuration. Each set of changes to a Packer template or the scripts used in the template should have an associated build configuration version.

When creating versions via the API, the builds attribute can be sent that describes what the configuration will cause Packer to build.

Build Configuration Version Attributes

Attribute Description Required
builds An arrray of builds that the version of configuration will run. No
builds[name] The name of the build. This must be unique per version Yes
builds[type] The type of the build, i.e amazon-ebs. Yes
builds[artifact] Boolean of whether this post-processes to Atlas. No
builds[artifact_name] The name of the artifact it uploads to. No
metadata A hash of key value metadata pairs. No

Actions

The following actions can be perfomed on this resource.

Create
POST /api/v1/packer/build-configurations/:username/:name/versions
Upload progress
GET /api/v1/packer/build-configurations/:username/:name/versions/progress/:token

Examples

Creating a build configuration version

Creates a build configuration with the provided attributes.

$ cat version.json
{
    "version":{
        "builds": [
            {
                "name": "foobar",
                "type": "amazon-ebs"
            },
            {
                "name": "baz",
                "type": "amazon-ebs"
            }
        ],
        "metadata":
        {
            "key1": "value1",
            "key2": "value2"
        }
    }
}

$ curl https://atlas.hashicorp.com/api/v1/packer/build-configurations/acmeinc/test/versions \
    -X POST \
    -H "X-Atlas-Token: $ATLAS_TOKEN" \
    -H "Content-Type: application/json" \
    -d @version.json

Retrieving the progress of an upload for a build configuration version

Returns upload progress for the version.

$ curl https://atlas.hashicorp.com/api/v1/packer/build-configurations/acmeinc/test/versions/progress/63fc7e18-3911-4853-8b17-7fdc28f158f2 \
    -H "X-Atlas-Token: $ATLAS_TOKEN"