greenlake-activate-cli 0.2.0__tar.gz → 0.2.2__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.
- {greenlake_activate_cli-0.2.0 → greenlake_activate_cli-0.2.2}/PKG-INFO +21 -23
- {greenlake_activate_cli-0.2.0 → greenlake_activate_cli-0.2.2}/README.md +19 -21
- {greenlake_activate_cli-0.2.0 → greenlake_activate_cli-0.2.2}/pyproject.toml +2 -2
- {greenlake_activate_cli-0.2.0 → greenlake_activate_cli-0.2.2}/src/glcli/cli.py +13 -0
- {greenlake_activate_cli-0.2.0 → greenlake_activate_cli-0.2.2}/src/greenlake_activate_cli.egg-info/PKG-INFO +21 -23
- {greenlake_activate_cli-0.2.0 → greenlake_activate_cli-0.2.2}/setup.cfg +0 -0
- {greenlake_activate_cli-0.2.0 → greenlake_activate_cli-0.2.2}/src/glcli/__init__.py +0 -0
- {greenlake_activate_cli-0.2.0 → greenlake_activate_cli-0.2.2}/src/glcli/activate_login.py +0 -0
- {greenlake_activate_cli-0.2.0 → greenlake_activate_cli-0.2.2}/src/glcli/data_parsing.py +0 -0
- {greenlake_activate_cli-0.2.0 → greenlake_activate_cli-0.2.2}/src/glcli/display_data.py +0 -0
- {greenlake_activate_cli-0.2.0 → greenlake_activate_cli-0.2.2}/src/glcli/query_folder.py +0 -0
- {greenlake_activate_cli-0.2.0 → greenlake_activate_cli-0.2.2}/src/glcli/query_inventory.py +0 -0
- {greenlake_activate_cli-0.2.0 → greenlake_activate_cli-0.2.2}/src/greenlake_activate_cli.egg-info/SOURCES.txt +0 -0
- {greenlake_activate_cli-0.2.0 → greenlake_activate_cli-0.2.2}/src/greenlake_activate_cli.egg-info/dependency_links.txt +0 -0
- {greenlake_activate_cli-0.2.0 → greenlake_activate_cli-0.2.2}/src/greenlake_activate_cli.egg-info/entry_points.txt +0 -0
- {greenlake_activate_cli-0.2.0 → greenlake_activate_cli-0.2.2}/src/greenlake_activate_cli.egg-info/requires.txt +0 -0
- {greenlake_activate_cli-0.2.0 → greenlake_activate_cli-0.2.2}/src/greenlake_activate_cli.egg-info/top_level.txt +0 -0
- {greenlake_activate_cli-0.2.0 → greenlake_activate_cli-0.2.2}/tests/test_activate_login.py +0 -0
- {greenlake_activate_cli-0.2.0 → greenlake_activate_cli-0.2.2}/tests/test_cli.py +0 -0
- {greenlake_activate_cli-0.2.0 → greenlake_activate_cli-0.2.2}/tests/test_configure.py +0 -0
- {greenlake_activate_cli-0.2.0 → greenlake_activate_cli-0.2.2}/tests/test_data_parsing.py +0 -0
- {greenlake_activate_cli-0.2.0 → greenlake_activate_cli-0.2.2}/tests/test_query_folder.py +0 -0
- {greenlake_activate_cli-0.2.0 → greenlake_activate_cli-0.2.2}/tests/test_query_inventory.py +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: greenlake-activate-cli
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.2
|
|
4
4
|
Summary: A CLI tool used to interact with HPE GreenLake Activate
|
|
5
|
-
Requires-Python: >=3.
|
|
5
|
+
Requires-Python: >=3.12
|
|
6
6
|
Description-Content-Type: text/markdown
|
|
7
7
|
Requires-Dist: python-dotenv>=1.2.3
|
|
8
8
|
Requires-Dist: requests>=2.34.2
|
|
@@ -30,10 +30,20 @@ The CLI uses the following Python packages, which are installed automatically:
|
|
|
30
30
|
|
|
31
31
|
## Installation
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
I recommend installing this package with `uv`. [Install uv](https://docs.astral.sh/uv/getting-started/installation/) if it is not already available.
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
Installing uv on Linux/Mac:
|
|
36
|
+
```sh
|
|
37
|
+
curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Installing uv on Windows:
|
|
41
|
+
|
|
42
|
+
```ps
|
|
43
|
+
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
---
|
|
37
47
|
|
|
38
48
|
To install the latest published package as a global command:
|
|
39
49
|
|
|
@@ -41,17 +51,17 @@ To install the latest published package as a global command:
|
|
|
41
51
|
uv tool install greenlake-activate-cli
|
|
42
52
|
```
|
|
43
53
|
|
|
44
|
-
|
|
45
|
-
any directory. If uv reports that its tool directory is not on your `PATH`, run:
|
|
54
|
+
Verify the installation:
|
|
46
55
|
|
|
47
56
|
```sh
|
|
48
|
-
|
|
57
|
+
glcli --version
|
|
49
58
|
```
|
|
50
59
|
|
|
51
|
-
|
|
60
|
+
This installs the CLI in an isolated environment and makes `glcli` available from
|
|
61
|
+
any directory. If uv reports that its tool directory is not on your `PATH`, run:
|
|
52
62
|
|
|
53
63
|
```sh
|
|
54
|
-
|
|
64
|
+
uv tool update-shell
|
|
55
65
|
```
|
|
56
66
|
|
|
57
67
|
To upgrade or remove the installed CLI:
|
|
@@ -76,7 +86,7 @@ python -m pip install .
|
|
|
76
86
|
The `glcli` command is then available directly:
|
|
77
87
|
|
|
78
88
|
```sh
|
|
79
|
-
glcli --
|
|
89
|
+
glcli --version
|
|
80
90
|
```
|
|
81
91
|
|
|
82
92
|
## Configure Credentials
|
|
@@ -136,14 +146,8 @@ Query inventory by folder ID or folder name:
|
|
|
136
146
|
```sh
|
|
137
147
|
glcli query folder 5297450
|
|
138
148
|
glcli query folder SiteA-South
|
|
139
|
-
glcli query folder SiteA-South 5389522
|
|
140
149
|
```
|
|
141
150
|
|
|
142
|
-
Folder names are matched case-insensitively and exactly. Numeric values are treated
|
|
143
|
-
as folder IDs. Folder names are resolved through Activate before the inventory query;
|
|
144
|
-
unknown or ambiguous names are rejected. Folder queries currently accept positional
|
|
145
|
-
values only and do not support `--file`.
|
|
146
|
-
|
|
147
151
|
Serial numbers and MAC addresses can also be loaded from CSV or newline-delimited files:
|
|
148
152
|
|
|
149
153
|
```sh
|
|
@@ -162,9 +166,3 @@ glcli --verbose query serial PHWLKAS02
|
|
|
162
166
|
|
|
163
167
|
Exit codes are `0` for a complete result, `1` when no devices are returned, and
|
|
164
168
|
`2` when at least one requested identifier is missing.
|
|
165
|
-
|
|
166
|
-
Run the offline tests with:
|
|
167
|
-
|
|
168
|
-
```sh
|
|
169
|
-
uv run pytest
|
|
170
|
-
```
|
|
@@ -19,10 +19,20 @@ The CLI uses the following Python packages, which are installed automatically:
|
|
|
19
19
|
|
|
20
20
|
## Installation
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
I recommend installing this package with `uv`. [Install uv](https://docs.astral.sh/uv/getting-started/installation/) if it is not already available.
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
Installing uv on Linux/Mac:
|
|
25
|
+
```sh
|
|
26
|
+
curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Installing uv on Windows:
|
|
30
|
+
|
|
31
|
+
```ps
|
|
32
|
+
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
---
|
|
26
36
|
|
|
27
37
|
To install the latest published package as a global command:
|
|
28
38
|
|
|
@@ -30,17 +40,17 @@ To install the latest published package as a global command:
|
|
|
30
40
|
uv tool install greenlake-activate-cli
|
|
31
41
|
```
|
|
32
42
|
|
|
33
|
-
|
|
34
|
-
any directory. If uv reports that its tool directory is not on your `PATH`, run:
|
|
43
|
+
Verify the installation:
|
|
35
44
|
|
|
36
45
|
```sh
|
|
37
|
-
|
|
46
|
+
glcli --version
|
|
38
47
|
```
|
|
39
48
|
|
|
40
|
-
|
|
49
|
+
This installs the CLI in an isolated environment and makes `glcli` available from
|
|
50
|
+
any directory. If uv reports that its tool directory is not on your `PATH`, run:
|
|
41
51
|
|
|
42
52
|
```sh
|
|
43
|
-
|
|
53
|
+
uv tool update-shell
|
|
44
54
|
```
|
|
45
55
|
|
|
46
56
|
To upgrade or remove the installed CLI:
|
|
@@ -65,7 +75,7 @@ python -m pip install .
|
|
|
65
75
|
The `glcli` command is then available directly:
|
|
66
76
|
|
|
67
77
|
```sh
|
|
68
|
-
glcli --
|
|
78
|
+
glcli --version
|
|
69
79
|
```
|
|
70
80
|
|
|
71
81
|
## Configure Credentials
|
|
@@ -125,14 +135,8 @@ Query inventory by folder ID or folder name:
|
|
|
125
135
|
```sh
|
|
126
136
|
glcli query folder 5297450
|
|
127
137
|
glcli query folder SiteA-South
|
|
128
|
-
glcli query folder SiteA-South 5389522
|
|
129
138
|
```
|
|
130
139
|
|
|
131
|
-
Folder names are matched case-insensitively and exactly. Numeric values are treated
|
|
132
|
-
as folder IDs. Folder names are resolved through Activate before the inventory query;
|
|
133
|
-
unknown or ambiguous names are rejected. Folder queries currently accept positional
|
|
134
|
-
values only and do not support `--file`.
|
|
135
|
-
|
|
136
140
|
Serial numbers and MAC addresses can also be loaded from CSV or newline-delimited files:
|
|
137
141
|
|
|
138
142
|
```sh
|
|
@@ -151,9 +155,3 @@ glcli --verbose query serial PHWLKAS02
|
|
|
151
155
|
|
|
152
156
|
Exit codes are `0` for a complete result, `1` when no devices are returned, and
|
|
153
157
|
`2` when at least one requested identifier is missing.
|
|
154
|
-
|
|
155
|
-
Run the offline tests with:
|
|
156
|
-
|
|
157
|
-
```sh
|
|
158
|
-
uv run pytest
|
|
159
|
-
```
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "greenlake-activate-cli"
|
|
3
|
-
version = "0.2.
|
|
3
|
+
version = "0.2.2"
|
|
4
4
|
description = "A CLI tool used to interact with HPE GreenLake Activate"
|
|
5
5
|
readme = "README.md"
|
|
6
|
-
requires-python = ">=3.
|
|
6
|
+
requires-python = ">=3.12"
|
|
7
7
|
dependencies = [
|
|
8
8
|
"python-dotenv>=1.2.3",
|
|
9
9
|
"requests>=2.34.2",
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import logging
|
|
2
|
+
from importlib.metadata import PackageNotFoundError, version
|
|
2
3
|
from pathlib import Path
|
|
3
4
|
|
|
4
5
|
import typer
|
|
@@ -23,6 +24,17 @@ def setup_logging(verbose: bool):
|
|
|
23
24
|
logging.getLogger("urllib3").setLevel(logging.WARNING)
|
|
24
25
|
|
|
25
26
|
|
|
27
|
+
def get_version() -> str:
|
|
28
|
+
try:
|
|
29
|
+
return version("greenlake-activate-cli")
|
|
30
|
+
except PackageNotFoundError:
|
|
31
|
+
return "dev"
|
|
32
|
+
|
|
33
|
+
def show_version(value:bool) -> None:
|
|
34
|
+
if value:
|
|
35
|
+
typer.echo(f"glcli {get_version()}")
|
|
36
|
+
raise typer.Exit()
|
|
37
|
+
|
|
26
38
|
def _load_credential() -> str:
|
|
27
39
|
try:
|
|
28
40
|
return load_credentials()
|
|
@@ -89,6 +101,7 @@ def _query_folder(values: list[str]) -> None:
|
|
|
89
101
|
@app.callback()
|
|
90
102
|
def main_callback(
|
|
91
103
|
verbose: bool = typer.Option(False, "--verbose", "-v", help="Enable debugging output to console."),
|
|
104
|
+
version: bool = typer.Option(False, "--version", callback=show_version, is_eager=True, help="Show the installed version.")
|
|
92
105
|
) -> None:
|
|
93
106
|
setup_logging(verbose)
|
|
94
107
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: greenlake-activate-cli
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.2
|
|
4
4
|
Summary: A CLI tool used to interact with HPE GreenLake Activate
|
|
5
|
-
Requires-Python: >=3.
|
|
5
|
+
Requires-Python: >=3.12
|
|
6
6
|
Description-Content-Type: text/markdown
|
|
7
7
|
Requires-Dist: python-dotenv>=1.2.3
|
|
8
8
|
Requires-Dist: requests>=2.34.2
|
|
@@ -30,10 +30,20 @@ The CLI uses the following Python packages, which are installed automatically:
|
|
|
30
30
|
|
|
31
31
|
## Installation
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
I recommend installing this package with `uv`. [Install uv](https://docs.astral.sh/uv/getting-started/installation/) if it is not already available.
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
Installing uv on Linux/Mac:
|
|
36
|
+
```sh
|
|
37
|
+
curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Installing uv on Windows:
|
|
41
|
+
|
|
42
|
+
```ps
|
|
43
|
+
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
---
|
|
37
47
|
|
|
38
48
|
To install the latest published package as a global command:
|
|
39
49
|
|
|
@@ -41,17 +51,17 @@ To install the latest published package as a global command:
|
|
|
41
51
|
uv tool install greenlake-activate-cli
|
|
42
52
|
```
|
|
43
53
|
|
|
44
|
-
|
|
45
|
-
any directory. If uv reports that its tool directory is not on your `PATH`, run:
|
|
54
|
+
Verify the installation:
|
|
46
55
|
|
|
47
56
|
```sh
|
|
48
|
-
|
|
57
|
+
glcli --version
|
|
49
58
|
```
|
|
50
59
|
|
|
51
|
-
|
|
60
|
+
This installs the CLI in an isolated environment and makes `glcli` available from
|
|
61
|
+
any directory. If uv reports that its tool directory is not on your `PATH`, run:
|
|
52
62
|
|
|
53
63
|
```sh
|
|
54
|
-
|
|
64
|
+
uv tool update-shell
|
|
55
65
|
```
|
|
56
66
|
|
|
57
67
|
To upgrade or remove the installed CLI:
|
|
@@ -76,7 +86,7 @@ python -m pip install .
|
|
|
76
86
|
The `glcli` command is then available directly:
|
|
77
87
|
|
|
78
88
|
```sh
|
|
79
|
-
glcli --
|
|
89
|
+
glcli --version
|
|
80
90
|
```
|
|
81
91
|
|
|
82
92
|
## Configure Credentials
|
|
@@ -136,14 +146,8 @@ Query inventory by folder ID or folder name:
|
|
|
136
146
|
```sh
|
|
137
147
|
glcli query folder 5297450
|
|
138
148
|
glcli query folder SiteA-South
|
|
139
|
-
glcli query folder SiteA-South 5389522
|
|
140
149
|
```
|
|
141
150
|
|
|
142
|
-
Folder names are matched case-insensitively and exactly. Numeric values are treated
|
|
143
|
-
as folder IDs. Folder names are resolved through Activate before the inventory query;
|
|
144
|
-
unknown or ambiguous names are rejected. Folder queries currently accept positional
|
|
145
|
-
values only and do not support `--file`.
|
|
146
|
-
|
|
147
151
|
Serial numbers and MAC addresses can also be loaded from CSV or newline-delimited files:
|
|
148
152
|
|
|
149
153
|
```sh
|
|
@@ -162,9 +166,3 @@ glcli --verbose query serial PHWLKAS02
|
|
|
162
166
|
|
|
163
167
|
Exit codes are `0` for a complete result, `1` when no devices are returned, and
|
|
164
168
|
`2` when at least one requested identifier is missing.
|
|
165
|
-
|
|
166
|
-
Run the offline tests with:
|
|
167
|
-
|
|
168
|
-
```sh
|
|
169
|
-
uv run pytest
|
|
170
|
-
```
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|