[GitHub] cloudstack-docs pull request: Inclusion of Nuage-VSP plugin
Github user nlivens commented on the pull request: https://github.com/apache/cloudstack-docs/pull/14#issuecomment-168667533 @runseb, I've handled your comments --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r41972015 --- Diff: plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/sync/SyncDomainAnswer.java --- @@ -0,0 +1,54 @@ +// +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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.cloud.agent.api.sync; + +import com.cloud.agent.api.Answer; + +public class SyncDomainAnswer extends Answer { + +private final boolean _success; + +public SyncDomainAnswer(boolean success) { +super(); +this._success = success; +} + +public boolean getSuccess() { +return _success; +} + + +@Override +public boolean equals(Object o) { +if (this == o) return true; +if (o == null || getClass() != o.getClass()) return false; + +SyncDomainAnswer that = (SyncDomainAnswer) o; + +if (_success != that._success) return false; + +return true; +} + +@Override +public int hashCode() { +return (_success ? 1 : 0); +} --- End diff -- We can't, the toString() method is made final in the base class Command of which Answer is a subclass --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r41972058 --- Diff: plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/manager/SupportedApiVersionCommand.java --- @@ -0,0 +1,58 @@ +// +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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.cloud.agent.api.manager; + +import com.cloud.agent.api.Command; + +public class SupportedApiVersionCommand extends Command { + +private final String _apiVersion; + +public SupportedApiVersionCommand(String apiVersion) { +super(); +this._apiVersion = apiVersion; +} + +public String getApiVersion() { +return _apiVersion; +} + +@Override +public boolean executeInSequence() { +return false; +} + +@Override +public boolean equals(Object o) { +if (this == o) return true; +if (o == null || getClass() != o.getClass()) return false; + +SupportedApiVersionCommand that = (SupportedApiVersionCommand) o; + +if (_apiVersion != null ? !_apiVersion.equals(that._apiVersion) : that._apiVersion != null) return false; + +return true; +} + +@Override +public int hashCode() { +return _apiVersion != null ? _apiVersion.hashCode() : 0; +} --- End diff -- We can't, the toString() method is made final in the base class Command of which Answer is a subclass --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r41972073 --- Diff: plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/guru/TrashNetworkVspCommand.java --- @@ -48,13 +53,93 @@ public boolean isL3Network() { return _isL3Network; } +public boolean isSharedNetwork() { +return _isSharedNetwork; +} + public String getVpcUuid() { return _vpcUuid; } +public String getDomainTemplateName() { +return _domainTemplateName; +} + +public static class Builder extends CmdBuilder { +private String _domainUuid; +private String _networkUuid; +private boolean _isL3Network; +private boolean _isSharedNetwork; +private String _vpcUuid; +private String _domainTemplateName; + +public Builder domainUuid(String domainUuid) { +this._domainUuid = domainUuid; +return this; +} + +public Builder networkUuid(String networkUuid) { +this._networkUuid = networkUuid; +return this; +} + +public Builder isL3Network(boolean isL3Network) { +this._isL3Network = isL3Network; +return this; +} + +public Builder isSharedNetwork(boolean isSharedNetwork) { +this._isSharedNetwork = isSharedNetwork; +return this; +} + +public Builder vpcUuid(String vpcUuid) { +this._vpcUuid = vpcUuid; +return this; +} + +public Builder domainTemplateName(String domainTemplateName) { +this._domainTemplateName = domainTemplateName; +return this; +} + +@Override +public TrashNetworkVspCommand build() { +return new TrashNetworkVspCommand(_domainUuid, _networkUuid, _isL3Network, _isSharedNetwork, _vpcUuid, _domainTemplateName); +} +} + @Override public boolean executeInSequence() { return false; } +@Override +public boolean equals(Object o) { +if (this == o) return true; +if (o == null || getClass() != o.getClass()) return false; + +TrashNetworkVspCommand that = (TrashNetworkVspCommand) o; + +if (_isL3Network != that._isL3Network) return false; +if (_isSharedNetwork != that._isSharedNetwork) return false; +if (_domainTemplateName != null ? !_domainTemplateName.equals(that._domainTemplateName) : that._domainTemplateName != null) +return false; +if (_domainUuid != null ? !_domainUuid.equals(that._domainUuid) : that._domainUuid != null) return false; +if (_networkUuid != null ? !_networkUuid.equals(that._networkUuid) : that._networkUuid != null) return false; +if (_vpcUuid != null ? !_vpcUuid.equals(that._vpcUuid) : that._vpcUuid != null) return false; + +return true; +} + +@Override +public int hashCode() { +int result = _domainUuid != null ? _domainUuid.hashCode() : 0; +result = 31 * result + (_networkUuid != null ? _networkUuid.hashCode() : 0); +result = 31 * result + (_isL3Network ? 1 : 0); +result = 31 * result + (_isSharedNetwork ? 1 : 0); +result = 31 * result + (_vpcUuid != null ? _vpcUuid.hashCode() : 0); +result = 31 * result + (_domainTemplateName != null ? _domainTemplateName.hashCode() : 0); +return result; +} --- End diff -- We can't, the toString() method is made final in the base class Command of which Answer is a subclass --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r41972064 --- Diff: plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/manager/GetClientDefaultsAnswer.java --- @@ -0,0 +1,79 @@ +// +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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.cloud.agent.api.manager; + +import com.cloud.agent.api.Answer; + +import java.util.Map; + +public class GetClientDefaultsAnswer extends Answer { + +private String _currentApiVersion; +private Integer _apiRetryCount; +private Long _apiRetryInterval; + +public GetClientDefaultsAnswer(GetClientDefaultsCommand cmd, Map defaults) { +super(cmd); +this._currentApiVersion = (String) defaults.get("CURRENT_API_VERSION"); +this._apiRetryCount = (Integer) defaults.get("DEFAULT_API_RETRY_COUNT"); +this._apiRetryInterval = (Long) defaults.get("DEFAULT_API_RETRY_INTERVAL"); +} + +public GetClientDefaultsAnswer(GetClientDefaultsCommand cmd, Exception e) { +super(cmd, e); +} + +public String getCurrentApiVersion() { +return _currentApiVersion; +} + +public Integer getApiRetryCount() { +return _apiRetryCount; +} + +public Long getApiRetryInterval() { +return _apiRetryInterval; +} + +@Override +public boolean equals(Object o) { +if (this == o) return true; +if (o == null || getClass() != o.getClass()) return false; + +GetClientDefaultsAnswer that = (GetClientDefaultsAnswer) o; + +if (_apiRetryCount != null ? !_apiRetryCount.equals(that._apiRetryCount) : that._apiRetryCount != null) +return false; +if (_apiRetryInterval != null ? !_apiRetryInterval.equals(that._apiRetryInterval) : that._apiRetryInterval != null) +return false; +if (_currentApiVersion != null ? !_currentApiVersion.equals(that._currentApiVersion) : that._currentApiVersion != null) +return false; + +return true; +} + +@Override +public int hashCode() { +int result = _currentApiVersion != null ? _currentApiVersion.hashCode() : 0; +result = 31 * result + (_apiRetryCount != null ? _apiRetryCount.hashCode() : 0); +result = 31 * result + (_apiRetryInterval != null ? _apiRetryInterval.hashCode() : 0); +return result; +} --- End diff -- We can't, the toString() method is made final in the base class Command of which Answer is a subclass --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r41972179 --- Diff: plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/guru/DeallocateVmVspCommand.java --- @@ -83,9 +92,130 @@ public String getVmUuid() { return _vmUuid; } +public boolean isExpungingState() { +return _isExpungingState; +} + +public static class Builder extends CmdBuilder { +private String _networkUuid; +private String _nicFromDdUuid; +private String _nicMacAddress; +private String _nicIp4Address; +private boolean _isL3Network; +private boolean _isSharedNetwork; +private String _vpcUuid; +private String _networksDomainUuid; +private String _vmInstanceName; +private String _vmUuid; +private boolean _isExpungingState; + +public Builder networkUuid(String networkUuid) { +this._networkUuid = networkUuid; +return this; +} + +public Builder nicFromDbUuid(String nicFromDbUuid) { +this._nicFromDdUuid = nicFromDbUuid; +return this; +} + +public Builder nicMacAddress(String nicMacAddress) { +this._nicMacAddress = nicMacAddress; +return this; +} + +public Builder nicIp4Address(String nicIp4Address) { +this._nicIp4Address = nicIp4Address; +return this; +} + +public Builder isL3Network(boolean isL3Network) { +this._isL3Network = isL3Network; +return this; +} + +public Builder isSharedNetwork(boolean isSharedNetwork) { +this._isSharedNetwork = isSharedNetwork; +return this; +} + +public Builder vpcUuid(String vpcUuid) { +this._vpcUuid = vpcUuid; +return this; +} + +public Builder networksDomainUuid(String networksDomainUuid) { +this._networksDomainUuid = networksDomainUuid; +return this; +} + +public Builder vmInstanceName(String vmInstanceName) { +this._vmInstanceName = vmInstanceName; +return this; +} + +public Builder vmUuid(String vmUuid) { +this._vmUuid = vmUuid; +return this; +} + +public Builder isExpungingState(boolean isExpungingState) { +this._isExpungingState = isExpungingState; +return this; +} + +@Override +public DeallocateVmVspCommand build() { +return new DeallocateVmVspCommand(_networkUuid,_nicFromDdUuid, _nicMacAddress, _nicIp4Address, _isL3Network, _isSharedNetwork, _vpcUuid, +_networksDomainUuid, _vmInstanceName, _vmUuid, _isExpungingState); +} +} + @Override public boolean executeInSequence() { return false; } +@Override +public boolean equals(Object o) { +if (this == o) return true; +if (o == null || getClass() != o.getClass()) return false; + +DeallocateVmVspCommand that = (DeallocateVmVspCommand) o; + +if (_isExpungingState != that._isExpungingState) return false; +if (_isL3Network != that._isL3Network) return false; +if (_isSharedNetwork != that._isSharedNetwork) return false; +if (_networkUuid != null ? !_networkUuid.equals(that._networkUuid) : that._networkUuid != null) return false; +if (_networksDomainUuid != null ? !_networksDomainUuid.equals(that._networksDomainUuid) : that._networksDomainUuid != null) +return false; +if (_nicFromDdUuid != null ? !_nicFromDdUuid.equals(that._nicFromDdUuid) : that._nicFromDdUuid != null) +return false; +if (_nicIp4Address != null ? !_nicIp4Address.equals(that._nicIp4Address) : that._nicIp4Address != null) +return false; +if (_nicMacAddress != null ? !_nicMacAddress.equals(that._nicMacAddress) : that._nicMacAddress != null) +return false; +if (_vmInstanceName != null ? !_vmInstanceName.equals(that._vmInstanceName) : that._vmInstanceName != null) +return false; +if (_vmUuid != null ? !_vmUuid.equals(that._vmUuid) : that._vmUuid != null) return false; +if (_vpcUuid != null ? !_vpcUuid.equals(that._vpcUuid) : that._vpcUuid != null) return false; + +return true; +} + +@Override +public int hashCode
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r41972163 --- Diff: plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/guru/ImplementNetworkVspCommand.java --- @@ -112,13 +147,212 @@ public boolean isDefaultEgressPolicy() { return _defaultEgressPolicy; } -public Collection getIpAddressRange() { +public Collection getIpAddressRange() { return _ipAddressRange; } +public String getDomainTemplateName() { +return _domainTemplateName; +} + +public static class Builder extends CmdBuilder { +private String _networkDomainName; +private String _networkDomainPath; +private String _networkDomainUuid; +private String _networkAccountName; +private String _networkAccountUuid; +private String _networkName; +private String _networkCidr; +private String _networkGateway; +private Long _networkAclId; +private List _dnsServers; +private List _gatewaySystemIds; +private String _networkUuid; +private boolean _isL3Network; +private boolean _isVpc; +private boolean _isSharedNetwork; +private String _vpcName; +private String _vpcUuid; +private boolean _defaultEgressPolicy; +private List _ipAddressRange; +private String _domainTemplateName; + +public Builder networkDomainName(String networkDomainName) { +this._networkDomainName = networkDomainName; +return this; +} + +public Builder networkDomainPath(String networkDomainPath) { +this._networkDomainPath = networkDomainPath; +return this; +} + +public Builder networkDomainUuid(String networkDomainUuid) { +this._networkDomainUuid = networkDomainUuid; +return this; +} + +public Builder networkAccountName(String networkAccountName) { +this._networkAccountName = networkAccountName; +return this; +} + +public Builder networkAccountUuid(String networkAccountUuid) { +this._networkAccountUuid = networkAccountUuid; +return this; +} + +public Builder networkName(String networkName) { +this._networkName = networkName; +return this; +} + +public Builder networkCidr(String networkCidr) { +this._networkCidr = networkCidr; +return this; +} + +public Builder networkGateway(String networkGateway) { +this._networkGateway = networkGateway; +return this; +} + +public Builder networkAclId(Long networkAclId) { +this._networkAclId = networkAclId; +return this; +} + +public Builder dnsServers(List dnsServers) { +this._dnsServers = dnsServers; +return this; +} + +public Builder gatewaySystemIds(List gatewaySystemIds) { +this._gatewaySystemIds = gatewaySystemIds; +return this; +} + +public Builder networkUuid(String networkUuid) { +this._networkUuid = networkUuid; +return this; +} + +public Builder isL3Network(boolean isL3Network) { +this._isL3Network = isL3Network; +return this; +} + +public Builder isVpc(boolean isVpc) { +this._isVpc = isVpc; +return this; +} + +public Builder isSharedNetwork(boolean isSharedNetwork) { +this._isSharedNetwork = isSharedNetwork; +return this; +} + +public Builder vpcName(String vpcName) { +this._vpcName = vpcName; +return this; +} + +public Builder vpcUuid(String vpcUuid) { +this._vpcUuid = vpcUuid; +return this; +} + +public Builder defaultEgressPolicy(boolean defaultEgressPolicy) { +this._defaultEgressPolicy = defaultEgressPolicy; +return this; +} + +public Builder ipAddressRange(List ipAddressRange) { +this._ipAddressRange = ipAddressRange; +return this; +} + +public Builder domainTemplateName(String domainTemplateName) { +this._domainTemplateName = domainTemplateName
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r41972148 --- Diff: plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/guru/ReserveVmInterfaceVspCommand.java --- @@ -87,29 +114,285 @@ public boolean isDomainRouter() { return _isDomainRouter; } -public String _getDomainRouterIp() { +public String getDomainRouterIp() { return _domainRouterIp; } -public String _getVmInstanceName() { +public String getVmInstanceName() { return _vmInstanceName; } -public String _getVmUuid() { +public String getVmUuid() { return _vmUuid; } -public String _getVmUserName() { +public String getVmUserName() { return _vmUserName; } -public String _getVmUserDomainName() { +public String getVmUserDomainName() { return _vmUserDomainName; } +public boolean useStaticIp() { +return _useStaticIp; +} + +public String getStaticIp() { +return _staticIp; +} + +public String getStaticNatIpUuid() { +return _staticNatIpUuid; +} + +public String getStaticNatIpAddress() { +return _staticNatIpAddress; +} + +public boolean isStaticNatIpAllocated() { +return _isStaticNatIpAllocated; +} + +public boolean isOneToOneNat() { +return _isOneToOneNat; +} + +public String getStaticNatVlanUuid() { +return _staticNatVlanUuid; +} + +public String getStaticNatVlanGateway() { +return _staticNatVlanGateway; +} + +public String getStaticNatVlanNetmask() { +return _staticNatVlanNetmask; +} + +public static class Builder extends CmdBuilder { +private String _nicUuid; +private String _nicMacAddress; +private String _networkUuid; +private boolean _isL3Network; +private boolean _isSharedNetwork; +private String _vpcUuid; +private String _networkDomainUuid; +private String _networksAccountUuid; +private boolean _isDomainRouter; +private String _domainRouterIp; +private String _vmInstanceName; +private String _vmUuid; +private String _vmUserName; +private String _vmUserDomainName; +private boolean _useStaticIp; +private String _staticIp; +private String _staticNatIpUuid; +private String _staticNatIpAddress; +private boolean _isStaticNatIpAllocated; +private boolean _isOneToOneNat; +private String _staticNatVlanUuid; +private String _staticNatVlanGateway; +private String _staticNatVlanNetmask; + +public Builder nicUuid(String nicUuid) { +this._nicUuid = nicUuid; +return this; +} + +public Builder nicMacAddress(String nicMacAddress) { +this._nicMacAddress = nicMacAddress; +return this; +} + +public Builder networkUuid(String networkUuid) { +this._networkUuid = networkUuid; +return this; +} + +public Builder isL3Network(boolean isL3Network) { +this._isL3Network = isL3Network; +return this; +} + +public Builder isSharedNetwork(boolean isSharedNetwork) { +this._isSharedNetwork = isSharedNetwork; +return this; +} + +public Builder vpcUuid(String vpcUuid) { +this._vpcUuid = vpcUuid; +return this; +} + +public Builder networkDomainUuid(String networkDomainUuid) { +this._networkDomainUuid = networkDomainUuid; +return this; +} + +public Builder networksAccountUuid(String networksAccountUuid) { +this._networksAccountUuid = networksAccountUuid; +return this; +} + +public Builder isDomainRouter(boolean isDomainRouter) { +this._isDomainRouter = isDomainRouter; +return this; +} + +public Builder domainRouterIp(String domainRouterIp) { +this._domainRouterIp = domainRouterIp; +return this; +} + +public Builder vmInstanceName(String vmInstanceName) { +this._vmInstanceName = vmInstanceName; +return this; +} + +public Builder
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r41972191 --- Diff: plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/element/ShutDownVpcVspCommand.java --- @@ -40,9 +43,61 @@ public String getVpcUuid() { return _vpcUuid; } +public String getDomainTemplateName() { +return _domainTemplateName; +} + +public static class Builder extends CmdBuilder { +private String _domainUuid; +private String _vpcUuid; +private String _domainTemplateName; + +public Builder domainUuid(String domainUuid) { +this._domainUuid = domainUuid; +return this; +} + +public Builder vpcUuid(String vpcUuid) { +this._vpcUuid = vpcUuid; +return this; +} + +public Builder domainTemplateName(String domainTemplateName) { +this._domainTemplateName = domainTemplateName; +return this; +} + +@Override +public ShutDownVpcVspCommand build() { +return new ShutDownVpcVspCommand(_domainUuid, _vpcUuid, _domainTemplateName); +} +} + @Override public boolean executeInSequence() { return false; } +@Override +public boolean equals(Object o) { +if (this == o) return true; +if (o == null || getClass() != o.getClass()) return false; + +ShutDownVpcVspCommand that = (ShutDownVpcVspCommand) o; + +if (_domainTemplateName != null ? !_domainTemplateName.equals(that._domainTemplateName) : that._domainTemplateName != null) +return false; +if (_domainUuid != null ? !_domainUuid.equals(that._domainUuid) : that._domainUuid != null) return false; +if (_vpcUuid != null ? !_vpcUuid.equals(that._vpcUuid) : that._vpcUuid != null) return false; + +return true; +} + +@Override +public int hashCode() { +int result = _domainUuid != null ? _domainUuid.hashCode() : 0; +result = 31 * result + (_vpcUuid != null ? _vpcUuid.hashCode() : 0); +result = 31 * result + (_domainTemplateName != null ? _domainTemplateName.hashCode() : 0); +return result; +} --- End diff -- We can't, the toString() method is made final in the base class Command --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r41972200 --- Diff: plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/element/ImplementVspCommand.java --- @@ -0,0 +1,295 @@ +// +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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.cloud.agent.api.element; + +import com.cloud.agent.api.CmdBuilder; +import com.cloud.agent.api.Command; + +import java.util.List; +import java.util.Map; + +public class ImplementVspCommand extends Command { + +private final long _networkId; +private final String _networkDomainUuid; +private final String _networkUuid; +private final String _networkName; +private final String _vpcOrSubnetUuid; +private final boolean _isL2Network; +private final boolean _isL3Network; +private final boolean _isVpc; +private final boolean _isShared; +private final String _domainTemplateName; +private final boolean _isFirewallServiceSupported; +private final List _dnsServers; +private final List> _ingressFirewallRules; +private final List> _egressFirewallRules; +private final List _acsFipUuid; +private final boolean _egressDefaultPolicy; + +private ImplementVspCommand(long networkId, String networkDomainUuid, String networkUuid, String networkName, String vpcOrSubnetUuid, boolean isL2Network, boolean isL3Network, +boolean isVpc, boolean isShared, String domainTemplateName, boolean isFirewallServiceSupported, List dnsServers, List> ingressFirewallRules, +List> egressFirewallRules, List acsFipUuid, boolean egressDefaultPolicy) { +super(); +this._networkId = networkId; +this._networkDomainUuid = networkDomainUuid; +this._networkUuid = networkUuid; +this._networkName = networkName; +this._vpcOrSubnetUuid = vpcOrSubnetUuid; +this._isL2Network = isL2Network; +this._isL3Network = isL3Network; +this._isVpc = isVpc; +this._isShared = isShared; +this._domainTemplateName = domainTemplateName; +this._isFirewallServiceSupported = isFirewallServiceSupported; +this._dnsServers = dnsServers; +this._ingressFirewallRules = ingressFirewallRules; +this._egressFirewallRules = egressFirewallRules; +this._acsFipUuid = acsFipUuid; +this._egressDefaultPolicy = egressDefaultPolicy; +} + +public long getNetworkId() { +return _networkId; +} + +public String getNetworkDomainUuid() { +return _networkDomainUuid; +} + +public String getNetworkUuid() { +return _networkUuid; +} + +public String getNetworkName() { +return _networkName; +} + +public String getVpcOrSubnetUuid() { +return _vpcOrSubnetUuid; +} + +public boolean isL2Network() { +return _isL2Network; +} + +public boolean isL3Network() { +return _isL3Network; +} + +public boolean isVpc() { +return _isVpc; +} + +public boolean isShared() { +return _isShared; +} + +public String getDomainTemplateName() { +return _domainTemplateName; +} + +public boolean isFirewallServiceSupported() { +return _isFirewallServiceSupported; +} + +public List getDnsServers() { +return _dnsServers; +} + +public List> getIngressFirewallRules() { +return _ingressFirewallRules; +} + +public List> getEgressFirewallRules() { +return _egressFirewallRules; +} + +public List getAcsFipUuid() { +return _acsFipUuid; +} + +
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r41972314 --- Diff: plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/element/ApplyAclRuleVspCommand.java --- @@ -79,4 +191,47 @@ public boolean executeInSequence() { return false; } +@Override +public boolean equals(Object o) { +if (this == o) return true; +if (o == null || getClass() != o.getClass()) return false; + +ApplyAclRuleVspCommand that = (ApplyAclRuleVspCommand) o; + +if (_egressDefaultPolicy != that._egressDefaultPolicy) return false; +if (_isL2Network != that._isL2Network) return false; +if (_networkAcl != that._networkAcl) return false; +if (_networkId != that._networkId) return false; +if (_networkReset != that._networkReset) return false; +if (_aclRules != null ? !_aclRules.equals(that._aclRules) : that._aclRules != null) return false; +if (_acsIngressAcl != null ? !_acsIngressAcl.equals(that._acsIngressAcl) : that._acsIngressAcl != null) +return false; +if (_domainTemplateName != null ? !_domainTemplateName.equals(that._domainTemplateName) : that._domainTemplateName != null) +return false; +if (_networkDomainUuid != null ? !_networkDomainUuid.equals(that._networkDomainUuid) : that._networkDomainUuid != null) +return false; +if (_networkName != null ? !_networkName.equals(that._networkName) : that._networkName != null) return false; +if (_networkUuid != null ? !_networkUuid.equals(that._networkUuid) : that._networkUuid != null) return false; +if (_vpcOrSubnetUuid != null ? !_vpcOrSubnetUuid.equals(that._vpcOrSubnetUuid) : that._vpcOrSubnetUuid != null) +return false; + +return true; +} + +@Override +public int hashCode() { +int result = (_networkAcl ? 1 : 0); +result = 31 * result + (_networkUuid != null ? _networkUuid.hashCode() : 0); +result = 31 * result + (_networkDomainUuid != null ? _networkDomainUuid.hashCode() : 0); +result = 31 * result + (_vpcOrSubnetUuid != null ? _vpcOrSubnetUuid.hashCode() : 0); +result = 31 * result + (_networkName != null ? _networkName.hashCode() : 0); +result = 31 * result + (_isL2Network ? 1 : 0); +result = 31 * result + (_aclRules != null ? _aclRules.hashCode() : 0); +result = 31 * result + (int) (_networkId ^ (_networkId >>> 32)); +result = 31 * result + (_egressDefaultPolicy ? 1 : 0); +result = 31 * result + (_acsIngressAcl != null ? _acsIngressAcl.hashCode() : 0); +result = 31 * result + (_networkReset ? 1 : 0); +result = 31 * result + (_domainTemplateName != null ? _domainTemplateName.hashCode() : 0); +return result; +} --- End diff -- We can't, the toString() method is made final in the base class Command --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r41972355 --- Diff: plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/VspResourceAnswer.java --- @@ -39,4 +39,22 @@ public VspResourceAnswer(VspResourceCommand cmd, Exception e) { public String getResourceInfo() { return this._resourceInfo; } + +@Override +public boolean equals(Object o) { +if (this == o) return true; +if (o == null || getClass() != o.getClass()) return false; + +VspResourceAnswer that = (VspResourceAnswer) o; + +if (_resourceInfo != null ? !_resourceInfo.equals(that._resourceInfo) : that._resourceInfo != null) +return false; + +return true; +} + +@Override +public int hashCode() { +return _resourceInfo != null ? _resourceInfo.hashCode() : 0; +} --- End diff -- We can't, the toString() method is made final in the base class Command of which Answer is a subclass --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r41972373 --- Diff: plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/UpdateNuageVspDeviceCommand.java --- @@ -0,0 +1,60 @@ +// +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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.cloud.agent.api; + +import java.util.Collections; +import java.util.Map; + +public class UpdateNuageVspDeviceCommand extends Command { + +private final Map _parametersToBeUpdated; + +public UpdateNuageVspDeviceCommand(Map parametersToBeUpdated) { +super(); +this._parametersToBeUpdated = parametersToBeUpdated; +} + +public Map getParametersToBeUpdated() { +return Collections.unmodifiableMap(_parametersToBeUpdated); +} + +@Override +public boolean executeInSequence() { +return false; +} + +@Override +public boolean equals(Object o) { +if (this == o) return true; +if (o == null || getClass() != o.getClass()) return false; + +UpdateNuageVspDeviceCommand that = (UpdateNuageVspDeviceCommand) o; + +if (_parametersToBeUpdated != null ? !_parametersToBeUpdated.equals(that._parametersToBeUpdated) : that._parametersToBeUpdated != null) +return false; + +return true; +} + +@Override +public int hashCode() { +return _parametersToBeUpdated != null ? _parametersToBeUpdated.hashCode() : 0; +} --- End diff -- We can't, the toString() method is made final in the base class Command --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r41972321 --- Diff: plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/VspResourceCommand.java --- @@ -79,4 +79,41 @@ public String getProxyUserDomainuuid() { public boolean executeInSequence() { return false; } + +@Override +public boolean equals(Object o) { +if (this == o) return true; +if (o == null || getClass() != o.getClass()) return false; + +VspResourceCommand that = (VspResourceCommand) o; + +if (_childResource != null ? !_childResource.equals(that._childResource) : that._childResource != null) +return false; +if (_entityDetails != null ? !_entityDetails.equals(that._entityDetails) : that._entityDetails != null) +return false; +if (_method != null ? !_method.equals(that._method) : that._method != null) return false; +if (_proxyUserDomainuuid != null ? !_proxyUserDomainuuid.equals(that._proxyUserDomainuuid) : that._proxyUserDomainuuid != null) +return false; +if (_proxyUserUuid != null ? !_proxyUserUuid.equals(that._proxyUserUuid) : that._proxyUserUuid != null) +return false; +if (_resource != null ? !_resource.equals(that._resource) : that._resource != null) return false; +if (_resourceFilter != null ? !_resourceFilter.equals(that._resourceFilter) : that._resourceFilter != null) +return false; +if (_resourceId != null ? !_resourceId.equals(that._resourceId) : that._resourceId != null) return false; + +return true; +} + +@Override +public int hashCode() { +int result = _method != null ? _method.hashCode() : 0; +result = 31 * result + (_resource != null ? _resource.hashCode() : 0); +result = 31 * result + (_resourceId != null ? _resourceId.hashCode() : 0); +result = 31 * result + (_childResource != null ? _childResource.hashCode() : 0); +result = 31 * result + (_entityDetails != null ? _entityDetails.hashCode() : 0); +result = 31 * result + (_resourceFilter != null ? _resourceFilter.hashCode() : 0); +result = 31 * result + (_proxyUserUuid != null ? _proxyUserUuid.hashCode() : 0); +result = 31 * result + (_proxyUserDomainuuid != null ? _proxyUserDomainuuid.hashCode() : 0); +return result; +} --- End diff -- We can't, the toString() method is made final in the base class Command --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r41972301 --- Diff: plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/element/ApplyStaticNatVspCommand.java --- @@ -51,13 +61,91 @@ public boolean isL3Network() { return _isL3Network; } +public boolean isVpc() { +return _isVpc; +} + public List> getStaticNatDetails() { return _staticNatDetails; } +public static class Builder extends CmdBuilder { +private String _networkDomainUuid; +private String _networkUuid; +private String _vpcOrSubnetUuid; +private boolean _isL3Network; +private boolean _isVpc; +private List> _staticNatDetails; + +public Builder networkDomainUuid(String networkDomainUuid) { +this._networkDomainUuid = networkDomainUuid; +return this; +} + +public Builder networkUuid(String networkUuid) { +this._networkUuid = networkUuid; +return this; +} + +public Builder vpcOrSubnetUuid(String vpcOrSubnetUuid) { +this._vpcOrSubnetUuid = vpcOrSubnetUuid; +return this; +} + +public Builder isL3Network(boolean isL3Network) { +this._isL3Network = isL3Network; +return this; +} + +public Builder isVpc(boolean isVpc) { +this._isVpc = isVpc; +return this; +} + +public Builder staticNatDetails(List> staticNatDetails) { +this._staticNatDetails = staticNatDetails; +return this; +} + +@Override +public ApplyStaticNatVspCommand build() { +return new ApplyStaticNatVspCommand(_networkDomainUuid, _networkUuid, _vpcOrSubnetUuid, _isL3Network, _isVpc, _staticNatDetails); +} +} + @Override public boolean executeInSequence() { return false; } +@Override +public boolean equals(Object o) { +if (this == o) return true; +if (o == null || getClass() != o.getClass()) return false; + +ApplyStaticNatVspCommand that = (ApplyStaticNatVspCommand) o; + +if (_isL3Network != that._isL3Network) return false; +if (_isVpc != that._isVpc) return false; +if (_networkDomainUuid != null ? !_networkDomainUuid.equals(that._networkDomainUuid) : that._networkDomainUuid != null) +return false; +if (_networkUuid != null ? !_networkUuid.equals(that._networkUuid) : that._networkUuid != null) return false; +if (_staticNatDetails != null ? !_staticNatDetails.equals(that._staticNatDetails) : that._staticNatDetails != null) +return false; +if (_vpcOrSubnetUuid != null ? !_vpcOrSubnetUuid.equals(that._vpcOrSubnetUuid) : that._vpcOrSubnetUuid != null) +return false; + +return true; +} + +@Override +public int hashCode() { +int result = _networkDomainUuid != null ? _networkDomainUuid.hashCode() : 0; +result = 31 * result + (_networkUuid != null ? _networkUuid.hashCode() : 0); +result = 31 * result + (_vpcOrSubnetUuid != null ? _vpcOrSubnetUuid.hashCode() : 0); +result = 31 * result + (_isL3Network ? 1 : 0); +result = 31 * result + (_isVpc ? 1 : 0); +result = 31 * result + (_staticNatDetails != null ? _staticNatDetails.hashCode() : 0); +return result; +} --- End diff -- We can't, the toString() method is made final in the base class Command --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r41972646 --- Diff: plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/StartupVspCommand.java --- @@ -26,4 +26,14 @@ public StartupVspCommand() { super(Host.Type.L2Networking); } + +@Override +public boolean equals(Object obj) { +return super.equals(obj); +} + +@Override +public int hashCode() { +return super.hashCode(); +} --- End diff -- We can't, the toString() method is made final in the base class Command --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r41972823 --- Diff: plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/CmdBuilder.java --- @@ -0,0 +1,24 @@ +// +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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.cloud.agent.api; + +public abstract class CmdBuilder { --- End diff -- You are right, changed to an interface --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r41973409 --- Diff: plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/sync/SyncNuageVspCmsIdAnswer.java --- @@ -0,0 +1,71 @@ +// +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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.cloud.agent.api.sync; + +import com.cloud.agent.api.Answer; + +public class SyncNuageVspCmsIdAnswer extends Answer { + +private final boolean _success; +private final String _nuageVspCmsId; +private final SyncNuageVspCmsIdCommand.SyncType _syncType; + +public SyncNuageVspCmsIdAnswer(boolean success, String nuageVspCmsId, SyncNuageVspCmsIdCommand.SyncType syncType) { +super(); +this._success = success; +this._nuageVspCmsId = nuageVspCmsId; +this._syncType = syncType; +} + +public boolean getSuccess() { +return _success; +} + +public String getNuageVspCmsId() { +return _nuageVspCmsId; +} + +public SyncNuageVspCmsIdCommand.SyncType getSyncType() { +return _syncType; +} + +@Override +public boolean equals(Object o) { +if (this == o) return true; +if (o == null || getClass() != o.getClass()) return false; + +SyncNuageVspCmsIdAnswer that = (SyncNuageVspCmsIdAnswer) o; + +if (_success != that._success) return false; +if (_nuageVspCmsId != null ? !_nuageVspCmsId.equals(that._nuageVspCmsId) : that._nuageVspCmsId != null) +return false; +if (_syncType != that._syncType) return false; + +return true; +} + +@Override +public int hashCode() { +int result = (_success ? 1 : 0); +result = 31 * result + (_nuageVspCmsId != null ? _nuageVspCmsId.hashCode() : 0); +result = 31 * result + (_syncType != null ? _syncType.hashCode() : 0); +return result; +} --- End diff -- We can't, the toString() method is made final in the base class Command of which Answer is a subclass --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r41973419 --- Diff: plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/sync/SyncNuageVspCmsIdCommand.java --- @@ -0,0 +1,70 @@ +// +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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.cloud.agent.api.sync; + +import com.cloud.agent.api.Command; + +public class SyncNuageVspCmsIdCommand extends Command { + +public static enum SyncType { AUDIT, AUDIT_ONLY, REGISTER, UNREGISTER } + +private final SyncType _syncType; +private final String _nuageVspCmsId; + +public SyncNuageVspCmsIdCommand(SyncType syncType, String nuageVspCmsId) { +super(); +this._syncType = syncType; +this._nuageVspCmsId = nuageVspCmsId; +} + +public SyncType getSyncType() { +return _syncType; +} + +public String getNuageVspCmsId() { +return _nuageVspCmsId; +} + +@Override +public boolean executeInSequence() { +return false; +} + +@Override +public boolean equals(Object o) { +if (this == o) return true; +if (o == null || getClass() != o.getClass()) return false; + +SyncNuageVspCmsIdCommand that = (SyncNuageVspCmsIdCommand) o; + +if (_nuageVspCmsId != null ? !_nuageVspCmsId.equals(that._nuageVspCmsId) : that._nuageVspCmsId != null) +return false; +if (_syncType != that._syncType) return false; + +return true; +} + +@Override +public int hashCode() { +int result = _syncType != null ? _syncType.hashCode() : 0; +result = 31 * result + (_nuageVspCmsId != null ? _nuageVspCmsId.hashCode() : 0); +return result; +} --- End diff -- We can't, the toString() method is made final in the base class Command --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r41973391 --- Diff: plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/sync/SyncDomainCommand.java --- @@ -0,0 +1,91 @@ +// +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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.cloud.agent.api.sync; + +import com.cloud.agent.api.Command; + +public class SyncDomainCommand extends Command { + +private final String _domainUuid; +private final String _domainName; +private final String _domainPath; +private final boolean _toAdd; +private final boolean _toRemove; + +public SyncDomainCommand(String domainUuid, String domainName, String domainPath, boolean toAdd, boolean toRemove) { +super(); +this._domainUuid = domainUuid; +this._domainName = domainName; +this._domainPath = domainPath; +this._toAdd = toAdd; +this._toRemove = toRemove; +} + +public String getDomainUuid() { +return _domainUuid; +} + +public String getDomainName() { +return _domainName; +} + +public String getDomainPath() { +return _domainPath; +} + +public boolean isToAdd() { +return _toAdd; +} + +public boolean isToRemove() { +return _toRemove; +} + +@Override +public boolean executeInSequence() { +return false; +} + +@Override +public boolean equals(Object o) { +if (this == o) return true; +if (o == null || getClass() != o.getClass()) return false; + +SyncDomainCommand that = (SyncDomainCommand) o; + +if (_toAdd != that._toAdd) return false; +if (_toRemove != that._toRemove) return false; +if (_domainName != null ? !_domainName.equals(that._domainName) : that._domainName != null) return false; +if (_domainPath != null ? !_domainPath.equals(that._domainPath) : that._domainPath != null) return false; +if (_domainUuid != null ? !_domainUuid.equals(that._domainUuid) : that._domainUuid != null) return false; + +return true; +} + +@Override +public int hashCode() { +int result = _domainUuid != null ? _domainUuid.hashCode() : 0; +result = 31 * result + (_domainName != null ? _domainName.hashCode() : 0); +result = 31 * result + (_domainPath != null ? _domainPath.hashCode() : 0); +result = 31 * result + (_toAdd ? 1 : 0); +result = 31 * result + (_toRemove ? 1 : 0); +return result; +} --- End diff -- We can't, the toString() method is made final in the base class Command --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r41973323 --- Diff: plugins/network-elements/nuage-vsp/pom.xml --- @@ -28,6 +28,13 @@ 4.6.0-SNAPSHOT ../../pom.xml + + + org.apache.commons + commons-lang3 + ${cs.lang3.version} + + --- End diff -- Yes, this is used for the Pair class. Unfortunately Guava has no Pair class, or anything related, in their library. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r41973455 --- Diff: plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/sync/SyncVspCommand.java --- @@ -39,4 +39,21 @@ public String getNuageVspEntity() { return _nuageVspEntity; } +@Override +public boolean equals(Object o) { +if (this == o) return true; +if (o == null || getClass() != o.getClass()) return false; + +SyncVspCommand that = (SyncVspCommand) o; + +if (_nuageVspEntity != null ? !_nuageVspEntity.equals(that._nuageVspEntity) : that._nuageVspEntity != null) +return false; + +return true; +} + +@Override +public int hashCode() { +return _nuageVspEntity != null ? _nuageVspEntity.hashCode() : 0; +} --- End diff -- We can't, the toString() method is made final in the base class Command --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r41973520 --- Diff: plugins/network-elements/nuage-vsp/src/com/cloud/network/dao/NuageVspDaoImpl.java --- @@ -36,11 +34,16 @@ implements NuageVspDao { protected final SearchBuilder physicalNetworkIdSearch; +protected final SearchBuilder hostIdSearch; --- End diff -- That was a mistake, changed to private --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r41979052 --- Diff: plugins/network-elements/nuage-vsp/src/com/cloud/network/element/NuageVspElement.java --- @@ -205,9 +254,79 @@ public boolean implement(Network network, NetworkOffering offering, DeployDestin return false; } +final boolean egressDefaultPolicy = offering.getEgressDefaultPolicy(); +Domain networkDomain = _domainDao.findById(network.getDomainId()); +boolean isFirewallServiceSupported = _networkModel.areServicesSupportedByNetworkOffering(offering.getId(), Service.Firewall); +List dnsServers = _nuageVspManager.getDnsDetails(network); + +boolean isL2Network = false, isL3Network = false, isShared = false; +String subnetUuid = network.getUuid(); +if (offering.getGuestType() == Network.GuestType.Shared) { +isShared = true; +subnetUuid = networkDomain.getUuid(); +} else if (_ntwkOfferingSrvcDao.areServicesSupportedByNetworkOffering(offering.getId(), Service.SourceNat) +|| _ntwkOfferingSrvcDao.areServicesSupportedByNetworkOffering(offering.getId(), Service.StaticNat) +|| _ntwkOfferingSrvcDao.areServicesSupportedByNetworkOffering(offering.getId(), Service.Connectivity)) { +isL3Network = true; +} else { +isL2Network = true; +} + +String preConfiguredDomainTemplateName = NuageVspUtil.getPreConfiguredDomainTemplateName(_configDao, network, offering); +List firewallIngressRulesToApply = getFirewallRulesToApply(network.getId(), FirewallRule.TrafficType.Ingress); +List firewallEgressRulesToApply = getFirewallRulesToApply(network.getId(), FirewallRule.TrafficType.Egress); + +List> ingressFirewallRules = Lists.transform(firewallIngressRulesToApply, new Function>() { +@Override +public Map apply(FirewallRuleVO firewallRuleVO) { +return getACLRuleDetails(firewallRuleVO, egressDefaultPolicy); +} +}); + +List> egressFirewallRules = Lists.transform(firewallEgressRulesToApply, new Function>() { +@Override +public Map apply(FirewallRuleVO firewallRuleVO) { +return getACLRuleDetails(firewallRuleVO, egressDefaultPolicy); +} +}); + +List ips = _ipAddressDao.listStaticNatPublicIps(network.getId()); +List acsFipUuid = new ArrayList(); +for (IPAddressVO ip : ips) { +acsFipUuid.add(ip.getUuid()); +} + +try { +HostVO nuageVspHost = getNuageVspHost(network.getPhysicalNetworkId()); +ImplementVspCommand.Builder cmdBuilder = new ImplementVspCommand.Builder().networkId(network.getId()).networkDomainUuid(networkDomain.getUuid()) + .networkUuid(network.getUuid()).networkName(network.getName()).vpcOrSubnetUuid(subnetUuid).isL2Network(isL2Network).isL3Network(isL3Network) + .isVpc(false).isShared(isShared).domainTemplateName(preConfiguredDomainTemplateName).isFirewallServiceSupported(isFirewallServiceSupported) + .dnsServers(dnsServers).ingressFirewallRules(ingressFirewallRules).egressFirewallRules(egressFirewallRules).acsFipUuid(acsFipUuid) +.egressDefaultPolicy(egressDefaultPolicy); +ImplementVspAnswer answer = (ImplementVspAnswer) _agentMgr.easySend(nuageVspHost.getId(), cmdBuilder.build()); +if (answer == null || !answer.getResult()) { +s_logger.error("ImplementVspCommand for network " + network.getUuid() + " failed"); +if ((null != answer) && (null != answer.getDetails())) { +throw new ResourceUnavailableException(answer.getDetails(), Network.class, network.getId()); +} +} +} catch (Exception e) { +s_logger.warn("Failed to implement network in Vsp", e); --- End diff -- Changed to ERROR, added additional information about the VSP device --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r41979420 --- Diff: plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/element/ApplyStaticNatVspAnswer.java --- @@ -31,4 +31,13 @@ public ApplyStaticNatVspAnswer(ApplyStaticNatVspCommand cmd, Exception e) { super(cmd, e); } +@Override +public boolean equals(Object obj) { +return super.equals(obj); +} + +@Override +public int hashCode() { +return super.hashCode(); +} --- End diff -- Removed, using Answer base class instead --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r41979391 --- Diff: plugins/network-elements/nuage-vsp/src/com/cloud/network/element/NuageVspElement.java --- @@ -303,13 +422,17 @@ protected boolean canHandle(Network network, Service service) { } if (!_networkModel.isProviderForNetwork(getProvider(), network.getId())) { -s_logger.debug("NuageElement is not a provider for network " + network.getDisplayText()); +if (s_logger.isDebugEnabled()) { +s_logger.debug("NuageElement is not a provider for network " + network.getDisplayText()); --- End diff -- Changed NuageElement to NuageVsp to reflect the name of the provider. No additional context information needed. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r41979426 --- Diff: plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/guru/ReserveVmInterfaceVspAnswer.java --- @@ -19,26 +19,26 @@ package com.cloud.agent.api.guru; -import java.util.List; -import java.util.Map; - import com.cloud.agent.api.Answer; import com.cloud.agent.api.Command; public class ReserveVmInterfaceVspAnswer extends Answer { -public List> _interfaceDetails; - -public ReserveVmInterfaceVspAnswer(Command cmd, List> interfaceDetails, String details) { +public ReserveVmInterfaceVspAnswer(Command cmd, String details) { --- End diff -- Removed, using Answer base class instead --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r41979431 --- Diff: plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/guru/TrashNetworkVspAnswer.java --- @@ -31,4 +31,14 @@ public TrashNetworkVspAnswer(Command command, Exception e) { public TrashNetworkVspAnswer(TrashNetworkVspCommand cmd, boolean success, String details) { super(cmd, success, details); } + +@Override +public boolean equals(Object obj) { +return super.equals(obj); +} + +@Override +public int hashCode() { +return super.hashCode(); +} --- End diff -- Removed, using Answer base class instead --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r41979423 --- Diff: plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/element/ImplementVspAnswer.java --- @@ -17,18 +17,27 @@ // under the License. // -package com.cloud.agent.api.guru; +package com.cloud.agent.api.element; import com.cloud.agent.api.Answer; -import com.cloud.agent.api.Command; -public class ReleaseVmVspAnswer extends Answer { +public class ImplementVspAnswer extends Answer { --- End diff -- Removed, using Answer base class instead --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r41979424 --- Diff: plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/element/ShutDownVpcVspAnswer.java --- @@ -31,4 +31,13 @@ public ShutDownVpcVspAnswer(ShutDownVpcVspCommand cmd, Exception e) { super(cmd, e); } +@Override +public boolean equals(Object obj) { +return super.equals(obj); +} + +@Override +public int hashCode() { +return super.hashCode(); +} --- End diff -- Removed, using Answer base class instead --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r41979442 --- Diff: plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/manager/GetClientDefaultsCommand.java --- @@ -17,38 +17,28 @@ // under the License. // -package com.cloud.agent.api.guru; +package com.cloud.agent.api.manager; import com.cloud.agent.api.Command; -public class ReleaseVmVspCommand extends Command { +public class GetClientDefaultsCommand extends Command { -String _networkUuid; -String _vmUuid; -String _vmInstanceName; - -public ReleaseVmVspCommand(String networkUuid, String vmUuid, String vmInstanceName) { +public GetClientDefaultsCommand() { super(); -this._networkUuid = networkUuid; -this._vmUuid = vmUuid; -this._vmInstanceName = vmInstanceName; -} - -public String getNetworkUuid() { -return _networkUuid; } -public String getVmUuid() { -return _vmUuid; +@Override +public boolean executeInSequence() { +return false; } -public String getVmInstanceName() { -return _vmInstanceName; +@Override +public boolean equals(Object obj) { +return super.equals(obj); } @Override -public boolean executeInSequence() { -return false; +public int hashCode() { +return super.hashCode(); } - -} +} --- End diff -- Added a comment on top of the class --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r41979446 --- Diff: plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/manager/SupportedApiVersionAnswer.java --- @@ -0,0 +1,43 @@ +// +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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.cloud.agent.api.manager; + +import com.cloud.agent.api.Answer; + +public class SupportedApiVersionAnswer extends Answer { --- End diff -- Removed, using Answer base class instead --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r41979480 --- Diff: plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/element/ApplyAclRuleVspAnswer.java --- @@ -31,4 +31,13 @@ public ApplyAclRuleVspAnswer(ApplyAclRuleVspCommand cmd, Exception e) { super(cmd, e); } +@Override +public boolean equals(Object obj) { +return super.equals(obj); +} + +@Override +public int hashCode() { +return super.hashCode(); +} --- End diff -- Removed, using Answer base class instead --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r41979466 --- Diff: plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/guru/DeallocateVmVspAnswer.java --- @@ -31,4 +31,14 @@ public DeallocateVmVspAnswer(Command command, Exception e) { public DeallocateVmVspAnswer(DeallocateVmVspCommand cmd, boolean success, String details) { super(cmd, success, details); } + +@Override +public boolean equals(Object obj) { +return super.equals(obj); +} + +@Override +public int hashCode() { +return super.hashCode(); +} --- End diff -- Removed, using Answer base class instead --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r41979553 --- Diff: plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/UpdateNuageVspDeviceCommand.java --- @@ -0,0 +1,60 @@ +// +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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.cloud.agent.api; + +import java.util.Collections; +import java.util.Map; + +public class UpdateNuageVspDeviceCommand extends Command { + +private final Map _parametersToBeUpdated; + +public UpdateNuageVspDeviceCommand(Map parametersToBeUpdated) { +super(); +this._parametersToBeUpdated = parametersToBeUpdated; --- End diff -- Used ImmutableMap.copyOf() --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r41979581 --- Diff: plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/sync/SyncVspAnswer.java --- @@ -31,4 +31,13 @@ public SyncVspAnswer(SyncVspCommand cmd, Exception e) { super(cmd, e); } +@Override +public boolean equals(Object obj) { +return super.equals(obj); +} + +@Override +public int hashCode() { +return super.hashCode(); +} --- End diff -- Removed, using Answer base class instead --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r41979565 --- Diff: plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/UpdateNuageVspDeviceAnswer.java --- @@ -0,0 +1,41 @@ +// +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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.cloud.agent.api; + +public class UpdateNuageVspDeviceAnswer extends Answer { --- End diff -- Removed, using Answer base class instead --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r41980395 --- Diff: plugins/network-elements/nuage-vsp/src/com/cloud/network/element/NuageVspElement.java --- @@ -205,9 +254,79 @@ public boolean implement(Network network, NetworkOffering offering, DeployDestin return false; } +final boolean egressDefaultPolicy = offering.getEgressDefaultPolicy(); +Domain networkDomain = _domainDao.findById(network.getDomainId()); +boolean isFirewallServiceSupported = _networkModel.areServicesSupportedByNetworkOffering(offering.getId(), Service.Firewall); +List dnsServers = _nuageVspManager.getDnsDetails(network); + +boolean isL2Network = false, isL3Network = false, isShared = false; +String subnetUuid = network.getUuid(); +if (offering.getGuestType() == Network.GuestType.Shared) { +isShared = true; +subnetUuid = networkDomain.getUuid(); +} else if (_ntwkOfferingSrvcDao.areServicesSupportedByNetworkOffering(offering.getId(), Service.SourceNat) +|| _ntwkOfferingSrvcDao.areServicesSupportedByNetworkOffering(offering.getId(), Service.StaticNat) +|| _ntwkOfferingSrvcDao.areServicesSupportedByNetworkOffering(offering.getId(), Service.Connectivity)) { +isL3Network = true; +} else { +isL2Network = true; +} + +String preConfiguredDomainTemplateName = NuageVspUtil.getPreConfiguredDomainTemplateName(_configDao, network, offering); +List firewallIngressRulesToApply = getFirewallRulesToApply(network.getId(), FirewallRule.TrafficType.Ingress); +List firewallEgressRulesToApply = getFirewallRulesToApply(network.getId(), FirewallRule.TrafficType.Egress); + +List> ingressFirewallRules = Lists.transform(firewallIngressRulesToApply, new Function>() { +@Override +public Map apply(FirewallRuleVO firewallRuleVO) { +return getACLRuleDetails(firewallRuleVO, egressDefaultPolicy); +} +}); + +List> egressFirewallRules = Lists.transform(firewallEgressRulesToApply, new Function>() { +@Override +public Map apply(FirewallRuleVO firewallRuleVO) { +return getACLRuleDetails(firewallRuleVO, egressDefaultPolicy); +} +}); + +List ips = _ipAddressDao.listStaticNatPublicIps(network.getId()); +List acsFipUuid = new ArrayList(); +for (IPAddressVO ip : ips) { +acsFipUuid.add(ip.getUuid()); +} + +try { +HostVO nuageVspHost = getNuageVspHost(network.getPhysicalNetworkId()); +ImplementVspCommand.Builder cmdBuilder = new ImplementVspCommand.Builder().networkId(network.getId()).networkDomainUuid(networkDomain.getUuid()) + .networkUuid(network.getUuid()).networkName(network.getName()).vpcOrSubnetUuid(subnetUuid).isL2Network(isL2Network).isL3Network(isL3Network) + .isVpc(false).isShared(isShared).domainTemplateName(preConfiguredDomainTemplateName).isFirewallServiceSupported(isFirewallServiceSupported) + .dnsServers(dnsServers).ingressFirewallRules(ingressFirewallRules).egressFirewallRules(egressFirewallRules).acsFipUuid(acsFipUuid) +.egressDefaultPolicy(egressDefaultPolicy); +ImplementVspAnswer answer = (ImplementVspAnswer) _agentMgr.easySend(nuageVspHost.getId(), cmdBuilder.build()); +if (answer == null || !answer.getResult()) { +s_logger.error("ImplementVspCommand for network " + network.getUuid() + " failed"); +if ((null != answer) && (null != answer.getDetails())) { +throw new ResourceUnavailableException(answer.getDetails(), Network.class, network.getId()); +} +} +} catch (Exception e) { --- End diff -- Removed the try {} catch () {} block since it didn't add any value --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r41980442 --- Diff: plugins/network-elements/nuage-vsp/src/com/cloud/network/element/NuageVspElement.java --- @@ -303,13 +422,17 @@ protected boolean canHandle(Network network, Service service) { } if (!_networkModel.isProviderForNetwork(getProvider(), network.getId())) { -s_logger.debug("NuageElement is not a provider for network " + network.getDisplayText()); +if (s_logger.isDebugEnabled()) { +s_logger.debug("NuageElement is not a provider for network " + network.getDisplayText()); +} return false; } if (service != null) { if (!_ntwkSrvcDao.canProviderSupportServiceInNetwork(network.getId(), service, getProvider())) { -s_logger.debug("NuageElement can't provide the " + service.getName() + " service on network " + network.getDisplayText()); +if (s_logger.isDebugEnabled()) { +s_logger.debug("NuageElement can't provide the " + service.getName() + " service on network " + network.getDisplayText()); --- End diff -- Changed NuageElement to NuageVsp to reflect the name of the provider. No additional context information needed. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r41980490 --- Diff: plugins/network-elements/nuage-vsp/src/com/cloud/network/element/NuageVspElement.java --- @@ -368,18 +492,15 @@ public boolean applyStaticNats(Network config, List rules) sourceNatDetails.add(sourceNatDetail); } try { -try { -HostVO nuageVspHost = getNuageVspHost(config.getPhysicalNetworkId()); -ApplyStaticNatVspCommand cmd = new ApplyStaticNatVspCommand(networkDomain.getUuid(), vpcOrSubnetUuid, isL3Network, sourceNatDetails); -ApplyStaticNatVspAnswer answer = (ApplyStaticNatVspAnswer)_agentMgr.easySend(nuageVspHost.getId(), cmd); -if (answer == null || !answer.getResult()) { -s_logger.error("ApplyStaticNatNuageVspCommand for network " + config.getUuid() + " failed"); -if ((null != answer) && (null != answer.getDetails())) { -throw new ResourceUnavailableException(answer.getDetails(), Network.class, config.getId()); -} +HostVO nuageVspHost = getNuageVspHost(config.getPhysicalNetworkId()); +ApplyStaticNatVspCommand.Builder cmdBuilder = new ApplyStaticNatVspCommand.Builder().networkDomainUuid(networkDomain.getUuid()) + .networkUuid(config.getUuid()).vpcOrSubnetUuid(vpcOrSubnetUuid).isL3Network(isL3Network).isVpc(vpcId != null).staticNatDetails(sourceNatDetails); +ApplyStaticNatVspAnswer answer = (ApplyStaticNatVspAnswer)_agentMgr.easySend(nuageVspHost.getId(), cmdBuilder.build()); +if (answer == null || !answer.getResult()) { +s_logger.error("ApplyStaticNatNuageVspCommand for network " + config.getUuid() + " failed"); +if ((null != answer) && (null != answer.getDetails())) { +throw new ResourceUnavailableException(answer.getDetails(), Network.class, config.getId()); } -} catch (Exception e) { -s_logger.warn("Failed to apply static Nat in Vsp " + e.getMessage()); } } catch (Exception e) { --- End diff -- Removed the try {} catch () {} block since it didn't add any value --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r41980525 --- Diff: plugins/network-elements/nuage-vsp/src/com/cloud/network/element/NuageVspElement.java --- @@ -447,13 +568,95 @@ protected boolean applyACLRules(Network network, Listtry {} catch () {} block since it didn't add any value --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r41981224 --- Diff: plugins/network-elements/nuage-vsp/src/com/cloud/network/guru/NuageVspGuestNetworkGuru.java --- @@ -114,7 +117,9 @@ public Network design(NetworkOffering offering, DeploymentPlan plan, Network use PhysicalNetworkVO physnet = _physicalNetworkDao.findById(plan.getPhysicalNetworkId()); DataCenter dc = _dcDao.findById(plan.getDataCenterId()); if (!canHandle(offering, dc.getNetworkType(), physnet)) { -s_logger.debug("Refusing to design this network"); +if (s_logger.isDebugEnabled()) { +s_logger.debug("Refusing to design this network"); --- End diff -- This is DEBUG logging since core ACS asks our plugin to design some network which we do not support, therefore we just log that we are refusing it, and just returning NULL which core ACS will handle nicely. Added some additional info about the network to be designed. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r41981328 --- Diff: plugins/network-elements/nuage-vsp/src/com/cloud/network/guru/NuageVspGuestNetworkGuru.java --- @@ -129,66 +134,94 @@ public Network design(NetworkOffering offering, DeploymentPlan plan, Network use @Override public Network implement(Network network, NetworkOffering offering, DeployDestination dest, ReservationContext context) throws InsufficientVirtualNetworkCapacityException { +long networkId = network.getId(); +network = _networkDao.acquireInLockTable(network.getId(), 1200); +if (network == null) { +throw new ConcurrentOperationException("Unable to acquire lock on network " + networkId); +} -assert (network.getState() == State.Implementing) : "Why are we implementing " + network; +NetworkVO implemented = null; +try { +assert (network.getState() == State.Implementing) : "Why are we implementing " + network; + +long dcId = dest.getDataCenter().getId(); +//Get physical network id +Long physicalNetworkId = network.getPhysicalNetworkId(); +//Physical network id can be null in Guest Network in Basic zone, so locate the physical network +if (physicalNetworkId == null) { +physicalNetworkId = _networkModel.findPhysicalNetworkId(dcId, offering.getTags(), offering.getTrafficType()); +} +implemented = new NetworkVO(network.getTrafficType(), network.getMode(), network.getBroadcastDomainType(), network.getNetworkOfferingId(), State.Allocated, +network.getDataCenterId(), physicalNetworkId, offering.getRedundantRouter()); +if (network.getGateway() != null) { +implemented.setGateway(network.getGateway()); +} +if (network.getCidr() != null) { +implemented.setCidr(network.getCidr()); +} +List ipAddressRanges = new ArrayList(); +String virtualRouterIp = getVirtualRouterIP(network, ipAddressRanges); +String networkUuid = implemented.getUuid(); +String tenantId = context.getDomain().getName() + "-" + context.getAccount().getAccountId(); +String broadcastUriStr = networkUuid + "/" + virtualRouterIp; + implemented.setBroadcastUri(Networks.BroadcastDomainType.Vsp.toUri(broadcastUriStr)); + implemented.setBroadcastDomainType(Networks.BroadcastDomainType.Vsp); +//Check if the network is associated to a VPC +Long vpcId = network.getVpcId(); +boolean isVpc = (vpcId != null); +//Check owner of the Network +Domain networksDomain = _domainDao.findById(network.getDomainId()); +//Get the Account details and find the type +AccountVO networksAccount = _accountDao.findById(network.getAccountId()); +if (networksAccount.getType() == Account.ACCOUNT_TYPE_PROJECT) { +String errorMessage = "CS project support is not yet implemented in NuageVsp"; +if (s_logger.isDebugEnabled()) { --- End diff -- Changed log level to ERROR. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r41983905 --- Diff: plugins/network-elements/nuage-vsp/src/com/cloud/network/guru/NuageVspGuestNetworkGuru.java --- @@ -129,66 +134,94 @@ public Network design(NetworkOffering offering, DeploymentPlan plan, Network use @Override public Network implement(Network network, NetworkOffering offering, DeployDestination dest, ReservationContext context) throws InsufficientVirtualNetworkCapacityException { +long networkId = network.getId(); +network = _networkDao.acquireInLockTable(network.getId(), 1200); +if (network == null) { +throw new ConcurrentOperationException("Unable to acquire lock on network " + networkId); +} -assert (network.getState() == State.Implementing) : "Why are we implementing " + network; +NetworkVO implemented = null; +try { +assert (network.getState() == State.Implementing) : "Why are we implementing " + network; + +long dcId = dest.getDataCenter().getId(); +//Get physical network id +Long physicalNetworkId = network.getPhysicalNetworkId(); +//Physical network id can be null in Guest Network in Basic zone, so locate the physical network +if (physicalNetworkId == null) { +physicalNetworkId = _networkModel.findPhysicalNetworkId(dcId, offering.getTags(), offering.getTrafficType()); +} +implemented = new NetworkVO(network.getTrafficType(), network.getMode(), network.getBroadcastDomainType(), network.getNetworkOfferingId(), State.Allocated, +network.getDataCenterId(), physicalNetworkId, offering.getRedundantRouter()); +if (network.getGateway() != null) { +implemented.setGateway(network.getGateway()); +} +if (network.getCidr() != null) { +implemented.setCidr(network.getCidr()); +} +List ipAddressRanges = new ArrayList(); +String virtualRouterIp = getVirtualRouterIP(network, ipAddressRanges); +String networkUuid = implemented.getUuid(); +String tenantId = context.getDomain().getName() + "-" + context.getAccount().getAccountId(); +String broadcastUriStr = networkUuid + "/" + virtualRouterIp; + implemented.setBroadcastUri(Networks.BroadcastDomainType.Vsp.toUri(broadcastUriStr)); + implemented.setBroadcastDomainType(Networks.BroadcastDomainType.Vsp); +//Check if the network is associated to a VPC +Long vpcId = network.getVpcId(); +boolean isVpc = (vpcId != null); +//Check owner of the Network +Domain networksDomain = _domainDao.findById(network.getDomainId()); +//Get the Account details and find the type +AccountVO networksAccount = _accountDao.findById(network.getAccountId()); +if (networksAccount.getType() == Account.ACCOUNT_TYPE_PROJECT) { +String errorMessage = "CS project support is not yet implemented in NuageVsp"; --- End diff -- Added some additional information to the log statement. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r41983983 --- Diff: plugins/network-elements/nuage-vsp/src/com/cloud/network/guru/NuageVspGuestNetworkGuru.java --- @@ -129,66 +134,94 @@ public Network design(NetworkOffering offering, DeploymentPlan plan, Network use @Override public Network implement(Network network, NetworkOffering offering, DeployDestination dest, ReservationContext context) throws InsufficientVirtualNetworkCapacityException { +long networkId = network.getId(); +network = _networkDao.acquireInLockTable(network.getId(), 1200); +if (network == null) { +throw new ConcurrentOperationException("Unable to acquire lock on network " + networkId); +} -assert (network.getState() == State.Implementing) : "Why are we implementing " + network; +NetworkVO implemented = null; +try { +assert (network.getState() == State.Implementing) : "Why are we implementing " + network; + +long dcId = dest.getDataCenter().getId(); +//Get physical network id +Long physicalNetworkId = network.getPhysicalNetworkId(); +//Physical network id can be null in Guest Network in Basic zone, so locate the physical network +if (physicalNetworkId == null) { +physicalNetworkId = _networkModel.findPhysicalNetworkId(dcId, offering.getTags(), offering.getTrafficType()); +} +implemented = new NetworkVO(network.getTrafficType(), network.getMode(), network.getBroadcastDomainType(), network.getNetworkOfferingId(), State.Allocated, +network.getDataCenterId(), physicalNetworkId, offering.getRedundantRouter()); +if (network.getGateway() != null) { +implemented.setGateway(network.getGateway()); +} +if (network.getCidr() != null) { +implemented.setCidr(network.getCidr()); +} +List ipAddressRanges = new ArrayList(); +String virtualRouterIp = getVirtualRouterIP(network, ipAddressRanges); +String networkUuid = implemented.getUuid(); +String tenantId = context.getDomain().getName() + "-" + context.getAccount().getAccountId(); +String broadcastUriStr = networkUuid + "/" + virtualRouterIp; + implemented.setBroadcastUri(Networks.BroadcastDomainType.Vsp.toUri(broadcastUriStr)); + implemented.setBroadcastDomainType(Networks.BroadcastDomainType.Vsp); +//Check if the network is associated to a VPC +Long vpcId = network.getVpcId(); +boolean isVpc = (vpcId != null); +//Check owner of the Network +Domain networksDomain = _domainDao.findById(network.getDomainId()); +//Get the Account details and find the type +AccountVO networksAccount = _accountDao.findById(network.getAccountId()); +if (networksAccount.getType() == Account.ACCOUNT_TYPE_PROJECT) { +String errorMessage = "CS project support is not yet implemented in NuageVsp"; +if (s_logger.isDebugEnabled()) { +s_logger.debug(errorMessage); +} +throw new InsufficientVirtualNetworkCapacityException(errorMessage, Account.class, network.getAccountId()); +} +String vpcName = null; +String vpcUuid = null; +String preConfiguredDomainTemplateName = NuageVspUtil.getPreConfiguredDomainTemplateName(_configDao, network, offering); +boolean isSharedNetwork = offering.getGuestType() == GuestType.Shared; +boolean isL3Network = !isVpc && (isSharedNetwork || isL3Network(network)); -long dcId = dest.getDataCenter().getId(); -//Get physical network id -Long physicalNetworkId = network.getPhysicalNetworkId(); -//Physical network id can be null in Guest Network in Basic zone, so locate the physical network -if (physicalNetworkId == null) { -physicalNetworkId = _networkModel.findPhysicalNetworkId(dcId, offering.getTags(), offering.getTrafficType()); -} -NetworkVO implemented = new NetworkVO(network.getTrafficType(), network.getMode(), network.getBroadcastDomainType(), network.getNetworkOfferingId(), State.Allocated, -network.getDataCenterId(), physicalNetworkId, offering.getRedundantRouter()); -if (network.getGateway() != null) { -implemented.setGateway(ne
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r41984374 --- Diff: plugins/network-elements/nuage-vsp/src/com/cloud/network/guru/NuageVspGuestNetworkGuru.java --- @@ -322,35 +389,52 @@ public void shutdown(NetworkProfile profile, NetworkOffering offering) { @Override public boolean trash(Network network, NetworkOffering offering) { - -s_logger.debug("Handling trash() call back to delete the network " + network.getName() + " with uuid " + network.getUuid() + " from VSP"); -long domainId = network.getDomainId(); -Domain domain = _domainDao.findById(domainId); -Long vpcId = network.getVpcId(); -String vpcUuid = null; -if (vpcId != null) { -Vpc vpcObj = _vpcDao.findById(vpcId); -vpcUuid = vpcObj.getUuid(); +long networkId = network.getId(); +network = _networkDao.acquireInLockTable(networkId, 1200); +if (network == null) { +throw new ConcurrentOperationException("Unable to acquire lock on network " + networkId); } + try { -HostVO nuageVspHost = getNuageVspHost(network.getPhysicalNetworkId()); -TrashNetworkVspCommand cmd = new TrashNetworkVspCommand(domain.getUuid(), network.getUuid(), isL3Network(offering.getId()), vpcUuid); -TrashNetworkVspAnswer answer = (TrashNetworkVspAnswer)_agentMgr.easySend(nuageVspHost.getId(), cmd); -if (answer == null || !answer.getResult()) { -s_logger.error("TrashNetworkNuageVspCommand for network " + network.getUuid() + " failed"); -if ((null != answer) && (null != answer.getDetails())) { -s_logger.error(answer.getDetails()); +if (s_logger.isDebugEnabled()) { +s_logger.debug("Handling trash() call back to delete the network " + network.getName() + " with uuid " + network.getUuid() + " from VSP"); +} +long domainId = network.getDomainId(); +Domain domain = _domainDao.findById(domainId); +boolean isL3Network = isL3Network(network); +boolean isSharedNetwork = offering.getGuestType() == GuestType.Shared; +Long vpcId = network.getVpcId(); +String vpcUuid = null; +if (vpcId != null) { +Vpc vpcObj = _vpcDao.findById(vpcId); +vpcUuid = vpcObj.getUuid(); +} + +String preConfiguredDomainTemplateName = NuageVspUtil.getPreConfiguredDomainTemplateName(_configDao, network, offering); +try { +HostVO nuageVspHost = getNuageVspHost(network.getPhysicalNetworkId()); +TrashNetworkVspCommand.Builder cmdBuilder = new TrashNetworkVspCommand.Builder().domainUuid(domain.getUuid()).networkUuid(network.getUuid()) + .isL3Network(isL3Network).isSharedNetwork(isSharedNetwork).vpcUuid(vpcUuid).domainTemplateName(preConfiguredDomainTemplateName); +TrashNetworkVspAnswer answer = (TrashNetworkVspAnswer)_agentMgr.easySend(nuageVspHost.getId(), cmdBuilder.build()); +if (answer == null || !answer.getResult()) { +s_logger.error("TrashNetworkNuageVspCommand for network " + network.getUuid() + " failed"); +if ((null != answer) && (null != answer.getDetails())) { +s_logger.error(answer.getDetails()); +} } +} catch (Exception e) { --- End diff -- Removed the try {} catch () {} block since it didn't add any value --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r41984944 --- Diff: plugins/network-elements/nuage-vsp/src/com/cloud/network/guru/NuageVspGuestNetworkGuru.java --- @@ -358,19 +442,28 @@ private String getVirtualRouterIP(Network network, Collection addressRan Set allIPsInCidr = NetUtils.getAllIpsFromCidr(subnet, cidrSize, new HashSet()); if (allIPsInCidr.size() > 3) { +//get the second IP and see if it the networks GatewayIP Iterator ipIterator = allIPsInCidr.iterator(); long vip = ipIterator.next(); if (NetUtils.ip2Long(network.getGateway()) == vip) { -s_logger.debug("Gateway of the Network(" + network.getUuid() + ") has the first IP " + NetUtils.long2Ip(vip)); +if (s_logger.isDebugEnabled()) { +s_logger.debug("Gateway of the Network(" + network.getName() + ") has the first IP " + NetUtils.long2Ip(vip)); +} vip = ipIterator.next(); virtualRouterIp = NetUtils.long2Ip(vip); -s_logger.debug("So, reserving the 2nd IP " + virtualRouterIp + " for the Virtual Router IP in Network(" + network.getUuid() + ")"); +if (s_logger.isDebugEnabled()) { +s_logger.debug("So, reserving the 2nd IP " + virtualRouterIp + " for the Virtual Router IP in Network(" + network.getName() + ")"); +} } else { virtualRouterIp = NetUtils.long2Ip(vip); -s_logger.debug("1nd IP is not used as the gateway IP. So, reserving" + virtualRouterIp + " for the Virtual Router IP for " + "Network(" + network.getUuid() + ")"); +if (s_logger.isDebugEnabled()) { +s_logger.debug("1nd IP is not used as the gateway IP. So, reserving" + virtualRouterIp + " for the Virtual Router IP for " + "Network(" + network.getName() + ")"); --- End diff -- Changed the latter message to contain the previous one. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r41984914 --- Diff: plugins/network-elements/nuage-vsp/src/com/cloud/network/guru/NuageVspGuestNetworkGuru.java --- @@ -358,19 +442,28 @@ private String getVirtualRouterIP(Network network, Collection addressRan Set allIPsInCidr = NetUtils.getAllIpsFromCidr(subnet, cidrSize, new HashSet()); if (allIPsInCidr.size() > 3) { +//get the second IP and see if it the networks GatewayIP Iterator ipIterator = allIPsInCidr.iterator(); long vip = ipIterator.next(); if (NetUtils.ip2Long(network.getGateway()) == vip) { -s_logger.debug("Gateway of the Network(" + network.getUuid() + ") has the first IP " + NetUtils.long2Ip(vip)); +if (s_logger.isDebugEnabled()) { +s_logger.debug("Gateway of the Network(" + network.getName() + ") has the first IP " + NetUtils.long2Ip(vip)); +} vip = ipIterator.next(); virtualRouterIp = NetUtils.long2Ip(vip); -s_logger.debug("So, reserving the 2nd IP " + virtualRouterIp + " for the Virtual Router IP in Network(" + network.getUuid() + ")"); +if (s_logger.isDebugEnabled()) { +s_logger.debug("So, reserving the 2nd IP " + virtualRouterIp + " for the Virtual Router IP in Network(" + network.getName() + ")"); --- End diff -- Changed the latter message to contain the previous one. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r41985327 --- Diff: plugins/network-elements/nuage-vsp/src/com/cloud/network/manager/NuageVspManagerImpl.java --- @@ -67,25 +74,76 @@ import com.cloud.network.dao.PhysicalNetworkVO; import com.cloud.network.resource.NuageVspResource; import com.cloud.network.sync.NuageVspSync; +import com.cloud.network.vpc.VpcManager; +import com.cloud.network.vpc.VpcOffering; +import com.cloud.network.vpc.VpcOfferingServiceMapVO; +import com.cloud.network.vpc.VpcOfferingVO; import com.cloud.network.vpc.dao.VpcDao; import com.cloud.network.vpc.dao.VpcOfferingDao; import com.cloud.network.vpc.dao.VpcOfferingServiceMapDao; +import com.cloud.network.vpc.dao.VpcServiceMapDao; +import com.cloud.offering.NetworkOffering; +import com.cloud.offerings.NetworkOfferingServiceMapVO; +import com.cloud.offerings.NetworkOfferingVO; +import com.cloud.offerings.dao.NetworkOfferingDao; +import com.cloud.offerings.dao.NetworkOfferingServiceMapDao; import com.cloud.resource.ResourceManager; import com.cloud.resource.ResourceState; import com.cloud.resource.ServerResource; +import com.cloud.user.AccountManager; +import com.cloud.user.DomainManager; import com.cloud.utils.component.ManagerBase; +import com.cloud.utils.db.DB; import com.cloud.utils.db.Transaction; import com.cloud.utils.db.TransactionCallback; +import com.cloud.utils.db.TransactionCallbackNoReturn; import com.cloud.utils.db.TransactionStatus; import com.cloud.utils.exception.CloudRuntimeException; +import com.cloud.utils.fsm.StateListener; +import com.cloud.utils.fsm.StateMachine2; +import com.google.common.base.MoreObjects; +import com.google.common.base.Strings; +import com.google.common.collect.Maps; +import com.google.common.collect.Sets; +import net.nuage.vsp.acs.NuageVspPluginClientLoader; +import org.apache.cloudstack.framework.config.ConfigKey; +import org.apache.cloudstack.framework.config.Configurable; +import org.apache.cloudstack.framework.config.dao.ConfigurationDao; +import org.apache.cloudstack.framework.config.impl.ConfigurationVO; +import org.apache.cloudstack.framework.messagebus.MessageBus; +import org.apache.cloudstack.framework.messagebus.MessageSubscriber; +import org.apache.cloudstack.network.ExternalNetworkDeviceManager; +import org.apache.commons.codec.binary.Base64; +import org.apache.commons.collections.CollectionUtils; +import org.apache.log4j.Logger; + +import javax.ejb.Local; +import javax.inject.Inject; +import javax.naming.ConfigurationException; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.StringTokenizer; +import java.util.UUID; +import java.util.concurrent.ScheduledExecutorService; + +import static com.cloud.agent.api.sync.SyncNuageVspCmsIdCommand.SyncType; @Local(value = {NuageVspManager.class}) -public class NuageVspManagerImpl extends ManagerBase implements NuageVspManager, Configurable { +public class NuageVspManagerImpl extends ManagerBase implements NuageVspManager, Configurable, StateListener { private static final Logger s_logger = Logger.getLogger(NuageVspManagerImpl.class); private static final int ONE_MINUTE_MULTIPLIER = 60 * 1000; +private static final Set NUAGE_VSP_PROVIDERS; +private static final Map> NUAGE_VSP_VPC_SERVICE_MAP; +private static final ConfigKey[] NUAGE_VSP_CONFIG_KEYS = new ConfigKey[] { NuageVspConfigDns, NuageVspDnsExternal, NuageVspConfigGateway, --- End diff -- Since this array is used as return statement ```java @Override public ConfigKey[] getConfigKeys() { return NUAGE_VSP_CONFIG_KEYS; } ``` Unless you want to create an ImmutableSet, and use NUAGE_VSP_CONFIG_KEYS.toArray() as return statement. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r41985416 --- Diff: plugins/network-elements/nuage-vsp/src/com/cloud/network/manager/NuageVspManagerImpl.java --- @@ -109,12 +163,49 @@ @Inject VpcDao _vpcDao; @Inject -NuageVspDao nuageVspDao; +VpcManager _vpcManager; +@Inject +NuageVspDao _nuageVspDao; +@Inject +NuageVspSync _nuageVspSync; +@Inject +DataCenterDao _dataCenterDao; +@Inject +ConfigurationDao _configDao; +@Inject +NetworkModel _ntwkModel; +@Inject +AccountManager _accountMgr; +@Inject +IPAddressDao _ipAddressDao; +@Inject +FirewallRulesDao _firewallDao; +@Inject +VpcServiceMapDao _vpcSrvcDao; +@Inject +AgentManager _agentMgr; +@Inject +private DomainDao _domainDao; @Inject -NuageVspSync nuageVspSync; +NetworkOfferingDao _networkOfferingDao; +@Inject +NetworkOfferingServiceMapDao _networkOfferingServiceMapDao; private ScheduledExecutorService scheduler; +@Inject +MessageBus _messageBus; + +static { +NUAGE_VSP_PROVIDERS = Sets.newHashSet(Network.Provider.NuageVsp); --- End diff -- Using ImmutableSet.of() now. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r41985628 --- Diff: plugins/network-elements/nuage-vsp/src/com/cloud/network/manager/NuageVspManagerImpl.java --- @@ -109,12 +163,49 @@ @Inject VpcDao _vpcDao; @Inject -NuageVspDao nuageVspDao; +VpcManager _vpcManager; +@Inject +NuageVspDao _nuageVspDao; +@Inject +NuageVspSync _nuageVspSync; +@Inject +DataCenterDao _dataCenterDao; +@Inject +ConfigurationDao _configDao; +@Inject +NetworkModel _ntwkModel; +@Inject +AccountManager _accountMgr; +@Inject +IPAddressDao _ipAddressDao; +@Inject +FirewallRulesDao _firewallDao; +@Inject +VpcServiceMapDao _vpcSrvcDao; +@Inject +AgentManager _agentMgr; +@Inject +private DomainDao _domainDao; @Inject -NuageVspSync nuageVspSync; +NetworkOfferingDao _networkOfferingDao; +@Inject +NetworkOfferingServiceMapDao _networkOfferingServiceMapDao; private ScheduledExecutorService scheduler; +@Inject +MessageBus _messageBus; + +static { +NUAGE_VSP_PROVIDERS = Sets.newHashSet(Network.Provider.NuageVsp); +NUAGE_VSP_VPC_SERVICE_MAP = Maps.newHashMap(); --- End diff -- Using ImmutableMap.builder().put().put()build() now to build up the ImmutableMap --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r41985759 --- Diff: plugins/network-elements/nuage-vsp/src/com/cloud/network/manager/NuageVspManagerImpl.java --- @@ -122,13 +213,13 @@ cmdList.add(DeleteNuageVspDeviceCmd.class); cmdList.add(ListNuageVspDevicesCmd.class); cmdList.add(IssueNuageVspResourceRequestCmd.class); - +cmdList.add(UpdateNuageVspDeviceCmd.class); --- End diff -- Using Lists.newArrayList() now. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r41986510 --- Diff: plugins/network-elements/nuage-vsp/src/com/cloud/network/manager/NuageVspManagerImpl.java --- @@ -152,50 +243,179 @@ public NuageVspDeviceVO addNuageVspDevice(AddNuageVspDeviceCmd cmd) { throw new CloudRuntimeException("A NuageVsp device is already configured on this physical network"); } -Map params = new HashMap(); -params.put("guid", UUID.randomUUID().toString()); -params.put("zoneId", String.valueOf(physicalNetwork.getDataCenterId())); -params.put("physicalNetworkId", String.valueOf(physicalNetwork.getId())); -params.put("name", "Nuage VSD - " + cmd.getHostName()); -params.put("hostname", cmd.getHostName()); -params.put("cmsuser", cmd.getUserName()); -String cmsUserPasswordBase64 = org.apache.commons.codec.binary.StringUtils.newStringUtf8(Base64.encodeBase64(cmd.getPassword().getBytes(Charset.forName("UTF-8"; -params.put("cmsuserpass", cmsUserPasswordBase64); -int port = cmd.getPort(); -if (0 == port) { -port = 443; -} -params.put("port", String.valueOf(port)); -params.put("apirelativepath", "/nuage/api/" + cmd.getApiVersion()); -params.put("retrycount", String.valueOf(cmd.getApiRetryCount())); -params.put("retryinterval", String.valueOf(cmd.getApiRetryInterval())); +try { +NuageVspPluginClientLoader clientLoader = NuageVspPluginClientLoader.getClientLoader(null, null, 1, 1, null); -Map hostdetails = new HashMap(); -hostdetails.putAll(params); +Map clientDefaults = clientLoader.getNuageVspManagerClient().getClientDefaults(); +String apiVersion = MoreObjects.firstNonNull(cmd.getApiVersion(), (String) clientDefaults.get("CURRENT_API_VERSION")); +if (!clientLoader.getNuageVspManagerClient().isSupportedApiVersion(apiVersion)) { +throw new CloudRuntimeException("Unsupported API version : " + apiVersion); +} -try { +Map params = new HashMap(); +params.put("guid", UUID.randomUUID().toString()); +params.put("zoneId", String.valueOf(physicalNetwork.getDataCenterId())); +params.put("physicalNetworkId", String.valueOf(physicalNetwork.getId())); +params.put("name", "Nuage VSD - " + cmd.getHostName()); +params.put("hostname", cmd.getHostName()); +params.put("cmsuser", cmd.getUserName()); +String cmsUserPasswordBase64 = org.apache.commons.codec.binary.StringUtils.newStringUtf8(Base64.encodeBase64(cmd.getPassword().getBytes())); +params.put("cmsuserpass", cmsUserPasswordBase64); +int port = cmd.getPort(); +if (0 == port) { +port = 8443; +} +params.put("port", String.valueOf(port)); +params.put("apiversion", apiVersion); +params.put("apirelativepath", "/nuage/api/" + apiVersion); +params.put("retrycount", String.valueOf(MoreObjects.firstNonNull(cmd.getApiRetryCount(), clientDefaults.get("DEFAULT_API_RETRY_COUNT"; +params.put("retryinterval", String.valueOf(MoreObjects.firstNonNull(cmd.getApiRetryInterval(), clientDefaults.get("DEFAULT_API_RETRY_INTERVAL"; + +final Map hostdetails = new HashMap(); +hostdetails.putAll(params); resource.configure(cmd.getHostName(), hostdetails); -final Host host = _resourceMgr.addHost(zoneId, resource, Host.Type.L2Networking, params); +Host host = _resourceMgr.addHost(zoneId, resource, Host.Type.L2Networking, params); if (host != null) { -return Transaction.execute(new TransactionCallback() { -@Override -public NuageVspDeviceVO doInTransaction(TransactionStatus status) { -NuageVspDeviceVO nuageVspDevice = new NuageVspDeviceVO(host.getId(), physicalNetworkId, ntwkSvcProvider.getProviderName(), deviceName); -_nuageVspDao.persist(nuageVspDevice); +NuageVspDeviceVO nuageVspDevice = new NuageVspDeviceVO(host.getId(), physicalNetworkId, ntwkSvc
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r41986564 --- Diff: plugins/network-elements/nuage-vsp/src/com/cloud/network/manager/NuageVspManagerImpl.java --- @@ -152,50 +243,179 @@ public NuageVspDeviceVO addNuageVspDevice(AddNuageVspDeviceCmd cmd) { throw new CloudRuntimeException("A NuageVsp device is already configured on this physical network"); } -Map params = new HashMap(); -params.put("guid", UUID.randomUUID().toString()); -params.put("zoneId", String.valueOf(physicalNetwork.getDataCenterId())); -params.put("physicalNetworkId", String.valueOf(physicalNetwork.getId())); -params.put("name", "Nuage VSD - " + cmd.getHostName()); -params.put("hostname", cmd.getHostName()); -params.put("cmsuser", cmd.getUserName()); -String cmsUserPasswordBase64 = org.apache.commons.codec.binary.StringUtils.newStringUtf8(Base64.encodeBase64(cmd.getPassword().getBytes(Charset.forName("UTF-8"; -params.put("cmsuserpass", cmsUserPasswordBase64); -int port = cmd.getPort(); -if (0 == port) { -port = 443; -} -params.put("port", String.valueOf(port)); -params.put("apirelativepath", "/nuage/api/" + cmd.getApiVersion()); -params.put("retrycount", String.valueOf(cmd.getApiRetryCount())); -params.put("retryinterval", String.valueOf(cmd.getApiRetryInterval())); +try { +NuageVspPluginClientLoader clientLoader = NuageVspPluginClientLoader.getClientLoader(null, null, 1, 1, null); -Map hostdetails = new HashMap(); -hostdetails.putAll(params); +Map clientDefaults = clientLoader.getNuageVspManagerClient().getClientDefaults(); +String apiVersion = MoreObjects.firstNonNull(cmd.getApiVersion(), (String) clientDefaults.get("CURRENT_API_VERSION")); +if (!clientLoader.getNuageVspManagerClient().isSupportedApiVersion(apiVersion)) { +throw new CloudRuntimeException("Unsupported API version : " + apiVersion); +} -try { +Map params = new HashMap(); +params.put("guid", UUID.randomUUID().toString()); +params.put("zoneId", String.valueOf(physicalNetwork.getDataCenterId())); +params.put("physicalNetworkId", String.valueOf(physicalNetwork.getId())); +params.put("name", "Nuage VSD - " + cmd.getHostName()); +params.put("hostname", cmd.getHostName()); +params.put("cmsuser", cmd.getUserName()); +String cmsUserPasswordBase64 = org.apache.commons.codec.binary.StringUtils.newStringUtf8(Base64.encodeBase64(cmd.getPassword().getBytes())); +params.put("cmsuserpass", cmsUserPasswordBase64); +int port = cmd.getPort(); +if (0 == port) { +port = 8443; +} +params.put("port", String.valueOf(port)); +params.put("apiversion", apiVersion); +params.put("apirelativepath", "/nuage/api/" + apiVersion); +params.put("retrycount", String.valueOf(MoreObjects.firstNonNull(cmd.getApiRetryCount(), clientDefaults.get("DEFAULT_API_RETRY_COUNT"; +params.put("retryinterval", String.valueOf(MoreObjects.firstNonNull(cmd.getApiRetryInterval(), clientDefaults.get("DEFAULT_API_RETRY_INTERVAL"; + +final Map hostdetails = new HashMap(); +hostdetails.putAll(params); resource.configure(cmd.getHostName(), hostdetails); -final Host host = _resourceMgr.addHost(zoneId, resource, Host.Type.L2Networking, params); +Host host = _resourceMgr.addHost(zoneId, resource, Host.Type.L2Networking, params); if (host != null) { -return Transaction.execute(new TransactionCallback() { -@Override -public NuageVspDeviceVO doInTransaction(TransactionStatus status) { -NuageVspDeviceVO nuageVspDevice = new NuageVspDeviceVO(host.getId(), physicalNetworkId, ntwkSvcProvider.getProviderName(), deviceName); -_nuageVspDao.persist(nuageVspDevice); +NuageVspDeviceVO nuageVspDevice = new NuageVspDeviceVO(host.getId(), physicalNetworkId, ntwkSvc
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r41986636 --- Diff: plugins/network-elements/nuage-vsp/src/com/cloud/network/manager/NuageVspManagerImpl.java --- @@ -152,50 +243,179 @@ public NuageVspDeviceVO addNuageVspDevice(AddNuageVspDeviceCmd cmd) { throw new CloudRuntimeException("A NuageVsp device is already configured on this physical network"); } -Map params = new HashMap(); -params.put("guid", UUID.randomUUID().toString()); -params.put("zoneId", String.valueOf(physicalNetwork.getDataCenterId())); -params.put("physicalNetworkId", String.valueOf(physicalNetwork.getId())); -params.put("name", "Nuage VSD - " + cmd.getHostName()); -params.put("hostname", cmd.getHostName()); -params.put("cmsuser", cmd.getUserName()); -String cmsUserPasswordBase64 = org.apache.commons.codec.binary.StringUtils.newStringUtf8(Base64.encodeBase64(cmd.getPassword().getBytes(Charset.forName("UTF-8"; -params.put("cmsuserpass", cmsUserPasswordBase64); -int port = cmd.getPort(); -if (0 == port) { -port = 443; -} -params.put("port", String.valueOf(port)); -params.put("apirelativepath", "/nuage/api/" + cmd.getApiVersion()); -params.put("retrycount", String.valueOf(cmd.getApiRetryCount())); -params.put("retryinterval", String.valueOf(cmd.getApiRetryInterval())); +try { +NuageVspPluginClientLoader clientLoader = NuageVspPluginClientLoader.getClientLoader(null, null, 1, 1, null); -Map hostdetails = new HashMap(); -hostdetails.putAll(params); +Map clientDefaults = clientLoader.getNuageVspManagerClient().getClientDefaults(); +String apiVersion = MoreObjects.firstNonNull(cmd.getApiVersion(), (String) clientDefaults.get("CURRENT_API_VERSION")); +if (!clientLoader.getNuageVspManagerClient().isSupportedApiVersion(apiVersion)) { +throw new CloudRuntimeException("Unsupported API version : " + apiVersion); +} -try { +Map params = new HashMap(); +params.put("guid", UUID.randomUUID().toString()); +params.put("zoneId", String.valueOf(physicalNetwork.getDataCenterId())); +params.put("physicalNetworkId", String.valueOf(physicalNetwork.getId())); +params.put("name", "Nuage VSD - " + cmd.getHostName()); +params.put("hostname", cmd.getHostName()); +params.put("cmsuser", cmd.getUserName()); +String cmsUserPasswordBase64 = org.apache.commons.codec.binary.StringUtils.newStringUtf8(Base64.encodeBase64(cmd.getPassword().getBytes())); +params.put("cmsuserpass", cmsUserPasswordBase64); +int port = cmd.getPort(); +if (0 == port) { +port = 8443; +} +params.put("port", String.valueOf(port)); +params.put("apiversion", apiVersion); +params.put("apirelativepath", "/nuage/api/" + apiVersion); +params.put("retrycount", String.valueOf(MoreObjects.firstNonNull(cmd.getApiRetryCount(), clientDefaults.get("DEFAULT_API_RETRY_COUNT"; +params.put("retryinterval", String.valueOf(MoreObjects.firstNonNull(cmd.getApiRetryInterval(), clientDefaults.get("DEFAULT_API_RETRY_INTERVAL"; + +final Map hostdetails = new HashMap(); +hostdetails.putAll(params); resource.configure(cmd.getHostName(), hostdetails); -final Host host = _resourceMgr.addHost(zoneId, resource, Host.Type.L2Networking, params); +Host host = _resourceMgr.addHost(zoneId, resource, Host.Type.L2Networking, params); if (host != null) { -return Transaction.execute(new TransactionCallback() { -@Override -public NuageVspDeviceVO doInTransaction(TransactionStatus status) { -NuageVspDeviceVO nuageVspDevice = new NuageVspDeviceVO(host.getId(), physicalNetworkId, ntwkSvcProvider.getProviderName(), deviceName); -_nuageVspDao.persist(nuageVspDevice); +NuageVspDeviceVO nuageVspDevice = new NuageVspDeviceVO(host.getId(), physicalNetworkId, ntwkSvc
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r41986904 --- Diff: plugins/network-elements/nuage-vsp/src/com/cloud/network/manager/NuageVspManagerImpl.java --- @@ -152,50 +243,179 @@ public NuageVspDeviceVO addNuageVspDevice(AddNuageVspDeviceCmd cmd) { throw new CloudRuntimeException("A NuageVsp device is already configured on this physical network"); } -Map params = new HashMap(); -params.put("guid", UUID.randomUUID().toString()); -params.put("zoneId", String.valueOf(physicalNetwork.getDataCenterId())); -params.put("physicalNetworkId", String.valueOf(physicalNetwork.getId())); -params.put("name", "Nuage VSD - " + cmd.getHostName()); -params.put("hostname", cmd.getHostName()); -params.put("cmsuser", cmd.getUserName()); -String cmsUserPasswordBase64 = org.apache.commons.codec.binary.StringUtils.newStringUtf8(Base64.encodeBase64(cmd.getPassword().getBytes(Charset.forName("UTF-8"; -params.put("cmsuserpass", cmsUserPasswordBase64); -int port = cmd.getPort(); -if (0 == port) { -port = 443; -} -params.put("port", String.valueOf(port)); -params.put("apirelativepath", "/nuage/api/" + cmd.getApiVersion()); -params.put("retrycount", String.valueOf(cmd.getApiRetryCount())); -params.put("retryinterval", String.valueOf(cmd.getApiRetryInterval())); +try { +NuageVspPluginClientLoader clientLoader = NuageVspPluginClientLoader.getClientLoader(null, null, 1, 1, null); -Map hostdetails = new HashMap(); -hostdetails.putAll(params); +Map clientDefaults = clientLoader.getNuageVspManagerClient().getClientDefaults(); +String apiVersion = MoreObjects.firstNonNull(cmd.getApiVersion(), (String) clientDefaults.get("CURRENT_API_VERSION")); +if (!clientLoader.getNuageVspManagerClient().isSupportedApiVersion(apiVersion)) { +throw new CloudRuntimeException("Unsupported API version : " + apiVersion); +} -try { +Map params = new HashMap(); +params.put("guid", UUID.randomUUID().toString()); +params.put("zoneId", String.valueOf(physicalNetwork.getDataCenterId())); +params.put("physicalNetworkId", String.valueOf(physicalNetwork.getId())); +params.put("name", "Nuage VSD - " + cmd.getHostName()); +params.put("hostname", cmd.getHostName()); +params.put("cmsuser", cmd.getUserName()); +String cmsUserPasswordBase64 = org.apache.commons.codec.binary.StringUtils.newStringUtf8(Base64.encodeBase64(cmd.getPassword().getBytes())); +params.put("cmsuserpass", cmsUserPasswordBase64); +int port = cmd.getPort(); +if (0 == port) { +port = 8443; +} +params.put("port", String.valueOf(port)); +params.put("apiversion", apiVersion); +params.put("apirelativepath", "/nuage/api/" + apiVersion); +params.put("retrycount", String.valueOf(MoreObjects.firstNonNull(cmd.getApiRetryCount(), clientDefaults.get("DEFAULT_API_RETRY_COUNT"; +params.put("retryinterval", String.valueOf(MoreObjects.firstNonNull(cmd.getApiRetryInterval(), clientDefaults.get("DEFAULT_API_RETRY_INTERVAL"; + +final Map hostdetails = new HashMap(); +hostdetails.putAll(params); resource.configure(cmd.getHostName(), hostdetails); -final Host host = _resourceMgr.addHost(zoneId, resource, Host.Type.L2Networking, params); +Host host = _resourceMgr.addHost(zoneId, resource, Host.Type.L2Networking, params); if (host != null) { -return Transaction.execute(new TransactionCallback() { -@Override -public NuageVspDeviceVO doInTransaction(TransactionStatus status) { -NuageVspDeviceVO nuageVspDevice = new NuageVspDeviceVO(host.getId(), physicalNetworkId, ntwkSvcProvider.getProviderName(), deviceName); -_nuageVspDao.persist(nuageVspDevice); +NuageVspDeviceVO nuageVspDevice = new NuageVspDeviceVO(host.getId(), physicalNetworkId, ntwkSvc
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r41986950 --- Diff: plugins/network-elements/nuage-vsp/src/com/cloud/network/manager/NuageVspManagerImpl.java --- @@ -152,50 +243,179 @@ public NuageVspDeviceVO addNuageVspDevice(AddNuageVspDeviceCmd cmd) { throw new CloudRuntimeException("A NuageVsp device is already configured on this physical network"); } -Map params = new HashMap(); -params.put("guid", UUID.randomUUID().toString()); -params.put("zoneId", String.valueOf(physicalNetwork.getDataCenterId())); -params.put("physicalNetworkId", String.valueOf(physicalNetwork.getId())); -params.put("name", "Nuage VSD - " + cmd.getHostName()); -params.put("hostname", cmd.getHostName()); -params.put("cmsuser", cmd.getUserName()); -String cmsUserPasswordBase64 = org.apache.commons.codec.binary.StringUtils.newStringUtf8(Base64.encodeBase64(cmd.getPassword().getBytes(Charset.forName("UTF-8"; -params.put("cmsuserpass", cmsUserPasswordBase64); -int port = cmd.getPort(); -if (0 == port) { -port = 443; -} -params.put("port", String.valueOf(port)); -params.put("apirelativepath", "/nuage/api/" + cmd.getApiVersion()); -params.put("retrycount", String.valueOf(cmd.getApiRetryCount())); -params.put("retryinterval", String.valueOf(cmd.getApiRetryInterval())); +try { +NuageVspPluginClientLoader clientLoader = NuageVspPluginClientLoader.getClientLoader(null, null, 1, 1, null); -Map hostdetails = new HashMap(); -hostdetails.putAll(params); +Map clientDefaults = clientLoader.getNuageVspManagerClient().getClientDefaults(); +String apiVersion = MoreObjects.firstNonNull(cmd.getApiVersion(), (String) clientDefaults.get("CURRENT_API_VERSION")); +if (!clientLoader.getNuageVspManagerClient().isSupportedApiVersion(apiVersion)) { +throw new CloudRuntimeException("Unsupported API version : " + apiVersion); +} -try { +Map params = new HashMap(); +params.put("guid", UUID.randomUUID().toString()); +params.put("zoneId", String.valueOf(physicalNetwork.getDataCenterId())); +params.put("physicalNetworkId", String.valueOf(physicalNetwork.getId())); +params.put("name", "Nuage VSD - " + cmd.getHostName()); +params.put("hostname", cmd.getHostName()); +params.put("cmsuser", cmd.getUserName()); +String cmsUserPasswordBase64 = org.apache.commons.codec.binary.StringUtils.newStringUtf8(Base64.encodeBase64(cmd.getPassword().getBytes())); +params.put("cmsuserpass", cmsUserPasswordBase64); +int port = cmd.getPort(); +if (0 == port) { +port = 8443; +} +params.put("port", String.valueOf(port)); +params.put("apiversion", apiVersion); +params.put("apirelativepath", "/nuage/api/" + apiVersion); +params.put("retrycount", String.valueOf(MoreObjects.firstNonNull(cmd.getApiRetryCount(), clientDefaults.get("DEFAULT_API_RETRY_COUNT"; +params.put("retryinterval", String.valueOf(MoreObjects.firstNonNull(cmd.getApiRetryInterval(), clientDefaults.get("DEFAULT_API_RETRY_INTERVAL"; + +final Map hostdetails = new HashMap(); +hostdetails.putAll(params); resource.configure(cmd.getHostName(), hostdetails); -final Host host = _resourceMgr.addHost(zoneId, resource, Host.Type.L2Networking, params); +Host host = _resourceMgr.addHost(zoneId, resource, Host.Type.L2Networking, params); if (host != null) { -return Transaction.execute(new TransactionCallback() { -@Override -public NuageVspDeviceVO doInTransaction(TransactionStatus status) { -NuageVspDeviceVO nuageVspDevice = new NuageVspDeviceVO(host.getId(), physicalNetworkId, ntwkSvcProvider.getProviderName(), deviceName); -_nuageVspDao.persist(nuageVspDevice); +NuageVspDeviceVO nuageVspDevice = new NuageVspDeviceVO(host.getId(), physicalNetworkId, ntwkSvc
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r41986962 --- Diff: plugins/network-elements/nuage-vsp/src/com/cloud/network/manager/NuageVspManagerImpl.java --- @@ -152,50 +243,179 @@ public NuageVspDeviceVO addNuageVspDevice(AddNuageVspDeviceCmd cmd) { throw new CloudRuntimeException("A NuageVsp device is already configured on this physical network"); } -Map params = new HashMap(); -params.put("guid", UUID.randomUUID().toString()); -params.put("zoneId", String.valueOf(physicalNetwork.getDataCenterId())); -params.put("physicalNetworkId", String.valueOf(physicalNetwork.getId())); -params.put("name", "Nuage VSD - " + cmd.getHostName()); -params.put("hostname", cmd.getHostName()); -params.put("cmsuser", cmd.getUserName()); -String cmsUserPasswordBase64 = org.apache.commons.codec.binary.StringUtils.newStringUtf8(Base64.encodeBase64(cmd.getPassword().getBytes(Charset.forName("UTF-8"; -params.put("cmsuserpass", cmsUserPasswordBase64); -int port = cmd.getPort(); -if (0 == port) { -port = 443; -} -params.put("port", String.valueOf(port)); -params.put("apirelativepath", "/nuage/api/" + cmd.getApiVersion()); -params.put("retrycount", String.valueOf(cmd.getApiRetryCount())); -params.put("retryinterval", String.valueOf(cmd.getApiRetryInterval())); +try { +NuageVspPluginClientLoader clientLoader = NuageVspPluginClientLoader.getClientLoader(null, null, 1, 1, null); -Map hostdetails = new HashMap(); -hostdetails.putAll(params); +Map clientDefaults = clientLoader.getNuageVspManagerClient().getClientDefaults(); +String apiVersion = MoreObjects.firstNonNull(cmd.getApiVersion(), (String) clientDefaults.get("CURRENT_API_VERSION")); +if (!clientLoader.getNuageVspManagerClient().isSupportedApiVersion(apiVersion)) { +throw new CloudRuntimeException("Unsupported API version : " + apiVersion); +} -try { +Map params = new HashMap(); +params.put("guid", UUID.randomUUID().toString()); +params.put("zoneId", String.valueOf(physicalNetwork.getDataCenterId())); +params.put("physicalNetworkId", String.valueOf(physicalNetwork.getId())); +params.put("name", "Nuage VSD - " + cmd.getHostName()); +params.put("hostname", cmd.getHostName()); +params.put("cmsuser", cmd.getUserName()); +String cmsUserPasswordBase64 = org.apache.commons.codec.binary.StringUtils.newStringUtf8(Base64.encodeBase64(cmd.getPassword().getBytes())); +params.put("cmsuserpass", cmsUserPasswordBase64); +int port = cmd.getPort(); +if (0 == port) { +port = 8443; +} +params.put("port", String.valueOf(port)); +params.put("apiversion", apiVersion); +params.put("apirelativepath", "/nuage/api/" + apiVersion); +params.put("retrycount", String.valueOf(MoreObjects.firstNonNull(cmd.getApiRetryCount(), clientDefaults.get("DEFAULT_API_RETRY_COUNT"; +params.put("retryinterval", String.valueOf(MoreObjects.firstNonNull(cmd.getApiRetryInterval(), clientDefaults.get("DEFAULT_API_RETRY_INTERVAL"; + +final Map hostdetails = new HashMap(); +hostdetails.putAll(params); resource.configure(cmd.getHostName(), hostdetails); -final Host host = _resourceMgr.addHost(zoneId, resource, Host.Type.L2Networking, params); +Host host = _resourceMgr.addHost(zoneId, resource, Host.Type.L2Networking, params); if (host != null) { -return Transaction.execute(new TransactionCallback() { -@Override -public NuageVspDeviceVO doInTransaction(TransactionStatus status) { -NuageVspDeviceVO nuageVspDevice = new NuageVspDeviceVO(host.getId(), physicalNetworkId, ntwkSvcProvider.getProviderName(), deviceName); -_nuageVspDao.persist(nuageVspDevice); +NuageVspDeviceVO nuageVspDevice = new NuageVspDeviceVO(host.getId(), physicalNetworkId, ntwkSvc
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r41987747 --- Diff: plugins/network-elements/nuage-vsp/src/com/cloud/network/manager/NuageVspManagerImpl.java --- @@ -152,50 +243,179 @@ public NuageVspDeviceVO addNuageVspDevice(AddNuageVspDeviceCmd cmd) { throw new CloudRuntimeException("A NuageVsp device is already configured on this physical network"); } -Map params = new HashMap(); -params.put("guid", UUID.randomUUID().toString()); -params.put("zoneId", String.valueOf(physicalNetwork.getDataCenterId())); -params.put("physicalNetworkId", String.valueOf(physicalNetwork.getId())); -params.put("name", "Nuage VSD - " + cmd.getHostName()); -params.put("hostname", cmd.getHostName()); -params.put("cmsuser", cmd.getUserName()); -String cmsUserPasswordBase64 = org.apache.commons.codec.binary.StringUtils.newStringUtf8(Base64.encodeBase64(cmd.getPassword().getBytes(Charset.forName("UTF-8"; -params.put("cmsuserpass", cmsUserPasswordBase64); -int port = cmd.getPort(); -if (0 == port) { -port = 443; -} -params.put("port", String.valueOf(port)); -params.put("apirelativepath", "/nuage/api/" + cmd.getApiVersion()); -params.put("retrycount", String.valueOf(cmd.getApiRetryCount())); -params.put("retryinterval", String.valueOf(cmd.getApiRetryInterval())); +try { +NuageVspPluginClientLoader clientLoader = NuageVspPluginClientLoader.getClientLoader(null, null, 1, 1, null); -Map hostdetails = new HashMap(); -hostdetails.putAll(params); +Map clientDefaults = clientLoader.getNuageVspManagerClient().getClientDefaults(); +String apiVersion = MoreObjects.firstNonNull(cmd.getApiVersion(), (String) clientDefaults.get("CURRENT_API_VERSION")); +if (!clientLoader.getNuageVspManagerClient().isSupportedApiVersion(apiVersion)) { +throw new CloudRuntimeException("Unsupported API version : " + apiVersion); +} -try { +Map params = new HashMap(); +params.put("guid", UUID.randomUUID().toString()); +params.put("zoneId", String.valueOf(physicalNetwork.getDataCenterId())); +params.put("physicalNetworkId", String.valueOf(physicalNetwork.getId())); +params.put("name", "Nuage VSD - " + cmd.getHostName()); +params.put("hostname", cmd.getHostName()); +params.put("cmsuser", cmd.getUserName()); +String cmsUserPasswordBase64 = org.apache.commons.codec.binary.StringUtils.newStringUtf8(Base64.encodeBase64(cmd.getPassword().getBytes())); +params.put("cmsuserpass", cmsUserPasswordBase64); +int port = cmd.getPort(); +if (0 == port) { +port = 8443; +} +params.put("port", String.valueOf(port)); +params.put("apiversion", apiVersion); +params.put("apirelativepath", "/nuage/api/" + apiVersion); +params.put("retrycount", String.valueOf(MoreObjects.firstNonNull(cmd.getApiRetryCount(), clientDefaults.get("DEFAULT_API_RETRY_COUNT"; +params.put("retryinterval", String.valueOf(MoreObjects.firstNonNull(cmd.getApiRetryInterval(), clientDefaults.get("DEFAULT_API_RETRY_INTERVAL"; + +final Map hostdetails = new HashMap(); +hostdetails.putAll(params); resource.configure(cmd.getHostName(), hostdetails); -final Host host = _resourceMgr.addHost(zoneId, resource, Host.Type.L2Networking, params); +Host host = _resourceMgr.addHost(zoneId, resource, Host.Type.L2Networking, params); if (host != null) { -return Transaction.execute(new TransactionCallback() { -@Override -public NuageVspDeviceVO doInTransaction(TransactionStatus status) { -NuageVspDeviceVO nuageVspDevice = new NuageVspDeviceVO(host.getId(), physicalNetworkId, ntwkSvcProvider.getProviderName(), deviceName); -_nuageVspDao.persist(nuageVspDevice); +NuageVspDeviceVO nuageVspDevice = new NuageVspDeviceVO(host.getId(), physicalNetworkId, ntwkSvc
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r41987775 --- Diff: plugins/network-elements/nuage-vsp/src/com/cloud/network/manager/NuageVspManagerImpl.java --- @@ -152,50 +243,179 @@ public NuageVspDeviceVO addNuageVspDevice(AddNuageVspDeviceCmd cmd) { throw new CloudRuntimeException("A NuageVsp device is already configured on this physical network"); } -Map params = new HashMap(); -params.put("guid", UUID.randomUUID().toString()); -params.put("zoneId", String.valueOf(physicalNetwork.getDataCenterId())); -params.put("physicalNetworkId", String.valueOf(physicalNetwork.getId())); -params.put("name", "Nuage VSD - " + cmd.getHostName()); -params.put("hostname", cmd.getHostName()); -params.put("cmsuser", cmd.getUserName()); -String cmsUserPasswordBase64 = org.apache.commons.codec.binary.StringUtils.newStringUtf8(Base64.encodeBase64(cmd.getPassword().getBytes(Charset.forName("UTF-8"; -params.put("cmsuserpass", cmsUserPasswordBase64); -int port = cmd.getPort(); -if (0 == port) { -port = 443; -} -params.put("port", String.valueOf(port)); -params.put("apirelativepath", "/nuage/api/" + cmd.getApiVersion()); -params.put("retrycount", String.valueOf(cmd.getApiRetryCount())); -params.put("retryinterval", String.valueOf(cmd.getApiRetryInterval())); +try { +NuageVspPluginClientLoader clientLoader = NuageVspPluginClientLoader.getClientLoader(null, null, 1, 1, null); -Map hostdetails = new HashMap(); -hostdetails.putAll(params); +Map clientDefaults = clientLoader.getNuageVspManagerClient().getClientDefaults(); +String apiVersion = MoreObjects.firstNonNull(cmd.getApiVersion(), (String) clientDefaults.get("CURRENT_API_VERSION")); +if (!clientLoader.getNuageVspManagerClient().isSupportedApiVersion(apiVersion)) { +throw new CloudRuntimeException("Unsupported API version : " + apiVersion); +} -try { +Map params = new HashMap(); +params.put("guid", UUID.randomUUID().toString()); +params.put("zoneId", String.valueOf(physicalNetwork.getDataCenterId())); +params.put("physicalNetworkId", String.valueOf(physicalNetwork.getId())); +params.put("name", "Nuage VSD - " + cmd.getHostName()); +params.put("hostname", cmd.getHostName()); +params.put("cmsuser", cmd.getUserName()); +String cmsUserPasswordBase64 = org.apache.commons.codec.binary.StringUtils.newStringUtf8(Base64.encodeBase64(cmd.getPassword().getBytes())); +params.put("cmsuserpass", cmsUserPasswordBase64); +int port = cmd.getPort(); +if (0 == port) { +port = 8443; +} +params.put("port", String.valueOf(port)); +params.put("apiversion", apiVersion); +params.put("apirelativepath", "/nuage/api/" + apiVersion); +params.put("retrycount", String.valueOf(MoreObjects.firstNonNull(cmd.getApiRetryCount(), clientDefaults.get("DEFAULT_API_RETRY_COUNT"; +params.put("retryinterval", String.valueOf(MoreObjects.firstNonNull(cmd.getApiRetryInterval(), clientDefaults.get("DEFAULT_API_RETRY_INTERVAL"; + +final Map hostdetails = new HashMap(); +hostdetails.putAll(params); resource.configure(cmd.getHostName(), hostdetails); -final Host host = _resourceMgr.addHost(zoneId, resource, Host.Type.L2Networking, params); +Host host = _resourceMgr.addHost(zoneId, resource, Host.Type.L2Networking, params); if (host != null) { -return Transaction.execute(new TransactionCallback() { -@Override -public NuageVspDeviceVO doInTransaction(TransactionStatus status) { -NuageVspDeviceVO nuageVspDevice = new NuageVspDeviceVO(host.getId(), physicalNetworkId, ntwkSvcProvider.getProviderName(), deviceName); -_nuageVspDao.persist(nuageVspDevice); +NuageVspDeviceVO nuageVspDevice = new NuageVspDeviceVO(host.getId(), physicalNetworkId, ntwkSvc
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r41987892 --- Diff: plugins/network-elements/nuage-vsp/src/com/cloud/network/manager/NuageVspManagerImpl.java --- @@ -152,50 +243,179 @@ public NuageVspDeviceVO addNuageVspDevice(AddNuageVspDeviceCmd cmd) { throw new CloudRuntimeException("A NuageVsp device is already configured on this physical network"); } -Map params = new HashMap(); -params.put("guid", UUID.randomUUID().toString()); -params.put("zoneId", String.valueOf(physicalNetwork.getDataCenterId())); -params.put("physicalNetworkId", String.valueOf(physicalNetwork.getId())); -params.put("name", "Nuage VSD - " + cmd.getHostName()); -params.put("hostname", cmd.getHostName()); -params.put("cmsuser", cmd.getUserName()); -String cmsUserPasswordBase64 = org.apache.commons.codec.binary.StringUtils.newStringUtf8(Base64.encodeBase64(cmd.getPassword().getBytes(Charset.forName("UTF-8"; -params.put("cmsuserpass", cmsUserPasswordBase64); -int port = cmd.getPort(); -if (0 == port) { -port = 443; -} -params.put("port", String.valueOf(port)); -params.put("apirelativepath", "/nuage/api/" + cmd.getApiVersion()); -params.put("retrycount", String.valueOf(cmd.getApiRetryCount())); -params.put("retryinterval", String.valueOf(cmd.getApiRetryInterval())); +try { +NuageVspPluginClientLoader clientLoader = NuageVspPluginClientLoader.getClientLoader(null, null, 1, 1, null); -Map hostdetails = new HashMap(); -hostdetails.putAll(params); +Map clientDefaults = clientLoader.getNuageVspManagerClient().getClientDefaults(); +String apiVersion = MoreObjects.firstNonNull(cmd.getApiVersion(), (String) clientDefaults.get("CURRENT_API_VERSION")); +if (!clientLoader.getNuageVspManagerClient().isSupportedApiVersion(apiVersion)) { +throw new CloudRuntimeException("Unsupported API version : " + apiVersion); +} -try { +Map params = new HashMap(); +params.put("guid", UUID.randomUUID().toString()); +params.put("zoneId", String.valueOf(physicalNetwork.getDataCenterId())); +params.put("physicalNetworkId", String.valueOf(physicalNetwork.getId())); +params.put("name", "Nuage VSD - " + cmd.getHostName()); +params.put("hostname", cmd.getHostName()); +params.put("cmsuser", cmd.getUserName()); +String cmsUserPasswordBase64 = org.apache.commons.codec.binary.StringUtils.newStringUtf8(Base64.encodeBase64(cmd.getPassword().getBytes())); +params.put("cmsuserpass", cmsUserPasswordBase64); +int port = cmd.getPort(); +if (0 == port) { +port = 8443; +} +params.put("port", String.valueOf(port)); +params.put("apiversion", apiVersion); +params.put("apirelativepath", "/nuage/api/" + apiVersion); +params.put("retrycount", String.valueOf(MoreObjects.firstNonNull(cmd.getApiRetryCount(), clientDefaults.get("DEFAULT_API_RETRY_COUNT"; +params.put("retryinterval", String.valueOf(MoreObjects.firstNonNull(cmd.getApiRetryInterval(), clientDefaults.get("DEFAULT_API_RETRY_INTERVAL"; + +final Map hostdetails = new HashMap(); +hostdetails.putAll(params); resource.configure(cmd.getHostName(), hostdetails); -final Host host = _resourceMgr.addHost(zoneId, resource, Host.Type.L2Networking, params); +Host host = _resourceMgr.addHost(zoneId, resource, Host.Type.L2Networking, params); if (host != null) { -return Transaction.execute(new TransactionCallback() { -@Override -public NuageVspDeviceVO doInTransaction(TransactionStatus status) { -NuageVspDeviceVO nuageVspDevice = new NuageVspDeviceVO(host.getId(), physicalNetworkId, ntwkSvcProvider.getProviderName(), deviceName); -_nuageVspDao.persist(nuageVspDevice); +NuageVspDeviceVO nuageVspDevice = new NuageVspDeviceVO(host.getId(), physicalNetworkId, ntwkSvc
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r41988014 --- Diff: plugins/network-elements/nuage-vsp/src/com/cloud/network/manager/NuageVspManagerImpl.java --- @@ -152,50 +243,179 @@ public NuageVspDeviceVO addNuageVspDevice(AddNuageVspDeviceCmd cmd) { throw new CloudRuntimeException("A NuageVsp device is already configured on this physical network"); } -Map params = new HashMap(); -params.put("guid", UUID.randomUUID().toString()); -params.put("zoneId", String.valueOf(physicalNetwork.getDataCenterId())); -params.put("physicalNetworkId", String.valueOf(physicalNetwork.getId())); -params.put("name", "Nuage VSD - " + cmd.getHostName()); -params.put("hostname", cmd.getHostName()); -params.put("cmsuser", cmd.getUserName()); -String cmsUserPasswordBase64 = org.apache.commons.codec.binary.StringUtils.newStringUtf8(Base64.encodeBase64(cmd.getPassword().getBytes(Charset.forName("UTF-8"; -params.put("cmsuserpass", cmsUserPasswordBase64); -int port = cmd.getPort(); -if (0 == port) { -port = 443; -} -params.put("port", String.valueOf(port)); -params.put("apirelativepath", "/nuage/api/" + cmd.getApiVersion()); -params.put("retrycount", String.valueOf(cmd.getApiRetryCount())); -params.put("retryinterval", String.valueOf(cmd.getApiRetryInterval())); +try { +NuageVspPluginClientLoader clientLoader = NuageVspPluginClientLoader.getClientLoader(null, null, 1, 1, null); -Map hostdetails = new HashMap(); -hostdetails.putAll(params); +Map clientDefaults = clientLoader.getNuageVspManagerClient().getClientDefaults(); +String apiVersion = MoreObjects.firstNonNull(cmd.getApiVersion(), (String) clientDefaults.get("CURRENT_API_VERSION")); +if (!clientLoader.getNuageVspManagerClient().isSupportedApiVersion(apiVersion)) { +throw new CloudRuntimeException("Unsupported API version : " + apiVersion); +} -try { +Map params = new HashMap(); +params.put("guid", UUID.randomUUID().toString()); +params.put("zoneId", String.valueOf(physicalNetwork.getDataCenterId())); +params.put("physicalNetworkId", String.valueOf(physicalNetwork.getId())); +params.put("name", "Nuage VSD - " + cmd.getHostName()); +params.put("hostname", cmd.getHostName()); +params.put("cmsuser", cmd.getUserName()); +String cmsUserPasswordBase64 = org.apache.commons.codec.binary.StringUtils.newStringUtf8(Base64.encodeBase64(cmd.getPassword().getBytes())); +params.put("cmsuserpass", cmsUserPasswordBase64); +int port = cmd.getPort(); +if (0 == port) { +port = 8443; +} +params.put("port", String.valueOf(port)); +params.put("apiversion", apiVersion); +params.put("apirelativepath", "/nuage/api/" + apiVersion); +params.put("retrycount", String.valueOf(MoreObjects.firstNonNull(cmd.getApiRetryCount(), clientDefaults.get("DEFAULT_API_RETRY_COUNT"; +params.put("retryinterval", String.valueOf(MoreObjects.firstNonNull(cmd.getApiRetryInterval(), clientDefaults.get("DEFAULT_API_RETRY_INTERVAL"; + +final Map hostdetails = new HashMap(); +hostdetails.putAll(params); resource.configure(cmd.getHostName(), hostdetails); -final Host host = _resourceMgr.addHost(zoneId, resource, Host.Type.L2Networking, params); +Host host = _resourceMgr.addHost(zoneId, resource, Host.Type.L2Networking, params); if (host != null) { -return Transaction.execute(new TransactionCallback() { -@Override -public NuageVspDeviceVO doInTransaction(TransactionStatus status) { -NuageVspDeviceVO nuageVspDevice = new NuageVspDeviceVO(host.getId(), physicalNetworkId, ntwkSvcProvider.getProviderName(), deviceName); -_nuageVspDao.persist(nuageVspDevice); +NuageVspDeviceVO nuageVspDevice = new NuageVspDeviceVO(host.getId(), physicalNetworkId, ntwkSvc
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r41988124 --- Diff: plugins/network-elements/nuage-vsp/src/com/cloud/network/manager/NuageVspManagerImpl.java --- @@ -247,6 +467,26 @@ public boolean deleteNuageVspDevice(DeleteNuageVspDeviceCmd cmd) { } } +ConfigurationVO cmsIdConfig = _configDao.findByName("nuagevsp.cms.id"); +HostVO host = findNuageVspHost(nuageVspDevice.getHostId()); +if (!auditDomainsOnVsp(host, false, true)) { +return false; +} + +String nuageVspCmsId = findNuageVspCmsIdForDevice(nuageVspDevice.getId(), cmsIdConfig); +SyncNuageVspCmsIdCommand syncCmd = new SyncNuageVspCmsIdCommand(SyncType.UNREGISTER, nuageVspCmsId); +SyncNuageVspCmsIdAnswer answer = (SyncNuageVspCmsIdAnswer) _agentMgr.easySend(nuageVspDevice.getHostId(), syncCmd); +if (answer != null && answer.getSuccess()) { +String currentValue = cmsIdConfig.getValue(); +String newValue = currentValue.replace(nuageVspDevice.getId() + ":" + answer.getNuageVspCmsId(), ""); +if (newValue.startsWith(";")) { --- End diff -- Done. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r41988188 --- Diff: plugins/network-elements/nuage-vsp/src/com/cloud/network/manager/NuageVspManagerImpl.java --- @@ -285,60 +525,345 @@ public boolean deleteNuageVspDevice(DeleteNuageVspDeviceCmd cmd) { return responseList; } -@Override -public boolean configure(String name, Map params) throws ConfigurationException { -try { -initNuageScheduledTasks(); -} catch (Exception ce) { -s_logger.warn("Failed to load NuageVsp configuration properties. Check if the NuageVsp properties are configured correctly"); +private void registerNewNuageVspDevice(ConfigurationVO currentConfig, String registeredNuageVspDevice) { +if (currentConfig == null) { +ConfigKey configKey = new ConfigKey("Advanced", String.class, "nuagevsp.cms.id", registeredNuageVspDevice, +": - Do not edit", false); +ConfigurationVO configuration = new ConfigurationVO("management-server", configKey); +_configDao.persist(configuration); +} else { +String newValue; +String currentValue = currentConfig.getValue(); +if (!Strings.isNullOrEmpty(currentValue)) { +newValue = currentValue + ";" + registeredNuageVspDevice; +} else { +newValue = registeredNuageVspDevice; +} +_configDao.update("nuagevsp.cms.id", newValue); } -return true; } -private void initNuageScheduledTasks() { -Integer numOfSyncThreads = Integer.valueOf(_configDao.getValue(NuageVspManager.NuageVspSyncWorkers.key())); -Integer syncUpIntervalInMinutes = Integer.valueOf(_configDao.getValue(NuageVspManager.NuageVspSyncInterval.key())); - -if (numOfSyncThreads != null && syncUpIntervalInMinutes != null) { -ThreadFactory threadFactory = new ThreadFactory() { -public Thread newThread(Runnable runnable) { -Thread thread = new Thread(runnable, "Nuage Vsp sync task"); -if (thread.isDaemon()) -thread.setDaemon(false); -if (thread.getPriority() != Thread.NORM_PRIORITY) -thread.setPriority(Thread.NORM_PRIORITY); -return thread; +private void auditHost(HostVO host) { +_hostDao.loadDetails(host); + +boolean validateDomains = true; +List nuageVspDevices = _nuageVspDao.listByHost(host.getId()); +if (!CollectionUtils.isEmpty(nuageVspDevices)) { +for (NuageVspDeviceVO nuageVspDevice : nuageVspDevices) { +ConfigurationVO cmsIdConfig = _configDao.findByName("nuagevsp.cms.id"); +String nuageVspCmsId = findNuageVspCmsIdForDevice(nuageVspDevice.getId(), cmsIdConfig); +SyncNuageVspCmsIdCommand syncCmd = new SyncNuageVspCmsIdCommand(SyncType.AUDIT, nuageVspCmsId); +SyncNuageVspCmsIdAnswer answer = (SyncNuageVspCmsIdAnswer) _agentMgr.easySend(nuageVspDevice.getHostId(), syncCmd); + +if (answer != null && !answer.getSuccess()) { +s_logger.fatal("Nuage VSP Device with ID " + nuageVspDevice.getId() + " is configured with an unknown CMS ID!"); --- End diff -- Changed log level to ERROR. No reason for it to be FATAL --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r41988458 --- Diff: plugins/network-elements/nuage-vsp/src/com/cloud/network/manager/NuageVspManagerImpl.java --- @@ -285,60 +525,345 @@ public boolean deleteNuageVspDevice(DeleteNuageVspDeviceCmd cmd) { return responseList; } -@Override -public boolean configure(String name, Map params) throws ConfigurationException { -try { -initNuageScheduledTasks(); -} catch (Exception ce) { -s_logger.warn("Failed to load NuageVsp configuration properties. Check if the NuageVsp properties are configured correctly"); +private void registerNewNuageVspDevice(ConfigurationVO currentConfig, String registeredNuageVspDevice) { +if (currentConfig == null) { +ConfigKey configKey = new ConfigKey("Advanced", String.class, "nuagevsp.cms.id", registeredNuageVspDevice, +": - Do not edit", false); +ConfigurationVO configuration = new ConfigurationVO("management-server", configKey); +_configDao.persist(configuration); +} else { +String newValue; +String currentValue = currentConfig.getValue(); +if (!Strings.isNullOrEmpty(currentValue)) { +newValue = currentValue + ";" + registeredNuageVspDevice; +} else { +newValue = registeredNuageVspDevice; +} +_configDao.update("nuagevsp.cms.id", newValue); } -return true; } -private void initNuageScheduledTasks() { -Integer numOfSyncThreads = Integer.valueOf(_configDao.getValue(NuageVspManager.NuageVspSyncWorkers.key())); -Integer syncUpIntervalInMinutes = Integer.valueOf(_configDao.getValue(NuageVspManager.NuageVspSyncInterval.key())); - -if (numOfSyncThreads != null && syncUpIntervalInMinutes != null) { -ThreadFactory threadFactory = new ThreadFactory() { -public Thread newThread(Runnable runnable) { -Thread thread = new Thread(runnable, "Nuage Vsp sync task"); -if (thread.isDaemon()) -thread.setDaemon(false); -if (thread.getPriority() != Thread.NORM_PRIORITY) -thread.setPriority(Thread.NORM_PRIORITY); -return thread; +private void auditHost(HostVO host) { +_hostDao.loadDetails(host); + +boolean validateDomains = true; +List nuageVspDevices = _nuageVspDao.listByHost(host.getId()); +if (!CollectionUtils.isEmpty(nuageVspDevices)) { +for (NuageVspDeviceVO nuageVspDevice : nuageVspDevices) { +ConfigurationVO cmsIdConfig = _configDao.findByName("nuagevsp.cms.id"); +String nuageVspCmsId = findNuageVspCmsIdForDevice(nuageVspDevice.getId(), cmsIdConfig); +SyncNuageVspCmsIdCommand syncCmd = new SyncNuageVspCmsIdCommand(SyncType.AUDIT, nuageVspCmsId); +SyncNuageVspCmsIdAnswer answer = (SyncNuageVspCmsIdAnswer) _agentMgr.easySend(nuageVspDevice.getHostId(), syncCmd); + +if (answer != null && !answer.getSuccess()) { +s_logger.fatal("Nuage VSP Device with ID " + nuageVspDevice.getId() + " is configured with an unknown CMS ID!"); +validateDomains = false; +} else if (answer != null && answer.getSyncType() == SyncType.REGISTER) { +registerNewNuageVspDevice(cmsIdConfig, nuageVspDevice.getId() + ":" + answer.getNuageVspCmsId()); } -}; -scheduler = Executors.newScheduledThreadPool(numOfSyncThreads, threadFactory); -scheduler.scheduleWithFixedDelay(new NuageVspSyncTask("FLOATING_IP"), ONE_MINUTE_MULTIPLIER * 15, ONE_MINUTE_MULTIPLIER * syncUpIntervalInMinutes, -TimeUnit.MILLISECONDS); -scheduler.scheduleWithFixedDelay(new NuageVspSyncTask("ENTERPRISE_NTWK_MACRO"), ONE_MINUTE_MULTIPLIER * 15, ONE_MINUTE_MULTIPLIER * syncUpIntervalInMinutes, -TimeUnit.MILLISECONDS); -scheduler -.scheduleWithFixedDelay(new NuageVspSyncTask("ENTERPRISE"), ONE_MINUTE_MULTIPLIER * 15, ONE_MINUTE_MULTIPLIER * syncUpIntervalInMinutes, TimeUnit.MILLISECONDS); -} else { -s_logger.warn("NuageVsp configuration for syncWorkers="
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r41988797 --- Diff: plugins/network-elements/nuage-vsp/src/com/cloud/network/resource/NuageVspResource.java --- @@ -262,15 +260,19 @@ public String getName() { public PingCommand getCurrentStatus(long id) { if ((_relativePath == null) || (_relativePath.isEmpty()) || (_cmsUserInfo == null) || (_cmsUserInfo.length == 0)) { s_logger.error("Failed to ping to Nuage VSD"); --- End diff -- Done. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r41989312 --- Diff: plugins/network-elements/nuage-vsp/src/com/cloud/network/resource/NuageVspResource.java --- @@ -360,32 +375,25 @@ private Answer executeRequest(ImplementNetworkVspCommand cmd) { private Answer executeRequest(ReserveVmInterfaceVspCommand cmd) { try { isNuageVspGuruLoaded(); -List> vmInterfaceInfo = _nuageVspGuruClient.reserve(cmd.getNicUuid(), cmd.getNicMacAddress(), cmd.getNetworkUuid(), cmd.isL3Network(), -cmd.getVpcUuid(), cmd.getNetworkDomainUuid(), cmd.getNetworksAccountUuid(), cmd.isDomainRouter(), cmd._getDomainRouterIp(), cmd._getVmInstanceName(), -cmd._getVmUuid()); -return new ReserveVmInterfaceVspAnswer(cmd, vmInterfaceInfo, "Created NIC in VSP that maps to nicUuid" + cmd.getNicUuid()); +_nuageVspGuruClient.reserve(cmd.getNicUuid(), cmd.getNicMacAddress(), cmd.getNetworkUuid(), cmd.isL3Network(), +cmd.isSharedNetwork(), cmd.getVpcUuid(), cmd.getNetworkDomainUuid(), cmd.getNetworksAccountUuid(), cmd.isDomainRouter(), cmd.getDomainRouterIp(), +cmd.getVmInstanceName(), cmd.getVmUuid(), cmd.useStaticIp(), cmd.getStaticIp(), cmd.getStaticNatIpUuid(), cmd.getStaticNatIpAddress(), cmd.isStaticNatIpAllocated(), +cmd.isOneToOneNat(), cmd.getStaticNatVlanUuid(), cmd.getStaticNatVlanGateway(), cmd.getStaticNatVlanNetmask()); +return new ReserveVmInterfaceVspAnswer(cmd, "Created NIC in VSP that maps to nicUuid" + cmd.getNicUuid()); --- End diff -- Done. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r41989728 --- Diff: plugins/network-elements/nuage-vsp/src/com/cloud/network/resource/NuageVspResource.java --- @@ -403,20 +412,36 @@ private Answer executeRequest(TrashNetworkVspCommand cmd) { private Answer executeRequest(ApplyStaticNatVspCommand cmd) { try { isNuageVspElementLoaded(); - _nuageVspElementClient.applyStaticNats(cmd.getNetworkDomainUuid(), cmd.getVpcOrSubnetUuid(), cmd.isL3Network(), cmd.getStaticNatDetails()); + _nuageVspElementClient.applyStaticNats(cmd.getNetworkDomainUuid(), cmd.getNetworkUuid(), cmd.getVpcOrSubnetUuid(), cmd.isL3Network(), +cmd.isVpc(), cmd.getStaticNatDetails()); return new ApplyStaticNatVspAnswer(cmd, true, "Applied Static NAT to VSP network mapping to " + cmd.getVpcOrSubnetUuid()); } catch (Exception e) { +s_logger.error("Failure during " + cmd, e); return new ApplyStaticNatVspAnswer(cmd, e); } } +private Answer executeRequest(ImplementVspCommand cmd) { +try { +isNuageVspElementLoaded(); +boolean success = _nuageVspElementClient.implement(cmd.getNetworkId(), cmd.getNetworkDomainUuid(), cmd.getNetworkUuid(), cmd.getNetworkName(), cmd.getVpcOrSubnetUuid(), cmd.isL2Network(), +cmd.isL3Network(), cmd.isVpc(), cmd.isShared(), cmd.getDomainTemplateName(), cmd.isFirewallServiceSupported(), cmd.getDnsServers(), cmd.getIngressFirewallRules(), +cmd.getEgressFirewallRules(), cmd.getAcsFipUuid(), cmd.isEgressDefaultPolicy()); +return new ImplementVspAnswer(cmd, success, "Implemented network in VSP " + cmd.getNetworkUuid()); +} catch (Exception e) { --- End diff -- Our client is using internal exceptions, which are not available in ACS, and which translated to Exception before we return from the client. Therefore we need to catch on Exception --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r41989725 --- Diff: plugins/network-elements/nuage-vsp/src/com/cloud/network/resource/NuageVspResource.java --- @@ -393,9 +401,10 @@ private Answer executeRequest(DeallocateVmVspCommand cmd) { private Answer executeRequest(TrashNetworkVspCommand cmd) { try { isNuageVspGuruLoaded(); -_nuageVspGuruClient.trash(cmd.getDomainUuid(), cmd.getNetworkUuid(), cmd.isL3Network(), cmd.getVpcUuid()); +_nuageVspGuruClient.trash(cmd.getDomainUuid(), cmd.getNetworkUuid(), cmd.isL3Network(), cmd.isSharedNetwork(), cmd.getVpcUuid(), cmd.getDomainTemplateName()); return new TrashNetworkVspAnswer(cmd, true, "Deleted Nuage VSP network mapping to " + cmd.getNetworkUuid()); } catch (Exception e) { --- End diff -- Our client is using internal exceptions, which are not available in ACS, and which translated to Exception before we return from the client. Therefore we need to catch on Exception --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r41989708 --- Diff: plugins/network-elements/nuage-vsp/src/com/cloud/network/resource/NuageVspResource.java --- @@ -360,32 +375,25 @@ private Answer executeRequest(ImplementNetworkVspCommand cmd) { private Answer executeRequest(ReserveVmInterfaceVspCommand cmd) { try { isNuageVspGuruLoaded(); -List> vmInterfaceInfo = _nuageVspGuruClient.reserve(cmd.getNicUuid(), cmd.getNicMacAddress(), cmd.getNetworkUuid(), cmd.isL3Network(), -cmd.getVpcUuid(), cmd.getNetworkDomainUuid(), cmd.getNetworksAccountUuid(), cmd.isDomainRouter(), cmd._getDomainRouterIp(), cmd._getVmInstanceName(), -cmd._getVmUuid()); -return new ReserveVmInterfaceVspAnswer(cmd, vmInterfaceInfo, "Created NIC in VSP that maps to nicUuid" + cmd.getNicUuid()); +_nuageVspGuruClient.reserve(cmd.getNicUuid(), cmd.getNicMacAddress(), cmd.getNetworkUuid(), cmd.isL3Network(), +cmd.isSharedNetwork(), cmd.getVpcUuid(), cmd.getNetworkDomainUuid(), cmd.getNetworksAccountUuid(), cmd.isDomainRouter(), cmd.getDomainRouterIp(), +cmd.getVmInstanceName(), cmd.getVmUuid(), cmd.useStaticIp(), cmd.getStaticIp(), cmd.getStaticNatIpUuid(), cmd.getStaticNatIpAddress(), cmd.isStaticNatIpAllocated(), +cmd.isOneToOneNat(), cmd.getStaticNatVlanUuid(), cmd.getStaticNatVlanGateway(), cmd.getStaticNatVlanNetmask()); +return new ReserveVmInterfaceVspAnswer(cmd, "Created NIC in VSP that maps to nicUuid" + cmd.getNicUuid()); } catch (Exception e) { +s_logger.error("Failure during " + cmd, e); return new ReserveVmInterfaceVspAnswer(cmd, e); } } -private Answer executeRequest(ReleaseVmVspCommand cmd) { -try { -isNuageVspGuruLoaded(); -_nuageVspGuruClient.release(cmd.getNetworkUuid(), cmd.getVmUuid(), cmd.getVmInstanceName()); -return new ReleaseVmVspAnswer(cmd, true, "VM has been deleted from VSP."); -} catch (Exception e) { -return new ReleaseVmVspAnswer(cmd, e); -} -} - private Answer executeRequest(DeallocateVmVspCommand cmd) { try { isNuageVspGuruLoaded(); -_nuageVspGuruClient.deallocate(cmd.getNetworkUuid(), cmd.getNicFrmDdUuid(), cmd.getNicMacAddress(), cmd.getNicIp4Address(), cmd.isL3Network(), cmd.getVpcUuid(), -cmd.getNetworksDomainUuid(), cmd.getVmInstanceName(), cmd.getVmUuid()); +_nuageVspGuruClient.deallocate(cmd.getNetworkUuid(), cmd.getNicFromDdUuid(), cmd.getNicMacAddress(), cmd.getNicIp4Address(), cmd.isL3Network(), cmd.isSharedNetwork(), +cmd.getVpcUuid(), cmd.getNetworksDomainUuid(), cmd.getVmInstanceName(), cmd.getVmUuid(), cmd.isExpungingState()); return new DeallocateVmVspAnswer(cmd, true, "Deallocated VM from Nuage VSP."); } catch (Exception e) { --- End diff -- Our client is using internal exceptions, which are not available in ACS, and which translated to Exception before we return from the client. Therefore we need to catch on Exception --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r41989738 --- Diff: plugins/network-elements/nuage-vsp/src/com/cloud/network/resource/NuageVspResource.java --- @@ -424,9 +449,10 @@ private Answer executeRequest(ApplyAclRuleVspCommand cmd) { private Answer executeRequest(ShutDownVpcVspCommand cmd) { try { isNuageVspElementLoaded(); -_nuageVspElementClient.shutDownVpc(cmd.getDomainUuid(), cmd.getVpcUuid()); +_nuageVspElementClient.shutdownVpc(cmd.getDomainUuid(), cmd.getVpcUuid(), cmd.getDomainTemplateName()); return new ShutDownVpcVspAnswer(cmd, true, "Shutdown VPC " + cmd.getVpcUuid()); } catch (Exception e) { --- End diff -- Our client is using internal exceptions, which are not available in ACS, and which translated to Exception before we return from the client. Therefore we need to catch on Exception --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r41989863 --- Diff: plugins/network-elements/nuage-vsp/src/com/cloud/network/resource/NuageVspResource.java --- @@ -437,31 +463,79 @@ private Answer executeRequest(SyncVspCommand cmd) { _nuageVspSyncClient.syncWithNuageVsp(cmd.getNuageVspEntity()); return new SyncVspAnswer(cmd, true, "Synced " + cmd.getNuageVspEntity() + " in VSP"); } catch (Exception e) { +s_logger.error("Failure during " + cmd, e); return new SyncVspAnswer(cmd, e); } } +private Answer executeRequest(SyncNuageVspCmsIdCommand cmd) { +try { +isNuageVspManagerLoaded(); +if (cmd.getSyncType() == SyncType.AUDIT || cmd.getSyncType() == SyncType.AUDIT_ONLY) { +Pair answer = _nuageVspManagerClient.auditNuageVspCmsId(cmd.getNuageVspCmsId(), cmd.getSyncType() == SyncType.AUDIT_ONLY); +return new SyncNuageVspCmsIdAnswer(answer.getLeft(), answer.getRight(), cmd.getSyncType()); +} else if (cmd.getSyncType() == SyncType.REGISTER) { +String registeredNuageVspCmsId = _nuageVspManagerClient.registerNuageVspCmsId(); +return new SyncNuageVspCmsIdAnswer(StringUtils.isNotBlank(registeredNuageVspCmsId), registeredNuageVspCmsId, cmd.getSyncType()); +} else { +boolean success = _nuageVspManagerClient.unregisterNuageVspCmsId(cmd.getNuageVspCmsId()); +return new SyncNuageVspCmsIdAnswer(success, cmd.getNuageVspCmsId(), cmd.getSyncType()); +} +} catch (Exception e) { +s_logger.error("Failure during " + cmd, e); +return new SyncNuageVspCmsIdAnswer(false, null, cmd.getSyncType()); +} +} + +private Answer executeRequest(SyncDomainCommand cmd) { +try { +isNuageVspManagerLoaded(); +boolean success = _nuageVspManagerClient.syncDomainWithNuageVsp(cmd.getDomainUuid(), cmd.getDomainName(), cmd.getDomainPath(), cmd.isToAdd(), cmd.isToRemove()); +return new SyncDomainAnswer(success); +} catch (Exception e) { +s_logger.error("Failure during " + cmd, e); --- End diff -- Done. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r41989853 --- Diff: plugins/network-elements/nuage-vsp/src/com/cloud/network/resource/NuageVspResource.java --- @@ -424,9 +449,10 @@ private Answer executeRequest(ApplyAclRuleVspCommand cmd) { private Answer executeRequest(ShutDownVpcVspCommand cmd) { try { isNuageVspElementLoaded(); -_nuageVspElementClient.shutDownVpc(cmd.getDomainUuid(), cmd.getVpcUuid()); +_nuageVspElementClient.shutdownVpc(cmd.getDomainUuid(), cmd.getVpcUuid(), cmd.getDomainTemplateName()); return new ShutDownVpcVspAnswer(cmd, true, "Shutdown VPC " + cmd.getVpcUuid()); } catch (Exception e) { +s_logger.error("Failure during " + cmd, e); --- End diff -- Done. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r41989892 --- Diff: plugins/network-elements/nuage-vsp/src/com/cloud/network/resource/NuageVspResource.java --- @@ -437,31 +463,79 @@ private Answer executeRequest(SyncVspCommand cmd) { _nuageVspSyncClient.syncWithNuageVsp(cmd.getNuageVspEntity()); return new SyncVspAnswer(cmd, true, "Synced " + cmd.getNuageVspEntity() + " in VSP"); } catch (Exception e) { +s_logger.error("Failure during " + cmd, e); return new SyncVspAnswer(cmd, e); } } +private Answer executeRequest(SyncNuageVspCmsIdCommand cmd) { +try { +isNuageVspManagerLoaded(); +if (cmd.getSyncType() == SyncType.AUDIT || cmd.getSyncType() == SyncType.AUDIT_ONLY) { +Pair answer = _nuageVspManagerClient.auditNuageVspCmsId(cmd.getNuageVspCmsId(), cmd.getSyncType() == SyncType.AUDIT_ONLY); +return new SyncNuageVspCmsIdAnswer(answer.getLeft(), answer.getRight(), cmd.getSyncType()); +} else if (cmd.getSyncType() == SyncType.REGISTER) { +String registeredNuageVspCmsId = _nuageVspManagerClient.registerNuageVspCmsId(); +return new SyncNuageVspCmsIdAnswer(StringUtils.isNotBlank(registeredNuageVspCmsId), registeredNuageVspCmsId, cmd.getSyncType()); +} else { +boolean success = _nuageVspManagerClient.unregisterNuageVspCmsId(cmd.getNuageVspCmsId()); +return new SyncNuageVspCmsIdAnswer(success, cmd.getNuageVspCmsId(), cmd.getSyncType()); +} +} catch (Exception e) { +s_logger.error("Failure during " + cmd, e); +return new SyncNuageVspCmsIdAnswer(false, null, cmd.getSyncType()); +} +} + +private Answer executeRequest(SyncDomainCommand cmd) { +try { +isNuageVspManagerLoaded(); +boolean success = _nuageVspManagerClient.syncDomainWithNuageVsp(cmd.getDomainUuid(), cmd.getDomainName(), cmd.getDomainPath(), cmd.isToAdd(), cmd.isToRemove()); +return new SyncDomainAnswer(success); +} catch (Exception e) { +s_logger.error("Failure during " + cmd, e); +return new SyncDomainAnswer(false); +} +} + +private Answer executeRequest(GetClientDefaultsCommand cmd) { +try { +isNuageVspManagerLoaded(); +Map clientDefaults = _nuageVspManagerClient.getClientDefaults(); +return new GetClientDefaultsAnswer(cmd, clientDefaults); +} catch (Exception e) { +s_logger.error("Failure during " + cmd, e); --- End diff -- Done. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r41989878 --- Diff: plugins/network-elements/nuage-vsp/src/com/cloud/network/resource/NuageVspResource.java --- @@ -437,31 +463,79 @@ private Answer executeRequest(SyncVspCommand cmd) { _nuageVspSyncClient.syncWithNuageVsp(cmd.getNuageVspEntity()); return new SyncVspAnswer(cmd, true, "Synced " + cmd.getNuageVspEntity() + " in VSP"); } catch (Exception e) { +s_logger.error("Failure during " + cmd, e); return new SyncVspAnswer(cmd, e); } } +private Answer executeRequest(SyncNuageVspCmsIdCommand cmd) { +try { +isNuageVspManagerLoaded(); +if (cmd.getSyncType() == SyncType.AUDIT || cmd.getSyncType() == SyncType.AUDIT_ONLY) { +Pair answer = _nuageVspManagerClient.auditNuageVspCmsId(cmd.getNuageVspCmsId(), cmd.getSyncType() == SyncType.AUDIT_ONLY); +return new SyncNuageVspCmsIdAnswer(answer.getLeft(), answer.getRight(), cmd.getSyncType()); +} else if (cmd.getSyncType() == SyncType.REGISTER) { +String registeredNuageVspCmsId = _nuageVspManagerClient.registerNuageVspCmsId(); +return new SyncNuageVspCmsIdAnswer(StringUtils.isNotBlank(registeredNuageVspCmsId), registeredNuageVspCmsId, cmd.getSyncType()); +} else { +boolean success = _nuageVspManagerClient.unregisterNuageVspCmsId(cmd.getNuageVspCmsId()); +return new SyncNuageVspCmsIdAnswer(success, cmd.getNuageVspCmsId(), cmd.getSyncType()); +} +} catch (Exception e) { +s_logger.error("Failure during " + cmd, e); --- End diff -- Done. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r41989984 --- Diff: plugins/network-elements/nuage-vsp/src/net/nuage/vsp/acs/NuageVspPluginClientLoader.java --- @@ -19,28 +19,86 @@ package net.nuage.vsp.acs; +import net.nuage.vsp.acs.client.NuageVspApiClient; +import net.nuage.vsp.acs.client.NuageVspElementClient; +import net.nuage.vsp.acs.client.NuageVspGuruClient; +import net.nuage.vsp.acs.client.NuageVspManagerClient; +import net.nuage.vsp.acs.client.NuageVspSyncClient; + import java.net.MalformedURLException; import java.net.URL; import java.net.URLClassLoader; public class NuageVspPluginClientLoader { -private static NuageVspPluginClientLoader nuageVspPluginClientClassloader; -private ClassLoader loader = null; +private ClassLoader _loader = null; + +private NuageVspApiClient _nuageVspApiClient; +private NuageVspElementClient _nuageVspElementClient; +private NuageVspGuruClient _nuageVspGuruClient; +private NuageVspManagerClient _nuageVspManagerClient; +private NuageVspSyncClient _nuageVspSyncClient; + +public static final String NUAGE_PLUGIN_CLIENT_JAR_FILE = "/usr/share/nuagevsp/lib/nuage-vsp-acs-client.jar"; +private static final String NUAGE_VSP_API_CLIENT_IMPL = "net.nuage.vsp.acs.client.impl.NuageVspApiClientImpl"; +private static final String NUAGE_VSP_SYNC_CLIENT_IMPL = "net.nuage.vsp.acs.client.impl.NuageVspSyncClientImpl"; +private static final String NUAGE_VSP_ELEMENT_CLIENT_IMPL = "net.nuage.vsp.acs.client.impl.NuageVspElementClientImpl"; +private static final String NUAGE_VSP_GURU_CLIENT_IMPL = "net.nuage.vsp.acs.client.impl.NuageVspGuruClientImpl"; +private static final String NUAGE_VSP_MANAGER_CLIENT_IMPL = "net.nuage.vsp.acs.client.impl.NuageVspManagerClientImpl"; private NuageVspPluginClientLoader(String nuagePluginClientJarLocation) { try { -loader = URLClassLoader.newInstance(new URL[] {new URL("jar:file:" + nuagePluginClientJarLocation + "!/")}, +_loader = URLClassLoader.newInstance(new URL[] {new URL("jar:file:" + nuagePluginClientJarLocation + "!/")}, getClass().getClassLoader()); } catch (MalformedURLException e) { -e.printStackTrace(); +throw new IllegalArgumentException(e); } } -public static ClassLoader getClassLoader(String nuagePluginClientJarLocation) { -if (nuageVspPluginClientClassloader == null) { -nuageVspPluginClientClassloader = new NuageVspPluginClientLoader(nuagePluginClientJarLocation); -} -return nuageVspPluginClientClassloader.loader; +public static NuageVspPluginClientLoader getClientLoader(String relativePath, String[] cmsUserInfo, int numRetries, int retryInterval, +String nuageVspCmsId) throws Exception { --- End diff -- Removed the throws Exception. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r41990041 --- Diff: plugins/network-elements/nuage-vsp/src/net/nuage/vsp/acs/NuageVspPluginClientLoader.java --- @@ -19,28 +19,86 @@ package net.nuage.vsp.acs; +import net.nuage.vsp.acs.client.NuageVspApiClient; +import net.nuage.vsp.acs.client.NuageVspElementClient; +import net.nuage.vsp.acs.client.NuageVspGuruClient; +import net.nuage.vsp.acs.client.NuageVspManagerClient; +import net.nuage.vsp.acs.client.NuageVspSyncClient; + import java.net.MalformedURLException; import java.net.URL; import java.net.URLClassLoader; public class NuageVspPluginClientLoader { -private static NuageVspPluginClientLoader nuageVspPluginClientClassloader; -private ClassLoader loader = null; +private ClassLoader _loader = null; + +private NuageVspApiClient _nuageVspApiClient; +private NuageVspElementClient _nuageVspElementClient; +private NuageVspGuruClient _nuageVspGuruClient; +private NuageVspManagerClient _nuageVspManagerClient; +private NuageVspSyncClient _nuageVspSyncClient; + +public static final String NUAGE_PLUGIN_CLIENT_JAR_FILE = "/usr/share/nuagevsp/lib/nuage-vsp-acs-client.jar"; +private static final String NUAGE_VSP_API_CLIENT_IMPL = "net.nuage.vsp.acs.client.impl.NuageVspApiClientImpl"; +private static final String NUAGE_VSP_SYNC_CLIENT_IMPL = "net.nuage.vsp.acs.client.impl.NuageVspSyncClientImpl"; +private static final String NUAGE_VSP_ELEMENT_CLIENT_IMPL = "net.nuage.vsp.acs.client.impl.NuageVspElementClientImpl"; +private static final String NUAGE_VSP_GURU_CLIENT_IMPL = "net.nuage.vsp.acs.client.impl.NuageVspGuruClientImpl"; +private static final String NUAGE_VSP_MANAGER_CLIENT_IMPL = "net.nuage.vsp.acs.client.impl.NuageVspManagerClientImpl"; private NuageVspPluginClientLoader(String nuagePluginClientJarLocation) { try { -loader = URLClassLoader.newInstance(new URL[] {new URL("jar:file:" + nuagePluginClientJarLocation + "!/")}, +_loader = URLClassLoader.newInstance(new URL[] {new URL("jar:file:" + nuagePluginClientJarLocation + "!/")}, getClass().getClassLoader()); } catch (MalformedURLException e) { -e.printStackTrace(); +throw new IllegalArgumentException(e); } } -public static ClassLoader getClassLoader(String nuagePluginClientJarLocation) { -if (nuageVspPluginClientClassloader == null) { -nuageVspPluginClientClassloader = new NuageVspPluginClientLoader(nuagePluginClientJarLocation); -} -return nuageVspPluginClientClassloader.loader; +public static NuageVspPluginClientLoader getClientLoader(String relativePath, String[] cmsUserInfo, int numRetries, int retryInterval, +String nuageVspCmsId) throws Exception { +NuageVspPluginClientLoader nuageVspPluginClientClassloader = new NuageVspPluginClientLoader(NUAGE_PLUGIN_CLIENT_JAR_FILE); +nuageVspPluginClientClassloader.loadClasses(relativePath, cmsUserInfo, numRetries, retryInterval, nuageVspCmsId); +return nuageVspPluginClientClassloader; +} + +private void loadClasses(String relativePath, String[] cmsUserInfo, int numRetries, int retryInterval, String nuageVspCmsId) throws Exception { --- End diff -- Changed so we catch subset of checked exceptions in the method itself. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r41990154 --- Diff: plugins/network-elements/nuage-vsp/src/net/nuage/vsp/acs/client/NuageVspElementClient.java --- @@ -24,13 +24,18 @@ public interface NuageVspElementClient { -public void applyStaticNats(String networkDomainUuid, String vpcOrSubnetUuid, boolean isL3Network, List> staticNatDetails) throws Exception; +boolean implement(long networkId, String networkDomainUuid, String networkUuid, String networkName, String vpcOrSubnetUuid, boolean isL2Network, boolean isL3Network, + boolean isVpc, boolean isShared, String domainTemplateName, boolean isFirewallServiceSupported, List dnsServers, List> ingressFirewallRules, + List> egressFirewallRules, List acsFipUuid, boolean egressDefaultPolicy) throws Exception; -public void applyAclRules(String networkUuid, String networkDomainUuid, String vpcOrSubnetUuid, boolean isL3Network, List> aclRules, boolean isVpc, long networkId) -throws Exception; +void applyStaticNats(String networkDomainUuid, String networkUuid, String vpcOrSubnetUuid, boolean isL3Network, boolean isVpc, +List> staticNatDetails) throws Exception; -public void shutDownVpc(String domainUuid, String vpcUuid) throws Exception; +void applyAclRules(boolean isNetworkAcl, String networkUuid, String networkDomainUuid, String vpcOrSubnetUuid, String networkName, boolean isL2Network, + List> rules, long networkId, boolean egressDefaultPolicy, Boolean isAcsIngressAcl, boolean networkReset, String domainTemplateName) throws Exception; --- End diff -- This is how the methods are declared in our client. They need to have the same signature as defined in our client. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r41990152 --- Diff: plugins/network-elements/nuage-vsp/src/net/nuage/vsp/acs/client/NuageVspElementClient.java --- @@ -24,13 +24,18 @@ public interface NuageVspElementClient { -public void applyStaticNats(String networkDomainUuid, String vpcOrSubnetUuid, boolean isL3Network, List> staticNatDetails) throws Exception; +boolean implement(long networkId, String networkDomainUuid, String networkUuid, String networkName, String vpcOrSubnetUuid, boolean isL2Network, boolean isL3Network, + boolean isVpc, boolean isShared, String domainTemplateName, boolean isFirewallServiceSupported, List dnsServers, List> ingressFirewallRules, + List> egressFirewallRules, List acsFipUuid, boolean egressDefaultPolicy) throws Exception; -public void applyAclRules(String networkUuid, String networkDomainUuid, String vpcOrSubnetUuid, boolean isL3Network, List> aclRules, boolean isVpc, long networkId) -throws Exception; +void applyStaticNats(String networkDomainUuid, String networkUuid, String vpcOrSubnetUuid, boolean isL3Network, boolean isVpc, +List> staticNatDetails) throws Exception; --- End diff -- This is how the methods are declared in our client. They need to have the same signature as defined in our client. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r41990167 --- Diff: plugins/network-elements/nuage-vsp/src/net/nuage/vsp/acs/client/NuageVspGuruClient.java --- @@ -21,24 +21,22 @@ import java.util.Collection; import java.util.List; -import java.util.Map; public interface NuageVspGuruClient { -public void implement(String networkDomainName, String networkDomainPath, String networkDomainUuid, String networkAccountName, String networkAccountUuid, String networkName, -String networkCidr, String networkGateway, String networkUuid, boolean isL3Network, String vpcName, String vpcUuid, boolean defaultEgressPolicy, -Collection ipAddressRange) throws Exception; +void implement(String networkDomainName, String networkDomainPath, String networkDomainUuid, String networkAccountName, String networkAccountUuid, String networkName, + String networkCidr, String networkGateway, Long networkAclId, List dnsServers, List gatewaySystemIds, boolean isL3Network, boolean isVpc, boolean isSharedNetwork, + String networkUuid, String vpcName, String vpcUuid, boolean defaultEgressPolicy, Collection ipAddressRange, String domainTemplateName) throws Exception; -public List> reserve(String nicUuid, String nicMacAddress, String networkUuid, boolean isL3Network, String vpcUuid, String networkDomainUuid, -String networksAccountUuid, boolean isDomainRouter, String domainRouterIp, String vmInstanceName, String vmUuid) throws Exception; +void reserve(String nicUuid, String nicMacAddress, String networkUuid, boolean isL3Network, boolean isSharedNetwork, String vpcUuid, String networkDomainUuid, + String networksAccountUuid, boolean isDomainRouter, String domainRouterIp, String vmInstanceName, String vmUuid, boolean useStaticIp, String staticIp, String staticNatIpUuid, + String staticNatIpAddress, boolean isStaticNatIpAllocated, boolean isOneToOneNat, String staticNatVlanUuid, String staticNatVlanGateway, String staticNatVlanNetmask) throws Exception; --- End diff -- This is how the methods are declared in our client. They need to have the same signature as defined in our client. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r41990174 --- Diff: plugins/network-elements/nuage-vsp/src/net/nuage/vsp/acs/client/NuageVspGuruClient.java --- @@ -21,24 +21,22 @@ import java.util.Collection; import java.util.List; -import java.util.Map; public interface NuageVspGuruClient { -public void implement(String networkDomainName, String networkDomainPath, String networkDomainUuid, String networkAccountName, String networkAccountUuid, String networkName, -String networkCidr, String networkGateway, String networkUuid, boolean isL3Network, String vpcName, String vpcUuid, boolean defaultEgressPolicy, -Collection ipAddressRange) throws Exception; +void implement(String networkDomainName, String networkDomainPath, String networkDomainUuid, String networkAccountName, String networkAccountUuid, String networkName, + String networkCidr, String networkGateway, Long networkAclId, List dnsServers, List gatewaySystemIds, boolean isL3Network, boolean isVpc, boolean isSharedNetwork, + String networkUuid, String vpcName, String vpcUuid, boolean defaultEgressPolicy, Collection ipAddressRange, String domainTemplateName) throws Exception; -public List> reserve(String nicUuid, String nicMacAddress, String networkUuid, boolean isL3Network, String vpcUuid, String networkDomainUuid, -String networksAccountUuid, boolean isDomainRouter, String domainRouterIp, String vmInstanceName, String vmUuid) throws Exception; +void reserve(String nicUuid, String nicMacAddress, String networkUuid, boolean isL3Network, boolean isSharedNetwork, String vpcUuid, String networkDomainUuid, + String networksAccountUuid, boolean isDomainRouter, String domainRouterIp, String vmInstanceName, String vmUuid, boolean useStaticIp, String staticIp, String staticNatIpUuid, + String staticNatIpAddress, boolean isStaticNatIpAllocated, boolean isOneToOneNat, String staticNatVlanUuid, String staticNatVlanGateway, String staticNatVlanNetmask) throws Exception; -public void release(String networkUuid, String vmUuid, String vmInstanceName) throws Exception; +void deallocate(String networkUuid, String nicFrmDdUuid, String nicMacAddress, String nicIp4Address, boolean isL3Network, boolean isSharedNetwork, + String vpcUuid, String networksDomainUuid, String vmInstanceName, String vmUuid, boolean isExpungingState) throws Exception; -public void deallocate(String networkUuid, String nicFrmDdUuid, String nicMacAddress, String nicIp4Address, boolean isL3Network, String vpcUuid, String networksDomainUuid, -String vmInstanceName, String vmUuid) throws Exception; +void trash(String domainUuid, String networkUuid, boolean isL3Network, boolean isSharedNetwork, String vpcUuid, String domainTemplateName) throws Exception; --- End diff -- This is how the methods are declared in our client. They need to have the same signature as defined in our client. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r41990144 --- Diff: plugins/network-elements/nuage-vsp/src/net/nuage/vsp/acs/client/NuageVspApiClient.java --- @@ -21,10 +21,10 @@ public interface NuageVspApiClient { -public void login() throws Exception; +void login() throws Exception; -public void setNuageVspHost(String restRelativePath, String[] cmsUserInfo, int noofRetry, int retryInterval); +void setNuageVspHost(String restRelativePath, String[] cmsUserInfo, int noofRetry, int retryInterval, String nuageVspCmsId); -public String executeRestApi(String method, String resource, String resourceId, String childResource, Object entityDetails, String resourceFilter, String proxyUserUuid, -String proxyUserDomainuuid) throws Exception; +String executeRestApi(String method, String resource, String resourceId, String childResource, Object entityDetails, String resourceFilter, String proxyUserUuid, + String proxyUserDomainuuid) throws Exception; --- End diff -- This is how the methods are declared in our client. They need to have the same signature as defined in our client. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r41990195 --- Diff: plugins/network-elements/nuage-vsp/src/net/nuage/vsp/acs/client/NuageVspManagerClient.java --- @@ -0,0 +1,41 @@ +// +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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 net.nuage.vsp.acs.client; + +import org.apache.commons.lang3.tuple.Pair; + +import java.util.Map; + +public interface NuageVspManagerClient { + +Pair auditNuageVspCmsId(String nuageVspCmsId, boolean auditOnly) throws Exception; + +String registerNuageVspCmsId() throws Exception; + +boolean unregisterNuageVspCmsId(String nuageVspCmsId) throws Exception; --- End diff -- This is how the methods are declared in our client. They need to have the same signature as defined in our client. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r41990182 --- Diff: plugins/network-elements/nuage-vsp/src/net/nuage/vsp/acs/client/NuageVspManagerClient.java --- @@ -0,0 +1,41 @@ +// +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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 net.nuage.vsp.acs.client; + +import org.apache.commons.lang3.tuple.Pair; + +import java.util.Map; + +public interface NuageVspManagerClient { + +Pair auditNuageVspCmsId(String nuageVspCmsId, boolean auditOnly) throws Exception; --- End diff -- This is how the methods are declared in our client. They need to have the same signature as defined in our client. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r41990201 --- Diff: plugins/network-elements/nuage-vsp/src/net/nuage/vsp/acs/client/NuageVspManagerClient.java --- @@ -0,0 +1,41 @@ +// +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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 net.nuage.vsp.acs.client; + +import org.apache.commons.lang3.tuple.Pair; + +import java.util.Map; + +public interface NuageVspManagerClient { + +Pair auditNuageVspCmsId(String nuageVspCmsId, boolean auditOnly) throws Exception; + +String registerNuageVspCmsId() throws Exception; + +boolean unregisterNuageVspCmsId(String nuageVspCmsId) throws Exception; + +boolean isSupportedApiVersion(String version); + +Map getClientDefaults() throws Exception; --- End diff -- This is how the methods are declared in our client. They need to have the same signature as defined in our client. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r41990215 --- Diff: plugins/network-elements/nuage-vsp/src/net/nuage/vsp/acs/client/NuageVspSyncClient.java --- @@ -21,7 +21,7 @@ public interface NuageVspSyncClient { -public void syncWithNuageVsp(String nuageVspEntity) throws Exception; +void syncWithNuageVsp(String nuageVspEntity) throws Exception; --- End diff -- This is how the methods are declared in our client. They need to have the same signature as defined in our client. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r41990209 --- Diff: plugins/network-elements/nuage-vsp/src/net/nuage/vsp/acs/client/NuageVspManagerClient.java --- @@ -0,0 +1,41 @@ +// +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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 net.nuage.vsp.acs.client; + +import org.apache.commons.lang3.tuple.Pair; + +import java.util.Map; + +public interface NuageVspManagerClient { + +Pair auditNuageVspCmsId(String nuageVspCmsId, boolean auditOnly) throws Exception; + +String registerNuageVspCmsId() throws Exception; + +boolean unregisterNuageVspCmsId(String nuageVspCmsId) throws Exception; + +boolean isSupportedApiVersion(String version); + +Map getClientDefaults() throws Exception; + +boolean syncDomainWithNuageVsp(String domainUuid, String domainName, String domainPath, boolean add, boolean remove) throws Exception; --- End diff -- This is how the methods are declared in our client. They need to have the same signature as defined in our client. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r41990136 --- Diff: plugins/network-elements/nuage-vsp/src/net/nuage/vsp/acs/client/NuageVspApiClient.java --- @@ -21,10 +21,10 @@ public interface NuageVspApiClient { -public void login() throws Exception; +void login() throws Exception; --- End diff -- This is how the methods are declared in our client. They need to have the same signature as defined in our client. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r41990190 --- Diff: plugins/network-elements/nuage-vsp/src/net/nuage/vsp/acs/client/NuageVspManagerClient.java --- @@ -0,0 +1,41 @@ +// +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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 net.nuage.vsp.acs.client; + +import org.apache.commons.lang3.tuple.Pair; + +import java.util.Map; + +public interface NuageVspManagerClient { + +Pair auditNuageVspCmsId(String nuageVspCmsId, boolean auditOnly) throws Exception; + +String registerNuageVspCmsId() throws Exception; --- End diff -- This is how the methods are declared in our client. They need to have the same signature as defined in our client. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r41990147 --- Diff: plugins/network-elements/nuage-vsp/src/net/nuage/vsp/acs/client/NuageVspElementClient.java --- @@ -24,13 +24,18 @@ public interface NuageVspElementClient { -public void applyStaticNats(String networkDomainUuid, String vpcOrSubnetUuid, boolean isL3Network, List> staticNatDetails) throws Exception; +boolean implement(long networkId, String networkDomainUuid, String networkUuid, String networkName, String vpcOrSubnetUuid, boolean isL2Network, boolean isL3Network, + boolean isVpc, boolean isShared, String domainTemplateName, boolean isFirewallServiceSupported, List dnsServers, List> ingressFirewallRules, + List> egressFirewallRules, List acsFipUuid, boolean egressDefaultPolicy) throws Exception; --- End diff -- This is how the methods are declared in our client. They need to have the same signature as defined in our client. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r41990169 --- Diff: plugins/network-elements/nuage-vsp/src/net/nuage/vsp/acs/client/NuageVspGuruClient.java --- @@ -21,24 +21,22 @@ import java.util.Collection; import java.util.List; -import java.util.Map; public interface NuageVspGuruClient { -public void implement(String networkDomainName, String networkDomainPath, String networkDomainUuid, String networkAccountName, String networkAccountUuid, String networkName, -String networkCidr, String networkGateway, String networkUuid, boolean isL3Network, String vpcName, String vpcUuid, boolean defaultEgressPolicy, -Collection ipAddressRange) throws Exception; +void implement(String networkDomainName, String networkDomainPath, String networkDomainUuid, String networkAccountName, String networkAccountUuid, String networkName, + String networkCidr, String networkGateway, Long networkAclId, List dnsServers, List gatewaySystemIds, boolean isL3Network, boolean isVpc, boolean isSharedNetwork, + String networkUuid, String vpcName, String vpcUuid, boolean defaultEgressPolicy, Collection ipAddressRange, String domainTemplateName) throws Exception; -public List> reserve(String nicUuid, String nicMacAddress, String networkUuid, boolean isL3Network, String vpcUuid, String networkDomainUuid, -String networksAccountUuid, boolean isDomainRouter, String domainRouterIp, String vmInstanceName, String vmUuid) throws Exception; +void reserve(String nicUuid, String nicMacAddress, String networkUuid, boolean isL3Network, boolean isSharedNetwork, String vpcUuid, String networkDomainUuid, + String networksAccountUuid, boolean isDomainRouter, String domainRouterIp, String vmInstanceName, String vmUuid, boolean useStaticIp, String staticIp, String staticNatIpUuid, + String staticNatIpAddress, boolean isStaticNatIpAllocated, boolean isOneToOneNat, String staticNatVlanUuid, String staticNatVlanGateway, String staticNatVlanNetmask) throws Exception; -public void release(String networkUuid, String vmUuid, String vmInstanceName) throws Exception; +void deallocate(String networkUuid, String nicFrmDdUuid, String nicMacAddress, String nicIp4Address, boolean isL3Network, boolean isSharedNetwork, + String vpcUuid, String networksDomainUuid, String vmInstanceName, String vmUuid, boolean isExpungingState) throws Exception; --- End diff -- This is how the methods are declared in our client. They need to have the same signature as defined in our client. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r41990160 --- Diff: plugins/network-elements/nuage-vsp/src/net/nuage/vsp/acs/client/NuageVspGuruClient.java --- @@ -21,24 +21,22 @@ import java.util.Collection; import java.util.List; -import java.util.Map; public interface NuageVspGuruClient { -public void implement(String networkDomainName, String networkDomainPath, String networkDomainUuid, String networkAccountName, String networkAccountUuid, String networkName, -String networkCidr, String networkGateway, String networkUuid, boolean isL3Network, String vpcName, String vpcUuid, boolean defaultEgressPolicy, -Collection ipAddressRange) throws Exception; +void implement(String networkDomainName, String networkDomainPath, String networkDomainUuid, String networkAccountName, String networkAccountUuid, String networkName, + String networkCidr, String networkGateway, Long networkAclId, List dnsServers, List gatewaySystemIds, boolean isL3Network, boolean isVpc, boolean isSharedNetwork, + String networkUuid, String vpcName, String vpcUuid, boolean defaultEgressPolicy, Collection ipAddressRange, String domainTemplateName) throws Exception; --- End diff -- This is how the methods are declared in our client. They need to have the same signature as defined in our client. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on the pull request: https://github.com/apache/cloudstack/pull/801#issuecomment-148632356 @jburwell, we've adapted the client so it's not throwing the broad Exception anymore. We're not catching any longer on the broad Exception, but rather on the subset of exceptions. We've added the equals tests as requested. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on the pull request: https://github.com/apache/cloudstack/pull/801#issuecomment-151120955 @remibergsma, I've rebased against current master. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r43090521 --- Diff: plugins/network-elements/nuage-vsp/src/com/cloud/network/element/NuageVspElement.java --- @@ -129,6 +145,18 @@ AgentManager _agentMgr; @Inject NetworkOfferingDao _ntwkOfferingDao; +@Inject +ConfigurationDao _configDao; +@Inject +NuageVspManager _nuageVspManager; +@Inject +FirewallRulesDao _firewallRulesDao; +@Inject +FirewallRulesCidrsDao _firewallRulesCidrsDao; +@Inject +PhysicalNetworkDao _physicalNetworkDao; +@Inject +NetworkACLItemDao _networkACLItemDao; @Override public boolean applyIps(Network network, List ipAddress, Set service) throws ResourceUnavailableException { --- End diff -- I moved some code here and there, it's shortened now by decomposing into smaller private methods. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r43090554 --- Diff: plugins/network-elements/nuage-vsp/src/com/cloud/network/element/NuageVspElement.java --- @@ -205,6 +250,75 @@ public boolean implement(Network network, NetworkOffering offering, DeployDestin return false; } +final boolean egressDefaultPolicy = offering.getEgressDefaultPolicy(); +Domain networkDomain = _domainDao.findById(network.getDomainId()); +boolean isFirewallServiceSupported = _networkModel.areServicesSupportedByNetworkOffering(offering.getId(), Service.Firewall); +List dnsServers = _nuageVspManager.getDnsDetails(network); + +boolean isL2Network = false, isL3Network = false, isShared = false; +String subnetUuid = network.getUuid(); +if (offering.getGuestType() == Network.GuestType.Shared) { +isShared = true; +subnetUuid = networkDomain.getUuid(); +} else if (_ntwkOfferingSrvcDao.areServicesSupportedByNetworkOffering(offering.getId(), Service.SourceNat) +|| _ntwkOfferingSrvcDao.areServicesSupportedByNetworkOffering(offering.getId(), Service.StaticNat) +|| _ntwkOfferingSrvcDao.areServicesSupportedByNetworkOffering(offering.getId(), Service.Connectivity)) { +isL3Network = true; +} else { +isL2Network = true; +} + +String preConfiguredDomainTemplateName = getPreConfiguredDomainTemplateName(network, offering); +List firewallIngressRulesToApply = + _firewallRulesDao.listByNetworkPurposeTrafficType(network.getId(), FirewallRule.Purpose.Firewall, FirewallRule.TrafficType.Ingress); +for (FirewallRuleVO rule : firewallIngressRulesToApply) { +// load cidrs if any + rule.setSourceCidrList(_firewallRulesCidrsDao.getSourceCidrs(rule.getId())); +} + +List firewallEgressRulesToApply = + _firewallRulesDao.listByNetworkPurposeTrafficType(network.getId(), FirewallRule.Purpose.Firewall, FirewallRule.TrafficType.Egress); +for (FirewallRuleVO rule : firewallEgressRulesToApply) { +// load cidrs if any + rule.setSourceCidrList(_firewallRulesCidrsDao.getSourceCidrs(rule.getId())); +} + +List> ingressFirewallRules = Lists.transform(firewallIngressRulesToApply, new Function>() { +@Override +public Map apply(FirewallRuleVO firewallRuleVO) { +return getACLRuleDetails(firewallRuleVO, egressDefaultPolicy); +} +}); + +List> egressFirewallRules = Lists.transform(firewallEgressRulesToApply, new Function>() { --- End diff -- Refactored so the transformation is done in a method used for retrieving both lists. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r43090895 --- Diff: plugins/network-elements/nuage-vsp/src/com/cloud/network/guru/NuageVspGuestNetworkGuru.java --- @@ -201,51 +234,82 @@ public NicProfile allocate(Network network, NicProfile nic, VirtualMachineProfil @Override public void reserve(NicProfile nic, Network network, VirtualMachineProfile vm, DeployDestination dest, ReservationContext context) throws InsufficientVirtualNetworkCapacityException, InsufficientAddressCapacityException { -nic.setBroadcastUri(network.getBroadcastUri()); -nic.setIsolationUri(network.getBroadcastUri()); - -s_logger.debug("Handling reserve() call back to with Create a new VM or add an interface to existing VM in network " + network.getName()); -DataCenter dc = _dcDao.findById(network.getDataCenterId()); -Account networksAccount = _accountDao.findById(network.getAccountId()); -DomainVO networksDomain = _domainDao.findById(network.getDomainId()); -//Get the Account details and find the type -long networkOwnedBy = network.getAccountId(); -AccountVO neworkAccountDetails = _accountDao.findById(networkOwnedBy); -if (neworkAccountDetails.getType() == Account.ACCOUNT_TYPE_PROJECT) { -throw new InsufficientVirtualNetworkCapacityException("CS project support is " + "not yet implemented in NuageVsp", DataCenter.class, dc.getId()); +boolean lockedNetwork = lockNetworkForUserVm(network, vm); +if (lockedNetwork) { +s_logger.debug("Locked network " + network.getId() + " for creation of user VM " + vm.getInstanceName()); } -//NicProfile does not contain the NIC UUID. We need this information to set it in the VMInterface and VPort -//that we create in VSP -NicVO nicFrmDB = _nicDao.findById(nic.getId()); -long networkOfferingId = _ntwkOfferingDao.findById(network.getNetworkOfferingId()).getId(); -boolean isL3Network = isL3Network(networkOfferingId); -Long vpcId = network.getVpcId(); -String vpcUuid = null; -if (vpcId != null) { -Vpc vpcObj = _vpcDao.findById(vpcId); -vpcUuid = vpcObj.getUuid(); -} -HostVO nuageVspHost = getNuageVspHost(network.getPhysicalNetworkId()); -ReserveVmInterfaceVspCommand cmd = new ReserveVmInterfaceVspCommand(nicFrmDB.getUuid(), nic.getMacAddress(), network.getUuid(), isL3Network, vpcUuid, -networksDomain.getUuid(), networksAccount.getUuid(), vm.getType().equals(VirtualMachine.Type.DomainRouter), network.getBroadcastUri().getPath().substring(1), -vm.getInstanceName(), vm.getUuid(), networksDomain.getUuid(), networksAccount.getUuid()); -ReserveVmInterfaceVspAnswer answer = (ReserveVmInterfaceVspAnswer)_agentMgr.easySend(nuageVspHost.getId(), cmd); - -if (answer == null || !answer.getResult()) { -s_logger.error("ReserveVmInterfaceNuageVspCommand failed"); -if ((null != answer) && (null != answer.getDetails())) { -s_logger.error(answer.getDetails()); +try { +nic.setBroadcastUri(network.getBroadcastUri()); +nic.setIsolationUri(network.getBroadcastUri()); + +s_logger.debug("Handling reserve() call back to with Create a new VM or add an interface to existing VM in network " + network.getName()); +DataCenter dc = _dcDao.findById(network.getDataCenterId()); +Account networksAccount = _accountDao.findById(network.getAccountId()); +DomainVO networksDomain = _domainDao.findById(network.getDomainId()); +//Get the Account details and find the type +long networkOwnedBy = network.getAccountId(); +AccountVO neworkAccountDetails = _accountDao.findById(networkOwnedBy); +if (neworkAccountDetails.getType() == Account.ACCOUNT_TYPE_PROJECT) { +throw new InsufficientVirtualNetworkCapacityException("CS project support is " + "not yet implemented in NuageVsp", DataCenter.class, dc.getId()); +} + +//NicProfile does not contain the NIC UUID. We need this information to set it in the VMInterface and VPort +//that we create in VSP +NicVO nicFrmDB = _nicDao.findById(nic.getId()); +NetworkOffering networkOffering = _ntwkOfferingDao.findById(network.getNetworkOfferingId()); +boolean isDomainRouter = vm.getType().equals(VirtualMachi
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r43091029 --- Diff: plugins/network-elements/nuage-vsp/src/com/cloud/network/guru/NuageVspGuestNetworkGuru.java --- @@ -358,19 +441,22 @@ private String getVirtualRouterIP(Network network, Collection addressRan Set allIPsInCidr = NetUtils.getAllIpsFromCidr(subnet, cidrSize, new HashSet()); if (allIPsInCidr.size() > 3) { +//get the second IP and see if it the networks GatewayIP Iterator ipIterator = allIPsInCidr.iterator(); long vip = ipIterator.next(); --- End diff -- Added your piece of code as extra validation for the returned Set. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r43091160 --- Diff: plugins/network-elements/nuage-vsp/src/com/cloud/network/manager/NuageVspManagerImpl.java --- @@ -285,60 +507,341 @@ public boolean deleteNuageVspDevice(DeleteNuageVspDeviceCmd cmd) { return responseList; } -@Override -public boolean configure(String name, Map params) throws ConfigurationException { -try { -initNuageScheduledTasks(); -} catch (Exception ce) { -s_logger.warn("Failed to load NuageVsp configuration properties. Check if the NuageVsp properties are configured correctly"); +private void registerNewNuageVspDevice(ConfigurationVO currentConfig, String registeredNuageVspDevice) { +if (currentConfig == null) { +ConfigKey configKey = new ConfigKey("Advanced", String.class, "nuagevsp.cms.id", registeredNuageVspDevice, +": - Do not edit", false); +ConfigurationVO configuration = new ConfigurationVO("management-server", configKey); +_configDao.persist(configuration); +} else { +String newValue; +String currentValue = currentConfig.getValue(); +if (StringUtils.isNotBlank(currentValue)) { +newValue = currentValue + ";" + registeredNuageVspDevice; +} else { +newValue = registeredNuageVspDevice; +} +_configDao.update("nuagevsp.cms.id", newValue); } -return true; } -private void initNuageScheduledTasks() { -Integer numOfSyncThreads = Integer.valueOf(_configDao.getValue(NuageVspManager.NuageVspSyncWorkers.key())); -Integer syncUpIntervalInMinutes = Integer.valueOf(_configDao.getValue(NuageVspManager.NuageVspSyncInterval.key())); - -if (numOfSyncThreads != null && syncUpIntervalInMinutes != null) { -ThreadFactory threadFactory = new ThreadFactory() { -public Thread newThread(Runnable runnable) { -Thread thread = new Thread(runnable, "Nuage Vsp sync task"); -if (thread.isDaemon()) -thread.setDaemon(false); -if (thread.getPriority() != Thread.NORM_PRIORITY) -thread.setPriority(Thread.NORM_PRIORITY); -return thread; +private void auditHost(HostVO host) { +_hostDao.loadDetails(host); + +boolean validateDomains = true; +List nuageVspDevices = _nuageVspDao.listByHost(host.getId()); +if (!CollectionUtils.isEmpty(nuageVspDevices)) { +for (NuageVspDeviceVO nuageVspDevice : nuageVspDevices) { +ConfigurationVO cmsIdConfig = _configDao.findByName("nuagevsp.cms.id"); +String nuageVspCmsId = findNuageVspCmsIdForDevice(nuageVspDevice.getId(), cmsIdConfig); +SyncNuageVspCmsIdCommand syncCmd = new SyncNuageVspCmsIdCommand(SyncType.AUDIT, nuageVspCmsId); +SyncNuageVspCmsIdAnswer answer = (SyncNuageVspCmsIdAnswer) _agentMgr.easySend(nuageVspDevice.getHostId(), syncCmd); + +if (answer != null && !answer.getSuccess()) { +s_logger.fatal("Nuage VSP Device with ID " + nuageVspDevice.getId() + " is configured with an unknown CMS ID!"); +validateDomains = false; +} else if (answer != null && answer.getSyncType() == SyncType.REGISTER) { +registerNewNuageVspDevice(cmsIdConfig, nuageVspDevice.getId() + ":" + answer.getNuageVspCmsId()); } -}; -scheduler = Executors.newScheduledThreadPool(numOfSyncThreads, threadFactory); -scheduler.scheduleWithFixedDelay(new NuageVspSyncTask("FLOATING_IP"), ONE_MINUTE_MULTIPLIER * 15, ONE_MINUTE_MULTIPLIER * syncUpIntervalInMinutes, -TimeUnit.MILLISECONDS); -scheduler.scheduleWithFixedDelay(new NuageVspSyncTask("ENTERPRISE_NTWK_MACRO"), ONE_MINUTE_MULTIPLIER * 15, ONE_MINUTE_MULTIPLIER * syncUpIntervalInMinutes, -TimeUnit.MILLISECONDS); -scheduler -.scheduleWithFixedDelay(new NuageVspSyncTask("ENTERPRISE"), ONE_MINUTE_MULTIPLIER * 15, ONE_MINUTE_MULTIPLIER * syncUpIntervalInMinutes, TimeUnit.MILLISECONDS); -} else { -s_logger.warn("NuageVsp configuration for syncWorkers="
[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Github user nlivens commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r43091274 --- Diff: plugins/network-elements/nuage-vsp/pom.xml --- @@ -28,6 +28,13 @@ 4.6.0-SNAPSHOT ../../pom.xml + + + org.apache.commons + commons-lang3 + ${cs.lang3.version} + + --- End diff -- Because our client has no dependencies to CloudStack, we had to find a common library between the 2 which has a Pair class. Which is commons-lang3 --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---