Skip to content
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

API design: Fleet-maintained apps for macOS #21801

Closed
wants to merge 13 commits into from
132 changes: 131 additions & 1 deletion docs/REST API/rest-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -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-maintained apps](#list-fleet-maintained-apps)
- [Get Fleet-maintained app](#get-fleet-maintained-app)
- [Add Fleet-maintained app](#add-fleet-maintained-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)
Expand Down Expand Up @@ -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

Expand All @@ -9138,6 +9141,133 @@ Add App Store (VPP) app purchased in Apple Business Manager.

`Status: 200`

### List Fleet-maintained 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.
marko-lisica marked this conversation as resolved.
Show resolved Hide resolved

List available Fleet-maintained apps.

`GET /api/v1/fleet/software/fleet_maintained_apps`

#### Parameters

| Name | Type | In | Description |
| ---- | ---- | -- | ----------- |
| team_id | integer | query | **Required**. The team ID. Filters Fleet-maintained apps to only include apps available for the specified team. |
marko-lisica marked this conversation as resolved.
Show resolved Hide resolved

#### Example

`GET /api/v1/fleet/software/fleet_maintained_apps?team_id=3`


##### Default response

`Status: 200`

```json
{
marko-lisica marked this conversation as resolved.
Show resolved Hide resolved
"fleet_maintained_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"
},
],
"meta": {
"has_next_results": false,
"has_previous_results": false
}
}
```

### Get Fleet-maintained 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-maintained app.

`GET /api/v1/fleet/software/fleet_maintained_apps/:id`

#### Parameters

| Name | Type | In | Description |
| ---- | ---- | -- | ----------- |
| id | integer | path | **Required.** The Fleet-maintained app's ID. |


#### Example

`GET /api/v1/fleet/software/fleet_maintained_apps/1`

##### Default response

`Status: 200`

```json
{
"fleet_maintained_app": {
"id": 1,
"name": "1Password",
"filename": "1Password-8.10.44-aarch64.zip",
marko-lisica marked this conversation as resolved.
Show resolved Hide resolved
"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-maintained 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 Fleet-maintained app so it's available for install.

`POST /api/v1/fleet/software/fleet_maintained`

#### Parameters

| Name | Type | In | Description |
| ---- | ---- | -- | ----------- |
| fleet_maintained_app_id | string | body | **Required.** The ID of Fleet-maintained app. |
marko-lisica marked this conversation as resolved.
Show resolved Hide resolved
| team_id | integer | body | **Required**. The team ID. Adds Fleet-maintained app to the specified team. |
| install_script | string | form | Command that Fleet runs to install software. If not specified Fleet runs default install command for each Fleet-maintained app. |
| pre_install_query | string | form | Query that is pre-install condition. If the query doesn't return any result, Fleet won't proceed to install. |
| post_install_script | string | form | The contents of the script to run after install. If the specified script fails (exit code non-zero) software install will be marked as failed and rolled back. |
| self_service | boolean | form | Self-service software is optional and can be installed by the end user. |

#### Example

`POST /api/v1/fleet/software/fleet_maintained`

##### Request body

```json
{
"fleet_maintained_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.
Expand Down
Loading