Skip to content

Commit e33a01b

Browse files
committed
patch
1 parent bfb033d commit e33a01b

4 files changed

Lines changed: 39 additions & 15 deletions

File tree

documentation/docs/reference/api.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -511,13 +511,24 @@ Mainly used by the `linupdate` agent, these endpoints allow to register a host t
511511
</thead>
512512
<tbody>
513513
<tr>
514-
<td>/host/<code>&lt;HOST_ID&gt;</code>/updates<br><code>GET</code></td>
514+
<td>/host/<code>&lt;HOST_ID&gt;</code>/installed<br><code>GET</code></td>
515+
<td><code>&lt;APIKEY&gt;</code></td>
516+
<td></td>
517+
<td>Get installed packages of a specific host</td>
518+
<td markdown="block">
519+
```bash
520+
curl --fail-with-body -L -s -X GET -H "Authorization: Bearer <APIKEY>" https://repomanager.mydomain.net/api/v2/host/<HOST_ID>/installed
521+
```
522+
</td>
523+
</tr>
524+
<tr>
525+
<td>/host/<code>&lt;HOST_ID&gt;</code>/available<br><code>GET</code></td>
515526
<td><code>&lt;APIKEY&gt;</code></td>
516527
<td></td>
517528
<td>Get available updates for a specific host</td>
518529
<td markdown="block">
519530
```bash
520-
curl --fail-with-body -L -s -X GET -H "Authorization: Bearer <APIKEY>" https://repomanager.mydomain.net/api/v2/host/<HOST_ID>/updates
531+
curl --fail-with-body -L -s -X GET -H "Authorization: Bearer <APIKEY>" https://repomanager.mydomain.net/api/v2/host/<HOST_ID>/available
521532
```
522533
</td>
523534
</tr>

www/controllers/Api/Host/Host.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,20 @@ public function execute(): array
3030
throw new Exception('Host #' . $id . ' does not exist.');
3131
}
3232

33+
/**
34+
* Get installed packages for a host
35+
* https://repomanager.mydomain.net/api/v2/host/{id}/installed
36+
*/
37+
if ($this->uri[5] == 'installed' and $this->method == 'GET') {
38+
$hostPackageController = new HostPackage($id);
39+
return ['results' => $hostPackageController->getInstalled()];
40+
}
41+
3342
/**
3443
* Get available updates for a host
3544
* https://repomanager.mydomain.net/api/v2/host/{id}/updates
3645
*/
37-
if ($this->uri[5] == 'updates' and $this->method == 'GET') {
46+
if (in_array($this->uri[5], ['available', 'updates']) and $this->method == 'GET') {
3847
$hostPackageController = new HostPackage($id);
3948
return ['results' => $hostPackageController->getAvailable()];
4049
}

www/views/includes/forms/tasks/update.inc.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -122,17 +122,19 @@
122122
endif;
123123

124124
if ($repoController->getPackageType() == 'deb') : ?>
125+
<h6>METADATA CUSTOM FIELDS</h6>
126+
125127
<h6>ORIGIN</h6>
126-
<p class="note">Optional. Configure <code>Origin</code> value in <code>Release</code> metadata file for this repository.</p>
127-
<input type="text" class="task-param" param-name="advanced-params.metadata-custom-fields.origin" value="<?= $repoController->getAdvancedParams()['metadata-custom-fields']['origin'] ?? '' ?>" />
128+
<p class="note">Optional. Configure the <code>Origin</code> value in <code>Release</code> metadata file for this repository.</p>
129+
<input type="text" class="task-param" param-name="advanced-params.metadata-custom-fields.origin" value="<?= $repoController->getAdvancedParams()['metadata-custom-fields']['origin'] ?? '' ?>" placeholder="e.g. repository > distribution > component" />
128130

129131
<h6>LABEL</h6>
130-
<p class="note">Optional. Configure <code>Label</code> value in <code>Release</code> metadata file for this repository.</p>
131-
<input type="text" class="task-param" param-name="advanced-params.metadata-custom-fields.label" value="<?= $repoController->getAdvancedParams()['metadata-custom-fields']['label'] ?? '' ?>" />
132+
<p class="note">Optional. Configure the <code>Label</code> value in <code>Release</code> metadata file for this repository.</p>
133+
<input type="text" class="task-param" param-name="advanced-params.metadata-custom-fields.label" value="<?= $repoController->getAdvancedParams()['metadata-custom-fields']['label'] ?? '' ?>" placeholder="e.g. deb packages repository" />
132134

133135
<h6>DESCRIPTION</h6>
134-
<p class="note">Optional. Configure <code>Description</code> value in <code>Release</code> metadata file for this repository.</p>
135-
<input type="text" class="task-param" param-name="advanced-params.metadata-custom-fields.description" value="<?= $repoController->getAdvancedParams()['metadata-custom-fields']['description'] ?? '' ?>" />
136+
<p class="note">Optional. Configure the <code>Description</code> value in <code>Release</code> metadata file for this repository.</p>
137+
<input type="text" class="task-param" param-name="advanced-params.metadata-custom-fields.description" value="<?= $repoController->getAdvancedParams()['metadata-custom-fields']['description'] ?? '' ?>" placeholder="e.g. repository > distribution > component" />
136138
<?php
137139
endif ?>
138140
</div>

www/views/includes/panels/repos/new.inc.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -225,17 +225,19 @@
225225
</div>
226226

227227
<div field-type="mirror local deb">
228+
<h6>METADATA CUSTOM FIELDS</h6>
229+
228230
<h6>ORIGIN</h6>
229-
<p class="note">Optional. Configure <code>Origin</code> value in <code>Release</code> metadata file for this repository.</p>
230-
<input type="text" class="task-param" param-name="advanced-params.metadata-custom-fields.origin" package-type="deb" />
231+
<p class="note">Optional. Configure the <code>Origin</code> value in <code>Release</code> metadata file for this repository.</p>
232+
<input type="text" class="task-param" param-name="advanced-params.metadata-custom-fields.origin" package-type="deb" placeholder="e.g. repository > distribution > component" />
231233

232234
<h6>LABEL</h6>
233-
<p class="note">Optional. Configure <code>Label</code> value in <code>Release</code> metadata file for this repository.</p>
234-
<input type="text" class="task-param" param-name="advanced-params.metadata-custom-fields.label" package-type="deb" />
235+
<p class="note">Optional. Configure the <code>Label</code> value in <code>Release</code> metadata file for this repository.</p>
236+
<input type="text" class="task-param" param-name="advanced-params.metadata-custom-fields.label" package-type="deb" placeholder="e.g. deb packages repository" />
235237

236238
<h6>DESCRIPTION</h6>
237-
<p class="note">Optional. Configure <code>Description</code> value in <code>Release</code> metadata file for this repository.</p>
238-
<input type="text" class="task-param" param-name="advanced-params.metadata-custom-fields.description" package-type="deb" />
239+
<p class="note">Optional. Configure the <code>Description</code> value in <code>Release</code> metadata file for this repository.</p>
240+
<input type="text" class="task-param" param-name="advanced-params.metadata-custom-fields.description" package-type="deb" placeholder="e.g. repository > distribution > component" />
239241
</div>
240242
</div>
241243
</div>

0 commit comments

Comments
 (0)