Skip to content

Commit

Permalink
[chore][enhance] add auto renew flag in the request
Browse files Browse the repository at this point in the history
  • Loading branch information
cuongpiger committed May 20, 2024
1 parent 8369ce2 commit 653534f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions vngcloud/services/compute/v2/irequest.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package v2
type ICreateServerRequest interface {
ToRequestBody() interface{}
WithEncryptionVolume(pencryptionVolume bool) ICreateServerRequest
WithAutoRenew(pval bool) ICreateServerRequest
WithUserData(puserData string, pbase64Encode bool) ICreateServerRequest
WithTags(ptags ...string) ICreateServerRequest
WithAttachFloating(pattachFloating bool) ICreateServerRequest
Expand Down
6 changes: 6 additions & 0 deletions vngcloud/services/compute/v2/server_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ type CreateServerRequest struct {
Product string `json:"product,omitempty"`
Type string `json:"type,omitempty"`
Tags []ServerTag `json:"tags,omitempty"`
AutoRenew bool `json:"isEnableAutoRenew,omitempty"`
}

type DataDiskEncryptionType string
Expand All @@ -91,6 +92,11 @@ func (s *CreateServerRequest) WithUserData(puserData string, pbase64Encode bool)
return s
}

func (s *CreateServerRequest) WithAutoRenew(pval bool) ICreateServerRequest {
s.AutoRenew = pval
return s
}

func (s *CreateServerRequest) WithTags(ptags ...string) ICreateServerRequest {
if s.Tags == nil {
s.Tags = make([]ServerTag, 0)
Expand Down

0 comments on commit 653534f

Please sign in to comment.