@@ -380,10 +380,23 @@ type ScalewayServer struct {
380380 Organization string `json:"organization,omitempty"`
381381}
382382
383- // ScalewayServerPathNameDefinition represents a Scaleway C1 server with only its name as field
384- type ScalewayServerPathNameDefinition struct {
385- // Name is the user-defined name of the server
386- Name string `json:"name"`
383+ // ScalewayServerPatchDefinition represents a Scaleway C1 server with nullable fields (for PATCH)
384+ type ScalewayServerPatchDefinition struct {
385+ Name * string `json:"name,omitempty"`
386+ CreationDate * string `json:"creation_date,omitempty"`
387+ ModificationDate * string `json:"modification_date,omitempty"`
388+ Image * ScalewayImage `json:"image,omitempty"`
389+ DynamicIPRequired * bool `json:"dynamic_ip_required,omitempty"`
390+ PublicAddress * ScalewayIPAddress `json:"public_ip,omitempty"`
391+ State * string `json:"state,omitempty"`
392+ StateDetail * string `json:"state_detail,omitempty"`
393+ PrivateIP * string `json:"private_ip,omitempty"`
394+ Bootscript * ScalewayBootscript `json:"bootscript,omitempty"`
395+ Hostname * string `json:"hostname,omitempty"`
396+ Volumes * map [string ]ScalewayVolume `json:"volumes,omitempty"`
397+ SecurityGroup * ScalewaySecurityGroup `json:"security_group,omitempty"`
398+ Organization * string `json:"organization,omitempty"`
399+ //Tags *[]string `json:"tags",omitempty`
387400}
388401
389402// ScalewayServerDefinition represents a Scaleway C1 server with image definition
@@ -682,8 +695,8 @@ func (s *ScalewayAPI) PostServer(definition ScalewayServerDefinition) (string, e
682695 return "" , error
683696}
684697
685- // PatchServerName changes the name of the server
686- func (s * ScalewayAPI ) PatchServerName (serverID string , definition ScalewayServerPathNameDefinition ) error {
698+ // PatchServer updates a server
699+ func (s * ScalewayAPI ) PatchServer (serverID string , definition ScalewayServerPatchDefinition ) error {
687700 resp , err := s .PatchResponse (fmt .Sprintf ("servers/%s" , serverID ), definition )
688701 if err != nil {
689702 return err
0 commit comments