Webhook events
This topic contains reference information about events that you can send in webhook payloads. HCP webhook payloads contain a set of fields that HCP Packer fills out with important information about a registry lifecycle event. Refer to Create and manage webhooks for additional information. For every event, HCP Packer provides the following information:
- Resource ID: The ID of your HCP Packer registry.
- Resource name: The resource name of your HCP Packer registry.
- Event ID: The unique identifier for the event generated by the services with the format
<service>.event:<random string>
. For example,packer.event:t79BRg8WhTmDPBRM
. - Event action: The type of action of this event. For example,
create
. - Event description: The event description. For example,
Created iteration
. - Event source: The source of the event. For example,
hashicorp.packer.iteration
. - Event version: The version of the event payload that is being sent.
- Event payload: The payload with the information about the event. Refer to the specific event payload documentation.
Refer to Create and manage webhooks for additional information.
Iteration events
HCP Packer sends webhook payloads for the following iteration events. The event description links to its payload reference.
Action | Description |
---|---|
create | Created iteration |
complete | Completed iteration |
revoke | Revoked iteration |
restore | Restored iteration |
delete | Deleted iteration |
schedule-revocation | Scheduled iteration revocation |
cancel-revocation | Cancelled iteration revocation |
assign | Assigned iteration to channel |
Common iteration events fields
Every iteration lifecycle event payload contains the following fields.
Field | Type | Description |
---|---|---|
organization_id | string | The HCP organization ID. |
project_id | string | The HCP Packer project ID. |
registry.id | string | The ID of the HCP Packer registry. |
bucket.id | string | The ID of the bucket. |
bucket.slug | string | User-given name of the bucket. |
iteration.id | string | ID of the Iteration. |
iteration.fingerprint | string | User-given build identifier. |
iteration.version | int | Incremental updating number when all builds are successful. |
iteration.revoke_at | timestamp | Date and time the iteration was revoked or is scheduled to be revoked. |
iteration.revocation_message | string | Message provided by the user when revoking the iteration or scheduling the iteration to be revoked. |
iteration.revocation_author | string | The actor who revoked the iteration or scheduled the iteration to be revoked. |
iteration.status | string | Current state of the iteration. Possible values: RUNNING , CANCELLED , REVOKED , REVOCATION_SCHEDULED , ACTIVE |
actor.principal_id | string | The ID of the actor. |
actor.type | string | The type of actor. This field returns "TYPE_UNSET", "TYPE_USER", "TYPE_SERVICE", "TYPE_INTERNAL_OPERATOR", or "TYPE_ANONYMOUS". |
actor.user.email | string | This field is present if the actor is "TYPE_USER". |
actor.user.name | string | This field is present if the actor is "TYPE_USER". |
actor.user.id | string | This field is present if the actor is "TYPE_USER". |
actor.service.id | string | This field is present if the actor is "TYPE_SERVICE". |
actor.service.name | string | This field is present if the actor is "TYPE_SERVICE". |
actor.service.user_managed | bool | This field is present if the actor is "TYPE_SERVICE". |
actor.internal_operator.id | string | This field is present if the actor is "TYPE_INTERNAL_OPERATOR". |
Example payload of a Completed iteration
event with the common fields.
Created iteration
Action | Source | Description |
---|---|---|
create | hashicorp.packer.iteration | Created iteration |
HCP Packer delivers a webhook payload when an iteration is created.
The following fields are available in the webhook event payload next to the common fields.
Field | Type | Description |
---|---|---|
builds | array | List of builds built in this iteration. |
builds.id | string | ID of the build. |
builds.cloud_provider | string | Cloud provider of the build. For example, aws or azure . |
builds.component_type | string | Builder or post-processor used on the build. For example, amazon-ebs.ubuntu . |
builds.labels | json | Labels of the build. |
builds.images | array | Images built by the build. |
builds.images.region | string | Region of the image. For example, eu-west-1 . |
builds.images.image_id | string | External identifier of the image. For example, ami-13245456 . |
Example payload of a Created iteration
event.
Completed iteration
Action | Source | Description |
---|---|---|
complete | hashicorp.packer.iteration | Completed iteration |
HCP Packer delivers a webhook payload with the common fields when an iteration is completed.
Revoked iteration
Action | Source | Description |
---|---|---|
revoke | hashicorp.packer.iteration | Revoked iteration |
HCP Packer delivers a webhook payload when an iteration is revoked.
The following field is available in the webhook event payload next to the common fields.
Field | Type | Description |
---|---|---|
skip_descendants_revocation | bool | This field is true when the request for revoking skips revoking the iteration descendants. |
Example payload of a Revoked iteration
event.
Restored iteration
Action | Source | Description |
---|---|---|
restore | hashicorp.packer.iteration | Restored iteration |
HCP Packer delivers a webhook payload with the common fields when a revoked iteration is restored.
Deleted iteration
Action | Source | Description |
---|---|---|
delete | hashicorp.packer.iteration | Deleted iteration |
HCP Packer delivers a webhook payload when an iteration is deleted.
The following fields are available in the webhook event payload next to the common fields.
Field | Type | Description |
---|---|---|
builds | array | List of builds built in this iteration. |
builds.id | string | ID of the build. |
builds.cloud_provider | string | Cloud provider of the build. For example, aws or azure . |
builds.component_type | string | Builder or post-processor used on the build. For example, amazon-ebs.ubuntu . |
builds.labels | json | Labels of the build. |
builds.images | array | Images built by the build. |
builds.images.region | string | Region of the image. For example, eu-west-1 . |
builds.images.image_id | string | External identifier of the image. For example, ami-13245456 . |
Example payload of a Deleted iteration
event.
Scheduled iteration revocation
Action | Source | Description |
---|---|---|
schedule-revocation | hashicorp.packer.iteration | Scheduled iteration revocation |
HCP Packer delivers a webhook payload when an iteration is scheduled to be revoked.
The following field is available in the webhook event payload next to the common fields.
Field | Type | Description |
---|---|---|
skip_descendants_revocation | bool | This field is true when the request for scheduling revocation skips schedule revocation for the iteration descendants. |
Example payload of a Scheduled iteration revocation
event.
Cancelled iteration revocation
Action | Source | Description |
---|---|---|
cancel-revocation | hashicorp.packer.iteration | Cancelled iteration revocation |
HCP Packer delivers a webhook payload with the common fields when an iteration scheduled revocation is cancelled.
Assigned iteration to channel
Action | Source | Description |
---|---|---|
assign | hashicorp.packer.iteration | Assigned iteration to channel |
HCP Packer delivers a webhook payload when an iteration is either assigned or unassigned from a channel.
The following fields are available in the webhook event payload next to the common fields.
Field | Type | Description |
---|---|---|
previous_iteration.id | string | ID of the iteration. Present only if an iteration was previously assigned to the channel. |
previous_iteration.fingerprint | string | User-given build identifier. Present only if an iteration was previously assigned to the channel. |
previous_iteration.version | int | Incrementally updated version number for successful builds. Present only if an iteration was previously assigned to the channel. |
channel.id | string | ID of the channel. |
channel.slug | string | The user readable name of the channel. |
channel.author_id | string | ID of the actor who create the channel. |
channel.managed | bool | Indicates whether the channel is managed by HCP Packer. HCP Packer-managed channels are also identified as the latest channel. |
channel.restricted | bool | Indicates whether the channel is restricted. |