Skip to content

Commit 9b437fe

Browse files
refactor: setup endpoints for openvpn client export configs
1 parent 605a603 commit 9b437fe

File tree

2 files changed

+29
-5
lines changed

2 files changed

+29
-5
lines changed

pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/VPNOpenVPNClientExportEndpoint.inc renamed to pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/VPNOpenVPNClientExportConfigEndpoint.inc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ require_once 'RESTAPI/autoloader.inc';
77
use RESTAPI\Core\Endpoint;
88

99
/**
10-
* Defines an Endpoint for interacting with a single OpenVPNExport Model object at
10+
* Defines an Endpoint for interacting with a single OpenVPNExportConfig Model object at
1111
* /api/v2/vpn/openvpn/clientexport.
1212
*/
13-
class VPNOpenVPNClientExportEndpoint extends Endpoint {
13+
class VPNOpenVPNClientExportConfigEndpoint extends Endpoint {
1414
public function __construct() {
1515
# Set Endpoint attributes
16-
$this->url = '/api/v2/vpn/openvpn/clientexport';
17-
$this->model_name = 'OpenVPNClientExport';
18-
$this->request_method_options = ['POST'];
16+
$this->url = '/api/v2/vpn/openvpn/client_export/config';
17+
$this->model_name = 'OpenVPNClientExportConfig';
18+
$this->request_method_options = ['GET', 'POST', "PATCH", 'DELETE'];
1919
$this->many = false;
2020

2121
# Construct the parent Endpoint object
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?php
2+
3+
namespace RESTAPI\Endpoints;
4+
5+
require_once 'RESTAPI/autoloader.inc';
6+
7+
use RESTAPI\Core\Endpoint;
8+
9+
/**
10+
* Defines an Endpoint for interacting with many OpenVPNClientExportConfig Model objects at
11+
* /api/v2/vpn/openvpn/client_export/configs.
12+
*/
13+
class VPNOpenVPNClientExportConfigsEndpoint extends Endpoint {
14+
public function __construct() {
15+
# Set Endpoint attributes
16+
$this->url = '/api/v2/vpn/openvpn/client_export/configs';
17+
$this->model_name = 'OpenVPNClientExportConfig';
18+
$this->many = true;
19+
$this->request_method_options = ['GET', 'PUT', 'DELETE'];
20+
21+
# Construct the parent Endpoint object
22+
parent::__construct();
23+
}
24+
}

0 commit comments

Comments
 (0)