# Path: bgpvpn_dashboard/api/bgpvpn.py
# LOG = logging.getLogger(__name__)
# class Bgpvpn(neutron.NeutronAPIDictWrapper):
# class NetworkAssociation(neutron.NeutronAPIDictWrapper):
# class RouterAssociation(neutron.NeutronAPIDictWrapper):
# def bgpvpns_list(request, **kwargs):
# def bgpvpn_get(request, bgpvpn_id, **kwargs):
# def bgpvpn_create(request, **kwargs):
# def bgpvpn_update(request, bgpvpn_id, **kwargs):
# def bgpvpn_delete(request, bgpvpn_id):
# def network_association_get(request, bgpvpn_id, network_assoc_id, **kwargs):
# def network_association_list(request, bgpvpn_id, **kwargs):
# def network_association_create(request, bgpvpn_id, **kwargs):
# def network_association_delete(request, resource_id, bgpvpn_id):
# def router_association_get(request, bgpvpn_id, router_assoc_id, **kwargs):
# def router_association_list(request, bgpvpn_id, **kwargs):
# def router_association_create(request, bgpvpn_id, **kwargs):
# def router_association_update(request, bgpvpn_id, router_association_id,
#                               **kwargs):
# def router_association_delete(request, resource_id, bgpvpn_id):
# 
# Path: bgpvpn_dashboard/dashboards/project/bgpvpn/network_associations/tabs.py
# class OverviewTab(tabs.Tab):
# class NetworkAssociationsTab(tabs.TableTab):
# class NetworkAssociationDetailTabs(tabs.TabGroup):
#     def get_context_data(self, request):
#     def get_network(self, network_id):
#     def get_network_detail_url(network_id):
#     def get_network_associations_data(self):


from django.urls import reverse
from django.utils.translation import ugettext_lazy as _
from horizon import exceptions
from horizon import tabs
from bgpvpn_dashboard.api import bgpvpn as bgpvpn_api
from bgpvpn_dashboard.dashboards.project.bgpvpn.network_associations \
    import tabs as project_tabs
#    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.





class DetailView(tabs.TabView):
    tab_group_class = project_tabs.NetworkAssociationDetailTabs
    template_name = 'horizon/common/_detail.html'
    page_title = "{{ network_association.id }}"

    def get_data(self):
        network_association_id = self.kwargs['network_association_id']
        bgpvpn_id = self.kwargs['bgpvpn_id']
        try:
            network_association = bgpvpn_api.network_association_get(
                self.request, bgpvpn_id, network_association_id)
            return network_association
        except Exception:
            network_association = []
            msg = _('Unable to retrieve network association details.')
            exceptions.handle(self.request, msg,

# Path: bgpvpn_dashboard/api/bgpvpn.py
# LOG = logging.getLogger(__name__)
# class Bgpvpn(neutron.NeutronAPIDictWrapper):
# class NetworkAssociation(neutron.NeutronAPIDictWrapper):
# class RouterAssociation(neutron.NeutronAPIDictWrapper):
# def bgpvpns_list(request, **kwargs):
# def bgpvpn_get(request, bgpvpn_id, **kwargs):
# def bgpvpn_create(request, **kwargs):
# def bgpvpn_update(request, bgpvpn_id, **kwargs):
# def bgpvpn_delete(request, bgpvpn_id):
# def network_association_get(request, bgpvpn_id, network_assoc_id, **kwargs):
# def network_association_list(request, bgpvpn_id, **kwargs):
# def network_association_create(request, bgpvpn_id, **kwargs):
# def network_association_delete(request, resource_id, bgpvpn_id):
# def router_association_get(request, bgpvpn_id, router_assoc_id, **kwargs):
# def router_association_list(request, bgpvpn_id, **kwargs):
# def router_association_create(request, bgpvpn_id, **kwargs):
# def router_association_update(request, bgpvpn_id, router_association_id,
#                               **kwargs):
# def router_association_delete(request, resource_id, bgpvpn_id):
# 
# Path: bgpvpn_dashboard/dashboards/project/bgpvpn/network_associations/tabs.py
# class OverviewTab(tabs.Tab):
# class NetworkAssociationsTab(tabs.TableTab):
# class NetworkAssociationDetailTabs(tabs.TabGroup):
#     def get_context_data(self, request):
#     def get_network(self, network_id):
#     def get_network_detail_url(network_id):
#     def get_network_associations_data(self):


# Path: bgpvpn_dashboard/dashboards/project/bgpvpn/network_associations/views.py
from django.urls import reverse
from django.utils.translation import ugettext_lazy as _
from horizon import exceptions
from horizon import tabs
from bgpvpn_dashboard.api import bgpvpn as bgpvpn_api
from bgpvpn_dashboard.dashboards.project.bgpvpn.network_associations \
    import tabs as project_tabs

#    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.





class DetailView(tabs.TabView):
    tab_group_class = project_tabs.NetworkAssociationDetailTabs
    template_name = 'horizon/common/_detail.html'
    page_title = "{{ network_association.id }}"

    def get_data(self):
        network_association_id = self.kwargs['network_association_id']
        bgpvpn_id = self.kwargs['bgpvpn_id']
        try:
            network_association = bgpvpn_api.network_association_get(
                self.request, bgpvpn_id, network_association_id)
            return network_association
        except Exception:
            network_association = []
            msg = _('Unable to retrieve network association details.')
            exceptions.handle(self.request, msg,

                              redirect=self.get_redirect_url())