Skip to content

Commit 81e1728

Browse files
committed
ui stuff
1 parent 49f6294 commit 81e1728

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+818
-211
lines changed

openstack-api/src/main/java/org/openstack/api/common/Resource.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,8 @@ public <T extends Resource> T path(String relativePath, Class<T> clazz) {
2828
return instance;
2929
}
3030

31+
public String getURL() {
32+
return target.getUri().toString();
33+
}
34+
3135
}

openstack-api/src/main/java/org/openstack/api/compute/TenantResource.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public ExtensionsResource extensions() {
9898
}
9999

100100
public SnapshotsResource snapshots() {
101-
return path("/os-security-group-rules", SnapshotsResource.class);
101+
return path("/os-snapshots", SnapshotsResource.class);
102102
}
103103

104104
}

openstack-api/src/main/java/org/openstack/api/compute/ext/SnapshotsResource.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66

77
import org.openstack.api.common.Resource;
88
import org.openstack.model.compute.Snapshot;
9+
import org.openstack.model.compute.SnapshotForCreate;
910
import org.openstack.model.compute.SnapshotList;
1011
import org.openstack.model.compute.nova.snapshot.NovaSnapshot;
1112
import org.openstack.model.compute.nova.snapshot.NovaSnapshotList;
12-
import org.openstack.model.compute.nova.snapshot.SnapshotForCreate;
1313

1414
public class SnapshotsResource extends Resource {
1515

openstack-api/src/main/java/org/openstack/api/compute/ext/VolumeAttachmentResource.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
public class VolumeAttachmentResource extends Resource {
99

10-
protected VolumeAttachmentResource(Target target) {
10+
public VolumeAttachmentResource(Target target) {
1111
super(target);
1212
}
1313

openstack-api/src/main/java/org/openstack/api/compute/ext/VolumeAttachmentsResource.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
public class VolumeAttachmentsResource extends Resource {
1313

14-
protected VolumeAttachmentsResource(Target target) {
14+
public VolumeAttachmentsResource(Target target) {
1515
super(target);
1616
}
1717

openstack-api/src/main/java/org/openstack/model/compute/Snapshot.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,11 @@ public interface Snapshot {
44

55
Integer getId();
66

7-
Integer getStatus();
7+
String getStatus();
88

99
Integer getSizeInGB();
1010

11-
Integer getAvailabilityZone();
12-
13-
String getType();
11+
String getAvailabilityZone();
1412

1513
String getCreated();
1614

openstack-api/src/main/java/org/openstack/model/compute/nova/snapshot/SnapshotForCreate.java renamed to openstack-api/src/main/java/org/openstack/model/compute/SnapshotForCreate.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package org.openstack.model.compute.nova.snapshot;
1+
package org.openstack.model.compute;
22

33
public interface SnapshotForCreate {
44

openstack-api/src/main/java/org/openstack/model/compute/nova/snapshot/NovaSnapshot.java

Lines changed: 28 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -7,42 +7,47 @@
77
import javax.xml.bind.annotation.XmlAttribute;
88
import javax.xml.bind.annotation.XmlRootElement;
99

10+
import org.openstack.model.common.JsonRootElement;
1011
import org.openstack.model.compute.Snapshot;
1112

13+
import com.google.gson.annotations.SerializedName;
1214

13-
@XmlRootElement(namespace="")
15+
16+
@XmlRootElement(name = "snapshot", namespace="")
1417
@XmlAccessorType(XmlAccessType.NONE)
18+
@JsonRootElement("snapshot")
1519
public class NovaSnapshot implements Serializable, Snapshot {
1620

1721
@XmlAttribute
1822
private Integer id;
1923

2024
@XmlAttribute
21-
private Integer status;
25+
private String status;
2226

2327
@XmlAttribute(name="size")
28+
@SerializedName("size")
2429
private Integer sizeInGB;
2530

26-
@XmlAttribute(name="availabilityZone")
27-
private Integer availabilityZone;
28-
29-
@XmlAttribute(name="volumeType")
30-
private String type;
31+
@XmlAttribute
32+
private String availabilityZone;
3133

3234
@XmlAttribute(name="createdAt")
35+
@SerializedName("createdAt")
3336
private String created;
3437

3538
@XmlAttribute(name="displayName")
39+
@SerializedName("displayName")
3640
private String name;
3741

3842
@XmlAttribute(name="displayDescription")
43+
@SerializedName("displayDescription")
3944
private String description;
4045

41-
@XmlAttribute(name="snapshotId")
46+
@XmlAttribute(name="volumeId")
4247
private Integer volumeId;
4348

4449
/* (non-Javadoc)
45-
* @see org.openstack.model.compute.Snapshot#getId()
50+
* @see org.openstack.model.compute.nova.snapshot.Snapshot#getId()
4651
*/
4752
@Override
4853
public Integer getId() {
@@ -54,19 +59,19 @@ public void setId(Integer id) {
5459
}
5560

5661
/* (non-Javadoc)
57-
* @see org.openstack.model.compute.Snapshot#getStatus()
62+
* @see org.openstack.model.compute.nova.snapshot.Snapshot#getStatus()
5863
*/
5964
@Override
60-
public Integer getStatus() {
65+
public String getStatus() {
6166
return status;
6267
}
6368

64-
public void setStatus(Integer status) {
69+
public void setStatus(String status) {
6570
this.status = status;
6671
}
6772

6873
/* (non-Javadoc)
69-
* @see org.openstack.model.compute.Snapshot#getSizeInGB()
74+
* @see org.openstack.model.compute.nova.snapshot.Snapshot#getSizeInGB()
7075
*/
7176
@Override
7277
public Integer getSizeInGB() {
@@ -78,31 +83,19 @@ public void setSizeInGB(Integer sizeInGB) {
7883
}
7984

8085
/* (non-Javadoc)
81-
* @see org.openstack.model.compute.Snapshot#getAvailabilityZone()
86+
* @see org.openstack.model.compute.nova.snapshot.Snapshot#getAvailabilityZone()
8287
*/
8388
@Override
84-
public Integer getAvailabilityZone() {
89+
public String getAvailabilityZone() {
8590
return availabilityZone;
8691
}
8792

88-
public void setAvailabilityZone(Integer availabilityZone) {
93+
public void setAvailabilityZone(String availabilityZone) {
8994
this.availabilityZone = availabilityZone;
9095
}
9196

9297
/* (non-Javadoc)
93-
* @see org.openstack.model.compute.Snapshot#getType()
94-
*/
95-
@Override
96-
public String getType() {
97-
return type;
98-
}
99-
100-
public void setType(String type) {
101-
this.type = type;
102-
}
103-
104-
/* (non-Javadoc)
105-
* @see org.openstack.model.compute.Snapshot#getCreated()
98+
* @see org.openstack.model.compute.nova.snapshot.Snapshot#getCreated()
10699
*/
107100
@Override
108101
public String getCreated() {
@@ -114,7 +107,7 @@ public void setCreated(String created) {
114107
}
115108

116109
/* (non-Javadoc)
117-
* @see org.openstack.model.compute.Snapshot#getName()
110+
* @see org.openstack.model.compute.nova.snapshot.Snapshot#getName()
118111
*/
119112
@Override
120113
public String getName() {
@@ -126,7 +119,7 @@ public void setName(String name) {
126119
}
127120

128121
/* (non-Javadoc)
129-
* @see org.openstack.model.compute.Snapshot#getDescription()
122+
* @see org.openstack.model.compute.nova.snapshot.Snapshot#getDescription()
130123
*/
131124
@Override
132125
public String getDescription() {
@@ -138,7 +131,7 @@ public void setDescription(String description) {
138131
}
139132

140133
/* (non-Javadoc)
141-
* @see org.openstack.model.compute.Snapshot#getVolumeId()
134+
* @see org.openstack.model.compute.nova.snapshot.Snapshot#getVolumeId()
142135
*/
143136
@Override
144137
public Integer getVolumeId() {
@@ -151,13 +144,10 @@ public void setVolumeId(Integer volumeId) {
151144

152145
@Override
153146
public String toString() {
154-
return "Volume [id=" + id + ", status=" + status + ", sizeInGB="
147+
return "NovaSnapshot [id=" + id + ", status=" + status + ", sizeInGB="
155148
+ sizeInGB + ", availabilityZone=" + availabilityZone
156-
+ ", type=" + type + ", created=" + created + ", name=" + name
157-
+ ", description=" + description + ", volumeId=" + volumeId
158-
+ ", metadata=" + volumeId + "]";
149+
+ ", created=" + created + ", name=" + name + ", description="
150+
+ description + ", volumeId=" + volumeId + "]";
159151
}
160-
161-
162152

163153
}

openstack-api/src/main/java/org/openstack/model/compute/nova/snapshot/NovaSnapshotForCreate.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,31 @@
77
import javax.xml.bind.annotation.XmlAttribute;
88
import javax.xml.bind.annotation.XmlRootElement;
99

10+
import org.openstack.model.common.JsonRootElement;
1011
import org.openstack.model.compute.Snapshot;
12+
import org.openstack.model.compute.SnapshotForCreate;
13+
14+
import com.google.gson.annotations.SerializedName;
1115

1216

1317
@XmlRootElement(namespace="")
1418
@XmlAccessorType(XmlAccessType.NONE)
19+
@JsonRootElement("snapshot")
1520
public class NovaSnapshotForCreate implements Serializable, SnapshotForCreate {
1621

1722
@XmlAttribute(name="volume_id")
23+
@SerializedName("volume_id")
1824
private Integer volumeId;
1925

2026
@XmlAttribute
2127
private Boolean force;
2228

2329
@XmlAttribute(name="display_name")
30+
@SerializedName("display_name")
2431
private String name;
2532

2633
@XmlAttribute(name="display_description")
34+
@SerializedName("display_description")
2735
private String description;
2836

2937
/* (non-Javadoc)

openstack-api/src/main/java/org/openstack/model/compute/nova/snapshot/NovaSnapshotList.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,18 @@
2020
public class NovaSnapshotList implements Serializable, SnapshotList {
2121

2222
@XmlElement(name="snapshot")
23-
private List<NovaSnapshot> list = new ArrayList<NovaSnapshot>();
23+
private List<NovaSnapshot> snapshots = new ArrayList<NovaSnapshot>();
2424

2525
/* (non-Javadoc)
2626
* @see org.openstack.model.compute.SnapshotList#getList()
2727
*/
2828
@Override
2929
public List<Snapshot> getList() {
30-
return (List<Snapshot>) (List<?>) list;
30+
return (List<Snapshot>) (List<?>) snapshots;
3131
}
3232

33-
public void setList(List<NovaSnapshot> list) {
34-
this.list = list;
33+
public void setList(List<NovaSnapshot> snapshots) {
34+
this.snapshots = snapshots;
3535
}
3636

3737
}

0 commit comments

Comments
 (0)