diff --git a/builder/oracle/classic/step_create_IP_reservation.go b/builder/oracle/classic/step_create_IP_reservation.go new file mode 100644 index 000000000..a719999dd --- /dev/null +++ b/builder/oracle/classic/step_create_IP_reservation.go @@ -0,0 +1,24 @@ +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 IP reservation...") + const endpoint_path = "/ip/reservation/" // POST + + // $ opc compute ip-reservations add \ + // /Compute-mydomain/user@example.com/master-instance-ip \ + // /oracle/public/ippool + + // account /Compute-mydomain/default + // ip 129.144.27.172 + // name /Compute-mydomain/user@example.com/master-instance-ip + // ... + +} diff --git a/builder/oracle/classic/step_create_instance.go b/builder/oracle/classic/step_create_instance.go new file mode 100644 index 000000000..6678979bf --- /dev/null +++ b/builder/oracle/classic/step_create_instance.go @@ -0,0 +1,34 @@ +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 + // ... + +} diff --git a/builder/oracle/classic/step_instance_info.go b/builder/oracle/classic/step_instance_info.go new file mode 100644 index 000000000..a2f935a99 --- /dev/null +++ b/builder/oracle/classic/step_instance_info.go @@ -0,0 +1,24 @@ +package classic + +import ( + "github.com/hashicorp/packer/packer" + "github.com/mitchellh/multistep" +) + +type stepCreateIPReservation struct{} + +func (s *stepInstanceInfo) Run(state multistep.StateBag) multistep.StepAction { + ui := state.Get("ui").(packer.Ui) + ui.Say("Getting Instance Info...") + endpoint_path := "/instance/%s", instanceName // GET + + // $ opc compute ip-reservations add \ + // /Compute-mydomain/user@example.com/master-instance-ip \ + // /oracle/public/ippool + + // account /Compute-mydomain/default + // ip 129.144.27.172 + // name /Compute-mydomain/user@example.com/master-instance-ip + // ... + +}