@@ -506,10 +506,11 @@ type ScalewaySnapshotDefinition struct {
506506
507507// ScalewayImageDefinition represents a Scaleway image definition
508508type 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"`
513514}
514515
515516// ScalewayRoleDefinition represents a Scaleway Token UserId Role
@@ -1007,13 +1008,16 @@ func (s *ScalewayAPI) PostSnapshot(volumeID string, name string) (string, error)
10071008}
10081009
10091010// 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 ) {
10111012 definition := ScalewayImageDefinition {
10121013 SnapshotIDentifier : volumeID ,
10131014 Name : name ,
10141015 Organization : s .Organization ,
10151016 Arch : "arm" ,
10161017 }
1018+ if bootscript != "" {
1019+ definition .DefaultBootscript = & bootscript
1020+ }
10171021
10181022 resp , err := s .PostResponse ("images" , definition )
10191023 if err != nil {
0 commit comments