Commit fdca6dd0 authored by Venkat's avatar Venkat
Browse files

fixed merge conflicts

parents 711ab613 b9056beb
......@@ -48,7 +48,7 @@ export class AppComponent {
ngOnInit(){
// this.getUserInformation();
//this.getAvailableIPs();
//this.testRecords.push(this.new_record);
//this.testRecords.push(this.new_record);
//this.UpdateIp();
this.getAllIps();
//this.getRecords(3);
......
......@@ -23,14 +23,9 @@ class ListSubnet(generics.ListAPIView):
serializer_class = serializers.SubnetSerializer
class ListRecords(generics.ListAPIView):
queryset = models.Record.objects.all()
serializer_class = serializers.RecordSerializer
def get_queryset(self):
queryset = models.Records.objects.all()
hostid = self.request.query_params.get('host')
queryset = models.Record.objects.filter(host==hostid)
return queryset
class ListIPRange(generics.ListAPIView):
queryset = models.IP.objects.all()
# permission_classes = (permissions.IsAuthenticated)
......@@ -41,17 +36,17 @@ class CreateRecord(generics.CreateAPIView):
# permission_classes = (permissions.IsAuthenticated)
serializer_class = serializers.RecordSerializer
class CreateHost(generics.CreateAPIView):
class CreateHost(generics.ListCreateAPIView):
queryset = models.Host.objects.all()
# permission_classes = (permissions.IsAuthenticated)
serializer_class = serializers.HostSerializer
class CreateAdapter(generics.CreateAPIView):
class CreateAdapter(generics.ListCreateAPIView):
queryset = models.Adapter.objects.all()
# permission_classes = (permissions.IsAuthenticated)
serializer_class = serializers.AdapterSerializer
class CreateMac(generics.CreateAPIView):
class CreateMac(generics.ListCreateAPIView):
queryset = models.Mac_Addr.objects.all()
# permission_classes = (permissions.IsAuthenticated)
serializer_class = serializers.MacAddrSerializer
......
......@@ -7,7 +7,7 @@ urlpatterns = [
url(r'^ipam/listavailaleips/', view=views.ListAvailaleIPs.as_view()),
url(r'^ipam/listallips/', view=views.ListAllIps.as_view()),
url(r'^ipam/listsubnets/', view=views.ListSubnet.as_view()),
url(r'^ipam/listrecords/', view=views.ListRecords.as_view()),
url(r'^ipam/listrecords/(?P<id>\d+)/$', view=views.ListRecords.as_view()),
url(r'^ipam/createrecord/', view=views.CreateRecord.as_view()),
url(r'^ipam/createhost/', view=views.CreateHost.as_view()),
url(r'^ipam/createadapter/', view=views.CreateAdapter.as_view()),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment