nmcli 1.5.0__tar.gz → 1.7.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.
- nmcli-1.7.0/LICENSE.txt +21 -0
- nmcli-1.7.0/PKG-INFO +638 -0
- {nmcli-1.5.0 → nmcli-1.7.0}/README.md +67 -6
- {nmcli-1.5.0 → nmcli-1.7.0}/nmcli/_connection.py +21 -3
- {nmcli-1.5.0 → nmcli-1.7.0}/nmcli/_device.py +20 -0
- {nmcli-1.5.0 → nmcli-1.7.0}/nmcli/_general.py +20 -0
- {nmcli-1.5.0 → nmcli-1.7.0}/nmcli/dummy/_connection.py +14 -2
- {nmcli-1.5.0 → nmcli-1.7.0}/nmcli/dummy/_device.py +19 -1
- {nmcli-1.5.0 → nmcli-1.7.0}/nmcli/dummy/_general.py +10 -1
- nmcli-1.7.0/nmcli.egg-info/PKG-INFO +638 -0
- {nmcli-1.5.0 → nmcli-1.7.0}/nmcli.egg-info/SOURCES.txt +10 -1
- nmcli-1.7.0/pyproject.toml +26 -0
- nmcli-1.7.0/setup.py +6 -0
- nmcli-1.7.0/tests/test_connection.py +161 -0
- nmcli-1.7.0/tests/test_device.py +368 -0
- nmcli-1.7.0/tests/test_general.py +79 -0
- nmcli-1.7.0/tests/test_helper.py +16 -0
- nmcli-1.7.0/tests/test_networking.py +51 -0
- nmcli-1.7.0/tests/test_radio.py +80 -0
- nmcli-1.7.0/tests/test_system.py +156 -0
- nmcli-1.5.0/PKG-INFO +0 -577
- nmcli-1.5.0/nmcli.egg-info/PKG-INFO +0 -577
- nmcli-1.5.0/setup.py +0 -39
- {nmcli-1.5.0 → nmcli-1.7.0}/nmcli/__init__.py +0 -0
- {nmcli-1.5.0 → nmcli-1.7.0}/nmcli/_const.py +0 -0
- {nmcli-1.5.0 → nmcli-1.7.0}/nmcli/_exception.py +0 -0
- {nmcli-1.5.0 → nmcli-1.7.0}/nmcli/_helper.py +0 -0
- {nmcli-1.5.0 → nmcli-1.7.0}/nmcli/_networking.py +0 -0
- {nmcli-1.5.0 → nmcli-1.7.0}/nmcli/_radio.py +0 -0
- {nmcli-1.5.0 → nmcli-1.7.0}/nmcli/_system.py +0 -0
- {nmcli-1.5.0 → nmcli-1.7.0}/nmcli/data/__init__.py +0 -0
- {nmcli-1.5.0 → nmcli-1.7.0}/nmcli/data/connection.py +0 -0
- {nmcli-1.5.0 → nmcli-1.7.0}/nmcli/data/device.py +0 -0
- {nmcli-1.5.0 → nmcli-1.7.0}/nmcli/data/general.py +0 -0
- {nmcli-1.5.0 → nmcli-1.7.0}/nmcli/data/hotspot.py +0 -0
- {nmcli-1.5.0 → nmcli-1.7.0}/nmcli/data/radio.py +0 -0
- {nmcli-1.5.0 → nmcli-1.7.0}/nmcli/dummy/__init__.py +0 -0
- {nmcli-1.5.0 → nmcli-1.7.0}/nmcli/dummy/_networking.py +0 -0
- {nmcli-1.5.0 → nmcli-1.7.0}/nmcli/dummy/_radio.py +0 -0
- {nmcli-1.5.0 → nmcli-1.7.0}/nmcli/py.typed +0 -0
- {nmcli-1.5.0 → nmcli-1.7.0}/nmcli.egg-info/dependency_links.txt +0 -0
- {nmcli-1.5.0 → nmcli-1.7.0}/nmcli.egg-info/top_level.txt +0 -0
- {nmcli-1.5.0 → nmcli-1.7.0}/setup.cfg +0 -0
nmcli-1.7.0/LICENSE.txt
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2020 ushiboy
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
nmcli-1.7.0/PKG-INFO
ADDED
|
@@ -0,0 +1,638 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: nmcli
|
|
3
|
+
Version: 1.7.0
|
|
4
|
+
Summary: A python wrapper library for the network-manager cli client
|
|
5
|
+
Author: ushiboy
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/ushiboy/nmcli
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
10
|
+
Requires-Python: >=3.7
|
|
11
|
+
Description-Content-Type: text/markdown
|
|
12
|
+
License-File: LICENSE.txt
|
|
13
|
+
Dynamic: license-file
|
|
14
|
+
|
|
15
|
+
# nmcli
|
|
16
|
+
|
|
17
|
+
nmcli is a python wrapper library for the network-manager cli client.
|
|
18
|
+
|
|
19
|
+
## Quick Sample
|
|
20
|
+
|
|
21
|
+
Here is a simple usecase.
|
|
22
|
+
|
|
23
|
+
```python
|
|
24
|
+
import nmcli
|
|
25
|
+
|
|
26
|
+
try:
|
|
27
|
+
print(nmcli.connection())
|
|
28
|
+
print(nmcli.device())
|
|
29
|
+
print(nmcli.device.wifi())
|
|
30
|
+
print(nmcli.general())
|
|
31
|
+
|
|
32
|
+
nmcli.device.wifi_connect('AP1', 'passphrase')
|
|
33
|
+
nmcli.connection.modify('AP1', {
|
|
34
|
+
'ipv4.addresses': '192.168.1.1/24',
|
|
35
|
+
'ipv4.gateway': '192.168.1.255',
|
|
36
|
+
'ipv4.method': 'manual'
|
|
37
|
+
})
|
|
38
|
+
nmcli.connection.down('AP1')
|
|
39
|
+
nmcli.connection.up('AP1')
|
|
40
|
+
nmcli.connection.delete('AP1')
|
|
41
|
+
except Exception as e:
|
|
42
|
+
print(e)
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Dependency
|
|
46
|
+
|
|
47
|
+
- NetworkManager
|
|
48
|
+
- `sudo apt install network-manager` (Debian)
|
|
49
|
+
- User who can execute nmcli with sudo with NOPASSWD
|
|
50
|
+
- If sudo is not needed (like root user), use `disable_use_sudo` at the beginning of the process.
|
|
51
|
+
|
|
52
|
+
## Compatibility table
|
|
53
|
+
|
|
54
|
+
| Object | Command | Status |
|
|
55
|
+
| ---------- | ------------ | ------------- |
|
|
56
|
+
| general | | supported |
|
|
57
|
+
| general | status | supported |
|
|
58
|
+
| general | hostname | supported |
|
|
59
|
+
| general | permissions | not supported |
|
|
60
|
+
| general | logging | not supported |
|
|
61
|
+
| general | reload | supported |
|
|
62
|
+
| networking | | supported |
|
|
63
|
+
| networking | on | supported |
|
|
64
|
+
| networking | off | supported |
|
|
65
|
+
| networking | connectivity | supported |
|
|
66
|
+
| radio | | supported |
|
|
67
|
+
| radio | all | supported |
|
|
68
|
+
| radio | wifi | supported |
|
|
69
|
+
| radio | wwan | supported |
|
|
70
|
+
| connection | | supported |
|
|
71
|
+
| connection | show | supported |
|
|
72
|
+
| connection | up | supported |
|
|
73
|
+
| connection | down | supported |
|
|
74
|
+
| connection | add | supported |
|
|
75
|
+
| connection | modify | supported |
|
|
76
|
+
| connection | clone | not supported |
|
|
77
|
+
| connection | edit | not supported |
|
|
78
|
+
| connection | delete | supported |
|
|
79
|
+
| connection | monitor | not supported |
|
|
80
|
+
| connection | reload | supported |
|
|
81
|
+
| connection | load | not supported |
|
|
82
|
+
| connection | import | not supported |
|
|
83
|
+
| connection | export | not supported |
|
|
84
|
+
| device | | supported |
|
|
85
|
+
| device | status | supported |
|
|
86
|
+
| device | show | supported |
|
|
87
|
+
| device | set | not supported |
|
|
88
|
+
| device | up | supported |
|
|
89
|
+
| device | connect | supported |
|
|
90
|
+
| device | reapply | supported |
|
|
91
|
+
| device | modify | not supported |
|
|
92
|
+
| device | down | supported |
|
|
93
|
+
| device | disconnect | supported |
|
|
94
|
+
| device | delete | supported |
|
|
95
|
+
| device | monitor | not supported |
|
|
96
|
+
| device | wifi | supported |
|
|
97
|
+
| device | wifi connect | supported |
|
|
98
|
+
| device | wifi rescan | supported |
|
|
99
|
+
| device | wifi hotspot | supported |
|
|
100
|
+
| device | wifi show-password | not supported |
|
|
101
|
+
| device | lldp | not supported |
|
|
102
|
+
| agent | | not supported |
|
|
103
|
+
| agent | secret | not supported |
|
|
104
|
+
| agent | polkit | not supported |
|
|
105
|
+
| agent | all | not supported |
|
|
106
|
+
| monitor | | not supported |
|
|
107
|
+
|
|
108
|
+
## API
|
|
109
|
+
|
|
110
|
+
### connection
|
|
111
|
+
|
|
112
|
+
#### nmcli.connection
|
|
113
|
+
|
|
114
|
+
Get a list of connections.
|
|
115
|
+
|
|
116
|
+
```
|
|
117
|
+
nmcli.connection() -> List[Connection]
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
#### nmcli.connection.add
|
|
121
|
+
|
|
122
|
+
Create a new connection using specified properties.
|
|
123
|
+
|
|
124
|
+
```
|
|
125
|
+
nmcli.connection.add(
|
|
126
|
+
conn_type: str,
|
|
127
|
+
options: Optional[ConnectionOptions] = None,
|
|
128
|
+
ifname: str = "*",
|
|
129
|
+
name: str = None,
|
|
130
|
+
autoconnect: bool = None) -> None
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
#### nmcli.connection.modify
|
|
134
|
+
|
|
135
|
+
Add, modify or remove properties in the connection profile.
|
|
136
|
+
|
|
137
|
+
```
|
|
138
|
+
nmcli.connection.modify(name: str, options: ConnectionOptions) -> None
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
#### nmcli.connection.delete
|
|
142
|
+
|
|
143
|
+
Delete a configured connection.
|
|
144
|
+
|
|
145
|
+
The `wait` argument applies the same effect to the command as the `--wait` option. If it is omitted, the default behavior is followed.
|
|
146
|
+
|
|
147
|
+
```
|
|
148
|
+
nmcli.connection.delete(name: str, wait: int = None) -> None
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
#### nmcli.connection.up
|
|
152
|
+
|
|
153
|
+
Activate a connection.
|
|
154
|
+
|
|
155
|
+
The `wait` argument applies the same effect to the command as the `--wait` option. If it is omitted, the default behavior is followed.
|
|
156
|
+
|
|
157
|
+
```
|
|
158
|
+
nmcli.connection.up(name: str, wait: int = None) -> None
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
#### nmcli.connection.down
|
|
162
|
+
|
|
163
|
+
Deactivate a connection from a device without preventing the device from further auto-activation.
|
|
164
|
+
|
|
165
|
+
The `wait` argument applies the same effect to the command as the `--wait` option. If it is omitted, the default behavior is followed.
|
|
166
|
+
|
|
167
|
+
```
|
|
168
|
+
nmcli.connection.down(name: str, wait: int = None) -> None
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
#### nmcli.connection.show
|
|
172
|
+
|
|
173
|
+
Show details for specified connections.
|
|
174
|
+
|
|
175
|
+
Use `show_secrets` argument to reveal associated secrets as well.
|
|
176
|
+
Use `active` argument to show only the active profile.
|
|
177
|
+
|
|
178
|
+
```
|
|
179
|
+
nmcli.connection.show(name: str, show_secrets: bool = False, active: bool = False) -> ConnectionDetails
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
#### nmcli.connection.show_all
|
|
183
|
+
|
|
184
|
+
Show all connections.
|
|
185
|
+
|
|
186
|
+
Use `active` argument to show only active connections.
|
|
187
|
+
|
|
188
|
+
```
|
|
189
|
+
nmcli.connection.show_all(active: bool = False) -> List[Connection]
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
#### nmcli.connection.reload
|
|
193
|
+
|
|
194
|
+
Reload all connection files from disk.
|
|
195
|
+
|
|
196
|
+
```
|
|
197
|
+
nmcli.connection.reload() -> None
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
### device
|
|
201
|
+
|
|
202
|
+
#### nmcli.device
|
|
203
|
+
|
|
204
|
+
Print status of devices.
|
|
205
|
+
|
|
206
|
+
```
|
|
207
|
+
nmcli.device() -> List[Device]
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
#### nmcli.device.status
|
|
211
|
+
|
|
212
|
+
Show status for all devices.
|
|
213
|
+
|
|
214
|
+
```
|
|
215
|
+
nmcli.device.status() -> List[Device]
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
#### nmcli.device.show
|
|
219
|
+
|
|
220
|
+
Show details of device.
|
|
221
|
+
|
|
222
|
+
The `fields` argument applies the same effect to the command as the `-f | --fields` option. If it is omitted, the default behavior is followed.
|
|
223
|
+
|
|
224
|
+
```
|
|
225
|
+
nmcli.device.show(ifname: str, fields: str = None) -> DeviceDetails
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
#### nmcli.device.show_all
|
|
229
|
+
|
|
230
|
+
Show details of devices.
|
|
231
|
+
|
|
232
|
+
The `fields` argument applies the same effect to the command as the `-f | --fields` option. If it is omitted, the default behavior is followed.
|
|
233
|
+
|
|
234
|
+
```
|
|
235
|
+
nmcli.device.show_all(fields: str = None) -> List[DeviceDetails]
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
#### nmcli.device.up
|
|
239
|
+
|
|
240
|
+
Connect the device.
|
|
241
|
+
|
|
242
|
+
The `wait` argument applies the same effect to the command as the `--wait` option. If it is omitted, the default behavior is followed.
|
|
243
|
+
|
|
244
|
+
```
|
|
245
|
+
nmcli.device.up(ifname: str, wait: int = None) -> None
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
#### nmcli.device.connect
|
|
249
|
+
|
|
250
|
+
Connect the device.
|
|
251
|
+
|
|
252
|
+
The `wait` argument applies the same effect to the command as the `--wait` option. If it is omitted, the default behavior is followed.
|
|
253
|
+
|
|
254
|
+
```
|
|
255
|
+
nmcli.device.connect(ifname: str, wait: int = None) -> None
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
#### nmcli.device.down
|
|
259
|
+
|
|
260
|
+
Disconnect a device and prevent the device from automatically activating further connections without user/manual intervention.
|
|
261
|
+
|
|
262
|
+
The `wait` argument applies the same effect to the command as the `--wait` option. If it is omitted, the default behavior is followed.
|
|
263
|
+
|
|
264
|
+
```
|
|
265
|
+
nmcli.device.down(ifname: str, wait: int = None) -> None
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
#### nmcli.device.disconnect
|
|
269
|
+
|
|
270
|
+
Disconnect devices.
|
|
271
|
+
|
|
272
|
+
The `wait` argument applies the same effect to the command as the `--wait` option. If it is omitted, the default behavior is followed.
|
|
273
|
+
|
|
274
|
+
```
|
|
275
|
+
nmcli.device.disconnect(ifname: str, wait: int = None) -> None
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
#### nmcli.device.reapply
|
|
279
|
+
|
|
280
|
+
Attempts to update device with changes to the currently active connection made since it was last applied.
|
|
281
|
+
|
|
282
|
+
```
|
|
283
|
+
nmcli.device.reapply(ifname: str) -> None
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
#### nmcli.device.delete
|
|
287
|
+
|
|
288
|
+
Delete the software devices.
|
|
289
|
+
|
|
290
|
+
The `wait` argument applies the same effect to the command as the `--wait` option. If it is omitted, the default behavior is followed.
|
|
291
|
+
|
|
292
|
+
```
|
|
293
|
+
nmcli.device.delete(ifname: str, wait: int = None) -> None
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
#### nmcli.device.wifi
|
|
297
|
+
|
|
298
|
+
List available Wi-Fi access points.
|
|
299
|
+
|
|
300
|
+
```
|
|
301
|
+
nmcli.device.wifi(ifname: str = None, rescan: bool = None) -> List[DeviceWifi]
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
#### nmcli.device.wifi_connect
|
|
305
|
+
|
|
306
|
+
Connect to a Wi-Fi network specified by SSID or BSSID.
|
|
307
|
+
|
|
308
|
+
The `wait` argument applies the same effect to the command as the `--wait` option. If it is omitted, the default behavior is followed.
|
|
309
|
+
|
|
310
|
+
```
|
|
311
|
+
nmcli.device.wifi_connect(ssid: str,
|
|
312
|
+
password: str,
|
|
313
|
+
ifname: str = None,
|
|
314
|
+
wait: int = None) -> None
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
#### nmcli.device.wifi_hotspot
|
|
318
|
+
|
|
319
|
+
Create a Wi-Fi hotspot
|
|
320
|
+
|
|
321
|
+
```
|
|
322
|
+
nmcli.device.wifi_hotspot(ifname: str = None,
|
|
323
|
+
con_name: str = None,
|
|
324
|
+
ssid: str = None,
|
|
325
|
+
band: str = None,
|
|
326
|
+
channel: int = None,
|
|
327
|
+
password: str = None) -> Hotspot
|
|
328
|
+
```
|
|
329
|
+
|
|
330
|
+
#### nmcli.device.wifi_rescan
|
|
331
|
+
|
|
332
|
+
Request that NetworkManager immediately re-scan for available access points.
|
|
333
|
+
|
|
334
|
+
```
|
|
335
|
+
nmcli.device.wifi_rescan(ifname: str = None, ssid: str = None) -> None
|
|
336
|
+
```
|
|
337
|
+
|
|
338
|
+
### general
|
|
339
|
+
|
|
340
|
+
#### nmcli.general
|
|
341
|
+
|
|
342
|
+
Show overall status of NetworkManager.
|
|
343
|
+
|
|
344
|
+
```
|
|
345
|
+
nmcli.general() -> General
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
#### nmcli.general.status
|
|
349
|
+
|
|
350
|
+
Show overall status of NetworkManager.
|
|
351
|
+
|
|
352
|
+
```
|
|
353
|
+
nmcli.general.status() -> General
|
|
354
|
+
```
|
|
355
|
+
|
|
356
|
+
#### nmcli.general.get_hostname
|
|
357
|
+
|
|
358
|
+
Get persistent system hostname.
|
|
359
|
+
|
|
360
|
+
```
|
|
361
|
+
nmcli.general.get_hostname() -> str
|
|
362
|
+
```
|
|
363
|
+
|
|
364
|
+
#### nmcli.general.set_hostname
|
|
365
|
+
|
|
366
|
+
Change persistent system hostname.
|
|
367
|
+
|
|
368
|
+
```
|
|
369
|
+
nmcli.general.set_hostname(hostname: str) -> None
|
|
370
|
+
```
|
|
371
|
+
|
|
372
|
+
#### nmcli.general.reload
|
|
373
|
+
|
|
374
|
+
Reload NetworkManager's configuration and perform certain updates.
|
|
375
|
+
|
|
376
|
+
The `flags` argument specifies which configurations to reload. Valid flags are:
|
|
377
|
+
- `conf`: Reload NetworkManager.conf configuration from disk
|
|
378
|
+
- `dns-rc`: Update DNS configuration (equivalent to SIGUSR1)
|
|
379
|
+
- `dns-full`: Restart the DNS plugin
|
|
380
|
+
|
|
381
|
+
If no flags are provided, everything that is supported is reloaded.
|
|
382
|
+
|
|
383
|
+
```
|
|
384
|
+
nmcli.general.reload(flags: Optional[List[str]] = None) -> None
|
|
385
|
+
```
|
|
386
|
+
|
|
387
|
+
### networking
|
|
388
|
+
|
|
389
|
+
#### nmcli.networking
|
|
390
|
+
|
|
391
|
+
Get network connectivity state.
|
|
392
|
+
|
|
393
|
+
```
|
|
394
|
+
nmcli.networking() -> NetworkConnectivity
|
|
395
|
+
```
|
|
396
|
+
|
|
397
|
+
#### nmcli.networking.on
|
|
398
|
+
|
|
399
|
+
Switch networking on.
|
|
400
|
+
|
|
401
|
+
```
|
|
402
|
+
nmcli.networking.on() -> None
|
|
403
|
+
```
|
|
404
|
+
|
|
405
|
+
#### nmcli.networking.off
|
|
406
|
+
|
|
407
|
+
Switch networking off.
|
|
408
|
+
|
|
409
|
+
```
|
|
410
|
+
nmcli.networking.off() -> None
|
|
411
|
+
```
|
|
412
|
+
|
|
413
|
+
#### nmcli.networking.connectivity
|
|
414
|
+
|
|
415
|
+
Get network connectivity state.
|
|
416
|
+
|
|
417
|
+
The optional 'check' argument makes NetworkManager re-check the connectivity.
|
|
418
|
+
|
|
419
|
+
```
|
|
420
|
+
nmcli.networking.connectivity(check:bool = False) -> NetworkConnectivity
|
|
421
|
+
```
|
|
422
|
+
|
|
423
|
+
### radio
|
|
424
|
+
|
|
425
|
+
#### nmcli.radio
|
|
426
|
+
|
|
427
|
+
Get status of all radio switches.
|
|
428
|
+
|
|
429
|
+
```
|
|
430
|
+
nmcli.radio() -> Radio
|
|
431
|
+
```
|
|
432
|
+
|
|
433
|
+
#### nmcli.radio.all
|
|
434
|
+
|
|
435
|
+
Get status of all radio switches.
|
|
436
|
+
|
|
437
|
+
```
|
|
438
|
+
nmcli.radio.all() -> Radio
|
|
439
|
+
```
|
|
440
|
+
|
|
441
|
+
#### nmcli.radio.all_on
|
|
442
|
+
|
|
443
|
+
Turn on all radio switches.
|
|
444
|
+
|
|
445
|
+
```
|
|
446
|
+
nmcli.radio.all_on() -> None
|
|
447
|
+
```
|
|
448
|
+
|
|
449
|
+
#### nmcli.radio.all_off
|
|
450
|
+
|
|
451
|
+
Turn off all radio switches.
|
|
452
|
+
|
|
453
|
+
```
|
|
454
|
+
nmcli.radio.all_off() -> None
|
|
455
|
+
```
|
|
456
|
+
|
|
457
|
+
#### nmcli.radio.wifi
|
|
458
|
+
|
|
459
|
+
Get status of Wi-Fi radio switch.
|
|
460
|
+
|
|
461
|
+
```
|
|
462
|
+
nmcli.radio.wifi() -> bool
|
|
463
|
+
```
|
|
464
|
+
|
|
465
|
+
#### nmcli.radio.wifi_on
|
|
466
|
+
|
|
467
|
+
Turn on Wi-Fi radio switches.
|
|
468
|
+
|
|
469
|
+
```
|
|
470
|
+
nmcli.radio.wifi_on() -> None
|
|
471
|
+
```
|
|
472
|
+
|
|
473
|
+
#### nmcli.radio.wifi_off
|
|
474
|
+
|
|
475
|
+
Turn off Wi-Fi radio switches.
|
|
476
|
+
|
|
477
|
+
```
|
|
478
|
+
nmcli.radio.wifi_off() -> None
|
|
479
|
+
```
|
|
480
|
+
|
|
481
|
+
#### nmcli.radio.wwan
|
|
482
|
+
|
|
483
|
+
Get status of mobile broadband radio switch.
|
|
484
|
+
|
|
485
|
+
```
|
|
486
|
+
nmcli.radio.wwan() -> bool
|
|
487
|
+
```
|
|
488
|
+
|
|
489
|
+
#### nmcli.radio.wwan_on
|
|
490
|
+
|
|
491
|
+
Turn on mobile broadband radio switches.
|
|
492
|
+
|
|
493
|
+
```
|
|
494
|
+
nmcli.radio.wwan_on() -> None
|
|
495
|
+
```
|
|
496
|
+
|
|
497
|
+
#### nmcli.radio.wwan_off
|
|
498
|
+
|
|
499
|
+
Turn off mobile broadband radio switches.
|
|
500
|
+
|
|
501
|
+
```
|
|
502
|
+
nmcli.radio.wwan_off() -> None
|
|
503
|
+
```
|
|
504
|
+
|
|
505
|
+
### other
|
|
506
|
+
|
|
507
|
+
#### nmcli.disable_use_sudo
|
|
508
|
+
|
|
509
|
+
Disable the use of sudo.
|
|
510
|
+
|
|
511
|
+
```
|
|
512
|
+
nmcli.disable_use_sudo() -> None
|
|
513
|
+
```
|
|
514
|
+
|
|
515
|
+
#### nmcli.set_lang
|
|
516
|
+
|
|
517
|
+
Change the environment variable LANG from the default `C`.
|
|
518
|
+
Run this command when you want to use `C.UTF-8`.
|
|
519
|
+
|
|
520
|
+
```
|
|
521
|
+
nmcli.set_lang(lang: str) -> None
|
|
522
|
+
```
|
|
523
|
+
|
|
524
|
+
## Change Log
|
|
525
|
+
|
|
526
|
+
### 1.7.0
|
|
527
|
+
|
|
528
|
+
- Added `nmcli.connection.show_all` method with active filtering support
|
|
529
|
+
- Added `nmcli.device.up` and `nmcli.device.down` methods
|
|
530
|
+
- Added `nmcli.general.reload` method with configuration flags support
|
|
531
|
+
|
|
532
|
+
### 1.6.0
|
|
533
|
+
|
|
534
|
+
- Added active option to `nmcli.connection.show`
|
|
535
|
+
|
|
536
|
+
### 1.5.0
|
|
537
|
+
|
|
538
|
+
- Added show_secrets option to `nmcli.connection.show`
|
|
539
|
+
|
|
540
|
+
### 1.4.0
|
|
541
|
+
|
|
542
|
+
- Supported unsupported cases of `DeviceWifi.parse`.
|
|
543
|
+
- Fixed the problem that `nmcli.general` does not work on nmcli client after version 1.48.x.
|
|
544
|
+
|
|
545
|
+
### 1.3.0
|
|
546
|
+
|
|
547
|
+
- Added rescan parameter to `nmcli.device.wifi`.
|
|
548
|
+
|
|
549
|
+
### 1.2.0
|
|
550
|
+
|
|
551
|
+
- Added support for encodings other than UTF-8.
|
|
552
|
+
|
|
553
|
+
### 1.1.2
|
|
554
|
+
|
|
555
|
+
- Fixed a problem with environment variables being scraped.
|
|
556
|
+
|
|
557
|
+
### 1.1.1
|
|
558
|
+
|
|
559
|
+
- Include LICENSE.txt in the tar.
|
|
560
|
+
|
|
561
|
+
### 1.1.0
|
|
562
|
+
|
|
563
|
+
- Added fields option to `nmcli.device.show` and `nmcli.device.show_all`
|
|
564
|
+
|
|
565
|
+
### 1.0.0
|
|
566
|
+
|
|
567
|
+
- Handle connection failure exceptions with `nmcli.device.wifi_connect`.
|
|
568
|
+
- Added wait param to `nmcli.connection.delete`, `nmcli.connection.up`, `nmcli.connection.down`, `nmcli.device.connect`, `nmcli.device.disconnect`, `nmcli.device.delete`, `nmcli.device.wifi_connect`.
|
|
569
|
+
|
|
570
|
+
### 0.9.0
|
|
571
|
+
|
|
572
|
+
- Added ifname param to wifi.
|
|
573
|
+
|
|
574
|
+
### 0.8.0
|
|
575
|
+
|
|
576
|
+
- Added support for changing the LANG environment variable.
|
|
577
|
+
|
|
578
|
+
### 0.7.0
|
|
579
|
+
|
|
580
|
+
- Added ifname param to wifi_connect.
|
|
581
|
+
|
|
582
|
+
### 0.6.1
|
|
583
|
+
|
|
584
|
+
- Fixed a bug in the autoconnect parameter of the nmcli.connection.add method (made the default value conform to the specification of nmcli connection add).
|
|
585
|
+
|
|
586
|
+
### 0.6.0
|
|
587
|
+
|
|
588
|
+
- Added BSSID and FREQ to DeviceWifi.
|
|
589
|
+
|
|
590
|
+
### 0.5.0
|
|
591
|
+
|
|
592
|
+
- Added support for "nmcli device wifi hotspot".
|
|
593
|
+
- Added support for "nmcli device wifi rescan".
|
|
594
|
+
|
|
595
|
+
### 0.4.2
|
|
596
|
+
|
|
597
|
+
- Fixed the parsing of device wifi.
|
|
598
|
+
|
|
599
|
+
### 0.4.1
|
|
600
|
+
|
|
601
|
+
- Fixed parsing when SSID has a space.
|
|
602
|
+
|
|
603
|
+
### 0.4.0
|
|
604
|
+
|
|
605
|
+
- Added disabling of sudo usage.
|
|
606
|
+
- Added support for parsing the execution results of recent versions of the nmcli device wifi command.
|
|
607
|
+
|
|
608
|
+
### 0.3.1
|
|
609
|
+
|
|
610
|
+
- Fixed device status and device wifi parsing bug.
|
|
611
|
+
|
|
612
|
+
### 0.3.0
|
|
613
|
+
|
|
614
|
+
- Added networking and radio APIs.
|
|
615
|
+
- Added more APIs for connection, device and general.
|
|
616
|
+
- Changed the properties of the General data class.
|
|
617
|
+
- Changed throw a ValueError exception if the regular expression pattern is not matched.
|
|
618
|
+
|
|
619
|
+
### 0.2.2
|
|
620
|
+
|
|
621
|
+
- Fix the parsing bug of connection names that contain spaces (connection.show).
|
|
622
|
+
- Added getting items that begin with a capital letter.
|
|
623
|
+
|
|
624
|
+
### 0.2.1
|
|
625
|
+
|
|
626
|
+
- Fix the parsing bug of connection names that contain spaces.
|
|
627
|
+
|
|
628
|
+
### 0.2.0
|
|
629
|
+
|
|
630
|
+
- Added dummy classes.
|
|
631
|
+
|
|
632
|
+
### 0.1.0
|
|
633
|
+
|
|
634
|
+
- Initial release.
|
|
635
|
+
|
|
636
|
+
## License
|
|
637
|
+
|
|
638
|
+
MIT
|