Skip to content

Commit 3a7924d

Browse files
committed
Add support for getting and updating boot script
1 parent c9488af commit 3a7924d

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

ovh/data_dedicated_server.go

+1
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ func dataSourceDedicatedServerRead(d *schema.ResourceData, meta interface{}) err
202202
d.SetId(ds.Name)
203203
d.Set("urn", ds.URN)
204204
d.Set("boot_id", ds.BootId)
205+
d.Set("boot_script", ds.BootScript)
205206
d.Set("commercial_range", ds.CommercialRange)
206207
d.Set("datacenter", ds.Datacenter)
207208
d.Set("ip", ds.Ip)

ovh/resource_dedicated_server_update.go

+6-1
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,17 @@ func resourceDedicatedServerUpdate() *schema.Resource {
2121
Description: "The internal name of your dedicated server.",
2222
Required: true,
2323
},
24-
2524
"boot_id": {
2625
Type: schema.TypeInt,
2726
Description: "The boot id of your dedicated server.",
2827
Computed: true,
2928
Optional: true,
3029
},
30+
"boot_script": {
31+
Type: schema.TypeString,
32+
Description: "The boot script of your dedicated server.",
33+
Optional: true,
34+
},
3135
"monitoring": {
3236
Type: schema.TypeBool,
3337
Computed: true,
@@ -93,6 +97,7 @@ func resourceDedicatedServerUpdateRead(d *schema.ResourceData, meta interface{})
9397
}
9498

9599
d.Set("boot_id", ds.BootId)
100+
d.Set("boot_script", ds.BootScript)
96101
d.Set("monitoring", ds.Monitoring)
97102
d.Set("state", ds.State)
98103

ovh/types_dedicated_server.go

+3
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
type DedicatedServer struct {
1212
Name string `json:"name"`
1313
BootId int `json:"bootId"`
14+
BootScript string `json:"bootScript"`
1415
CommercialRange string `json:"commercialRange"`
1516
Datacenter string `json:"datacenter"`
1617
Ip string `json:"ip"`
@@ -40,12 +41,14 @@ func (ds DedicatedServer) String() string {
4041

4142
type DedicatedServerUpdateOpts struct {
4243
BootId *int64 `json:"bootId,omitempty"`
44+
BootScript *string `json:"bootScript,omitempty"`
4345
Monitoring *bool `json:"monitoring,omitempty"`
4446
State *string `json:"state,omitempty"`
4547
}
4648

4749
func (opts *DedicatedServerUpdateOpts) FromResource(d *schema.ResourceData) *DedicatedServerUpdateOpts {
4850
opts.BootId = helpers.GetNilInt64PointerFromData(d, "boot_id")
51+
opts.BootScript = helpers.GetNilStringPointerFromData(d, "boot_script")
4952
opts.Monitoring = helpers.GetNilBoolPointerFromData(d, "monitoring")
5053
opts.State = helpers.GetNilStringPointerFromData(d, "state")
5154
return opts

0 commit comments

Comments
 (0)