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

35 lines
979 B
Go
Raw Normal View History

2018-01-12 19:06:03 -05:00
package classic
import (
"github.com/hashicorp/packer/packer"
"github.com/mitchellh/multistep"
)
type stepCreateIPReservation struct{}
func (s *stepCreateIPReservation) Run(state multistep.StateBag) multistep.StepAction {
ui := state.Get("ui").(packer.Ui)
ui.Say("Creating Instance...")
const endpoint_path = "/launchplan/" // POST
// master-instance.json
// {
// "instances": [{
// "shape": "oc3",
// "sshkeys": ["/Compute-mydomain/user@example.com/my_sshkey"],
// "name": "Compute-mydomain/user@example.com/master-instance",
// "label": "master-instance",
// "imagelist": "/Compute-mydomain/user@example.com/Ubuntu.16.04-LTS.amd64.20170330",
// "networking": {
// "eth0": {
// "nat": "ipreservation:/Compute-mydomain/user@example.com/master-instance-ip"
// }
// }
// }]
// }
// command line call
// $ opc compute launch-plans add --request-body=./master-instance.json
// ...
}