Skip to content

Commit 9404688

Browse files
committed
NFV-27102: Changes to support cluster name update
1 parent f051583 commit 9404688

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

client.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ type DeviceUpdateRequest interface {
151151
WithAdditionalBandwidth(additionalBandwidth int) DeviceUpdateRequest
152152
WithACLTemplate(templateID string) DeviceUpdateRequest
153153
WithMgmtAclTemplate(mgmtAclTemplateUuid string) DeviceUpdateRequest
154+
WithClusterName(clusterName string) DeviceUpdateRequest
154155
Execute() error
155156
}
156157

internal/api/device.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ type DeviceUpdateRequest struct {
144144
TermLength *int `json:"termLength,omitempty"`
145145
VirtualDeviceName *string `json:"virtualDeviceName,omitempty"`
146146
Core *int `json:"core,omitempty"`
147+
ClusterName *string `json:"clusterName,omitempty"`
147148
}
148149

149150
// DeviceAdditionalBandwidthUpdateRequest describes network device additional bandwidth update request

rest_device.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,12 @@ func (req *restDeviceUpdateRequest) WithCore(core int) DeviceUpdateRequest {
151151
return req
152152
}
153153

154+
// WithClusterName sets new cluster name in a composite device update request
155+
func (req *restDeviceUpdateRequest) WithClusterName(clusterName string) DeviceUpdateRequest {
156+
req.deviceFields["clusterName"] = clusterName
157+
return req
158+
}
159+
154160
// WithAdditionalBandwidth sets new additional bandwidth in a composite device update request
155161
func (req *restDeviceUpdateRequest) WithAdditionalBandwidth(additionalBandwidth int) DeviceUpdateRequest {
156162
req.additionalBandwidth = &additionalBandwidth
@@ -466,6 +472,10 @@ func (c RestClient) replaceDeviceFields(uuid string, fields map[string]interface
466472
reqBody.Core = Int(v.(int))
467473
okToSend = true
468474
}
475+
if v, ok := fields["clusterName"]; ok {
476+
reqBody.ClusterName = String(v.(string))
477+
okToSend = true
478+
}
469479
if okToSend {
470480
path := "/ne/v1/devices/" + uuid
471481
req := c.R().SetBody(&reqBody)

0 commit comments

Comments
 (0)