mreg-cli 1.4.2__tar.gz → 1.5.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. {mreg_cli-1.4.2 → mreg_cli-1.5.0}/CHANGELOG.md +13 -0
  2. {mreg_cli-1.4.2 → mreg_cli-1.5.0}/PKG-INFO +112 -4
  3. {mreg_cli-1.4.2 → mreg_cli-1.5.0}/README.md +110 -3
  4. {mreg_cli-1.4.2 → mreg_cli-1.5.0}/ci/testsuite-result.json +1135 -5965
  5. {mreg_cli-1.4.2 → mreg_cli-1.5.0}/data/mreg-cli.conf +2 -0
  6. {mreg_cli-1.4.2 → mreg_cli-1.5.0}/mreg_cli/_version.py +16 -3
  7. {mreg_cli-1.4.2 → mreg_cli-1.5.0}/mreg_cli/api/endpoints.py +3 -1
  8. {mreg_cli-1.4.2 → mreg_cli-1.5.0}/mreg_cli/api/errors.py +2 -2
  9. {mreg_cli-1.4.2 → mreg_cli-1.5.0}/mreg_cli/api/models.py +131 -5
  10. mreg_cli-1.5.0/mreg_cli/cache.py +318 -0
  11. {mreg_cli-1.4.2 → mreg_cli-1.5.0}/mreg_cli/cli.py +2 -0
  12. mreg_cli-1.5.0/mreg_cli/commands/cache.py +87 -0
  13. {mreg_cli-1.4.2 → mreg_cli-1.5.0}/mreg_cli/commands/help.py +15 -1
  14. {mreg_cli-1.4.2 → mreg_cli-1.5.0}/mreg_cli/config.py +34 -8
  15. {mreg_cli-1.4.2 → mreg_cli-1.5.0}/mreg_cli/exceptions.py +11 -1
  16. {mreg_cli-1.4.2 → mreg_cli-1.5.0}/mreg_cli/main.py +18 -1
  17. {mreg_cli-1.4.2 → mreg_cli-1.5.0}/mreg_cli/utilities/api.py +45 -2
  18. {mreg_cli-1.4.2 → mreg_cli-1.5.0}/mreg_cli.egg-info/PKG-INFO +112 -4
  19. {mreg_cli-1.4.2 → mreg_cli-1.5.0}/mreg_cli.egg-info/SOURCES.txt +3 -0
  20. {mreg_cli-1.4.2 → mreg_cli-1.5.0}/mreg_cli.egg-info/requires.txt +1 -0
  21. {mreg_cli-1.4.2 → mreg_cli-1.5.0}/pyproject.toml +4 -0
  22. mreg_cli-1.5.0/tests/test_cache.py +144 -0
  23. {mreg_cli-1.4.2 → mreg_cli-1.5.0}/tests/utilities/test_api.py +69 -45
  24. {mreg_cli-1.4.2 → mreg_cli-1.5.0}/uv.lock +286 -332
  25. {mreg_cli-1.4.2 → mreg_cli-1.5.0}/.github/workflows/publish.yml +0 -0
  26. {mreg_cli-1.4.2 → mreg_cli-1.5.0}/.github/workflows/test.yml +0 -0
  27. {mreg_cli-1.4.2 → mreg_cli-1.5.0}/.gitignore +0 -0
  28. {mreg_cli-1.4.2 → mreg_cli-1.5.0}/.markdownlint.json +0 -0
  29. {mreg_cli-1.4.2 → mreg_cli-1.5.0}/AUTHORS +0 -0
  30. {mreg_cli-1.4.2 → mreg_cli-1.5.0}/CONTRIBUTING +0 -0
  31. {mreg_cli-1.4.2 → mreg_cli-1.5.0}/LICENSE +0 -0
  32. {mreg_cli-1.4.2 → mreg_cli-1.5.0}/ci/Dockerfile +0 -0
  33. {mreg_cli-1.4.2 → mreg_cli-1.5.0}/ci/diff.py +0 -0
  34. {mreg_cli-1.4.2 → mreg_cli-1.5.0}/ci/docker-compose.yml +0 -0
  35. {mreg_cli-1.4.2 → mreg_cli-1.5.0}/ci/run_testsuite_and_record.sh +0 -0
  36. {mreg_cli-1.4.2 → mreg_cli-1.5.0}/ci/run_testsuite_and_record_V2.sh +0 -0
  37. {mreg_cli-1.4.2 → mreg_cli-1.5.0}/ci/testsuite +0 -0
  38. {mreg_cli-1.4.2 → mreg_cli-1.5.0}/mreg_cli/__about__.py +0 -0
  39. {mreg_cli-1.4.2 → mreg_cli-1.5.0}/mreg_cli/__init__.py +0 -0
  40. {mreg_cli-1.4.2 → mreg_cli-1.5.0}/mreg_cli/__main__.py +0 -0
  41. {mreg_cli-1.4.2 → mreg_cli-1.5.0}/mreg_cli/api/__init__.py +0 -0
  42. {mreg_cli-1.4.2 → mreg_cli-1.5.0}/mreg_cli/api/abstracts.py +0 -0
  43. {mreg_cli-1.4.2 → mreg_cli-1.5.0}/mreg_cli/api/fields.py +0 -0
  44. {mreg_cli-1.4.2 → mreg_cli-1.5.0}/mreg_cli/api/history.py +0 -0
  45. {mreg_cli-1.4.2 → mreg_cli-1.5.0}/mreg_cli/commands/__init__.py +0 -0
  46. {mreg_cli-1.4.2 → mreg_cli-1.5.0}/mreg_cli/commands/base.py +0 -0
  47. {mreg_cli-1.4.2 → mreg_cli-1.5.0}/mreg_cli/commands/dhcp.py +0 -0
  48. {mreg_cli-1.4.2 → mreg_cli-1.5.0}/mreg_cli/commands/group.py +0 -0
  49. {mreg_cli-1.4.2 → mreg_cli-1.5.0}/mreg_cli/commands/host.py +0 -0
  50. {mreg_cli-1.4.2 → mreg_cli-1.5.0}/mreg_cli/commands/host_submodules/__init__.py +0 -0
  51. {mreg_cli-1.4.2 → mreg_cli-1.5.0}/mreg_cli/commands/host_submodules/a_aaaa.py +0 -0
  52. {mreg_cli-1.4.2 → mreg_cli-1.5.0}/mreg_cli/commands/host_submodules/bacnet.py +0 -0
  53. {mreg_cli-1.4.2 → mreg_cli-1.5.0}/mreg_cli/commands/host_submodules/cname.py +0 -0
  54. {mreg_cli-1.4.2 → mreg_cli-1.5.0}/mreg_cli/commands/host_submodules/core.py +0 -0
  55. {mreg_cli-1.4.2 → mreg_cli-1.5.0}/mreg_cli/commands/host_submodules/rr.py +0 -0
  56. {mreg_cli-1.4.2 → mreg_cli-1.5.0}/mreg_cli/commands/label.py +0 -0
  57. {mreg_cli-1.4.2 → mreg_cli-1.5.0}/mreg_cli/commands/logging.py +0 -0
  58. {mreg_cli-1.4.2 → mreg_cli-1.5.0}/mreg_cli/commands/network.py +0 -0
  59. {mreg_cli-1.4.2 → mreg_cli-1.5.0}/mreg_cli/commands/permission.py +0 -0
  60. {mreg_cli-1.4.2 → mreg_cli-1.5.0}/mreg_cli/commands/policy.py +0 -0
  61. {mreg_cli-1.4.2 → mreg_cli-1.5.0}/mreg_cli/commands/recording.py +0 -0
  62. {mreg_cli-1.4.2 → mreg_cli-1.5.0}/mreg_cli/commands/registry.py +0 -0
  63. {mreg_cli-1.4.2 → mreg_cli-1.5.0}/mreg_cli/commands/root.py +0 -0
  64. {mreg_cli-1.4.2 → mreg_cli-1.5.0}/mreg_cli/commands/zone.py +0 -0
  65. {mreg_cli-1.4.2 → mreg_cli-1.5.0}/mreg_cli/errorbuilder.py +0 -0
  66. {mreg_cli-1.4.2 → mreg_cli-1.5.0}/mreg_cli/help_formatter.py +0 -0
  67. {mreg_cli-1.4.2 → mreg_cli-1.5.0}/mreg_cli/outputmanager.py +0 -0
  68. {mreg_cli-1.4.2 → mreg_cli-1.5.0}/mreg_cli/prompt.py +0 -0
  69. {mreg_cli-1.4.2 → mreg_cli-1.5.0}/mreg_cli/py.typed +0 -0
  70. {mreg_cli-1.4.2 → mreg_cli-1.5.0}/mreg_cli/tags.txt +0 -0
  71. {mreg_cli-1.4.2 → mreg_cli-1.5.0}/mreg_cli/tokenfile.py +0 -0
  72. {mreg_cli-1.4.2 → mreg_cli-1.5.0}/mreg_cli/types.py +0 -0
  73. {mreg_cli-1.4.2 → mreg_cli-1.5.0}/mreg_cli/utilities/__init__.py +0 -0
  74. {mreg_cli-1.4.2 → mreg_cli-1.5.0}/mreg_cli/utilities/shared.py +0 -0
  75. {mreg_cli-1.4.2 → mreg_cli-1.5.0}/mreg_cli/utilities/validators.py +0 -0
  76. {mreg_cli-1.4.2 → mreg_cli-1.5.0}/mreg_cli.egg-info/dependency_links.txt +0 -0
  77. {mreg_cli-1.4.2 → mreg_cli-1.5.0}/mreg_cli.egg-info/entry_points.txt +0 -0
  78. {mreg_cli-1.4.2 → mreg_cli-1.5.0}/mreg_cli.egg-info/top_level.txt +0 -0
  79. {mreg_cli-1.4.2 → mreg_cli-1.5.0}/run.py +0 -0
  80. {mreg_cli-1.4.2 → mreg_cli-1.5.0}/setup.cfg +0 -0
  81. {mreg_cli-1.4.2 → mreg_cli-1.5.0}/tests/__init__.py +0 -0
  82. {mreg_cli-1.4.2 → mreg_cli-1.5.0}/tests/api/__init__.py +0 -0
  83. {mreg_cli-1.4.2 → mreg_cli-1.5.0}/tests/api/test_fields.py +0 -0
  84. {mreg_cli-1.4.2 → mreg_cli-1.5.0}/tests/api/test_models.py +0 -0
  85. {mreg_cli-1.4.2 → mreg_cli-1.5.0}/tests/conftest.py +0 -0
  86. {mreg_cli-1.4.2 → mreg_cli-1.5.0}/tests/test_errorbuilder.py +0 -0
  87. {mreg_cli-1.4.2 → mreg_cli-1.5.0}/tests/test_exceptions.py +0 -0
  88. {mreg_cli-1.4.2 → mreg_cli-1.5.0}/tests/test_outputmanager.py +0 -0
  89. {mreg_cli-1.4.2 → mreg_cli-1.5.0}/tests/test_prompt.py +0 -0
  90. {mreg_cli-1.4.2 → mreg_cli-1.5.0}/tests/test_tokenfile.py +0 -0
  91. {mreg_cli-1.4.2 → mreg_cli-1.5.0}/tests/test_types.py +0 -0
  92. {mreg_cli-1.4.2 → mreg_cli-1.5.0}/tests/utilities/__init__.py +0 -0
  93. {mreg_cli-1.4.2 → mreg_cli-1.5.0}/tox.ini +0 -0
@@ -7,6 +7,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  <!-- ## Unreleased -->
9
9
 
10
+ ## [1.5.0](https://github.com/unioslo/mreg-cli/releases/tag/1.5.0) - 2025-09-01
11
+
12
+ ### Added
13
+
14
+ - `help health` command for checking the health of the server. The command will display "Unknown" for fields that are not implemented on the server.
15
+ - Caching of API responses. Enabled by default. Configurable:
16
+ - Enable/disable caching (default: `true`)
17
+ - Config file: `cache=true|false`
18
+ - CLI: `--no-cache` (flag)
19
+ - Cache time-to-live (TTL) in seconds (default: `300`)
20
+ - Config file: `cache_ttl=<seconds>`
21
+ - CLI: `--cache-ttl <seconds>`
22
+
10
23
  ## [1.4.2](https://github.com/unioslo/mreg-cli/releases/tag/1.4.2) - 2025-08-15
11
24
 
12
25
  ### Fixed
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mreg-cli
3
- Version: 1.4.2
3
+ Version: 1.5.0
4
4
  Summary: MREG interactive command line client
5
5
  Author: Others (see AUTHORS)
6
6
  Author-email: Øyvind Kolbu <oyvind.kolbu@usit.uio.no>, Safet A <amedov@usit.uio.no>, Magnus Hirth <mhmorgan42@gmail.com>, Nico <nicolaydmohebi@gmail.com>, Marius Bakke <marius.bakke@usit.uio.no>, Fredrik Larsen <fredrik.larsen@usit.uio.no>, Paal Braathen <paal.braathen@usit.uio.no>, Nils Hiorth <nils@nls.me>, Dmytro Karpenko <dmytrok@usit.uio.no>
@@ -701,6 +701,7 @@ Requires-Dist: typing_extensions>=4.12.0
701
701
  Requires-Dist: pydantic[email]>=2.7.1
702
702
  Requires-Dist: pydantic-extra-types>=2.1.0
703
703
  Requires-Dist: platformdirs>=4.3.0
704
+ Requires-Dist: diskcache>=5.6.3
704
705
  Dynamic: license-file
705
706
 
706
707
  # MREG CLI [![Build Status](https://github.com/unioslo/mreg-cli/actions/workflows/test.yml/badge.svg)](https://github.com/unioslo/mreg-cli/actions/workflows/test.yml)
@@ -739,8 +740,55 @@ url=https://mreg.example.com:8000
739
740
  user=mreg-user
740
741
  ```
741
742
 
743
+ An example config file can be found in [data/mreg-cli.conf](data/mreg-cli.conf).
744
+
742
745
  <details>
743
- <summary>Other options</summary>
746
+ <summary>Config options</summary>
747
+
748
+ ### URL
749
+
750
+ The URL of the MREG server. This is the only required option.
751
+
752
+ ```ini
753
+ [mreg]
754
+ url=https://mreg.example.com:8000
755
+ ```
756
+
757
+ The URL can also be specified as a command line argument:
758
+
759
+ ```bash
760
+ mreg-cli --url "https://mreg.example.com:8000"
761
+ ```
762
+
763
+ ### User
764
+
765
+ The username to use when connecting to the MREG server. This is optional, and if not specified, the CLI will try to use the current user's username.
766
+
767
+ ```ini
768
+ [mreg]
769
+ user=mreg-user
770
+ ```
771
+
772
+ The user can also be specified as a command line argument:
773
+
774
+ ```bash
775
+ mreg-cli --user "mreg-user"
776
+ ```
777
+
778
+ ### Domain
779
+
780
+ Default domain to use for hostnames. This is optional, and if not specified, the CLI will use `uio.no` as the default domain.
781
+
782
+ ```ini
783
+ [mreg]
784
+ domain=uio.no
785
+ ```
786
+
787
+ The domain can also be specified as a command line argument:
788
+
789
+ ```bash
790
+ mreg-cli --domain "uio.no"
791
+ ```
744
792
 
745
793
  ### Prompt
746
794
 
@@ -756,7 +804,7 @@ By default the prompt is set to `{user}@{host}`, which is equivalent to the foll
756
804
 
757
805
  ```ini
758
806
  [mreg]
759
- PROMPT={user}@{host}
807
+ prompt={user}@{host}
760
808
  ```
761
809
 
762
810
  Which results in a prompt like this:
@@ -779,7 +827,7 @@ The prompt text can be disabled by setting it to no value in the config file or
779
827
 
780
828
  ```ini
781
829
  [mreg]
782
- PROMPT=
830
+ prompt=
783
831
  ```
784
832
 
785
833
  ```bash
@@ -792,6 +840,66 @@ Which results in the following prompt:
792
840
  >
793
841
  ```
794
842
 
843
+ ### Log file
844
+
845
+ The location of the log file. The default location is `$XDG_DATA_DIRS/mreg-cli/mreg-cli.log`, which is typically `~/.local/share/mreg-cli/mreg-cli.log`.
846
+
847
+ ```ini
848
+ [mreg]
849
+ logfile=/var/log/mreg-cli.log
850
+ ```
851
+
852
+ The log file can also be specified as a command line argument:
853
+
854
+ ```bash
855
+ mreg-cli --logfile "/var/log/mreg-cli.log"
856
+ ```
857
+
858
+ ### Timeout
859
+
860
+ The timeout for HTTP requests to the MREG server. The default is 20 seconds.
861
+
862
+ ```ini
863
+ [mreg]
864
+ timeout=20
865
+ ```
866
+
867
+ ### Cache
868
+
869
+ Enable/disable caching of API results. Cache is always cleared on every write request (POST, PUT, PATCH, DELETE).
870
+
871
+ ```ini
872
+ [mreg]
873
+ cache=true
874
+ ```
875
+
876
+ ### Cache TTL
877
+
878
+ Time-to-live for cached API results, in seconds. Defaults to 300 seconds (5 minutes).
879
+
880
+ ```ini
881
+ [mreg]
882
+ cache_ttl=300
883
+ ```
884
+
885
+ ### Category tags
886
+
887
+ List of valid category tags for networks. Used by `network create`.
888
+
889
+ ```ini
890
+ [mreg]
891
+ category_tags=default,production,development,test
892
+ ```
893
+
894
+ ### Location tags
895
+
896
+ List of valid location tags for networks. Used by `network create`.
897
+
898
+ ```ini
899
+ [mreg]
900
+ location_tags=default,oslo,bergen,stavanger
901
+ ```
902
+
795
903
  </details>
796
904
 
797
905
  ## General usage
@@ -34,8 +34,55 @@ url=https://mreg.example.com:8000
34
34
  user=mreg-user
35
35
  ```
36
36
 
37
+ An example config file can be found in [data/mreg-cli.conf](data/mreg-cli.conf).
38
+
37
39
  <details>
38
- <summary>Other options</summary>
40
+ <summary>Config options</summary>
41
+
42
+ ### URL
43
+
44
+ The URL of the MREG server. This is the only required option.
45
+
46
+ ```ini
47
+ [mreg]
48
+ url=https://mreg.example.com:8000
49
+ ```
50
+
51
+ The URL can also be specified as a command line argument:
52
+
53
+ ```bash
54
+ mreg-cli --url "https://mreg.example.com:8000"
55
+ ```
56
+
57
+ ### User
58
+
59
+ The username to use when connecting to the MREG server. This is optional, and if not specified, the CLI will try to use the current user's username.
60
+
61
+ ```ini
62
+ [mreg]
63
+ user=mreg-user
64
+ ```
65
+
66
+ The user can also be specified as a command line argument:
67
+
68
+ ```bash
69
+ mreg-cli --user "mreg-user"
70
+ ```
71
+
72
+ ### Domain
73
+
74
+ Default domain to use for hostnames. This is optional, and if not specified, the CLI will use `uio.no` as the default domain.
75
+
76
+ ```ini
77
+ [mreg]
78
+ domain=uio.no
79
+ ```
80
+
81
+ The domain can also be specified as a command line argument:
82
+
83
+ ```bash
84
+ mreg-cli --domain "uio.no"
85
+ ```
39
86
 
40
87
  ### Prompt
41
88
 
@@ -51,7 +98,7 @@ By default the prompt is set to `{user}@{host}`, which is equivalent to the foll
51
98
 
52
99
  ```ini
53
100
  [mreg]
54
- PROMPT={user}@{host}
101
+ prompt={user}@{host}
55
102
  ```
56
103
 
57
104
  Which results in a prompt like this:
@@ -74,7 +121,7 @@ The prompt text can be disabled by setting it to no value in the config file or
74
121
 
75
122
  ```ini
76
123
  [mreg]
77
- PROMPT=
124
+ prompt=
78
125
  ```
79
126
 
80
127
  ```bash
@@ -87,6 +134,66 @@ Which results in the following prompt:
87
134
  >
88
135
  ```
89
136
 
137
+ ### Log file
138
+
139
+ The location of the log file. The default location is `$XDG_DATA_DIRS/mreg-cli/mreg-cli.log`, which is typically `~/.local/share/mreg-cli/mreg-cli.log`.
140
+
141
+ ```ini
142
+ [mreg]
143
+ logfile=/var/log/mreg-cli.log
144
+ ```
145
+
146
+ The log file can also be specified as a command line argument:
147
+
148
+ ```bash
149
+ mreg-cli --logfile "/var/log/mreg-cli.log"
150
+ ```
151
+
152
+ ### Timeout
153
+
154
+ The timeout for HTTP requests to the MREG server. The default is 20 seconds.
155
+
156
+ ```ini
157
+ [mreg]
158
+ timeout=20
159
+ ```
160
+
161
+ ### Cache
162
+
163
+ Enable/disable caching of API results. Cache is always cleared on every write request (POST, PUT, PATCH, DELETE).
164
+
165
+ ```ini
166
+ [mreg]
167
+ cache=true
168
+ ```
169
+
170
+ ### Cache TTL
171
+
172
+ Time-to-live for cached API results, in seconds. Defaults to 300 seconds (5 minutes).
173
+
174
+ ```ini
175
+ [mreg]
176
+ cache_ttl=300
177
+ ```
178
+
179
+ ### Category tags
180
+
181
+ List of valid category tags for networks. Used by `network create`.
182
+
183
+ ```ini
184
+ [mreg]
185
+ category_tags=default,production,development,test
186
+ ```
187
+
188
+ ### Location tags
189
+
190
+ List of valid location tags for networks. Used by `network create`.
191
+
192
+ ```ini
193
+ [mreg]
194
+ location_tags=default,oslo,bergen,stavanger
195
+ ```
196
+
90
197
  </details>
91
198
 
92
199
  ## General usage