Skip to content

Commit 0df9538

Browse files
committed
api_refactor: refactor security group (sg) apis
- Fix refactored apis, fix mapping in commands*.in - Fix comments etc. Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
1 parent 3e0b216 commit 0df9538

10 files changed

Lines changed: 24 additions & 28 deletions

File tree

‎api/src/com/cloud/network/security/SecurityGroupService.java‎

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,10 @@
1818

1919
import java.util.List;
2020

21-
import com.cloud.api.commands.AuthorizeSecurityGroupEgressCmd;
22-
import com.cloud.api.commands.AuthorizeSecurityGroupIngressCmd;
23-
import com.cloud.api.commands.CreateSecurityGroupCmd;
24-
import com.cloud.api.commands.DeleteSecurityGroupCmd;
25-
import com.cloud.api.commands.ListSecurityGroupsCmd;
26-
import com.cloud.api.commands.RevokeSecurityGroupEgressCmd;
27-
import com.cloud.api.commands.RevokeSecurityGroupIngressCmd;
21+
import org.apache.cloudstack.api.user.sg.command.*;
22+
import org.apache.cloudstack.api.user.sg.command.AuthorizeSecurityGroupIngressCmd;
23+
import org.apache.cloudstack.api.user.sg.command.CreateSecurityGroupCmd;
24+
import org.apache.cloudstack.api.user.sg.command.RevokeSecurityGroupEgressCmd;
2825
import com.cloud.exception.InvalidParameterValueException;
2926
import com.cloud.exception.PermissionDeniedException;
3027
import com.cloud.exception.ResourceInUseException;

api/src/com/cloud/api/commands/AuthorizeSecurityGroupEgressCmd.java renamed to api/src/org/apache/cloudstack/api/user/sg/command/AuthorizeSecurityGroupEgressCmd.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
// KIND, either express or implied. See the License for the
1515
// specific language governing permissions and limitations
1616
// under the License.
17-
package com.cloud.api.commands;
17+
package org.apache.cloudstack.api.user.sg.command;
1818

1919
import java.util.Collection;
2020
import java.util.HashMap;

api/src/com/cloud/api/commands/AuthorizeSecurityGroupIngressCmd.java renamed to api/src/org/apache/cloudstack/api/user/sg/command/AuthorizeSecurityGroupIngressCmd.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
// KIND, either express or implied. See the License for the
1515
// specific language governing permissions and limitations
1616
// under the License.
17-
package com.cloud.api.commands;
17+
package org.apache.cloudstack.api.user.sg.command;
1818

1919
import java.util.Collection;
2020
import java.util.HashMap;

api/src/com/cloud/api/commands/CreateSecurityGroupCmd.java renamed to api/src/org/apache/cloudstack/api/user/sg/command/CreateSecurityGroupCmd.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
// KIND, either express or implied. See the License for the
1515
// specific language governing permissions and limitations
1616
// under the License.
17-
package com.cloud.api.commands;
17+
package org.apache.cloudstack.api.user.sg.command;
1818

1919
import org.apache.log4j.Logger;
2020

api/src/com/cloud/api/commands/DeleteSecurityGroupCmd.java renamed to api/src/org/apache/cloudstack/api/user/sg/command/DeleteSecurityGroupCmd.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
// KIND, either express or implied. See the License for the
1515
// specific language governing permissions and limitations
1616
// under the License.
17-
package com.cloud.api.commands;
17+
package org.apache.cloudstack.api.user.sg.command;
1818

1919
import org.apache.log4j.Logger;
2020

api/src/com/cloud/api/commands/ListSecurityGroupsCmd.java renamed to api/src/org/apache/cloudstack/api/user/sg/command/ListSecurityGroupsCmd.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
// KIND, either express or implied. See the License for the
1515
// specific language governing permissions and limitations
1616
// under the License.
17-
package com.cloud.api.commands;
17+
package org.apache.cloudstack.api.user.sg.command;
1818

1919
import java.util.List;
2020

api/src/com/cloud/api/commands/RevokeSecurityGroupEgressCmd.java renamed to api/src/org/apache/cloudstack/api/user/sg/command/RevokeSecurityGroupEgressCmd.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
// KIND, either express or implied. See the License for the
1515
// specific language governing permissions and limitations
1616
// under the License.
17-
package com.cloud.api.commands;
17+
package org.apache.cloudstack.api.user.sg.command;
1818

1919
import org.apache.log4j.Logger;
2020

api/src/com/cloud/api/commands/RevokeSecurityGroupIngressCmd.java renamed to api/src/org/apache/cloudstack/api/user/sg/command/RevokeSecurityGroupIngressCmd.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
// KIND, either express or implied. See the License for the
1515
// specific language governing permissions and limitations
1616
// under the License.
17-
package com.cloud.api.commands;
17+
package org.apache.cloudstack.api.user.sg.command;
1818

1919
import org.apache.log4j.Logger;
2020

‎client/tomcatconf/commands.properties.in‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -273,13 +273,13 @@ enableStorageMaintenance=com.cloud.api.commands.PreparePrimaryStorageForMaintena
273273
cancelStorageMaintenance=com.cloud.api.commands.CancelPrimaryStorageMaintenanceCmd;1
274274

275275
#### security group commands
276-
createSecurityGroup=com.cloud.api.commands.CreateSecurityGroupCmd;15
277-
deleteSecurityGroup=com.cloud.api.commands.DeleteSecurityGroupCmd;15
278-
authorizeSecurityGroupIngress=com.cloud.api.commands.AuthorizeSecurityGroupIngressCmd;15
279-
revokeSecurityGroupIngress=com.cloud.api.commands.RevokeSecurityGroupIngressCmd;15
280-
authorizeSecurityGroupEgress=com.cloud.api.commands.AuthorizeSecurityGroupEgressCmd;15
281-
revokeSecurityGroupEgress=com.cloud.api.commands.RevokeSecurityGroupEgressCmd;15
282-
listSecurityGroups=com.cloud.api.commands.ListSecurityGroupsCmd;15
276+
createSecurityGroup=org.apache.cloudstack.api.user.sg.command.CreateSecurityGroupCmd;15
277+
deleteSecurityGroup=org.apache.cloudstack.api.user.sg.command.DeleteSecurityGroupCmd;15
278+
authorizeSecurityGroupIngress=org.apache.cloudstack.api.user.sg.command.AuthorizeSecurityGroupIngressCmd;15
279+
revokeSecurityGroupIngress=org.apache.cloudstack.api.user.sg.command.RevokeSecurityGroupIngressCmd;15
280+
authorizeSecurityGroupEgress=org.apache.cloudstack.api.user.sg.command.AuthorizeSecurityGroupEgressCmd;15
281+
revokeSecurityGroupEgress=org.apache.cloudstack.api.user.sg.command.RevokeSecurityGroupEgressCmd;15
282+
listSecurityGroups=org.apache.cloudstack.api.user.sg.command.ListSecurityGroupsCmd;15
283283

284284
#### vm group commands
285285
createInstanceGroup=com.cloud.api.commands.CreateVMGroupCmd;15

‎server/src/com/cloud/network/security/SecurityGroupManagerImpl.java‎

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
import javax.ejb.Local;
3737
import javax.naming.ConfigurationException;
3838

39+
import org.apache.cloudstack.api.user.sg.command.*;
3940
import org.apache.commons.codec.digest.DigestUtils;
4041
import org.apache.log4j.Logger;
4142

@@ -44,13 +45,11 @@
4445
import com.cloud.agent.api.SecurityGroupRulesCmd;
4546
import com.cloud.agent.api.SecurityGroupRulesCmd.IpPortAndProto;
4647
import com.cloud.agent.manager.Commands;
47-
import com.cloud.api.commands.AuthorizeSecurityGroupEgressCmd;
48-
import com.cloud.api.commands.AuthorizeSecurityGroupIngressCmd;
49-
import com.cloud.api.commands.CreateSecurityGroupCmd;
50-
import com.cloud.api.commands.DeleteSecurityGroupCmd;
51-
import com.cloud.api.commands.ListSecurityGroupsCmd;
52-
import com.cloud.api.commands.RevokeSecurityGroupEgressCmd;
53-
import com.cloud.api.commands.RevokeSecurityGroupIngressCmd;
48+
import org.apache.cloudstack.api.user.sg.command.AuthorizeSecurityGroupEgressCmd;
49+
import org.apache.cloudstack.api.user.sg.command.CreateSecurityGroupCmd;
50+
import org.apache.cloudstack.api.user.sg.command.DeleteSecurityGroupCmd;
51+
import org.apache.cloudstack.api.user.sg.command.ListSecurityGroupsCmd;
52+
import org.apache.cloudstack.api.user.sg.command.RevokeSecurityGroupEgressCmd;
5453
import com.cloud.configuration.Config;
5554
import com.cloud.configuration.dao.ConfigurationDao;
5655
import com.cloud.domain.dao.DomainDao;

0 commit comments

Comments
 (0)