Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
import feign.QueryMap;
import feign.RequestLine;
import org.apache.cloudstack.storage.feign.model.CliSnapshotRestoreRequest;
import org.apache.cloudstack.storage.feign.model.ConsistencyGroup;
import org.apache.cloudstack.storage.feign.model.ConsistencyGroupSnapshot;
import org.apache.cloudstack.storage.feign.model.FlexVolSnapshot;
import org.apache.cloudstack.storage.feign.model.SnapshotFileRestoreRequest;
import org.apache.cloudstack.storage.feign.model.response.JobResponse;
Expand Down Expand Up @@ -181,4 +183,96 @@ JobResponse restoreFileFromSnapshot(@Param("authHeader") String authHeader,
@Headers({"Authorization: {authHeader}", "Content-Type: application/json"})
JobResponse restoreFileFromSnapshotCli(@Param("authHeader") String authHeader,
CliSnapshotRestoreRequest request);

/**
* Creates a consistency group.
*
* <p>ONTAP REST: {@code POST /api/application/consistency-groups}</p>
*
* @param authHeader Basic auth header
* @param request consistency group create request body
* @return JobResponse containing the async job reference
*/
@RequestLine("POST /api/application/consistency-groups")
@Headers({"Authorization: {authHeader}", "Content-Type: application/json"})
JobResponse createConsistencyGroup(@Param("authHeader") String authHeader,
Comment thread
rajiv-jain-netapp marked this conversation as resolved.
ConsistencyGroup request);

/**
* Lists consistency groups.
*
* <p>ONTAP REST: {@code GET /api/application/consistency-groups}</p>
*
* @param authHeader Basic auth header
* @param queryParams Optional query parameters
* @return Paginated consistency group records
*/
@RequestLine("GET /api/application/consistency-groups")
@Headers({"Authorization: {authHeader}"})
OntapResponse<ConsistencyGroup> getConsistencyGroups(@Param("authHeader") String authHeader,
@QueryMap Map<String, Object> queryParams);

/**
* Creates (starts) a consistency group snapshot.
*
* <p>ONTAP REST: {@code POST /api/application/consistency-groups/{cgUuid}/snapshots}</p>
*
* @param authHeader Basic auth header
* @param cgUuid consistency group UUID
* @param request snapshot start request body
* @return JobResponse containing the async job reference
*/
@RequestLine("POST /api/application/consistency-groups/{cgUuid}/snapshots")
@Headers({"Authorization: {authHeader}", "Content-Type: application/json"})
JobResponse createConsistencyGroupSnapshot(@Param("authHeader") String authHeader,
Comment thread
rajiv-jain-netapp marked this conversation as resolved.
@Param("cgUuid") String cgUuid,
ConsistencyGroupSnapshot request);

/**
* Lists snapshots for a consistency group.
*
* <p>ONTAP REST: {@code GET /api/application/consistency-groups/{cgUuid}/snapshots}</p>
*
* @param authHeader Basic auth header
* @param cgUuid consistency group UUID
* @param queryParams Optional query parameters
* @return Paginated consistency group snapshot records
*/
@RequestLine("GET /api/application/consistency-groups/{cgUuid}/snapshots")
@Headers({"Authorization: {authHeader}"})
OntapResponse<ConsistencyGroupSnapshot> getConsistencyGroupSnapshots(@Param("authHeader") String authHeader,
@Param("cgUuid") String cgUuid,
@QueryMap Map<String, Object> queryParams);

/**
* Commits a started consistency group snapshot.
*
* <p>ONTAP REST: {@code PATCH /api/application/consistency-groups/{cgUuid}/snapshots/{snapshotUuid}}</p>
*
* @param authHeader Basic auth header
* @param cgUuid consistency group UUID
* @param snapshotUuid consistency group snapshot UUID
* @param request commit request body
* @return JobResponse containing the async job reference
*/
@RequestLine("PATCH /api/application/consistency-groups/{cgUuid}/snapshots/{snapshotUuid}")
@Headers({"Authorization: {authHeader}", "Content-Type: application/json"})
JobResponse commitConsistencyGroupSnapshot(@Param("authHeader") String authHeader,
@Param("cgUuid") String cgUuid,
@Param("snapshotUuid") String snapshotUuid,
ConsistencyGroupSnapshot request);

/**
* Deletes a consistency group.
*
* <p>ONTAP REST: {@code DELETE /api/application/consistency-groups/{cgUuid}}</p>
*
* @param authHeader Basic auth header
* @param cgUuid consistency group UUID
* @return JobResponse containing the async job reference
*/
@RequestLine("DELETE /api/application/consistency-groups/{cgUuid}")
@Headers({"Authorization: {authHeader}"})
JobResponse deleteConsistencyGroup(@Param("authHeader") String authHeader,
@Param("cgUuid") String cgUuid);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License 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.
*/
package org.apache.cloudstack.storage.feign.model;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;

import java.util.List;

/**
* Model representing an ONTAP application consistency group.
*
* <p>Maps to the ONTAP REST API resource at
* {@code /api/application/consistency-groups}.</p>
*
* @see <a href="https://docs.netapp.com/us-en/ontap-restapi/post-application-consistency-groups.html">
* ONTAP REST API - Create Consistency Group</a>
*/
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class ConsistencyGroup {

@JsonProperty("uuid")
private String uuid;

@JsonProperty("name")
private String name;

@JsonProperty("svm")
private Svm svm;

@JsonProperty("volumes")
private List<ConsistencyGroupVolume> volumes;

public ConsistencyGroup() {
}

public ConsistencyGroup(String name) {
this.name = name;
}

public String getUuid() {
return uuid;
}

public void setUuid(String uuid) {
this.uuid = uuid;
}

public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}

public Svm getSvm() {
return svm;
}

public void setSvm(Svm svm) {
this.svm = svm;
}

public List<ConsistencyGroupVolume> getVolumes() {
return volumes;
}

public void setVolumes(List<ConsistencyGroupVolume> volumes) {
this.volumes = volumes;
}

@Override
public String toString() {
return "ConsistencyGroup{" +
"uuid='" + uuid + '\'' +
", name='" + name + '\'' +
", volumes=" + (volumes != null ? volumes.size() : 0) +
'}';
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License 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.
*/
package org.apache.cloudstack.storage.feign.model;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;

/**
* Model representing an ONTAP consistency group snapshot.
*
* <p>Maps to the ONTAP REST API resource at
* {@code /api/application/consistency-groups/{consistency_group.uuid}/snapshots}.</p>
*
* @see <a href="https://docs.netapp.com/us-en/ontap-restapi/get-application-consistency-groups-snapshots.html">
* ONTAP REST API - Consistency Group Snapshots</a>
*/
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class ConsistencyGroupSnapshot {

@JsonProperty("uuid")
private String uuid;

@JsonProperty("name")
private String name;

@JsonProperty("create_time")
private String createTime;

@JsonProperty("comment")
private String comment;

@JsonProperty("consistency_type")
private String consistencyType;

@JsonProperty("snapmirror_label")
private String snapmirrorLabel;

@JsonProperty("action")
private String action;

@JsonProperty("consistency_group")
private VolumeConcise consistencyGroup;

public ConsistencyGroupSnapshot() {
// default constructor for Jackson
}

public ConsistencyGroupSnapshot(String name) {
this.name = name;
}

public ConsistencyGroupSnapshot(String name, String action) {
this.name = name;
this.action = action;
}

public String getUuid() {
return uuid;
}

public void setUuid(String uuid) {
this.uuid = uuid;
}

public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}

public String getCreateTime() {
return createTime;
}

public void setCreateTime(String createTime) {
this.createTime = createTime;
}

public String getComment() {
return comment;
}

public void setComment(String comment) {
this.comment = comment;
}

public String getConsistencyType() {
return consistencyType;
}

public void setConsistencyType(String consistencyType) {
this.consistencyType = consistencyType;
}

public String getSnapmirrorLabel() {
return snapmirrorLabel;
}

public void setSnapmirrorLabel(String snapmirrorLabel) {
this.snapmirrorLabel = snapmirrorLabel;
}

public String getAction() {
return action;
}

public void setAction(String action) {
this.action = action;
}

public VolumeConcise getConsistencyGroup() {
return consistencyGroup;
}

public void setConsistencyGroup(VolumeConcise consistencyGroup) {
this.consistencyGroup = consistencyGroup;
}

@Override
public String toString() {
return "ConsistencyGroupSnapshot{" +
"uuid='" + uuid + '\'' +
", name='" + name + '\'' +
", createTime='" + createTime + '\'' +
", comment='" + comment + '\'' +
", consistencyType='" + consistencyType + '\'' +
'}';
}
}
Loading
Loading