File tree Expand file tree Collapse file tree
api/src/org/apache/cloudstack/api/command/user Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2626import org .apache .log4j .Logger ;
2727
2828import com .cloud .event .EventTypes ;
29+ import com .cloud .exception .InvalidParameterValueException ;
2930import com .cloud .network .IpAddress ;
3031import com .cloud .user .Account ;
3132
@@ -127,4 +128,22 @@ public void execute(){
127128// throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to update port forwarding rule");
128129// }
129130 }
131+
132+ @ Override
133+ public String getSyncObjType () {
134+ return BaseAsyncCmd .networkSyncObject ;
135+ }
136+
137+ @ Override
138+ public Long getSyncObjId () {
139+ return getIp ().getAssociatedWithNetworkId ();
140+ }
141+
142+ private IpAddress getIp () {
143+ IpAddress ip = _networkService .getIp (publicIpId );
144+ if (ip == null ) {
145+ throw new InvalidParameterValueException ("Unable to find ip address by id " + publicIpId );
146+ }
147+ return ip ;
148+ }
130149}
Original file line number Diff line number Diff line change 2121import org .apache .cloudstack .api .APICommand ;
2222import org .apache .cloudstack .api .ApiConstants ;
2323import org .apache .cloudstack .api .ApiErrorCode ;
24+ import org .apache .cloudstack .api .BaseAsyncCmd ;
2425import org .apache .cloudstack .api .BaseAsyncCreateCmd ;
2526import org .apache .cloudstack .api .Parameter ;
2627import org .apache .cloudstack .api .ServerApiException ;
@@ -380,5 +381,14 @@ public AsyncJob.Type getInstanceType() {
380381 return AsyncJob .Type .FirewallRule ;
381382 }
382383
384+ @ Override
385+ public String getSyncObjType () {
386+ return BaseAsyncCmd .networkSyncObject ;
387+ }
388+
389+ @ Override
390+ public Long getSyncObjId () {
391+ return getNetworkId ();
392+ }
383393}
384394
Original file line number Diff line number Diff line change 2727import org .apache .log4j .Logger ;
2828
2929import com .cloud .event .EventTypes ;
30+ import com .cloud .exception .InvalidParameterValueException ;
3031import com .cloud .network .rules .LoadBalancer ;
3132import com .cloud .user .Account ;
3233import com .cloud .user .UserContext ;
@@ -113,4 +114,18 @@ public void execute(){
113114 throw new ServerApiException (ApiErrorCode .INTERNAL_ERROR , "Failed to update load balancer rule" );
114115 }
115116 }
117+
118+ @ Override
119+ public String getSyncObjType () {
120+ return BaseAsyncCmd .networkSyncObject ;
121+ }
122+
123+ @ Override
124+ public Long getSyncObjId () {
125+ LoadBalancer lb = _lbService .findById (getId ());
126+ if (lb == null ) {
127+ throw new InvalidParameterValueException ("Unable to find load balancer rule " + getId ());
128+ }
129+ return lb .getNetworkId ();
130+ }
116131}
Original file line number Diff line number Diff line change @@ -158,4 +158,14 @@ public String getEventDescription() {
158158 public String getEventType () {
159159 return EventTypes .EVENT_NETWORK_UPDATE ;
160160 }
161+
162+ @ Override
163+ public String getSyncObjType () {
164+ return BaseAsyncCmd .networkSyncObject ;
165+ }
166+
167+ @ Override
168+ public Long getSyncObjId () {
169+ return id ;
170+ }
161171}
Original file line number Diff line number Diff line change @@ -101,4 +101,13 @@ public long getEntityOwnerId() {
101101 return Account .ACCOUNT_ID_SYSTEM ; // no account info given, parent this command to SYSTEM so ERROR events are tracked
102102 }
103103
104+ @ Override
105+ public String getSyncObjType () {
106+ return BaseAsyncCmd .vpcSyncObject ;
107+ }
108+
109+ @ Override
110+ public Long getSyncObjId () {
111+ return getId ();
112+ }
104113}
Original file line number Diff line number Diff line change @@ -106,4 +106,14 @@ public String getEventType() {
106106 public String getEventDescription () {
107107 return "restarting VPC id=" + getId ();
108108 }
109+
110+ @ Override
111+ public String getSyncObjType () {
112+ return BaseAsyncCmd .vpcSyncObject ;
113+ }
114+
115+ @ Override
116+ public Long getSyncObjId () {
117+ return getId ();
118+ }
109119}
Original file line number Diff line number Diff line change @@ -105,4 +105,14 @@ public String getEventType() {
105105 public String getEventDescription () {
106106 return "updating VPC id=" + getId ();
107107 }
108+
109+ @ Override
110+ public String getSyncObjType () {
111+ return BaseAsyncCmd .vpcSyncObject ;
112+ }
113+
114+ @ Override
115+ public Long getSyncObjId () {
116+ return getId ();
117+ }
108118}
You can’t perform that action at this time.
0 commit comments