Skip to content

Commit

Permalink
Updated to BP API 5.3.1 (#590)
Browse files Browse the repository at this point in the history
  • Loading branch information
RachelTucker authored May 19, 2021
1 parent 6b43a95 commit c98b59b
Show file tree
Hide file tree
Showing 18 changed files with 310 additions and 3 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ plugins {

allprojects {
group = 'com.spectralogic.ds3'
version = '5.2.0'
version = '5.3.0'
}

subprojects {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2050,6 +2050,13 @@ InspectAllTapesSpectraS3Response inspectAllTapesSpectraS3(final InspectAllTapesS
InspectTapeSpectraS3Response inspectTapeSpectraS3(final InspectTapeSpectraS3Request request)
throws IOException;

@ResponsePayloadModel("Tape")
@Action("MODIFY")
@Resource("TAPE")

MarkTapeForCompactionSpectraS3Response markTapeForCompactionSpectraS3(final MarkTapeForCompactionSpectraS3Request request)
throws IOException;

@Action("BULK_MODIFY")
@Resource("TAPE_PARTITION")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1258,6 +1258,10 @@ public InspectTapeSpectraS3Response inspectTapeSpectraS3(final InspectTapeSpectr
return new InspectTapeSpectraS3ResponseParser().response(this.netClient.getResponse(request));
}
@Override
public MarkTapeForCompactionSpectraS3Response markTapeForCompactionSpectraS3(final MarkTapeForCompactionSpectraS3Request request) throws IOException {
return new MarkTapeForCompactionSpectraS3ResponseParser().response(this.netClient.getResponse(request));
}
@Override
public ModifyAllTapePartitionsSpectraS3Response modifyAllTapePartitionsSpectraS3(final ModifyAllTapePartitionsSpectraS3Request request) throws IOException {
return new ModifyAllTapePartitionsSpectraS3ResponseParser().response(this.netClient.getResponse(request));
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/*
* ******************************************************************************
* Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use
* this file except in compliance with the License. A copy of the License is located at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* or in the "license" file accompanying this file.
* This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
* ****************************************************************************
*/

// This code is auto-generated, do not modify
package com.spectralogic.ds3client.commands.parsers;

import com.spectralogic.ds3client.commands.parsers.interfaces.AbstractResponseParser;
import com.spectralogic.ds3client.commands.parsers.utils.ResponseParserUtils;
import com.spectralogic.ds3client.commands.spectrads3.MarkTapeForCompactionSpectraS3Response;
import com.spectralogic.ds3client.models.Tape;
import com.spectralogic.ds3client.networking.WebResponse;
import com.spectralogic.ds3client.serializer.XmlOutput;
import java.io.IOException;
import java.io.InputStream;

public class MarkTapeForCompactionSpectraS3ResponseParser extends AbstractResponseParser<MarkTapeForCompactionSpectraS3Response> {
private final int[] expectedStatusCodes = new int[]{200};

@Override
public MarkTapeForCompactionSpectraS3Response parseXmlResponse(final WebResponse response) throws IOException {
final int statusCode = response.getStatusCode();
if (ResponseParserUtils.validateStatusCode(statusCode, expectedStatusCodes)) {
switch (statusCode) {
case 200:
try (final InputStream inputStream = response.getResponseStream()) {
final Tape result = XmlOutput.fromXml(inputStream, Tape.class);
return new MarkTapeForCompactionSpectraS3Response(result, this.getChecksum(), this.getChecksumType());
}

default:
assert false: "validateStatusCode should have made it impossible to reach this line";
}
}

throw ResponseParserUtils.createFailedRequest(response, expectedStatusCodes);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
/*
* ******************************************************************************
* Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use
* this file except in compliance with the License. A copy of the License is located at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* or in the "license" file accompanying this file.
* This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
* ****************************************************************************
*/

// This code is auto-generated, do not modify
package com.spectralogic.ds3client.commands.spectrads3;

import com.spectralogic.ds3client.networking.HttpVerb;
import com.spectralogic.ds3client.commands.interfaces.AbstractRequest;
import java.util.UUID;
import com.google.common.net.UrlEscapers;

public class MarkTapeForCompactionSpectraS3Request extends AbstractRequest {

// Variables

private final String tapeId;

// Constructor


public MarkTapeForCompactionSpectraS3Request(final UUID tapeId) {
this.tapeId = tapeId.toString();

this.getQueryParams().put("operation", "mark_for_compaction");

}


public MarkTapeForCompactionSpectraS3Request(final String tapeId) {
this.tapeId = tapeId;

this.getQueryParams().put("operation", "mark_for_compaction");

}


@Override
public HttpVerb getVerb() {
return HttpVerb.PUT;
}

@Override
public String getPath() {
return "/_rest_/tape/" + tapeId;
}

public String getTapeId() {
return this.tapeId;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* ******************************************************************************
* Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use
* this file except in compliance with the License. A copy of the License is located at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* or in the "license" file accompanying this file.
* This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
* ****************************************************************************
*/

// This code is auto-generated, do not modify
package com.spectralogic.ds3client.commands.spectrads3;

import com.spectralogic.ds3client.models.Tape;
import com.spectralogic.ds3client.models.ChecksumType;
import com.spectralogic.ds3client.commands.interfaces.AbstractResponse;

public class MarkTapeForCompactionSpectraS3Response extends AbstractResponse {

private final Tape tapeResult;

public MarkTapeForCompactionSpectraS3Response(final Tape tapeResult, final String checksum, final ChecksumType.Type checksumType) {
super(checksum, checksumType);
this.tapeResult = tapeResult;
}

public Tape getTapeResult() {
return this.tapeResult;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import com.spectralogic.ds3client.networking.HttpVerb;
import com.spectralogic.ds3client.commands.interfaces.AbstractRequest;
import java.lang.Integer;
import com.spectralogic.ds3client.models.Priority;
import com.spectralogic.ds3client.models.Quiesced;
import com.spectralogic.ds3client.models.ReservedTaskType;
Expand All @@ -30,6 +31,8 @@ public class ModifyTapeDriveSpectraS3Request extends AbstractRequest {

private final String tapeDriveId;

private Integer maxFailedTapes;

private Priority minimumTaskPriority;

private Quiesced quiesced;
Expand All @@ -50,6 +53,13 @@ public ModifyTapeDriveSpectraS3Request(final String tapeDriveId) {

}

public ModifyTapeDriveSpectraS3Request withMaxFailedTapes(final Integer maxFailedTapes) {
this.maxFailedTapes = maxFailedTapes;
this.updateQueryParam("max_failed_tapes", maxFailedTapes);
return this;
}


public ModifyTapeDriveSpectraS3Request withMinimumTaskPriority(final Priority minimumTaskPriority) {
this.minimumTaskPriority = minimumTaskPriority;
this.updateQueryParam("minimum_task_priority", minimumTaskPriority);
Expand Down Expand Up @@ -87,6 +97,11 @@ public String getTapeDriveId() {
}


public Integer getMaxFailedTapes() {
return this.maxFailedTapes;
}


public Priority getMinimumTaskPriority() {
return this.minimumTaskPriority;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import com.spectralogic.ds3client.networking.HttpVerb;
import com.spectralogic.ds3client.commands.interfaces.AbstractRequest;
import java.lang.Integer;
import com.spectralogic.ds3client.models.Quiesced;
import com.google.common.net.UrlEscapers;

Expand All @@ -29,6 +30,10 @@ public class ModifyTapePartitionSpectraS3Request extends AbstractRequest {

private boolean autoCompactionEnabled;

private boolean autoQuiesceEnabled;

private Integer driveIdleTimeoutInMinutes;

private int minimumReadReservedDrives;

private int minimumWriteReservedDrives;
Expand All @@ -52,6 +57,20 @@ public ModifyTapePartitionSpectraS3Request withAutoCompactionEnabled(final boole
}


public ModifyTapePartitionSpectraS3Request withAutoQuiesceEnabled(final boolean autoQuiesceEnabled) {
this.autoQuiesceEnabled = autoQuiesceEnabled;
this.updateQueryParam("auto_quiesce_enabled", autoQuiesceEnabled);
return this;
}


public ModifyTapePartitionSpectraS3Request withDriveIdleTimeoutInMinutes(final Integer driveIdleTimeoutInMinutes) {
this.driveIdleTimeoutInMinutes = driveIdleTimeoutInMinutes;
this.updateQueryParam("drive_idle_timeout_in_minutes", driveIdleTimeoutInMinutes);
return this;
}


public ModifyTapePartitionSpectraS3Request withMinimumReadReservedDrives(final int minimumReadReservedDrives) {
this.minimumReadReservedDrives = minimumReadReservedDrives;
this.updateQueryParam("minimum_read_reserved_drives", minimumReadReservedDrives);
Expand Down Expand Up @@ -101,6 +120,16 @@ public boolean getAutoCompactionEnabled() {
}


public boolean getAutoQuiesceEnabled() {
return this.autoQuiesceEnabled;
}


public Integer getDriveIdleTimeoutInMinutes() {
return this.driveIdleTimeoutInMinutes;
}


public int getMinimumReadReservedDrives() {
return this.minimumReadReservedDrives;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ public class CacheFilesystemInformation {
@JacksonXmlElementWrapper(useWrapping = false)
private List<CacheEntryInformation> entries = new ArrayList<>();

@JsonProperty("JobLockedCacheInBytes")
private long jobLockedCacheInBytes;

@JsonProperty("Summary")
private String summary;

Expand Down Expand Up @@ -82,6 +85,15 @@ public void setEntries(final List<CacheEntryInformation> entries) {
}


public long getJobLockedCacheInBytes() {
return this.jobLockedCacheInBytes;
}

public void setJobLockedCacheInBytes(final long jobLockedCacheInBytes) {
this.jobLockedCacheInBytes = jobLockedCacheInBytes;
}


public String getSummary() {
return this.summary;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ public class DetailedTapePartition {
@JsonProperty("AutoCompactionEnabled")
private boolean autoCompactionEnabled;

@JsonProperty("AutoQuiesceEnabled")
private boolean autoQuiesceEnabled;

@JsonProperty("DriveIdleTimeoutInMinutes")
private Integer driveIdleTimeoutInMinutes;

@JsonProperty("DriveType")
private TapeDriveType driveType;

Expand Down Expand Up @@ -87,6 +93,24 @@ public void setAutoCompactionEnabled(final boolean autoCompactionEnabled) {
}


public boolean getAutoQuiesceEnabled() {
return this.autoQuiesceEnabled;
}

public void setAutoQuiesceEnabled(final boolean autoQuiesceEnabled) {
this.autoQuiesceEnabled = autoQuiesceEnabled;
}


public Integer getDriveIdleTimeoutInMinutes() {
return this.driveIdleTimeoutInMinutes;
}

public void setDriveIdleTimeoutInMinutes(final Integer driveIdleTimeoutInMinutes) {
this.driveIdleTimeoutInMinutes = driveIdleTimeoutInMinutes;
}


public TapeDriveType getDriveType() {
return this.driveType;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;

import java.io.Serializable;

@JacksonXmlRootElement(namespace = "Error")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ public class NamedDetailedTapePartition {
@JsonProperty("AutoCompactionEnabled")
private boolean autoCompactionEnabled;

@JsonProperty("AutoQuiesceEnabled")
private boolean autoQuiesceEnabled;

@JsonProperty("DriveIdleTimeoutInMinutes")
private Integer driveIdleTimeoutInMinutes;

@JsonProperty("DriveType")
private TapeDriveType driveType;

Expand Down Expand Up @@ -87,6 +93,24 @@ public void setAutoCompactionEnabled(final boolean autoCompactionEnabled) {
}


public boolean getAutoQuiesceEnabled() {
return this.autoQuiesceEnabled;
}

public void setAutoQuiesceEnabled(final boolean autoQuiesceEnabled) {
this.autoQuiesceEnabled = autoQuiesceEnabled;
}


public Integer getDriveIdleTimeoutInMinutes() {
return this.driveIdleTimeoutInMinutes;
}

public void setDriveIdleTimeoutInMinutes(final Integer driveIdleTimeoutInMinutes) {
this.driveIdleTimeoutInMinutes = driveIdleTimeoutInMinutes;
}


public TapeDriveType getDriveType() {
return this.driveType;
}
Expand Down
Loading

0 comments on commit c98b59b

Please sign in to comment.