Skip to content

Commit

Permalink
Added backup storage validation functions
Browse files Browse the repository at this point in the history
  • Loading branch information
SivaanandM committed Nov 18, 2024
1 parent 65ee957 commit b9f5db0
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions client/backup_storage_location.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,36 @@ func (h *V1Client) GetAzureBackupStorageLocation(uid string) (*models.V1UserAsse
return resp.Payload, nil
}

// ValidateS3BackupStorageLocation validate a S3 credential for backup storage location.
func (h *V1Client) ValidateS3BackupStorageLocation(awsCred *models.V1AwsS3BucketCredentials) error {
params := clientv1.NewV1AwsS3ValidateParamsWithContext(h.ctx).WithAwsS3Credential(awsCred)
_, err := h.Client.V1AwsS3Validate(params)
if err != nil {
return err
}
return nil
}

// ValidateGcpBackupStorageLocation validate a gcp credential for backup storage location.
func (h *V1Client) ValidateGcpBackupStorageLocation(gcpCred *models.V1GcpAccountNameValidateSpec) error {
params := clientv1.NewV1GcpBucketNameValidateParamsWithContext(h.ctx).WithBody(gcpCred)
_, err := h.Client.V1GcpBucketNameValidate(params)
if err != nil {
return err
}
return nil
}

// ValidateAzureBackupStorageLocation validate an azure credential for backup storage location.
func (h *V1Client) ValidateAzureBackupStorageLocation(azureCred *models.V1AzureCloudAccount) error {
params := clientv1.NewV1AzureAccountValidateParamsWithContext(h.ctx).WithAzureCloudAccount(azureCred)
_, err := h.Client.V1AzureAccountValidate(params)
if err != nil {
return err
}
return nil
}

// CreateS3BackupStorageLocation creates a new S3 backup storage location.
func (h *V1Client) CreateS3BackupStorageLocation(bsl *models.V1UserAssetsLocationS3) (string, error) {
params := clientv1.NewV1UsersAssetsLocationS3CreateParamsWithContext(h.ctx).
Expand Down

0 comments on commit b9f5db0

Please sign in to comment.