-
Notifications
You must be signed in to change notification settings - Fork 598
API design: Fleet-maintained apps for macOS #21801
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
8295ad9
27d0734
84207ac
b2de7fa
9e6b563
f0aa19e
6293fc3
97b7fb1
e1fda54
f41a3b8
b5063f9
46aada2
484446a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -8485,6 +8485,9 @@ Deletes the session specified by ID. When the user associated with the session n | |||
- [Add package](#add-package) | ||||
- [List App Store apps](#list-app-store-apps) | ||||
- [Add App Store app](#add-app-store-app) | ||||
- [List Fleet library apps](#list-fleet-library-apps) | ||||
- [Get Fleet library app](#get-fleet-library-app) | ||||
- [Add Fleet library app](#add-fleet-library-app) | ||||
- [Install package or App Store app](#install-package-or-app-store-app) | ||||
- [Get package install result](#get-package-install-result) | ||||
- [Download package](#download-package) | ||||
|
@@ -9122,7 +9125,7 @@ Add App Store (VPP) app purchased in Apple Business Manager. | |||
|
||||
#### Example | ||||
|
||||
`POST /api/v1/fleet/software/app_store_apps?team_id=3` | ||||
`POST /api/v1/fleet/software/app_store_apps` | ||||
|
||||
##### Request body | ||||
|
||||
|
@@ -9138,6 +9141,125 @@ Add App Store (VPP) app purchased in Apple Business Manager. | |||
|
||||
`Status: 200` | ||||
|
||||
### List Fleet library apps | ||||
|
||||
> **Experimental feature**. This feature is undergoing rapid improvement, which may result in breaking changes to the API or configuration surface. It is not recommended for use in automated workflows. | ||||
|
||||
List available Fleet library apps. | ||||
|
||||
`GET /api/v1/fleet/software/fleet_library_apps` | ||||
marko-lisica marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Dev note:List only apps that haven't added to a team yet.
|
||||
|
||||
#### Parameters | ||||
|
||||
| Name | Type | In | Description | | ||||
| ---- | ---- | -- | ----------- | | ||||
| team_id | integer | query | **Required**. The team ID. Filters Fleet library apps to only include apps available for the specified team. | | ||||
|
||||
#### Example | ||||
|
||||
`GET /api/v1/fleet/software/fleet_library_apps?team_id=3` | ||||
|
||||
|
||||
##### Default response | ||||
|
||||
`Status: 200` | ||||
|
||||
```json | ||||
{ | ||||
marko-lisica marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
"fleet_library_apps": [ | ||||
{ | ||||
"id": "1", | ||||
"name": "1Password", | ||||
"version": "8.10.40", | ||||
"platform": "darwin" | ||||
}, | ||||
{ | ||||
"id": "2", | ||||
"name": "Adobe Acrobat Reader", | ||||
"version": "24.002.21005", | ||||
"platform": "darwin" | ||||
}, | ||||
{ | ||||
"id": "3", | ||||
"name": "Box Drive", | ||||
"version": "2.39.179", | ||||
"platform": "darwin" | ||||
}, | ||||
] | ||||
} | ||||
``` | ||||
|
||||
### Get Fleet library app | ||||
|
||||
> **Experimental feature**. This feature is undergoing rapid improvement, which may result in breaking changes to the API or configuration surface. It is not recommended for use in automated workflows. | ||||
|
||||
Returns information about the specified Fleet library app. | ||||
|
||||
`GET /api/v1/fleet/software/fleet_library_apps/:id` | ||||
|
||||
#### Parameters | ||||
|
||||
| Name | Type | In | Description | | ||||
| ---- | ---- | -- | ----------- | | ||||
| id | integer | path | **Required.** The Fleet library app's ID. | | ||||
| team_id | integer | query | _Available in Fleet Premium_. Filters response data to the specified team. Use `0` to filter by hosts assigned to "No team" (default: 0). | | ||||
marko-lisica marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
|
||||
#### Example | ||||
|
||||
`GET /api/v1/fleet/software/fleet_library_apps/1?team_id=3` | ||||
|
||||
##### Default response | ||||
|
||||
`Status: 200` | ||||
|
||||
```json | ||||
{ | ||||
"fleet_library_app": { | ||||
"id": 1, | ||||
"name": "1Password", | ||||
"file_name": "1Password-8.10.44-aarch64.zip", | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @marko-lisica The filename seems to be the installer's filename from this example. We don't have this info explicitly in the brew API, should I fill this with just the last section of the installer's URL? In most case this would give a sensible filename like what you have here, but for some apps (like WhatsApp: (side-note: I think this should be called There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hey @mna, is there any other way to retrieve I agree, we should be consistent and use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We cannot download it at the time we process the brew metadata, as this cron job only calls the JSON API, it does not start downloading the installers (we do this only when adding the maintained app to a team). I'm curious though - what is the purpose of that field besides a light (non-critical) piece of information? Given a URL like WhatsApp , the filename of the installer could be whatever we want it to be (i.e. this is just a URL that sends some bytes, we can save those bytes under whatever filename we want). I'm thinking we could just generate a filename from the app name and installer type in this case (e.g. "whatsapp.dmg"). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @mna I think I added it so users understand what will be added to Fleet. Is it .pkg, .dmg, or something else. They'll see the $INSTALLER_PATH variable in the install script, it will help understand what's behind that variable. Since you brought this up, I think we should probably remove it or convey information that the installer will be downloaded and uploaded to Fleet server in a different way. I'm going to bring this to design review today for expedited drafting. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Gotcha, makes sense.
Sounds good, not a blocker for the moment but of course the sooner we can clarify, the better. Thanks! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @marko-lisica correct, yes we (will) have a JSON file that describes the list of maintained apps, (e.g. it contains the "brew identifier" - the part to use in the API call e.g.
Maybe we could add the filename as part of this hard-coded JSON file? Only thing is if we want to include the version as part of the filename, that part is dynamic (we could make the filename some kind of template string that we fill with brew data). But that's a possibility! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I didn't know that we'd hardcode
Could we simplify that, so I think if we want accurate name we'll need it dynamic (template string that we fill with brew data) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Absolutely! Makes sense to me.
Allright, so we want the version in there and the extension to reflect its format, correct? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @marko-lisica sounds good, thanks! |
||||
"version": "8.10.40", | ||||
"platform": "darwin", | ||||
"install_script": "#!/bin/sh\ninstaller -pkg \"$INSTALLER_PATH\" -target /", | ||||
"uninstall_script": "#!/bin/sh\npkg_ids=$PACKAGE_ID\nfor pkg_id in '${pkg_ids[@]}'...", | ||||
} | ||||
} | ||||
``` | ||||
|
||||
### Add Fleet library app | ||||
|
||||
> **Experimental feature**. This feature is undergoing rapid improvement, which may result in breaking changes to the API or configuration surface. It is not recommended for use in automated workflows. | ||||
|
||||
_Available in Fleet Premium._ | ||||
|
||||
Add app from Fleet library. | ||||
|
||||
`POST /api/v1/fleet/software/fleet_library_apps` | ||||
lukeheath marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
|
||||
#### Parameters | ||||
|
||||
| Name | Type | In | Description | | ||||
| ---- | ---- | -- | ----------- | | ||||
| fleet_library_app_id | string | body | **Required.** The ID of Fleet library app. | | ||||
| team_id | integer | body | **Required**. The team ID. Adds Fleet library app to the specified team. | | ||||
|
||||
#### Example | ||||
|
||||
`POST /api/v1/fleet/software/fleet_library_apps` | ||||
|
||||
##### Request body | ||||
|
||||
```json | ||||
{ | ||||
"fleet_library_app_id": "3", | ||||
"team_id": 2, | ||||
} | ||||
``` | ||||
|
||||
##### Default response | ||||
|
||||
`Status: 200` | ||||
|
||||
### Download package | ||||
|
||||
> **Experimental feature**. This feature is undergoing rapid improvement, which may result in breaking changes to the API or configuration surface. It is not recommended for use in automated workflows. | ||||
|
Uh oh!
There was an error while loading. Please reload this page.