Skip to content

Commit 0916311

Browse files
fix(instance): remove deprecated bootscript documentation (scaleway#2245)
Co-authored-by: Jules Casteran <[email protected]>
1 parent d2c643e commit 0916311

File tree

2 files changed

+5
-163
lines changed

2 files changed

+5
-163
lines changed

api/instance/v1/instance_sdk.go

Lines changed: 5 additions & 157 deletions
Original file line numberDiff line numberDiff line change
@@ -1204,41 +1204,30 @@ type ServerSummary struct {
12041204

12051205
// Bootscript: bootscript.
12061206
type Bootscript struct {
1207-
// Bootcmdargs: bootscript arguments.
1207+
// Architecture: default value: unknown_arch
1208+
Architecture Arch `json:"architecture"`
1209+
12081210
Bootcmdargs string `json:"bootcmdargs"`
12091211

1210-
// Default: display if the bootscript is the default bootscript (if no other boot option is configured).
12111212
Default bool `json:"default"`
12121213

1213-
// Dtb: provide information regarding a Device Tree Binary (DTB) for use with C1 servers.
12141214
Dtb string `json:"dtb"`
12151215

1216-
// ID: bootscript ID.
12171216
ID string `json:"id"`
12181217

1219-
// Initrd: initrd (initial ramdisk) configuration.
12201218
Initrd string `json:"initrd"`
12211219

1222-
// Kernel: instance kernel version.
12231220
Kernel string `json:"kernel"`
12241221

1225-
// Organization: bootscript Organization ID.
12261222
Organization string `json:"organization"`
12271223

1228-
// Project: bootscript Project ID.
1229-
Project string `json:"project"`
1230-
1231-
// Public: provide information if the bootscript is public.
12321224
Public bool `json:"public"`
12331225

1234-
// Title: bootscript title.
12351226
Title string `json:"title"`
12361227

1237-
// Architecture: bootscript architecture.
1238-
// Default value: unknown_arch
1239-
Architecture Arch `json:"architecture"`
1228+
Project string `json:"project"`
12401229

1241-
// Zone: zone in which the bootscript is located.
1230+
// Zone: zone to target. If none is passed will use default zone from the config.
12421231
Zone scw.Zone `json:"zone"`
12431232
}
12441233

@@ -1635,9 +1624,6 @@ type Server struct {
16351624
// Deprecated: IPv6: instance IPv6 address (deprecated when `routed_ip_enabled` is `True`).
16361625
IPv6 *ServerIPv6 `json:"ipv6"`
16371626

1638-
// Deprecated: Bootscript: instance bootscript.
1639-
Bootscript *Bootscript `json:"bootscript"`
1640-
16411627
// BootType: instance boot type.
16421628
// Default value: local
16431629
BootType BootType `json:"boot_type"`
@@ -2164,9 +2150,6 @@ type CreateImageRequest struct {
21642150
// Default value: unknown_arch
21652151
Arch Arch `json:"arch,omitempty"`
21662152

2167-
// Deprecated: DefaultBootscript: default bootscript of the image.
2168-
DefaultBootscript *string `json:"default_bootscript,omitempty"`
2169-
21702153
// ExtraVolumes: additional volumes of the image.
21712154
ExtraVolumes map[string]*VolumeTemplate `json:"extra_volumes,omitempty"`
21722155

@@ -2372,9 +2355,6 @@ type CreateServerRequest struct {
23722355
// Default value: local
23732356
BootType *BootType `json:"boot_type,omitempty"`
23742357

2375-
// Deprecated: Bootscript: bootscript ID to use when `boot_type` is set to `bootscript`.
2376-
Bootscript *string `json:"bootscript,omitempty"`
2377-
23782358
// Deprecated: Organization: instance Organization ID.
23792359
// Precisely one of Project, Organization must be set.
23802360
Organization *string `json:"organization,omitempty"`
@@ -2613,19 +2593,6 @@ type ExportSnapshotResponse struct {
26132593
Task *Task `json:"task"`
26142594
}
26152595

2616-
// GetBootscriptRequest: get bootscript request.
2617-
type GetBootscriptRequest struct {
2618-
// Zone: zone to target. If none is passed will use default zone from the config.
2619-
Zone scw.Zone `json:"-"`
2620-
2621-
BootscriptID string `json:"-"`
2622-
}
2623-
2624-
// GetBootscriptResponse: get bootscript response.
2625-
type GetBootscriptResponse struct {
2626-
Bootscript *Bootscript `json:"bootscript"`
2627-
}
2628-
26292596
// GetDashboardRequest: get dashboard request.
26302597
type GetDashboardRequest struct {
26312598
// Zone: zone to target. If none is passed will use default zone from the config.
@@ -2830,52 +2797,6 @@ type GetVolumeResponse struct {
28302797
Volume *Volume `json:"volume"`
28312798
}
28322799

2833-
// ListBootscriptsRequest: list bootscripts request.
2834-
type ListBootscriptsRequest struct {
2835-
// Zone: zone to target. If none is passed will use default zone from the config.
2836-
Zone scw.Zone `json:"-"`
2837-
2838-
Arch *string `json:"-"`
2839-
2840-
Title *string `json:"-"`
2841-
2842-
Default *bool `json:"-"`
2843-
2844-
Public *bool `json:"-"`
2845-
2846-
PerPage *uint32 `json:"-"`
2847-
2848-
Page *int32 `json:"-"`
2849-
}
2850-
2851-
// ListBootscriptsResponse: list bootscripts response.
2852-
type ListBootscriptsResponse struct {
2853-
// TotalCount: total number of bootscripts.
2854-
TotalCount uint32 `json:"total_count"`
2855-
2856-
// Bootscripts: list of bootscripts.
2857-
Bootscripts []*Bootscript `json:"bootscripts"`
2858-
}
2859-
2860-
// UnsafeGetTotalCount should not be used
2861-
// Internal usage only
2862-
func (r *ListBootscriptsResponse) UnsafeGetTotalCount() uint32 {
2863-
return r.TotalCount
2864-
}
2865-
2866-
// UnsafeAppend should not be used
2867-
// Internal usage only
2868-
func (r *ListBootscriptsResponse) UnsafeAppend(res interface{}) (uint32, error) {
2869-
results, ok := res.(*ListBootscriptsResponse)
2870-
if !ok {
2871-
return 0, errors.New("%T type cannot be appended to type %T", res, r)
2872-
}
2873-
2874-
r.Bootscripts = append(r.Bootscripts, results.Bootscripts...)
2875-
r.TotalCount += uint32(len(results.Bootscripts))
2876-
return uint32(len(results.Bootscripts)), nil
2877-
}
2878-
28792800
// ListDefaultSecurityGroupRulesRequest: list default security group rules request.
28802801
type ListDefaultSecurityGroupRulesRequest struct {
28812802
// Zone: zone to target. If none is passed will use default zone from the config.
@@ -3860,9 +3781,6 @@ type UpdateServerRequest struct {
38603781

38613782
Volumes *map[string]*VolumeServerTemplate `json:"volumes,omitempty"`
38623783

3863-
// Deprecated
3864-
Bootscript *string `json:"bootscript,omitempty"`
3865-
38663784
DynamicIPRequired *bool `json:"dynamic_ip_required,omitempty"`
38673785

38683786
// Deprecated: RoutedIPEnabled: true to configure the instance so it uses the new routed IP mode (once this is set to True you cannot set it back to False).
@@ -4111,9 +4029,6 @@ type setServerRequest struct {
41114029
// Deprecated: IPv6: instance IPv6 address (deprecated when `routed_ip_enabled` is `True`).
41124030
IPv6 *ServerIPv6 `json:"ipv6,omitempty"`
41134031

4114-
// Deprecated: Bootscript: instance bootscript.
4115-
Bootscript *Bootscript `json:"bootscript,omitempty"`
4116-
41174032
// BootType: instance boot type.
41184033
// Default value: local
41194034
BootType BootType `json:"boot_type"`
@@ -6619,73 +6534,6 @@ func (s *API) DeletePrivateNIC(req *DeletePrivateNICRequest, opts ...scw.Request
66196534
return nil
66206535
}
66216536

6622-
// Deprecated: ListBootscripts: List bootscripts.
6623-
func (s *API) ListBootscripts(req *ListBootscriptsRequest, opts ...scw.RequestOption) (*ListBootscriptsResponse, error) {
6624-
var err error
6625-
6626-
if req.Zone == "" {
6627-
defaultZone, _ := s.client.GetDefaultZone()
6628-
req.Zone = defaultZone
6629-
}
6630-
6631-
query := url.Values{}
6632-
parameter.AddToQuery(query, "arch", req.Arch)
6633-
parameter.AddToQuery(query, "title", req.Title)
6634-
parameter.AddToQuery(query, "default", req.Default)
6635-
parameter.AddToQuery(query, "public", req.Public)
6636-
parameter.AddToQuery(query, "per_page", req.PerPage)
6637-
parameter.AddToQuery(query, "page", req.Page)
6638-
6639-
if fmt.Sprint(req.Zone) == "" {
6640-
return nil, errors.New("field Zone cannot be empty in request")
6641-
}
6642-
6643-
scwReq := &scw.ScalewayRequest{
6644-
Method: "GET",
6645-
Path: "/instance/v1/zones/" + fmt.Sprint(req.Zone) + "/bootscripts",
6646-
Query: query,
6647-
}
6648-
6649-
var resp ListBootscriptsResponse
6650-
6651-
err = s.client.Do(scwReq, &resp, opts...)
6652-
if err != nil {
6653-
return nil, err
6654-
}
6655-
return &resp, nil
6656-
}
6657-
6658-
// Deprecated: GetBootscript: Get details of a bootscript with the specified ID.
6659-
func (s *API) GetBootscript(req *GetBootscriptRequest, opts ...scw.RequestOption) (*GetBootscriptResponse, error) {
6660-
var err error
6661-
6662-
if req.Zone == "" {
6663-
defaultZone, _ := s.client.GetDefaultZone()
6664-
req.Zone = defaultZone
6665-
}
6666-
6667-
if fmt.Sprint(req.Zone) == "" {
6668-
return nil, errors.New("field Zone cannot be empty in request")
6669-
}
6670-
6671-
if fmt.Sprint(req.BootscriptID) == "" {
6672-
return nil, errors.New("field BootscriptID cannot be empty in request")
6673-
}
6674-
6675-
scwReq := &scw.ScalewayRequest{
6676-
Method: "GET",
6677-
Path: "/instance/v1/zones/" + fmt.Sprint(req.Zone) + "/bootscripts/" + fmt.Sprint(req.BootscriptID) + "",
6678-
}
6679-
6680-
var resp GetBootscriptResponse
6681-
6682-
err = s.client.Do(scwReq, &resp, opts...)
6683-
if err != nil {
6684-
return nil, err
6685-
}
6686-
return &resp, nil
6687-
}
6688-
66896537
// GetDashboard:
66906538
func (s *API) GetDashboard(req *GetDashboardRequest, opts ...scw.RequestOption) (*GetDashboardResponse, error) {
66916539
var err error

api/instance/v1/instance_utils.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -187,12 +187,6 @@ func (r *ListServersResponse) UnsafeSetTotalCount(totalCount int) {
187187
r.TotalCount = uint32(totalCount)
188188
}
189189

190-
// UnsafeSetTotalCount should not be used
191-
// Internal usage only
192-
func (r *ListBootscriptsResponse) UnsafeSetTotalCount(totalCount int) {
193-
r.TotalCount = uint32(totalCount)
194-
}
195-
196190
// UnsafeSetTotalCount should not be used
197191
// Internal usage only
198192
func (r *ListIPsResponse) UnsafeSetTotalCount(totalCount int) {

0 commit comments

Comments
 (0)