Skip to content

Commit 4890aa2

Browse files
committed
updates cli params to match list name and updates readme and cli documentation
1 parent d923bba commit 4890aa2

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,17 +79,17 @@ device_assigned_server = axm_client.list_devices_in_mdm_server(device_id='SERIAL
7979
print(device_assigned_server)
8080

8181
assignment_result = axm_client.assign_unassign_device_to_mdm_server(
82-
device_id='SERIAL_NUMBER',
82+
device_ids=['SERIAL_NUMBER', "ANOTHER_SERIAL_NUMBER"],
8383
server_id="MDM_SERVER_ID",
8484
action="ASSIGN_DEVICES"|"UNASSIGN_DEVICES"
8585
)
86+
print(assignment_result)
8687

8788
apple_care_coverage = axm_client.get_apple_care_coverage(device_id='SERIAL_NUMBER')
8889
print(apple_care_coverage)
8990
```
9091

9192
## Issues:
9293
* need to add tests
93-
* unassign, assign devices need to be able to pass more than 1 device
9494

9595
This is still a work in progress

docs/cli.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,12 @@ Assign one or more devices to an MDM server.
130130
**Usage**:
131131

132132
```console
133-
$ pyaxm-cli assign-device [OPTIONS] DEVICE_ID... SERVER_ID
133+
$ pyaxm-cli assign-device [OPTIONS] DEVICE_IDS... SERVER_ID
134134
```
135135

136136
**Arguments**:
137137

138-
* `DEVICE_ID...`: [required]
138+
* `DEVICE_IDS...`: [required]
139139
* `SERVER_ID`: [required]
140140

141141
**Options**:
@@ -149,12 +149,12 @@ Unassign one or more devices from an MDM server.
149149
**Usage**:
150150

151151
```console
152-
$ pyaxm-cli unassign-device [OPTIONS] DEVICE_ID... SERVER_ID
152+
$ pyaxm-cli unassign-device [OPTIONS] DEVICE_IDS... SERVER_ID
153153
```
154154

155155
**Arguments**:
156156

157-
* `DEVICE_ID...`: [required]
157+
* `DEVICE_IDS...`: [required]
158158
* `SERVER_ID`: [required]
159159

160160
**Options**:

pyaxm/cli.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,10 @@ def mdm_server_assigned(device_id: Annotated[str, typer.Argument()]):
7272
df.to_csv(sys.stdout, index=False)
7373

7474
@app.command()
75-
def assign_device(device_id: Annotated[List[str], typer.Argument()], server_id: Annotated[str, typer.Argument()]):
75+
def assign_device(device_ids: Annotated[List[str], typer.Argument()], server_id: Annotated[str, typer.Argument()]):
7676
"""Assign one or more devices to an MDM server."""
7777
client = Client()
78-
activity = client.assign_unassign_device_to_mdm_server(device_id, server_id, 'ASSIGN_DEVICES')
78+
activity = client.assign_unassign_device_to_mdm_server(device_ids, server_id, 'ASSIGN_DEVICES')
7979
activity_data = {'id': activity.id}
8080
activity_data.update(activity.attributes.model_dump())
8181
df = pd.DataFrame([activity_data])
@@ -86,10 +86,10 @@ def assign_device(device_id: Annotated[List[str], typer.Argument()], server_id:
8686
typer.echo(f"Report downloaded successfully to: {file_path}")
8787

8888
@app.command()
89-
def unassign_device(device_id: Annotated[List[str], typer.Argument()], server_id: Annotated[str, typer.Argument()]):
89+
def unassign_device(device_ids: Annotated[List[str], typer.Argument()], server_id: Annotated[str, typer.Argument()]):
9090
"""Unassign one or more devices from an MDM server."""
9191
client = Client()
92-
activity = client.assign_unassign_device_to_mdm_server(device_id, server_id, 'UNASSIGN_DEVICES')
92+
activity = client.assign_unassign_device_to_mdm_server(device_ids, server_id, 'UNASSIGN_DEVICES')
9393
activity_data = {'id': activity.id}
9494
activity_data.update(activity.attributes.model_dump())
9595
df = pd.DataFrame([activity_data])

0 commit comments

Comments
 (0)