From 0a5548a2c66d88732f01e0b96b3b5e8f32fcbeb3 Mon Sep 17 00:00:00 2001 From: "Cuong. Duong Manh" Date: Wed, 29 May 2024 14:47:27 +0700 Subject: [PATCH] [chore] add encryption type --- vngcloud/services/volume/v2/blockvolume_request.go | 10 +++++++--- vngcloud/services/volume/v2/irequest.go | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/vngcloud/services/volume/v2/blockvolume_request.go b/vngcloud/services/volume/v2/blockvolume_request.go index aeea303..dfc0b35 100644 --- a/vngcloud/services/volume/v2/blockvolume_request.go +++ b/vngcloud/services/volume/v2/blockvolume_request.go @@ -46,12 +46,15 @@ func NewResizeBlockVolumeByIdRequest(pvolumeId, pvolumeType string, psize int) I const ( CreateFromNew = CreateVolumeFrom("NEW") CreateFromSnapshot = CreateVolumeFrom("SNAPSHOT") + + AesXtsPlain64_128 = EncryptType("aes-xts-plain64_128") + AesXtsPlain64_256 = EncryptType("aes-xts-plain64_256") ) type CreateBlockVolumeRequest struct { BackupVolumePointId string `json:"backupVolumePointId,omitempty"` CreatedFrom CreateVolumeFrom `json:"createdFrom,omitempty"` - EncryptionType string `json:"encryptionType,omitempty"` + EncryptionType EncryptType `json:"encryptionType,omitempty"` MultiAttach bool `json:"multiAttach,omitempty"` Name string `json:"name"` Size int64 `json:"size"` @@ -89,6 +92,7 @@ type GetBlockVolumeByIdRequest struct { type ( CreateVolumeFrom string + EncryptType string VolumeTag struct { Key string `json:"key"` @@ -141,8 +145,8 @@ func (s *CreateBlockVolumeRequest) WithSize(psize int64) ICreateBlockVolumeReque return s } -func (s *CreateBlockVolumeRequest) WithCreateFrom(pcreateFrom CreateVolumeFrom) ICreateBlockVolumeRequest { - s.CreatedFrom = pcreateFrom +func (s *CreateBlockVolumeRequest) WithEncryptionType(pet EncryptType) ICreateBlockVolumeRequest { + s.EncryptionType = pet return s } diff --git a/vngcloud/services/volume/v2/irequest.go b/vngcloud/services/volume/v2/irequest.go index d33662e..6f84a12 100644 --- a/vngcloud/services/volume/v2/irequest.go +++ b/vngcloud/services/volume/v2/irequest.go @@ -7,7 +7,7 @@ type ICreateBlockVolumeRequest interface { WithAutoRenew(pval bool) ICreateBlockVolumeRequest WithMultiAttach(pmultiAttach bool) ICreateBlockVolumeRequest WithSize(psize int64) ICreateBlockVolumeRequest - WithCreateFrom(pcreateFrom CreateVolumeFrom) ICreateBlockVolumeRequest + WithEncryptionType(pet EncryptType) ICreateBlockVolumeRequest WithVolumeType(pvolumeTypeId string) ICreateBlockVolumeRequest WithVolumeRestoreFromSnapshot(psnapshotID, pvolumeTypeID string) ICreateBlockVolumeRequest WithTags(ptags ...string) ICreateBlockVolumeRequest