Skip to content

Commit b6e256e

Browse files
author
Sharon Shabtai
authored
Merge pull request #117 from RachelTucker/merge-5-2-to-master
Merge 5.2 branch to master
2 parents 4a0ad11 + 48dacf4 commit b6e256e

File tree

8 files changed

+814
-0
lines changed

8 files changed

+814
-0
lines changed

ds3/ds3Deletes.go

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -710,6 +710,29 @@ func (client *Client) DeleteAzureTargetFailureNotificationRegistrationSpectraS3(
710710
return models.NewDeleteAzureTargetFailureNotificationRegistrationSpectraS3Response(response)
711711
}
712712

713+
func (client *Client) DeleteBucketChangesNotificationRegistrationSpectraS3(request *models.DeleteBucketChangesNotificationRegistrationSpectraS3Request) (*models.DeleteBucketChangesNotificationRegistrationSpectraS3Response, error) {
714+
// Build the http request
715+
httpRequest, err := networking.NewHttpRequestBuilder().
716+
WithHttpVerb(HTTP_VERB_DELETE).
717+
WithPath("/_rest_/bucket_changes_notification_registration/" + request.BucketChangesNotificationRegistration).
718+
Build(client.connectionInfo)
719+
720+
if err != nil {
721+
return nil, err
722+
}
723+
724+
networkRetryDecorator := networking.NewNetworkRetryDecorator(client.sendNetwork, client.clientPolicy.maxRetries)
725+
726+
// Invoke the HTTP request.
727+
response, requestErr := networkRetryDecorator.Invoke(httpRequest)
728+
if requestErr != nil {
729+
return nil, requestErr
730+
}
731+
732+
// Create a response object based on the result.
733+
return models.NewDeleteBucketChangesNotificationRegistrationSpectraS3Response(response)
734+
}
735+
713736
func (client *Client) DeleteDs3TargetFailureNotificationRegistrationSpectraS3(request *models.DeleteDs3TargetFailureNotificationRegistrationSpectraS3Request) (*models.DeleteDs3TargetFailureNotificationRegistrationSpectraS3Response, error) {
714737
// Build the http request
715738
httpRequest, err := networking.NewHttpRequestBuilder().

ds3/ds3Gets.go

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ func (client *Client) GetObject(request *models.GetObjectRequest) (*models.GetOb
2323
httpRequest, err := networking.NewHttpRequestBuilder().
2424
WithHttpVerb(HTTP_VERB_GET).
2525
WithPath("/" + request.BucketName + "/" + request.ObjectName).
26+
WithOptionalVoidQueryParam("cached_only", request.CachedOnly).
2627
WithOptionalQueryParam("job", request.Job).
2728
WithOptionalQueryParam("offset", networking.Int64PtrToStrPtr(request.Offset)).
2829
WithOptionalQueryParam("version_id", request.VersionId).
@@ -1800,6 +1801,89 @@ func (client *Client) GetAzureTargetFailureNotificationRegistrationsSpectraS3(re
18001801
return models.NewGetAzureTargetFailureNotificationRegistrationsSpectraS3Response(response)
18011802
}
18021803

1804+
func (client *Client) GetBucketChangesNotificationRegistrationSpectraS3(request *models.GetBucketChangesNotificationRegistrationSpectraS3Request) (*models.GetBucketChangesNotificationRegistrationSpectraS3Response, error) {
1805+
// Build the http request
1806+
httpRequest, err := networking.NewHttpRequestBuilder().
1807+
WithHttpVerb(HTTP_VERB_GET).
1808+
WithPath("/_rest_/bucket_changes_notification_registration/" + request.BucketChangesNotificationRegistration).
1809+
Build(client.connectionInfo)
1810+
1811+
if err != nil {
1812+
return nil, err
1813+
}
1814+
1815+
networkRetryDecorator := networking.NewNetworkRetryDecorator(client.sendNetwork, client.clientPolicy.maxRetries)
1816+
httpRedirectDecorator := networking.NewHttpTempRedirectDecorator(networkRetryDecorator, client.clientPolicy.maxRedirect)
1817+
1818+
// Invoke the HTTP request.
1819+
response, requestErr := httpRedirectDecorator.Invoke(httpRequest)
1820+
if requestErr != nil {
1821+
return nil, requestErr
1822+
}
1823+
1824+
// Create a response object based on the result.
1825+
return models.NewGetBucketChangesNotificationRegistrationSpectraS3Response(response)
1826+
}
1827+
1828+
func (client *Client) GetBucketChangesNotificationRegistrationsSpectraS3(request *models.GetBucketChangesNotificationRegistrationsSpectraS3Request) (*models.GetBucketChangesNotificationRegistrationsSpectraS3Response, error) {
1829+
// Build the http request
1830+
httpRequest, err := networking.NewHttpRequestBuilder().
1831+
WithHttpVerb(HTTP_VERB_GET).
1832+
WithPath("/_rest_/bucket_changes_notification_registration").
1833+
WithOptionalVoidQueryParam("last_page", request.LastPage).
1834+
WithOptionalQueryParam("page_length", networking.IntPtrToStrPtr(request.PageLength)).
1835+
WithOptionalQueryParam("page_offset", networking.IntPtrToStrPtr(request.PageOffset)).
1836+
WithOptionalQueryParam("page_start_marker", request.PageStartMarker).
1837+
WithOptionalQueryParam("user_id", request.UserId).
1838+
Build(client.connectionInfo)
1839+
1840+
if err != nil {
1841+
return nil, err
1842+
}
1843+
1844+
networkRetryDecorator := networking.NewNetworkRetryDecorator(client.sendNetwork, client.clientPolicy.maxRetries)
1845+
httpRedirectDecorator := networking.NewHttpTempRedirectDecorator(networkRetryDecorator, client.clientPolicy.maxRedirect)
1846+
1847+
// Invoke the HTTP request.
1848+
response, requestErr := httpRedirectDecorator.Invoke(httpRequest)
1849+
if requestErr != nil {
1850+
return nil, requestErr
1851+
}
1852+
1853+
// Create a response object based on the result.
1854+
return models.NewGetBucketChangesNotificationRegistrationsSpectraS3Response(response)
1855+
}
1856+
1857+
func (client *Client) GetBucketHistorySpectraS3(request *models.GetBucketHistorySpectraS3Request) (*models.GetBucketHistorySpectraS3Response, error) {
1858+
// Build the http request
1859+
httpRequest, err := networking.NewHttpRequestBuilder().
1860+
WithHttpVerb(HTTP_VERB_GET).
1861+
WithPath("/_rest_/bucket_history").
1862+
WithOptionalQueryParam("bucket_id", request.BucketId).
1863+
WithOptionalVoidQueryParam("last_page", request.LastPage).
1864+
WithOptionalQueryParam("min_sequence_number", networking.Int64PtrToStrPtr(request.MinSequenceNumber)).
1865+
WithOptionalQueryParam("page_length", networking.IntPtrToStrPtr(request.PageLength)).
1866+
WithOptionalQueryParam("page_offset", networking.IntPtrToStrPtr(request.PageOffset)).
1867+
WithOptionalQueryParam("page_start_marker", request.PageStartMarker).
1868+
Build(client.connectionInfo)
1869+
1870+
if err != nil {
1871+
return nil, err
1872+
}
1873+
1874+
networkRetryDecorator := networking.NewNetworkRetryDecorator(client.sendNetwork, client.clientPolicy.maxRetries)
1875+
httpRedirectDecorator := networking.NewHttpTempRedirectDecorator(networkRetryDecorator, client.clientPolicy.maxRedirect)
1876+
1877+
// Invoke the HTTP request.
1878+
response, requestErr := httpRedirectDecorator.Invoke(httpRequest)
1879+
if requestErr != nil {
1880+
return nil, requestErr
1881+
}
1882+
1883+
// Create a response object based on the result.
1884+
return models.NewGetBucketHistorySpectraS3Response(response)
1885+
}
1886+
18031887
func (client *Client) GetDs3TargetFailureNotificationRegistrationSpectraS3(request *models.GetDs3TargetFailureNotificationRegistrationSpectraS3Request) (*models.GetDs3TargetFailureNotificationRegistrationSpectraS3Response, error) {
18041888
// Build the http request
18051889
httpRequest, err := networking.NewHttpRequestBuilder().
@@ -3209,6 +3293,7 @@ func (client *Client) GetTapeDrivesSpectraS3(request *models.GetTapeDrivesSpectr
32093293
WithHttpVerb(HTTP_VERB_GET).
32103294
WithPath("/_rest_/tape_drive").
32113295
WithOptionalVoidQueryParam("last_page", request.LastPage).
3296+
WithOptionalQueryParam("minimum_task_priority", networking.InterfaceToStrPtr(request.MinimumTaskPriority)).
32123297
WithOptionalQueryParam("page_length", networking.IntPtrToStrPtr(request.PageLength)).
32133298
WithOptionalQueryParam("page_offset", networking.IntPtrToStrPtr(request.PageOffset)).
32143299
WithOptionalQueryParam("page_start_marker", request.PageStartMarker).
@@ -4118,6 +4203,7 @@ func (client *Client) GetS3TargetsSpectraS3(request *models.GetS3TargetsSpectraS
41184203
WithOptionalQueryParam("https", networking.BoolPtrToStrPtr(request.Https)).
41194204
WithOptionalVoidQueryParam("last_page", request.LastPage).
41204205
WithOptionalQueryParam("name", request.Name).
4206+
WithOptionalQueryParam("naming_mode", networking.InterfaceToStrPtr(request.NamingMode)).
41214207
WithOptionalQueryParam("page_length", networking.IntPtrToStrPtr(request.PageLength)).
41224208
WithOptionalQueryParam("page_offset", networking.IntPtrToStrPtr(request.PageOffset)).
41234209
WithOptionalQueryParam("page_start_marker", request.PageStartMarker).

ds3/ds3Heads.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ func (client *Client) HeadObject(request *models.HeadObjectRequest) (*models.Hea
4646
httpRequest, err := networking.NewHttpRequestBuilder().
4747
WithHttpVerb(HTTP_VERB_HEAD).
4848
WithPath("/" + request.BucketName + "/" + request.ObjectName).
49+
WithOptionalQueryParam("version_id", request.VersionId).
4950
Build(client.connectionInfo)
5051

5152
if err != nil {

ds3/ds3Posts.go

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,34 @@ import (
1818
"github.com/SpectraLogic/ds3_go_sdk/ds3/networking"
1919
)
2020

21+
func (client *Client) CompleteBlob(request *models.CompleteBlobRequest) (*models.CompleteBlobResponse, error) {
22+
// Build the http request
23+
httpRequest, err := networking.NewHttpRequestBuilder().
24+
WithHttpVerb(HTTP_VERB_POST).
25+
WithPath("/" + request.BucketName + "/" + request.ObjectName).
26+
WithQueryParam("blob", request.Blob).
27+
WithQueryParam("job", request.Job).
28+
WithOptionalQueryParam("size", networking.Int64PtrToStrPtr(request.Size)).
29+
WithChecksum(request.Checksum).
30+
WithHeaders(request.Metadata).
31+
Build(client.connectionInfo)
32+
33+
if err != nil {
34+
return nil, err
35+
}
36+
37+
networkRetryDecorator := networking.NewNetworkRetryDecorator(client.sendNetwork, client.clientPolicy.maxRetries)
38+
39+
// Invoke the HTTP request.
40+
response, requestErr := networkRetryDecorator.Invoke(httpRequest)
41+
if requestErr != nil {
42+
return nil, requestErr
43+
}
44+
45+
// Create a response object based on the result.
46+
return models.NewCompleteBlobResponse(response)
47+
}
48+
2149
func (client *Client) CompleteMultiPartUpload(request *models.CompleteMultiPartUploadRequest) (*models.CompleteMultiPartUploadResponse, error) {
2250
// Build the http request
2351
httpRequest, err := networking.NewHttpRequestBuilder().
@@ -570,6 +598,34 @@ func (client *Client) PutAzureTargetFailureNotificationRegistrationSpectraS3(req
570598
return models.NewPutAzureTargetFailureNotificationRegistrationSpectraS3Response(response)
571599
}
572600

601+
func (client *Client) PutBucketChangesNotificationRegistrationSpectraS3(request *models.PutBucketChangesNotificationRegistrationSpectraS3Request) (*models.PutBucketChangesNotificationRegistrationSpectraS3Response, error) {
602+
// Build the http request
603+
httpRequest, err := networking.NewHttpRequestBuilder().
604+
WithHttpVerb(HTTP_VERB_POST).
605+
WithPath("/_rest_/bucket_changes_notification_registration").
606+
WithQueryParam("notification_end_point", request.NotificationEndPoint).
607+
WithOptionalQueryParam("bucket_id", request.BucketId).
608+
WithOptionalQueryParam("format", networking.InterfaceToStrPtr(request.Format)).
609+
WithOptionalQueryParam("naming_convention", networking.InterfaceToStrPtr(request.NamingConvention)).
610+
WithOptionalQueryParam("notification_http_method", networking.InterfaceToStrPtr(request.NotificationHttpMethod)).
611+
Build(client.connectionInfo)
612+
613+
if err != nil {
614+
return nil, err
615+
}
616+
617+
networkRetryDecorator := networking.NewNetworkRetryDecorator(client.sendNetwork, client.clientPolicy.maxRetries)
618+
619+
// Invoke the HTTP request.
620+
response, requestErr := networkRetryDecorator.Invoke(httpRequest)
621+
if requestErr != nil {
622+
return nil, requestErr
623+
}
624+
625+
// Create a response object based on the result.
626+
return models.NewPutBucketChangesNotificationRegistrationSpectraS3Response(response)
627+
}
628+
573629
func (client *Client) PutDs3TargetFailureNotificationRegistrationSpectraS3(request *models.PutDs3TargetFailureNotificationRegistrationSpectraS3Request) (*models.PutDs3TargetFailureNotificationRegistrationSpectraS3Response, error) {
574630
// Build the http request
575631
httpRequest, err := networking.NewHttpRequestBuilder().
@@ -1276,6 +1332,7 @@ func (client *Client) RegisterS3TargetSpectraS3(request *models.RegisterS3Target
12761332
WithOptionalQueryParam("data_path_end_point", request.DataPathEndPoint).
12771333
WithOptionalQueryParam("default_read_preference", networking.InterfaceToStrPtr(request.DefaultReadPreference)).
12781334
WithOptionalQueryParam("https", networking.BoolPtrToStrPtr(request.Https)).
1335+
WithOptionalQueryParam("naming_mode", networking.InterfaceToStrPtr(request.NamingMode)).
12791336
WithOptionalQueryParam("offline_data_staging_window_in_tb", networking.IntPtrToStrPtr(request.OfflineDataStagingWindowInTb)).
12801337
WithOptionalQueryParam("permit_going_out_of_sync", networking.BoolPtrToStrPtr(request.PermitGoingOutOfSync)).
12811338
WithOptionalQueryParam("proxy_domain", request.ProxyDomain).
@@ -1284,6 +1341,7 @@ func (client *Client) RegisterS3TargetSpectraS3(request *models.RegisterS3Target
12841341
WithOptionalQueryParam("proxy_port", networking.IntPtrToStrPtr(request.ProxyPort)).
12851342
WithOptionalQueryParam("proxy_username", request.ProxyUsername).
12861343
WithOptionalQueryParam("region", networking.InterfaceToStrPtr(request.Region)).
1344+
WithOptionalQueryParam("restricted_access", networking.BoolPtrToStrPtr(request.RestrictedAccess)).
12871345
WithOptionalQueryParam("staged_data_expiration_in_days", networking.IntPtrToStrPtr(request.StagedDataExpirationInDays)).
12881346
Build(client.connectionInfo)
12891347

@@ -1309,6 +1367,7 @@ func (client *Client) DelegateCreateUserSpectraS3(request *models.DelegateCreate
13091367
WithHttpVerb(HTTP_VERB_POST).
13101368
WithPath("/_rest_/user").
13111369
WithQueryParam("name", request.Name).
1370+
WithOptionalQueryParam("default_data_policy_id", request.DefaultDataPolicyId).
13121371
WithOptionalQueryParam("id", request.Id).
13131372
WithOptionalQueryParam("max_buckets", networking.IntPtrToStrPtr(request.MaxBuckets)).
13141373
WithOptionalQueryParam("secret_key", request.SecretKey).

ds3/ds3Puts.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -613,6 +613,7 @@ func (client *Client) PutBulkJobSpectraS3(request *models.PutBulkJobSpectraS3Req
613613
WithOptionalQueryParam("max_upload_size", networking.Int64PtrToStrPtr(request.MaxUploadSize)).
614614
WithOptionalQueryParam("minimize_spanning_across_media", networking.BoolPtrToStrPtr(request.MinimizeSpanningAcrossMedia)).
615615
WithOptionalQueryParam("name", request.Name).
616+
WithOptionalVoidQueryParam("pre_allocate_job_space", request.PreAllocateJobSpace).
616617
WithOptionalQueryParam("priority", networking.InterfaceToStrPtr(request.Priority)).
617618
WithOptionalQueryParam("verify_after_write", networking.BoolPtrToStrPtr(request.VerifyAfterWrite)).
618619
WithQueryParam("operation", "start_bulk_put").
@@ -2039,6 +2040,7 @@ func (client *Client) ModifyTapeDriveSpectraS3(request *models.ModifyTapeDriveSp
20392040
httpRequest, err := networking.NewHttpRequestBuilder().
20402041
WithHttpVerb(HTTP_VERB_PUT).
20412042
WithPath("/_rest_/tape_drive/" + request.TapeDriveId).
2043+
WithOptionalQueryParam("minimum_task_priority", networking.InterfaceToStrPtr(request.MinimumTaskPriority)).
20422044
WithOptionalQueryParam("quiesced", networking.InterfaceToStrPtr(request.Quiesced)).
20432045
WithOptionalQueryParam("reserved_task_type", networking.InterfaceToStrPtr(request.ReservedTaskType)).
20442046
Build(client.connectionInfo)
@@ -2584,6 +2586,7 @@ func (client *Client) ModifyS3TargetSpectraS3(request *models.ModifyS3TargetSpec
25842586
WithOptionalQueryParam("default_read_preference", networking.InterfaceToStrPtr(request.DefaultReadPreference)).
25852587
WithOptionalQueryParam("https", networking.BoolPtrToStrPtr(request.Https)).
25862588
WithOptionalQueryParam("name", request.Name).
2589+
WithOptionalQueryParam("naming_mode", networking.InterfaceToStrPtr(request.NamingMode)).
25872590
WithOptionalQueryParam("offline_data_staging_window_in_tb", networking.IntPtrToStrPtr(request.OfflineDataStagingWindowInTb)).
25882591
WithOptionalQueryParam("permit_going_out_of_sync", networking.BoolPtrToStrPtr(request.PermitGoingOutOfSync)).
25892592
WithOptionalQueryParam("proxy_domain", request.ProxyDomain).
@@ -2593,6 +2596,7 @@ func (client *Client) ModifyS3TargetSpectraS3(request *models.ModifyS3TargetSpec
25932596
WithOptionalQueryParam("proxy_username", request.ProxyUsername).
25942597
WithOptionalQueryParam("quiesced", networking.InterfaceToStrPtr(request.Quiesced)).
25952598
WithOptionalQueryParam("region", networking.InterfaceToStrPtr(request.Region)).
2599+
WithOptionalQueryParam("restricted_access", networking.BoolPtrToStrPtr(request.RestrictedAccess)).
25962600
WithOptionalQueryParam("secret_key", request.SecretKey).
25972601
WithOptionalQueryParam("staged_data_expiration_in_days", networking.IntPtrToStrPtr(request.StagedDataExpirationInDays)).
25982602
Build(client.connectionInfo)

0 commit comments

Comments
 (0)