From ff0336965ba5e8484be81e4e32bb362774767510 Mon Sep 17 00:00:00 2001 From: Marin Salinas Date: Wed, 6 Mar 2019 14:03:56 -0600 Subject: [PATCH] feature: add create tags function --- builder/osc/common/tags.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/builder/osc/common/tags.go b/builder/osc/common/tags.go index 0f70bac4a..c42d48db7 100644 --- a/builder/osc/common/tags.go +++ b/builder/osc/common/tags.go @@ -43,3 +43,14 @@ func (t TagMap) OAPITags(ctx interpolate.Context, region string, state multistep } return oapiTags, nil } + +func CreateTags(conn *oapi.Client, resourceID string, ui packer.Ui, tags OAPITags) error { + tags.Report(ui) + + _, err := conn.POST_CreateTags(oapi.CreateTagsRequest{ + ResourceIds: []string{resourceID}, + Tags: tags, + }) + + return err +}