|
| 1 | +package org.zstack.header.storage.primary; |
| 2 | + |
| 3 | +import org.zstack.header.message.APIEvent; |
| 4 | +import org.zstack.header.rest.RestResponse; |
| 5 | + |
| 6 | +import java.util.Collections; |
| 7 | + |
| 8 | +@RestResponse(fieldsTo = {"all"}) |
| 9 | +public class APITakeoverPrimaryStorageEvent extends APIEvent { |
| 10 | + private PrimaryStorageInventory inventory; |
| 11 | + |
| 12 | + private ReconnectResult reconnectResult; |
| 13 | + |
| 14 | + private String reconnectError; |
| 15 | + |
| 16 | + public APITakeoverPrimaryStorageEvent() { |
| 17 | + } |
| 18 | + |
| 19 | + public APITakeoverPrimaryStorageEvent(String apiId) { |
| 20 | + super(apiId); |
| 21 | + } |
| 22 | + |
| 23 | + public PrimaryStorageInventory getInventory() { |
| 24 | + return inventory; |
| 25 | + } |
| 26 | + |
| 27 | + public void setInventory(PrimaryStorageInventory inventory) { |
| 28 | + this.inventory = inventory; |
| 29 | + } |
| 30 | + |
| 31 | + public ReconnectResult getReconnectResult() { |
| 32 | + return reconnectResult; |
| 33 | + } |
| 34 | + |
| 35 | + public void setReconnectResult(ReconnectResult reconnectResult) { |
| 36 | + this.reconnectResult = reconnectResult; |
| 37 | + } |
| 38 | + |
| 39 | + public String getReconnectError() { |
| 40 | + return reconnectError; |
| 41 | + } |
| 42 | + |
| 43 | + public void setReconnectError(String reconnectError) { |
| 44 | + this.reconnectError = reconnectError; |
| 45 | + } |
| 46 | + |
| 47 | + public static APITakeoverPrimaryStorageEvent __example__() { |
| 48 | + APITakeoverPrimaryStorageEvent event = new APITakeoverPrimaryStorageEvent(); |
| 49 | + |
| 50 | + PrimaryStorageInventory ps = new PrimaryStorageInventory(); |
| 51 | + ps.setName("PS1"); |
| 52 | + ps.setUrl("/zstack_ps"); |
| 53 | + ps.setType("SharedBlock"); |
| 54 | + ps.setAttachedClusterUuids(Collections.singletonList(uuid())); |
| 55 | + |
| 56 | + event.setInventory(ps); |
| 57 | + event.setReconnectResult(ReconnectResult.SUCCESS); |
| 58 | + return event; |
| 59 | + } |
| 60 | +} |
0 commit comments