Skip to content

Commit

Permalink
Merge branch 'v5_2_x' into merge-5-2-to-master
Browse files Browse the repository at this point in the history
  • Loading branch information
RachelTucker committed Aug 13, 2020
2 parents 4a0ad11 + c7d22a3 commit 48dacf4
Show file tree
Hide file tree
Showing 8 changed files with 814 additions and 0 deletions.
23 changes: 23 additions & 0 deletions ds3/ds3Deletes.go
Original file line number Diff line number Diff line change
Expand Up @@ -710,6 +710,29 @@ func (client *Client) DeleteAzureTargetFailureNotificationRegistrationSpectraS3(
return models.NewDeleteAzureTargetFailureNotificationRegistrationSpectraS3Response(response)
}

func (client *Client) DeleteBucketChangesNotificationRegistrationSpectraS3(request *models.DeleteBucketChangesNotificationRegistrationSpectraS3Request) (*models.DeleteBucketChangesNotificationRegistrationSpectraS3Response, error) {
// Build the http request
httpRequest, err := networking.NewHttpRequestBuilder().
WithHttpVerb(HTTP_VERB_DELETE).
WithPath("/_rest_/bucket_changes_notification_registration/" + request.BucketChangesNotificationRegistration).
Build(client.connectionInfo)

if err != nil {
return nil, err
}

networkRetryDecorator := networking.NewNetworkRetryDecorator(client.sendNetwork, client.clientPolicy.maxRetries)

// Invoke the HTTP request.
response, requestErr := networkRetryDecorator.Invoke(httpRequest)
if requestErr != nil {
return nil, requestErr
}

// Create a response object based on the result.
return models.NewDeleteBucketChangesNotificationRegistrationSpectraS3Response(response)
}

func (client *Client) DeleteDs3TargetFailureNotificationRegistrationSpectraS3(request *models.DeleteDs3TargetFailureNotificationRegistrationSpectraS3Request) (*models.DeleteDs3TargetFailureNotificationRegistrationSpectraS3Response, error) {
// Build the http request
httpRequest, err := networking.NewHttpRequestBuilder().
Expand Down
86 changes: 86 additions & 0 deletions ds3/ds3Gets.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ func (client *Client) GetObject(request *models.GetObjectRequest) (*models.GetOb
httpRequest, err := networking.NewHttpRequestBuilder().
WithHttpVerb(HTTP_VERB_GET).
WithPath("/" + request.BucketName + "/" + request.ObjectName).
WithOptionalVoidQueryParam("cached_only", request.CachedOnly).
WithOptionalQueryParam("job", request.Job).
WithOptionalQueryParam("offset", networking.Int64PtrToStrPtr(request.Offset)).
WithOptionalQueryParam("version_id", request.VersionId).
Expand Down Expand Up @@ -1800,6 +1801,89 @@ func (client *Client) GetAzureTargetFailureNotificationRegistrationsSpectraS3(re
return models.NewGetAzureTargetFailureNotificationRegistrationsSpectraS3Response(response)
}

func (client *Client) GetBucketChangesNotificationRegistrationSpectraS3(request *models.GetBucketChangesNotificationRegistrationSpectraS3Request) (*models.GetBucketChangesNotificationRegistrationSpectraS3Response, error) {
// Build the http request
httpRequest, err := networking.NewHttpRequestBuilder().
WithHttpVerb(HTTP_VERB_GET).
WithPath("/_rest_/bucket_changes_notification_registration/" + request.BucketChangesNotificationRegistration).
Build(client.connectionInfo)

if err != nil {
return nil, err
}

networkRetryDecorator := networking.NewNetworkRetryDecorator(client.sendNetwork, client.clientPolicy.maxRetries)
httpRedirectDecorator := networking.NewHttpTempRedirectDecorator(networkRetryDecorator, client.clientPolicy.maxRedirect)

// Invoke the HTTP request.
response, requestErr := httpRedirectDecorator.Invoke(httpRequest)
if requestErr != nil {
return nil, requestErr
}

// Create a response object based on the result.
return models.NewGetBucketChangesNotificationRegistrationSpectraS3Response(response)
}

func (client *Client) GetBucketChangesNotificationRegistrationsSpectraS3(request *models.GetBucketChangesNotificationRegistrationsSpectraS3Request) (*models.GetBucketChangesNotificationRegistrationsSpectraS3Response, error) {
// Build the http request
httpRequest, err := networking.NewHttpRequestBuilder().
WithHttpVerb(HTTP_VERB_GET).
WithPath("/_rest_/bucket_changes_notification_registration").
WithOptionalVoidQueryParam("last_page", request.LastPage).
WithOptionalQueryParam("page_length", networking.IntPtrToStrPtr(request.PageLength)).
WithOptionalQueryParam("page_offset", networking.IntPtrToStrPtr(request.PageOffset)).
WithOptionalQueryParam("page_start_marker", request.PageStartMarker).
WithOptionalQueryParam("user_id", request.UserId).
Build(client.connectionInfo)

if err != nil {
return nil, err
}

networkRetryDecorator := networking.NewNetworkRetryDecorator(client.sendNetwork, client.clientPolicy.maxRetries)
httpRedirectDecorator := networking.NewHttpTempRedirectDecorator(networkRetryDecorator, client.clientPolicy.maxRedirect)

// Invoke the HTTP request.
response, requestErr := httpRedirectDecorator.Invoke(httpRequest)
if requestErr != nil {
return nil, requestErr
}

// Create a response object based on the result.
return models.NewGetBucketChangesNotificationRegistrationsSpectraS3Response(response)
}

func (client *Client) GetBucketHistorySpectraS3(request *models.GetBucketHistorySpectraS3Request) (*models.GetBucketHistorySpectraS3Response, error) {
// Build the http request
httpRequest, err := networking.NewHttpRequestBuilder().
WithHttpVerb(HTTP_VERB_GET).
WithPath("/_rest_/bucket_history").
WithOptionalQueryParam("bucket_id", request.BucketId).
WithOptionalVoidQueryParam("last_page", request.LastPage).
WithOptionalQueryParam("min_sequence_number", networking.Int64PtrToStrPtr(request.MinSequenceNumber)).
WithOptionalQueryParam("page_length", networking.IntPtrToStrPtr(request.PageLength)).
WithOptionalQueryParam("page_offset", networking.IntPtrToStrPtr(request.PageOffset)).
WithOptionalQueryParam("page_start_marker", request.PageStartMarker).
Build(client.connectionInfo)

if err != nil {
return nil, err
}

networkRetryDecorator := networking.NewNetworkRetryDecorator(client.sendNetwork, client.clientPolicy.maxRetries)
httpRedirectDecorator := networking.NewHttpTempRedirectDecorator(networkRetryDecorator, client.clientPolicy.maxRedirect)

// Invoke the HTTP request.
response, requestErr := httpRedirectDecorator.Invoke(httpRequest)
if requestErr != nil {
return nil, requestErr
}

// Create a response object based on the result.
return models.NewGetBucketHistorySpectraS3Response(response)
}

func (client *Client) GetDs3TargetFailureNotificationRegistrationSpectraS3(request *models.GetDs3TargetFailureNotificationRegistrationSpectraS3Request) (*models.GetDs3TargetFailureNotificationRegistrationSpectraS3Response, error) {
// Build the http request
httpRequest, err := networking.NewHttpRequestBuilder().
Expand Down Expand Up @@ -3209,6 +3293,7 @@ func (client *Client) GetTapeDrivesSpectraS3(request *models.GetTapeDrivesSpectr
WithHttpVerb(HTTP_VERB_GET).
WithPath("/_rest_/tape_drive").
WithOptionalVoidQueryParam("last_page", request.LastPage).
WithOptionalQueryParam("minimum_task_priority", networking.InterfaceToStrPtr(request.MinimumTaskPriority)).
WithOptionalQueryParam("page_length", networking.IntPtrToStrPtr(request.PageLength)).
WithOptionalQueryParam("page_offset", networking.IntPtrToStrPtr(request.PageOffset)).
WithOptionalQueryParam("page_start_marker", request.PageStartMarker).
Expand Down Expand Up @@ -4118,6 +4203,7 @@ func (client *Client) GetS3TargetsSpectraS3(request *models.GetS3TargetsSpectraS
WithOptionalQueryParam("https", networking.BoolPtrToStrPtr(request.Https)).
WithOptionalVoidQueryParam("last_page", request.LastPage).
WithOptionalQueryParam("name", request.Name).
WithOptionalQueryParam("naming_mode", networking.InterfaceToStrPtr(request.NamingMode)).
WithOptionalQueryParam("page_length", networking.IntPtrToStrPtr(request.PageLength)).
WithOptionalQueryParam("page_offset", networking.IntPtrToStrPtr(request.PageOffset)).
WithOptionalQueryParam("page_start_marker", request.PageStartMarker).
Expand Down
1 change: 1 addition & 0 deletions ds3/ds3Heads.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ func (client *Client) HeadObject(request *models.HeadObjectRequest) (*models.Hea
httpRequest, err := networking.NewHttpRequestBuilder().
WithHttpVerb(HTTP_VERB_HEAD).
WithPath("/" + request.BucketName + "/" + request.ObjectName).
WithOptionalQueryParam("version_id", request.VersionId).
Build(client.connectionInfo)

if err != nil {
Expand Down
59 changes: 59 additions & 0 deletions ds3/ds3Posts.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,34 @@ import (
"github.com/SpectraLogic/ds3_go_sdk/ds3/networking"
)

func (client *Client) CompleteBlob(request *models.CompleteBlobRequest) (*models.CompleteBlobResponse, error) {
// Build the http request
httpRequest, err := networking.NewHttpRequestBuilder().
WithHttpVerb(HTTP_VERB_POST).
WithPath("/" + request.BucketName + "/" + request.ObjectName).
WithQueryParam("blob", request.Blob).
WithQueryParam("job", request.Job).
WithOptionalQueryParam("size", networking.Int64PtrToStrPtr(request.Size)).
WithChecksum(request.Checksum).
WithHeaders(request.Metadata).
Build(client.connectionInfo)

if err != nil {
return nil, err
}

networkRetryDecorator := networking.NewNetworkRetryDecorator(client.sendNetwork, client.clientPolicy.maxRetries)

// Invoke the HTTP request.
response, requestErr := networkRetryDecorator.Invoke(httpRequest)
if requestErr != nil {
return nil, requestErr
}

// Create a response object based on the result.
return models.NewCompleteBlobResponse(response)
}

func (client *Client) CompleteMultiPartUpload(request *models.CompleteMultiPartUploadRequest) (*models.CompleteMultiPartUploadResponse, error) {
// Build the http request
httpRequest, err := networking.NewHttpRequestBuilder().
Expand Down Expand Up @@ -570,6 +598,34 @@ func (client *Client) PutAzureTargetFailureNotificationRegistrationSpectraS3(req
return models.NewPutAzureTargetFailureNotificationRegistrationSpectraS3Response(response)
}

func (client *Client) PutBucketChangesNotificationRegistrationSpectraS3(request *models.PutBucketChangesNotificationRegistrationSpectraS3Request) (*models.PutBucketChangesNotificationRegistrationSpectraS3Response, error) {
// Build the http request
httpRequest, err := networking.NewHttpRequestBuilder().
WithHttpVerb(HTTP_VERB_POST).
WithPath("/_rest_/bucket_changes_notification_registration").
WithQueryParam("notification_end_point", request.NotificationEndPoint).
WithOptionalQueryParam("bucket_id", request.BucketId).
WithOptionalQueryParam("format", networking.InterfaceToStrPtr(request.Format)).
WithOptionalQueryParam("naming_convention", networking.InterfaceToStrPtr(request.NamingConvention)).
WithOptionalQueryParam("notification_http_method", networking.InterfaceToStrPtr(request.NotificationHttpMethod)).
Build(client.connectionInfo)

if err != nil {
return nil, err
}

networkRetryDecorator := networking.NewNetworkRetryDecorator(client.sendNetwork, client.clientPolicy.maxRetries)

// Invoke the HTTP request.
response, requestErr := networkRetryDecorator.Invoke(httpRequest)
if requestErr != nil {
return nil, requestErr
}

// Create a response object based on the result.
return models.NewPutBucketChangesNotificationRegistrationSpectraS3Response(response)
}

func (client *Client) PutDs3TargetFailureNotificationRegistrationSpectraS3(request *models.PutDs3TargetFailureNotificationRegistrationSpectraS3Request) (*models.PutDs3TargetFailureNotificationRegistrationSpectraS3Response, error) {
// Build the http request
httpRequest, err := networking.NewHttpRequestBuilder().
Expand Down Expand Up @@ -1276,6 +1332,7 @@ func (client *Client) RegisterS3TargetSpectraS3(request *models.RegisterS3Target
WithOptionalQueryParam("data_path_end_point", request.DataPathEndPoint).
WithOptionalQueryParam("default_read_preference", networking.InterfaceToStrPtr(request.DefaultReadPreference)).
WithOptionalQueryParam("https", networking.BoolPtrToStrPtr(request.Https)).
WithOptionalQueryParam("naming_mode", networking.InterfaceToStrPtr(request.NamingMode)).
WithOptionalQueryParam("offline_data_staging_window_in_tb", networking.IntPtrToStrPtr(request.OfflineDataStagingWindowInTb)).
WithOptionalQueryParam("permit_going_out_of_sync", networking.BoolPtrToStrPtr(request.PermitGoingOutOfSync)).
WithOptionalQueryParam("proxy_domain", request.ProxyDomain).
Expand All @@ -1284,6 +1341,7 @@ func (client *Client) RegisterS3TargetSpectraS3(request *models.RegisterS3Target
WithOptionalQueryParam("proxy_port", networking.IntPtrToStrPtr(request.ProxyPort)).
WithOptionalQueryParam("proxy_username", request.ProxyUsername).
WithOptionalQueryParam("region", networking.InterfaceToStrPtr(request.Region)).
WithOptionalQueryParam("restricted_access", networking.BoolPtrToStrPtr(request.RestrictedAccess)).
WithOptionalQueryParam("staged_data_expiration_in_days", networking.IntPtrToStrPtr(request.StagedDataExpirationInDays)).
Build(client.connectionInfo)

Expand All @@ -1309,6 +1367,7 @@ func (client *Client) DelegateCreateUserSpectraS3(request *models.DelegateCreate
WithHttpVerb(HTTP_VERB_POST).
WithPath("/_rest_/user").
WithQueryParam("name", request.Name).
WithOptionalQueryParam("default_data_policy_id", request.DefaultDataPolicyId).
WithOptionalQueryParam("id", request.Id).
WithOptionalQueryParam("max_buckets", networking.IntPtrToStrPtr(request.MaxBuckets)).
WithOptionalQueryParam("secret_key", request.SecretKey).
Expand Down
4 changes: 4 additions & 0 deletions ds3/ds3Puts.go
Original file line number Diff line number Diff line change
Expand Up @@ -613,6 +613,7 @@ func (client *Client) PutBulkJobSpectraS3(request *models.PutBulkJobSpectraS3Req
WithOptionalQueryParam("max_upload_size", networking.Int64PtrToStrPtr(request.MaxUploadSize)).
WithOptionalQueryParam("minimize_spanning_across_media", networking.BoolPtrToStrPtr(request.MinimizeSpanningAcrossMedia)).
WithOptionalQueryParam("name", request.Name).
WithOptionalVoidQueryParam("pre_allocate_job_space", request.PreAllocateJobSpace).
WithOptionalQueryParam("priority", networking.InterfaceToStrPtr(request.Priority)).
WithOptionalQueryParam("verify_after_write", networking.BoolPtrToStrPtr(request.VerifyAfterWrite)).
WithQueryParam("operation", "start_bulk_put").
Expand Down Expand Up @@ -2039,6 +2040,7 @@ func (client *Client) ModifyTapeDriveSpectraS3(request *models.ModifyTapeDriveSp
httpRequest, err := networking.NewHttpRequestBuilder().
WithHttpVerb(HTTP_VERB_PUT).
WithPath("/_rest_/tape_drive/" + request.TapeDriveId).
WithOptionalQueryParam("minimum_task_priority", networking.InterfaceToStrPtr(request.MinimumTaskPriority)).
WithOptionalQueryParam("quiesced", networking.InterfaceToStrPtr(request.Quiesced)).
WithOptionalQueryParam("reserved_task_type", networking.InterfaceToStrPtr(request.ReservedTaskType)).
Build(client.connectionInfo)
Expand Down Expand Up @@ -2584,6 +2586,7 @@ func (client *Client) ModifyS3TargetSpectraS3(request *models.ModifyS3TargetSpec
WithOptionalQueryParam("default_read_preference", networking.InterfaceToStrPtr(request.DefaultReadPreference)).
WithOptionalQueryParam("https", networking.BoolPtrToStrPtr(request.Https)).
WithOptionalQueryParam("name", request.Name).
WithOptionalQueryParam("naming_mode", networking.InterfaceToStrPtr(request.NamingMode)).
WithOptionalQueryParam("offline_data_staging_window_in_tb", networking.IntPtrToStrPtr(request.OfflineDataStagingWindowInTb)).
WithOptionalQueryParam("permit_going_out_of_sync", networking.BoolPtrToStrPtr(request.PermitGoingOutOfSync)).
WithOptionalQueryParam("proxy_domain", request.ProxyDomain).
Expand All @@ -2593,6 +2596,7 @@ func (client *Client) ModifyS3TargetSpectraS3(request *models.ModifyS3TargetSpec
WithOptionalQueryParam("proxy_username", request.ProxyUsername).
WithOptionalQueryParam("quiesced", networking.InterfaceToStrPtr(request.Quiesced)).
WithOptionalQueryParam("region", networking.InterfaceToStrPtr(request.Region)).
WithOptionalQueryParam("restricted_access", networking.BoolPtrToStrPtr(request.RestrictedAccess)).
WithOptionalQueryParam("secret_key", request.SecretKey).
WithOptionalQueryParam("staged_data_expiration_in_days", networking.IntPtrToStrPtr(request.StagedDataExpirationInDays)).
Build(client.connectionInfo)
Expand Down
Loading

0 comments on commit 48dacf4

Please sign in to comment.