Skip to content

Commit 24b2582

Browse files
author
shabtaisharon
authored
Merge pull request #56 from RachelTucker/merge_4_1
Merging 4.1 API into master branch
2 parents 7158bb2 + 7b1f263 commit 24b2582

22 files changed

+217
-3
lines changed

ds3/ds3Client_test.go

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1911,3 +1911,31 @@ func TestVerifyPhysicalPlacementForObjectsWithFullDetailsSpectraS3(t *testing.T)
19111911
}
19121912
ds3Testing.AssertBool(t, "WriteProtected", false, tape.WriteProtected)
19131913
}
1914+
1915+
func TestHeadObject(t *testing.T) {
1916+
bucketName := "bucket1"
1917+
objectName := "obj1"
1918+
1919+
responseHeaders := &http.Header{}
1920+
responseHeaders.Add("x-amz-meta-key", "value")
1921+
responseHeaders.Add("ds3-blob-checksum-type", "MD5")
1922+
responseHeaders.Add("ds3-blob-checksum-offset-0", "4nQGNX4nyz0pi8Hvap79PQ==")
1923+
responseHeaders.Add("ds3-blob-checksum-offset-10485760", "965Aa0/n8DlO1IwXYFh4bg==")
1924+
responseHeaders.Add("ds3-blob-checksum-offset-20971520", "iV2OqJaXJ/jmqgRSb1HmFA==")
1925+
1926+
response, err := mockedClient(t).
1927+
Expecting(HTTP_VERB_HEAD, "/" + bucketName + "/" + objectName, &url.Values{}, &http.Header{}, nil).
1928+
Returning(200, "", responseHeaders).
1929+
HeadObject(models.NewHeadObjectRequest(bucketName, objectName))
1930+
1931+
ds3Testing.AssertNilError(t, err)
1932+
1933+
if response.BlobChecksumType != models.CHECKSUM_TYPE_MD5 {
1934+
t.Fatalf("Expected checksum type to be 'MD5' but was '%s'.", response.BlobChecksumType.String())
1935+
}
1936+
1937+
ds3Testing.AssertInt(t, "# of blob checksums", 3, len(response.BlobChecksums))
1938+
ds3Testing.AssertString(t, "checksum at offset '0'", "4nQGNX4nyz0pi8Hvap79PQ==", response.BlobChecksums[0])
1939+
ds3Testing.AssertString(t, "checksum at offset '10485760'", "965Aa0/n8DlO1IwXYFh4bg==", response.BlobChecksums[10485760])
1940+
ds3Testing.AssertString(t, "checksum at offset '20971520'", "iV2OqJaXJ/jmqgRSb1HmFA==", response.BlobChecksums[20971520])
1941+
}

ds3/ds3Deletes.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,7 @@ func (client *Client) ClearSuspectBlobDs3TargetsSpectraS3(request *models.ClearS
305305
WithHttpVerb(HTTP_VERB_DELETE).
306306
WithPath("/_rest_/suspect_blob_ds3_target").
307307
WithOptionalVoidQueryParam("force", request.Force).
308+
WithReadCloser(buildIdListPayload(request.Ids)).
308309
Build(client.connectionInfo)
309310

310311
if err != nil {

ds3/ds3Gets.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3205,6 +3205,7 @@ func (client *Client) GetTapeDrivesSpectraS3(request *models.GetTapeDrivesSpectr
32053205
WithOptionalQueryParam("page_offset", networking.IntPtrToStrPtr(request.PageOffset)).
32063206
WithOptionalQueryParam("page_start_marker", request.PageStartMarker).
32073207
WithOptionalQueryParam("partition_id", request.PartitionId).
3208+
WithOptionalQueryParam("reserved_task_type", networking.InterfaceToStrPtr(request.ReservedTaskType)).
32083209
WithOptionalQueryParam("serial_number", request.SerialNumber).
32093210
WithOptionalQueryParam("state", networking.InterfaceToStrPtr(request.State)).
32103211
WithOptionalQueryParam("type", networking.InterfaceToStrPtr(request.TapeDriveType)).

ds3/ds3Puts.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,10 @@ func (client *Client) ModifyDataPathBackendSpectraS3(request *models.ModifyDataP
178178
WithHttpVerb(HTTP_VERB_PUT).
179179
WithPath("/_rest_/data_path_backend").
180180
WithOptionalQueryParam("activated", networking.BoolPtrToStrPtr(request.Activated)).
181+
WithOptionalQueryParam("allow_new_job_requests", networking.BoolPtrToStrPtr(request.AllowNewJobRequests)).
181182
WithOptionalQueryParam("auto_activate_timeout_in_mins", networking.IntPtrToStrPtr(request.AutoActivateTimeoutInMins)).
182183
WithOptionalQueryParam("auto_inspect", networking.InterfaceToStrPtr(request.AutoInspect)).
184+
WithOptionalQueryParam("cache_available_retry_after_in_seconds", networking.IntPtrToStrPtr(request.CacheAvailableRetryAfterInSeconds)).
183185
WithOptionalQueryParam("default_import_conflict_resolution_mode", networking.InterfaceToStrPtr(request.DefaultImportConflictResolutionMode)).
184186
WithOptionalQueryParam("default_verify_data_after_import", networking.InterfaceToStrPtr(request.DefaultVerifyDataAfterImport)).
185187
WithOptionalQueryParam("default_verify_data_prior_to_import", networking.BoolPtrToStrPtr(request.DefaultVerifyDataPriorToImport)).
@@ -1986,6 +1988,7 @@ func (client *Client) ModifyTapeDriveSpectraS3(request *models.ModifyTapeDriveSp
19861988
WithHttpVerb(HTTP_VERB_PUT).
19871989
WithPath("/_rest_/tape_drive/" + request.TapeDriveId).
19881990
WithOptionalQueryParam("quiesced", networking.InterfaceToStrPtr(request.Quiesced)).
1991+
WithOptionalQueryParam("reserved_task_type", networking.InterfaceToStrPtr(request.ReservedTaskType)).
19891992
Build(client.connectionInfo)
19901993

19911994
if err != nil {
@@ -2009,6 +2012,8 @@ func (client *Client) ModifyTapePartitionSpectraS3(request *models.ModifyTapePar
20092012
httpRequest, err := networking.NewHttpRequestBuilder().
20102013
WithHttpVerb(HTTP_VERB_PUT).
20112014
WithPath("/_rest_/tape_partition/" + request.TapePartition).
2015+
WithOptionalQueryParam("minimum_read_reserved_drives", networking.IntPtrToStrPtr(request.MinimumReadReservedDrives)).
2016+
WithOptionalQueryParam("minimum_write_reserved_drives", networking.IntPtrToStrPtr(request.MinimumWriteReservedDrives)).
20122017
WithOptionalQueryParam("quiesced", networking.InterfaceToStrPtr(request.Quiesced)).
20132018
Build(client.connectionInfo)
20142019

ds3/models/clearSuspectBlobDs3TargetsSpectraS3Request.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,12 @@ package models
1515

1616
type ClearSuspectBlobDs3TargetsSpectraS3Request struct {
1717
Force bool
18+
Ids []string
1819
}
1920

20-
func NewClearSuspectBlobDs3TargetsSpectraS3Request() *ClearSuspectBlobDs3TargetsSpectraS3Request {
21+
func NewClearSuspectBlobDs3TargetsSpectraS3Request(ids []string) *ClearSuspectBlobDs3TargetsSpectraS3Request {
2122
return &ClearSuspectBlobDs3TargetsSpectraS3Request{
23+
Ids: ids,
2224
}
2325
}
2426

ds3/models/dataPathBackend.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@ package models
1515

1616
type DataPathBackend struct {
1717
Activated bool
18+
AllowNewJobRequests bool
1819
AutoActivateTimeoutInMins *int
1920
AutoInspect AutoInspectMode
21+
CacheAvailableRetryAfterInSeconds int
2022
DefaultImportConflictResolutionMode ImportConflictResolutionMode
2123
DefaultVerifyDataAfterImport *Priority
2224
DefaultVerifyDataPriorToImport bool

ds3/models/dataPathBackendParser.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,14 @@ func (dataPathBackend *DataPathBackend) parse(xmlNode *XmlNode, aggErr *Aggregat
2222
switch child.XMLName.Local {
2323
case "Activated":
2424
dataPathBackend.Activated = parseBool(child.Content, aggErr)
25+
case "AllowNewJobRequests":
26+
dataPathBackend.AllowNewJobRequests = parseBool(child.Content, aggErr)
2527
case "AutoActivateTimeoutInMins":
2628
dataPathBackend.AutoActivateTimeoutInMins = parseNullableInt(child.Content, aggErr)
2729
case "AutoInspect":
2830
parseEnum(child.Content, &dataPathBackend.AutoInspect, aggErr)
31+
case "CacheAvailableRetryAfterInSeconds":
32+
dataPathBackend.CacheAvailableRetryAfterInSeconds = parseInt(child.Content, aggErr)
2933
case "DefaultImportConflictResolutionMode":
3034
parseEnum(child.Content, &dataPathBackend.DefaultImportConflictResolutionMode, aggErr)
3135
case "DefaultVerifyDataAfterImport":

ds3/models/detailedTapePartition.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ type DetailedTapePartition struct {
2020
Id string
2121
ImportExportConfiguration ImportExportConfiguration
2222
LibraryId string
23+
MinimumReadReservedDrives int
24+
MinimumWriteReservedDrives int
2325
Name *string
2426
Quiesced Quiesced
2527
SerialId *string

ds3/models/detailedTapePartitionParser.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ func (detailedTapePartition *DetailedTapePartition) parse(xmlNode *XmlNode, aggE
3434
parseEnum(child.Content, &detailedTapePartition.ImportExportConfiguration, aggErr)
3535
case "LibraryId":
3636
detailedTapePartition.LibraryId = parseString(child.Content)
37+
case "MinimumReadReservedDrives":
38+
detailedTapePartition.MinimumReadReservedDrives = parseInt(child.Content, aggErr)
39+
case "MinimumWriteReservedDrives":
40+
detailedTapePartition.MinimumWriteReservedDrives = parseInt(child.Content, aggErr)
3741
case "Name":
3842
detailedTapePartition.Name = parseNullableString(child.Content)
3943
case "Quiesced":

ds3/models/getTapeDrivesSpectraS3Request.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ type GetTapeDrivesSpectraS3Request struct {
1919
PageOffset *int
2020
PageStartMarker *string
2121
PartitionId *string
22+
ReservedTaskType ReservedTaskType
2223
SerialNumber *string
2324
State TapeDriveState
2425
TapeDriveType TapeDriveType
@@ -54,6 +55,11 @@ func (getTapeDrivesSpectraS3Request *GetTapeDrivesSpectraS3Request) WithPartitio
5455
return getTapeDrivesSpectraS3Request
5556
}
5657

58+
func (getTapeDrivesSpectraS3Request *GetTapeDrivesSpectraS3Request) WithReservedTaskType(reservedTaskType ReservedTaskType) *GetTapeDrivesSpectraS3Request {
59+
getTapeDrivesSpectraS3Request.ReservedTaskType = reservedTaskType
60+
return getTapeDrivesSpectraS3Request
61+
}
62+
5763
func (getTapeDrivesSpectraS3Request *GetTapeDrivesSpectraS3Request) WithSerialNumber(serialNumber string) *GetTapeDrivesSpectraS3Request {
5864
getTapeDrivesSpectraS3Request.SerialNumber = &serialNumber
5965
return getTapeDrivesSpectraS3Request

0 commit comments

Comments
 (0)