@@ -506,10 +506,11 @@ type ScalewaySnapshotDefinition struct {
506
506
507
507
// ScalewayImageDefinition represents a Scaleway image definition
508
508
type ScalewayImageDefinition struct {
509
- SnapshotIDentifier string `json:"root_volume"`
510
- Name string `json:"name,omitempty"`
511
- Organization string `json:"organization"`
512
- Arch string `json:"arch"`
509
+ SnapshotIDentifier string `json:"root_volume"`
510
+ Name string `json:"name,omitempty"`
511
+ Organization string `json:"organization"`
512
+ Arch string `json:"arch"`
513
+ DefaultBootscript * string `json:"default_bootscript,omitempty"`
513
514
}
514
515
515
516
// ScalewayRoleDefinition represents a Scaleway Token UserId Role
@@ -1007,13 +1008,16 @@ func (s *ScalewayAPI) PostSnapshot(volumeID string, name string) (string, error)
1007
1008
}
1008
1009
1009
1010
// PostImage creates a new image
1010
- func (s * ScalewayAPI ) PostImage (volumeID string , name string ) (string , error ) {
1011
+ func (s * ScalewayAPI ) PostImage (volumeID string , name string , bootscript string ) (string , error ) {
1011
1012
definition := ScalewayImageDefinition {
1012
1013
SnapshotIDentifier : volumeID ,
1013
1014
Name : name ,
1014
1015
Organization : s .Organization ,
1015
1016
Arch : "arm" ,
1016
1017
}
1018
+ if bootscript != "" {
1019
+ definition .DefaultBootscript = & bootscript
1020
+ }
1017
1021
1018
1022
resp , err := s .PostResponse ("images" , definition )
1019
1023
if err != nil {
0 commit comments