Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- `host find` now shows IP address(es) for each host.
- `host add -contact` is now repeatable, with one contact per flag, so options can be placed before or after the hostname.

### Fixed

- `naptr_remove` removing all records regardless of the provided options. Now requires all options to match for a record to be removed.

## [1.9.0](https://github.com/unioslo/mreg-cli/releases/tag/1.9.0) - 2026-04-14

### Changed
Expand Down
5 changes: 5 additions & 0 deletions ci/testsuite
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,11 @@ host mx_remove baz 10 mail.example.org
host naptr_add -name baz -preference 16384 -order 3 -flag u -service "SIP" -regex "[abc]+" -replacement "wonk"
host naptr_show baz
host naptr_remove -name baz -preference 16384 -order 3 -flag u -service "sip" -regex "[abc]+" -replacement "wonk"
## Add 2 nearly identical records with different services
host naptr_add -name baz -preference 101 -order 4 -flag s -service http+I2R -regex "" -replacement .
host naptr_add -name baz -preference 101 -order 4 -flag s -service ftp+I2R -regex "" -replacement .
host naptr_remove -name baz -preference 101 -order 4 -replacement . # fails, too many matches
host naptr_remove -name baz -preference 101 -order 4 -replacement . -force
# PTR
host ptr_add 10.0.0.20 baz.example.org
host ptr_show 10.0.0.20
Expand Down
343 changes: 343 additions & 0 deletions ci/testsuite-result.json
Original file line number Diff line number Diff line change
Expand Up @@ -27487,6 +27487,349 @@
],
"time": null
},
{
"command": "host naptr_add -name baz -preference 101 -order 4 -flag s -service http+I2R -regex \"\" -replacement .",
"command_filter": null,
"command_filter_negate": false,
"command_issued": "host naptr_add -name baz -preference 101 -order 4 -flag s -service http+I2R -regex \"\" -replacement .",
"ok": [
"Added NAPTR record to baz.example.org."
],
"warning": [],
"error": [],
"output": [],
"api_requests": [
{
"method": "GET",
"url": "/api/v1/hosts/baz.example.org",
"data": {},
"status": 200,
"response": {
"ipaddresses": [
{
"macaddress": "11:22:33:aa:bb:cc",
"created_at": "2026-04-24T13:14:13.137107+02:00",
"updated_at": "2026-04-24T13:14:23.189953+02:00",
"ipaddress": "10.0.0.10",
"host": 20
},
{
"macaddress": "11:22:33:44:55:67",
"created_at": "2026-04-24T13:14:24.505828+02:00",
"updated_at": "2026-04-24T13:14:27.229134+02:00",
"ipaddress": "2001:db8::14",
"host": 20
}
],
"cnames": [],
"mxs": [],
"txts": [
{
"created_at": "2026-04-24T13:14:22.395738+02:00",
"updated_at": "2026-04-24T13:14:22.395797+02:00",
"txt": "v=spf1 -all",
"host": 20
}
],
"ptr_overrides": [],
"srvs": [],
"naptrs": [],
"sshfps": [],
"hostgroups": [],
"roles": [],
"hinfo": null,
"loc": null,
"bacnetid": null,
"communities": [],
"contacts": [],
"created_at": "2026-04-24T13:14:22.378394+02:00",
"updated_at": "2026-04-24T13:14:22.378456+02:00",
"name": "baz.example.org",
"ttl": null,
"comment": "",
"zone": 1,
"contact": ""
}
},
{
"method": "GET",
"url": "/api/v1/naptrs/?preference=101&order=4&flag=s&service=http%2BI2R&regex=&replacement=.&host=20",
"data": {},
"status": 200,
"response": {
"count": 0,
"next": null,
"previous": null,
"results": []
}
},
{
"method": "POST",
"url": "/api/v1/naptrs/",
"data": {
"preference": 101,
"order": 4,
"flag": "s",
"service": "http+I2R",
"regex": "",
"replacement": ".",
"host": 20
},
"status": 201,
"response": {
"created_at": "2026-04-24T13:14:31.810704+02:00",
"updated_at": "2026-04-24T13:14:31.810798+02:00",
"preference": 101,
"order": 4,
"flag": "s",
"service": "http+I2R",
"regex": "",
"replacement": ".",
"host": 20
}
}
],
"time": null
},
{
"command": "host naptr_add -name baz -preference 101 -order 4 -flag s -service ftp+I2R -regex \"\" -replacement .",
"command_filter": null,
"command_filter_negate": false,
"command_issued": "host naptr_add -name baz -preference 101 -order 4 -flag s -service ftp+I2R -regex \"\" -replacement .",
"ok": [
"Added NAPTR record to baz.example.org."
],
"warning": [],
"error": [],
"output": [],
"api_requests": [
{
"method": "GET",
"url": "/api/v1/hosts/baz.example.org",
"data": {},
"status": 200,
"response": {
"ipaddresses": [
{
"macaddress": "11:22:33:aa:bb:cc",
"created_at": "2026-04-24T13:14:13.137107+02:00",
"updated_at": "2026-04-24T13:14:23.189953+02:00",
"ipaddress": "10.0.0.10",
"host": 20
},
{
"macaddress": "11:22:33:44:55:67",
"created_at": "2026-04-24T13:14:24.505828+02:00",
"updated_at": "2026-04-24T13:14:27.229134+02:00",
"ipaddress": "2001:db8::14",
"host": 20
}
],
"cnames": [],
"mxs": [],
"txts": [
{
"created_at": "2026-04-24T13:14:22.395738+02:00",
"updated_at": "2026-04-24T13:14:22.395797+02:00",
"txt": "v=spf1 -all",
"host": 20
}
],
"ptr_overrides": [],
"srvs": [],
"naptrs": [
{
"created_at": "2026-04-24T13:14:31.810704+02:00",
"updated_at": "2026-04-24T13:14:31.810798+02:00",
"preference": 101,
"order": 4,
"flag": "s",
"service": "http+i2r",
"regex": "",
"replacement": ".",
"host": 20
}
],
"sshfps": [],
"hostgroups": [],
"roles": [],
"hinfo": null,
"loc": null,
"bacnetid": null,
"communities": [],
"contacts": [],
"created_at": "2026-04-24T13:14:22.378394+02:00",
"updated_at": "2026-04-24T13:14:22.378456+02:00",
"name": "baz.example.org",
"ttl": null,
"comment": "",
"zone": 1,
"contact": ""
}
},
{
"method": "GET",
"url": "/api/v1/naptrs/?preference=101&order=4&flag=s&service=ftp%2BI2R&regex=&replacement=.&host=20",
"data": {},
"status": 200,
"response": {
"count": 0,
"next": null,
"previous": null,
"results": []
}
},
{
"method": "POST",
"url": "/api/v1/naptrs/",
"data": {
"preference": 101,
"order": 4,
"flag": "s",
"service": "ftp+I2R",
"regex": "",
"replacement": ".",
"host": 20
},
"status": 201,
"response": {
"created_at": "2026-04-24T13:14:32.141394+02:00",
"updated_at": "2026-04-24T13:14:32.141451+02:00",
"preference": 101,
"order": 4,
"flag": "s",
"service": "ftp+I2R",
"regex": "",
"replacement": ".",
"host": 20
}
}
],
"time": null
},
{
"command": "host naptr_remove -name baz -preference 101 -order 4 -replacement .",
"command_filter": null,
"command_filter_negate": false,
"command_issued": "host naptr_remove -name baz -preference 101 -order 4 -replacement . # fails, too many matches",
"ok": [],
"warning": [
"Use --force to delete all matching records."
],
"error": [],
"output": [
"Found multiple matching NAPTR records:",
"NAPTRs: Preference Order Flag Service Regex Replacement ",
" 101 4 s ftp+i2r \"\" . ",
" 101 4 s http+i2r \"\" . "
],
"api_requests": [
{
"method": "GET",
"url": "/api/v1/hosts/baz.example.org",
"data": {},
"status": 200,
"response": {
"ipaddresses": [
{
"macaddress": "11:22:33:aa:bb:cc",
"created_at": "2026-04-24T13:14:13.137107+02:00",
"updated_at": "2026-04-24T13:14:23.189953+02:00",
"ipaddress": "10.0.0.10",
"host": 20
},
{
"macaddress": "11:22:33:44:55:67",
"created_at": "2026-04-24T13:14:24.505828+02:00",
"updated_at": "2026-04-24T13:14:27.229134+02:00",
"ipaddress": "2001:db8::14",
"host": 20
}
],
"cnames": [],
"mxs": [],
"txts": [
{
"created_at": "2026-04-24T13:14:22.395738+02:00",
"updated_at": "2026-04-24T13:14:22.395797+02:00",
"txt": "v=spf1 -all",
"host": 20
}
],
"ptr_overrides": [],
"srvs": [],
"naptrs": [
{
"created_at": "2026-04-24T13:14:32.141394+02:00",
"updated_at": "2026-04-24T13:14:32.141451+02:00",
"preference": 101,
"order": 4,
"flag": "s",
"service": "ftp+i2r",
"regex": "",
"replacement": ".",
"host": 20
},
{
"created_at": "2026-04-24T13:14:31.810704+02:00",
"updated_at": "2026-04-24T13:14:31.810798+02:00",
"preference": 101,
"order": 4,
"flag": "s",
"service": "http+i2r",
"regex": "",
"replacement": ".",
"host": 20
}
],
"sshfps": [],
"hostgroups": [],
"roles": [],
"hinfo": null,
"loc": null,
"bacnetid": null,
"communities": [],
"contacts": [],
"created_at": "2026-04-24T13:14:22.378394+02:00",
"updated_at": "2026-04-24T13:14:22.378456+02:00",
"name": "baz.example.org",
"ttl": null,
"comment": "",
"zone": 1,
"contact": ""
}
}
],
"time": null
},
{
"command": "host naptr_remove -name baz -preference 101 -order 4 -replacement . -force",
"command_filter": null,
"command_filter_negate": false,
"command_issued": "host naptr_remove -name baz -preference 101 -order 4 -replacement . -force",
"ok": [
"Deleted NAPTR record from baz.example.org.",
"Deleted NAPTR record from baz.example.org."
],
"warning": [],
"error": [],
"output": [],
"api_requests": [
{
"method": "DELETE",
"url": "/api/v1/naptrs/3",
"data": {},
"status": 204
},
{
"method": "DELETE",
"url": "/api/v1/naptrs/2",
"data": {},
"status": 204
}
],
"time": null
},
{
"command": "host ptr_add 10.0.0.20 baz.example.org",
"command_filter": null,
Expand Down
Loading
Loading