You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
IP address acquired with associate ip address is marked as source nat (apache#3125)
* CLOUDSTACK-4045 added a check for network state when determining whether a new IP should be source NAT. this prevents associated IP's to be marked as source NAT when the network is in allocated state, causing disassociateIpAddress to fail later
* Remove mock object that cause other tests to fail
* Remove underscores from variable types and add documentation for the created method
* Improve exception message to include network name
* Include network UUID with the Exception message and fix failing marvin test
* Rebase against latest master and format AssociateIPAddrCmd class
Copy file name to clipboardExpand all lines: api/src/main/java/org/apache/cloudstack/api/command/user/address/AssociateIPAddrCmd.java
+41-26Lines changed: 41 additions & 26 deletions
Original file line number
Diff line number
Diff line change
@@ -57,8 +57,12 @@
57
57
importcom.cloud.projects.Project;
58
58
importcom.cloud.user.Account;
59
59
60
-
@APICommand(name = "associateIpAddress", description = "Acquires and associates a public IP to an account. Either of the parameters are required, i.e. either zoneId, or networkId, or vpcId ", responseObject = IPAddressResponse.class, responseView = ResponseView.Restricted,
@Parameter(name = ApiConstants.ACCOUNT, type = CommandType.STRING, description = "the account to associate with this IP address")
74
+
@Parameter(name = ApiConstants.ACCOUNT,
75
+
type = CommandType.STRING,
76
+
description = "the account to associate with this IP address")
71
77
privateStringaccountName;
72
78
73
79
@Parameter(name = ApiConstants.DOMAIN_ID,
74
-
type = CommandType.UUID,
75
-
entityType = DomainResponse.class,
76
-
description = "the ID of the domain to associate with this IP address")
80
+
type = CommandType.UUID,
81
+
entityType = DomainResponse.class,
82
+
description = "the ID of the domain to associate with this IP address")
77
83
privateLongdomainId;
78
84
79
85
@Parameter(name = ApiConstants.ZONE_ID,
80
-
type = CommandType.UUID,
81
-
entityType = ZoneResponse.class,
82
-
description = "the ID of the availability zone you want to acquire an public IP address from")
86
+
type = CommandType.UUID,
87
+
entityType = ZoneResponse.class,
88
+
description = "the ID of the availability zone you want to acquire an public IP address from")
83
89
privateLongzoneId;
84
90
85
91
@Parameter(name = ApiConstants.NETWORK_ID,
86
-
type = CommandType.UUID,
87
-
entityType = NetworkResponse.class,
88
-
description = "The network this IP address should be associated to.")
92
+
type = CommandType.UUID,
93
+
entityType = NetworkResponse.class,
94
+
description = "The network this IP address should be associated to.")
89
95
privateLongnetworkId;
90
96
91
-
@Parameter(name = ApiConstants.PROJECT_ID, type = CommandType.UUID, entityType = ProjectResponse.class, description = "Deploy VM for the project")
97
+
@Parameter(name = ApiConstants.PROJECT_ID,
98
+
type = CommandType.UUID,
99
+
entityType = ProjectResponse.class,
100
+
description = "Deploy VM for the project")
92
101
privateLongprojectId;
93
102
94
-
@Parameter(name = ApiConstants.VPC_ID, type = CommandType.UUID, entityType = VpcResponse.class, description = "the VPC you want the IP address to "
95
-
+ "be associated with")
103
+
@Parameter(name = ApiConstants.VPC_ID,
104
+
type = CommandType.UUID,
105
+
entityType = VpcResponse.class,
106
+
description = "the VPC you want the IP address to be associated with")
96
107
privateLongvpcId;
97
108
98
-
@Parameter(name = ApiConstants.IS_PORTABLE, type = BaseCmd.CommandType.BOOLEAN, description = "should be set to true "
99
-
+ "if public IP is required to be transferable across zones, if not specified defaults to false")
109
+
@Parameter(name = ApiConstants.IS_PORTABLE,
110
+
type = BaseCmd.CommandType.BOOLEAN,
111
+
description = "should be set to true if public IP is required to be transferable across zones, if not specified defaults to false")
100
112
privateBooleanisPortable;
101
113
102
114
@Parameter(name = ApiConstants.REGION_ID,
103
-
type = CommandType.INTEGER,
104
-
entityType = RegionResponse.class,
105
-
required = false,
106
-
description = "region ID from where portable IP is to be associated.")
115
+
type = CommandType.INTEGER,
116
+
entityType = RegionResponse.class,
117
+
required = false,
118
+
description = "region ID from where portable IP is to be associated.")
107
119
privateIntegerregionId;
108
120
109
-
@Parameter(name = ApiConstants.FOR_DISPLAY, type = CommandType.BOOLEAN, description = "an optional field, whether to the display the IP to the end user or not", since = "4.4", authorized = {RoleType.Admin})
121
+
@Parameter(name = ApiConstants.FOR_DISPLAY,
122
+
type = CommandType.BOOLEAN,
123
+
description = "an optional field, whether to the display the IP to the end user or not", since = "4.4",
0 commit comments