Skip to content

Commit ae5e478

Browse files
author
Sina Kashipazha
committed
FEATURE: add creation date as a value for domains and accounts.
1 parent ff376d8 commit ae5e478

File tree

12 files changed

+336
-0
lines changed

12 files changed

+336
-0
lines changed

api/src/main/java/com/cloud/domain/Domain.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ enum State {
4242

4343
void setName(String name);
4444

45+
Date getCreated();
46+
4547
Date getRemoved();
4648

4749
String getPath();

api/src/main/java/com/cloud/user/Account.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ public enum State {
5050

5151
public State getState();
5252

53+
public Date getCreated();
54+
5355
public Date getRemoved();
5456

5557
public String getNetworkDomain();

api/src/main/java/org/apache/cloudstack/api/response/AccountResponse.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
// under the License.
1717
package org.apache.cloudstack.api.response;
1818

19+
import java.util.Date;
1920
import java.util.List;
2021
import java.util.Map;
2122

@@ -238,6 +239,10 @@ public class AccountResponse extends BaseResponse implements ResourceLimitAndCou
238239
@Param(description = "true if the account requires cleanup")
239240
private Boolean cleanupRequired;
240241

242+
@SerializedName(ApiConstants.CREATED)
243+
@Param(description="the date when this account was created")
244+
private Date created;
245+
241246
@SerializedName("user")
242247
@Param(description = "the list of users associated with account", responseObject = UserResponse.class)
243248
private List<UserResponse> users;
@@ -398,6 +403,10 @@ public void setState(String state) {
398403
this.state = state;
399404
}
400405

406+
public void setCreated(Date created) {
407+
this.created = created;
408+
}
409+
401410
public void setCleanupRequired(Boolean cleanupRequired) {
402411
this.cleanupRequired = cleanupRequired;
403412
}

api/src/main/java/org/apache/cloudstack/api/response/DomainResponse.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
import com.cloud.domain.Domain;
2626
import com.cloud.serializer.Param;
2727

28+
import java.util.Date;
29+
2830
@EntityReference(value = Domain.class)
2931
public class DomainResponse extends BaseResponse implements ResourceLimitAndCountResponse {
3032
@SerializedName(ApiConstants.ID)
@@ -62,6 +64,9 @@ public class DomainResponse extends BaseResponse implements ResourceLimitAndCoun
6264
@SerializedName(ApiConstants.STATE) @Param(description="the state of the domain")
6365
private String state;
6466

67+
@SerializedName(ApiConstants.CREATED) @Param(description="the date when this domain was created")
68+
private Date created;
69+
6570
@SerializedName(ApiConstants.VM_LIMIT) @Param(description="the total number of virtual machines that can be deployed by this domain")
6671
private String vmLimit;
6772

@@ -230,6 +235,9 @@ public void setPath(String path) {
230235
this.path = path;
231236
}
232237

238+
public void setCreated(Date created) {
239+
this.created = created;
240+
}
233241

234242
@Override
235243
public void setVmLimit(String vmLimit) {

engine/schema/src/main/java/com/cloud/domain/DomainVO.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ public class DomainVO implements Domain {
5555
@Column(name = "level")
5656
private int level;
5757

58+
@Column(name = GenericDao.CREATED_COLUMN)
59+
private Date created;
60+
5861
@Column(name = GenericDao.REMOVED_COLUMN)
5962
private Date removed;
6063

@@ -143,6 +146,11 @@ public void setAccountId(long accountId) {
143146
this.accountId = accountId;
144147
}
145148

149+
@Override
150+
public Date getCreated() {
151+
return created;
152+
}
153+
146154
@Override
147155
public Date getRemoved() {
148156
return removed;

engine/schema/src/main/java/com/cloud/user/AccountVO.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ public class AccountVO implements Account {
5454
@Enumerated(value = EnumType.STRING)
5555
private State state;
5656

57+
@Column(name = GenericDao.CREATED_COLUMN)
58+
private Date created;
59+
5760
@Column(name = GenericDao.REMOVED_COLUMN)
5861
private Date removed;
5962

@@ -168,6 +171,11 @@ public void setState(State state) {
168171
this.state = state;
169172
}
170173

174+
@Override
175+
public Date getCreated() {
176+
return created;
177+
}
178+
171179
@Override
172180
public Date getRemoved() {
173181
return removed;

0 commit comments

Comments
 (0)