Commit 2d35dfd1 authored by Venkat's avatar Venkat
Browse files

added call to list all records

parent e6583396
......@@ -49,8 +49,9 @@ export class AppComponent {
// this.getUserInformation();
//this.getAvailableIPs();
//this.testRecords.push(this.new_record);
this.UpdateIp();
//this.UpdateIp();
//this.getAllIps();
this.getRecords();
//this.PutRecords();
//this.getIPsByRange()
//this.PostPreambles()
......@@ -101,6 +102,14 @@ export class AppComponent {
}
getRecords(): void{
this.sampleService.GetRecords()
.toPromise()
.then((res) => {
console.log('records retrieved')
});
}
getIPsByRange(): void{
this.sampleService.ListIPsByRange()
.toPromise()
......@@ -184,6 +193,21 @@ export class AppComponent {
data: {ipv4: this.selectedRow['ipv4'], ipv6: this.selectedRow['ipv6'], host: this.selectedRow['host'], adapter: this.selectedRow['adapter'], mac: this.selectedRow['mac_addr'], records: this.testRecords}
});
const dialogRef1 = this.dialog.open(DialogOverviewComponent, {
width: '500px',
data: {ipv4: this.selectedRow['ipv4'], ipv6: this.selectedRow['ipv6'], host: this.selectedRow['host'], adapter: this.selectedRow['adapter'], mac: this.selectedRow['mac_addr'], records: this.testRecords}
});
dialogRef1.afterClosed().subscribe(result => {
console.log('The dialog was closed');
this.postUIObject.ipv4 = result.ipv4;
this.postUIObject.ipv6 = result.ipv6;
this.postUIObject.host_name = result.host;
this.postUIObject.mac_address = result.mac;
this.postUIObject.adapter_name = result.adapter;
});
dialogRef.afterClosed().subscribe(result => {
console.log('The dialog was closed');
this.postUIObject.ipv4 = result.ipv4;
......@@ -192,6 +216,7 @@ export class AppComponent {
this.postUIObject.mac_address = result.mac;
this.postUIObject.adapter_name = result.adapter;
this.PostRecords(this.postUIObject.host_name, this.postUIObject.ipv4, this.postUIObject.ipv6, this.postUIObject.mac_address, this.postUIObject.adapter_name);
});
......
......@@ -179,6 +179,11 @@ export class SampleService {
return this.http.put<any>(this.HostLocation + this.endpoint, this.new_record_dict)
}
GetRecords(): Observable<any>{
this.endpoint = 'ipam/listrecords/';
return this.http.get<any>(this.HostLocation + this.endpoint, this.httpOptions);
}
//Add Record Types
//IP: Record Type of type string
......
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