Skip to content

Commit

Permalink
[chore] add encryption type
Browse files Browse the repository at this point in the history
  • Loading branch information
cuongpiger committed May 29, 2024
1 parent 4bf4e16 commit 0a5548a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 7 additions & 3 deletions vngcloud/services/volume/v2/blockvolume_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down Expand Up @@ -89,6 +92,7 @@ type GetBlockVolumeByIdRequest struct {

type (
CreateVolumeFrom string
EncryptType string

VolumeTag struct {
Key string `json:"key"`
Expand Down Expand Up @@ -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
}

Expand Down
2 changes: 1 addition & 1 deletion vngcloud/services/volume/v2/irequest.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0a5548a

Please sign in to comment.