This repository has been archived by the owner on Jan 14, 2020. It is now read-only.
/
DeleteVirtualNetworkWorkflowDocument.java
142 lines (124 loc) · 4 KB
/
DeleteVirtualNetworkWorkflowDocument.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
/*
* Copyright 2015 VMware, Inc. All Rights Reserved.
*
* Licensed 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 com.vmware.photon.controller.apibackend.servicedocuments;
import com.vmware.photon.controller.apibackend.annotations.ControlFlagsField;
import com.vmware.photon.controller.apibackend.annotations.TaskServiceEntityField;
import com.vmware.photon.controller.apibackend.annotations.TaskServiceStateField;
import com.vmware.photon.controller.apibackend.annotations.TaskStateField;
import com.vmware.photon.controller.apibackend.annotations.TaskStateSubStageField;
import com.vmware.photon.controller.cloudstore.xenon.entity.TaskService;
import com.vmware.photon.controller.cloudstore.xenon.entity.VirtualNetworkService;
import com.vmware.photon.controller.common.xenon.validation.DefaultInteger;
import com.vmware.photon.controller.common.xenon.validation.DefaultTaskState;
import com.vmware.photon.controller.common.xenon.validation.Immutable;
import com.vmware.photon.controller.common.xenon.validation.NotBlank;
import com.vmware.photon.controller.common.xenon.validation.WriteOnce;
import com.vmware.xenon.common.ServiceDocument;
import com.vmware.xenon.common.ServiceDocumentDescription;
/**
* This class defines the document state associated with a single
* DeleteVirtualNetworkWorkflowService instance.
*/
public class DeleteVirtualNetworkWorkflowDocument extends ServiceDocument{
/**
* This class defines the state of a DeleteVirtualNetworkWorkflowService instance.
*/
public static class TaskState extends com.vmware.xenon.common.TaskState {
/**
* The current sub-stage of the task.
*/
@TaskStateSubStageField
public SubStage subStage;
/**
* The sub-states for this this.
*/
public enum SubStage {
CHECK_VM_EXISTENCE,
GET_NSX_CONFIGURATION,
RELEASE_IP_ADDRESS_SPACE,
RELEASE_QUOTA,
RELEASE_SNAT_IP,
DELETE_LOGICAL_PORTS,
DELETE_LOGICAL_ROUTER,
DELETE_LOGICAL_SWITCH,
DELETE_DHCP_OPTION,
DELETE_NETWORK_ENTITY
}
}
///
/// Controls Input
///
/**
* The state of the current workflow.
*/
@TaskStateField
@DefaultTaskState(value = TaskState.TaskStage.CREATED)
public TaskState taskState;
/**
* This value represents control flags influencing the behavior of the workflow.
*/
@ControlFlagsField
@DefaultInteger(0)
@Immutable
public Integer controlFlags;
/**
* This value represents the poll interval for the sub-task in milliseconds.
*/
@DefaultInteger(5000)
@Immutable
public Integer subTaskPollIntervalInMilliseconds;
///
/// Task Input
///
/**
* Endpoint to the nsx manager.
*/
@WriteOnce
public String nsxAddress;
/**
* Username to access nsx manager.
*/
@WriteOnce
@ServiceDocument.UsageOption(option = ServiceDocumentDescription.PropertyUsageOption.SENSITIVE)
public String nsxUsername;
/**
* Password to access nsx manager.
*/
@WriteOnce
@ServiceDocument.UsageOption(option = ServiceDocumentDescription.PropertyUsageOption.SENSITIVE)
public String nsxPassword;
/**
* The id of the logical network.
*/
@NotBlank
@WriteOnce
public String networkId;
///
/// Task Output
///
/**
* The endpoint of DHCP agent.
*/
@WriteOnce
public String dhcpAgentEndpoint;
/**
* The VirtualNetworkService.State object.
*/
@TaskServiceEntityField
public VirtualNetworkService.State taskServiceEntity;
/**
* The TaskService.State object.
*/
@TaskServiceStateField
public TaskService.State taskServiceState;
}