forked from hashicorp/packer
/
artifact.go
46 lines (34 loc) · 939 Bytes
/
artifact.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package ncloud
import (
"bytes"
"fmt"
ncloud "github.com/NaverCloudPlatform/ncloud-sdk-go/sdk"
)
const BuilderID = "ncloud.server.image"
type Artifact struct {
ServerImage *ncloud.ServerImage
}
func (*Artifact) BuilderId() string {
return BuilderID
}
func (a *Artifact) Files() []string {
/* no file */
return nil
}
func (a *Artifact) Id() string {
return a.ServerImage.MemberServerImageNo
}
func (a *Artifact) String() string {
var buf bytes.Buffer
// TODO : Logging artifact information
buf.WriteString(fmt.Sprintf("%s:\n\n", a.BuilderId()))
buf.WriteString(fmt.Sprintf("Member Server Image Name: %s\n", a.ServerImage.MemberServerImageName))
buf.WriteString(fmt.Sprintf("Member Server Image No: %s\n", a.ServerImage.MemberServerImageNo))
return buf.String()
}
func (a *Artifact) State(name string) interface{} {
return a.ServerImage.MemberServerImageStatus
}
func (a *Artifact) Destroy() error {
return nil
}