packer-cn/builder/oracle/classic/artifact.go

49 lines
1.0 KiB
Go
Raw Normal View History

2018-01-12 17:12:15 -05:00
package classic
2018-01-23 21:13:51 -05:00
import (
"fmt"
"github.com/hashicorp/go-oracle-terraform/compute"
)
2018-01-31 13:47:19 -05:00
// Artifact is an artifact implementation that contains Image List
// and Machine Image info.
2018-01-12 17:12:15 -05:00
type Artifact struct {
2018-01-31 13:47:19 -05:00
MachineImageName string
MachineImageFile string
ImageListVersion int
driver *compute.ComputeClient
2018-01-12 17:12:15 -05:00
}
// BuilderId uniquely identifies the builder.
func (a *Artifact) BuilderId() string {
return BuilderId
}
// Files lists the files associated with an artifact. We don't have any files
// as the custom image is stored server side.
func (a *Artifact) Files() []string {
return nil
}
func (a *Artifact) Id() string {
2018-01-31 13:47:19 -05:00
return a.MachineImageName
2018-01-12 17:12:15 -05:00
}
func (a *Artifact) String() string {
2018-01-31 13:47:19 -05:00
return fmt.Sprintf("An image list entry was created: \n"+
2018-01-23 21:13:51 -05:00
"Name: %s\n"+
2018-01-31 13:47:19 -05:00
"File: %s\n"+
"Version: %d",
a.MachineImageName, a.MachineImageFile, a.ImageListVersion)
2018-01-12 17:12:15 -05:00
}
func (a *Artifact) State(name string) interface{} {
return nil
}
// Destroy deletes the custom image associated with the artifact.
func (a *Artifact) Destroy() error {
return nil
2018-01-12 17:12:15 -05:00
}