From 653534f03ee68d819c6a662601897d19f6dfd2ec Mon Sep 17 00:00:00 2001 From: "Cuong. Duong Manh" Date: Mon, 20 May 2024 15:01:11 +0700 Subject: [PATCH] [chore][enhance] add auto renew flag in the request --- vngcloud/services/compute/v2/irequest.go | 1 + vngcloud/services/compute/v2/server_request.go | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/vngcloud/services/compute/v2/irequest.go b/vngcloud/services/compute/v2/irequest.go index fc2fd07..102aacb 100644 --- a/vngcloud/services/compute/v2/irequest.go +++ b/vngcloud/services/compute/v2/irequest.go @@ -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 diff --git a/vngcloud/services/compute/v2/server_request.go b/vngcloud/services/compute/v2/server_request.go index e5f45c2..1c46136 100644 --- a/vngcloud/services/compute/v2/server_request.go +++ b/vngcloud/services/compute/v2/server_request.go @@ -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 @@ -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)