1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-10 08:52:39 +01:00

Add edit methods for Almanac services and devices

Summary: See T12414. This just gets started; we still need edit endpoints for network interfaces and bindings.

Test Plan: Created some devices/services from the conduit UI.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D18605
This commit is contained in:
Austin McKinley 2017-09-14 13:18:40 -07:00
parent 939008e64c
commit c71cb944a4
3 changed files with 42 additions and 0 deletions

View file

@ -9,6 +9,7 @@
phutil_register_library_map(array( phutil_register_library_map(array(
'__library_version__' => 2, '__library_version__' => 2,
'class' => array( 'class' => array(
'AlamancServiceEditConduitAPIMethod' => 'applications/almanac/conduit/AlamancServiceEditConduitAPIMethod.php',
'AlmanacAddress' => 'applications/almanac/util/AlmanacAddress.php', 'AlmanacAddress' => 'applications/almanac/util/AlmanacAddress.php',
'AlmanacBinding' => 'applications/almanac/storage/AlmanacBinding.php', 'AlmanacBinding' => 'applications/almanac/storage/AlmanacBinding.php',
'AlmanacBindingDisableController' => 'applications/almanac/controller/AlmanacBindingDisableController.php', 'AlmanacBindingDisableController' => 'applications/almanac/controller/AlmanacBindingDisableController.php',
@ -36,6 +37,7 @@ phutil_register_library_map(array(
'AlmanacDAO' => 'applications/almanac/storage/AlmanacDAO.php', 'AlmanacDAO' => 'applications/almanac/storage/AlmanacDAO.php',
'AlmanacDevice' => 'applications/almanac/storage/AlmanacDevice.php', 'AlmanacDevice' => 'applications/almanac/storage/AlmanacDevice.php',
'AlmanacDeviceController' => 'applications/almanac/controller/AlmanacDeviceController.php', 'AlmanacDeviceController' => 'applications/almanac/controller/AlmanacDeviceController.php',
'AlmanacDeviceEditConduitAPIMethod' => 'applications/almanac/conduit/AlmanacDeviceEditConduitAPIMethod.php',
'AlmanacDeviceEditController' => 'applications/almanac/controller/AlmanacDeviceEditController.php', 'AlmanacDeviceEditController' => 'applications/almanac/controller/AlmanacDeviceEditController.php',
'AlmanacDeviceEditEngine' => 'applications/almanac/editor/AlmanacDeviceEditEngine.php', 'AlmanacDeviceEditEngine' => 'applications/almanac/editor/AlmanacDeviceEditEngine.php',
'AlmanacDeviceEditor' => 'applications/almanac/editor/AlmanacDeviceEditor.php', 'AlmanacDeviceEditor' => 'applications/almanac/editor/AlmanacDeviceEditor.php',
@ -4930,6 +4932,7 @@ phutil_register_library_map(array(
'require_celerity_resource' => 'applications/celerity/api.php', 'require_celerity_resource' => 'applications/celerity/api.php',
), ),
'xmap' => array( 'xmap' => array(
'AlamancServiceEditConduitAPIMethod' => 'PhabricatorEditEngineAPIMethod',
'AlmanacAddress' => 'Phobject', 'AlmanacAddress' => 'Phobject',
'AlmanacBinding' => array( 'AlmanacBinding' => array(
'AlmanacDAO', 'AlmanacDAO',
@ -4975,6 +4978,7 @@ phutil_register_library_map(array(
'PhabricatorExtendedPolicyInterface', 'PhabricatorExtendedPolicyInterface',
), ),
'AlmanacDeviceController' => 'AlmanacController', 'AlmanacDeviceController' => 'AlmanacController',
'AlmanacDeviceEditConduitAPIMethod' => 'PhabricatorEditEngineAPIMethod',
'AlmanacDeviceEditController' => 'AlmanacDeviceController', 'AlmanacDeviceEditController' => 'AlmanacDeviceController',
'AlmanacDeviceEditEngine' => 'PhabricatorEditEngine', 'AlmanacDeviceEditEngine' => 'PhabricatorEditEngine',
'AlmanacDeviceEditor' => 'AlmanacEditor', 'AlmanacDeviceEditor' => 'AlmanacEditor',

View file

@ -0,0 +1,19 @@
<?php
final class AlamancServiceEditConduitAPIMethod
extends PhabricatorEditEngineAPIMethod {
public function getAPIMethodName() {
return 'almanac.service.edit';
}
public function newEditEngine() {
return new AlmanacServiceEditEngine();
}
public function getMethodSummary() {
return pht(
'Apply transactions to create a new service or edit an existing one.');
}
}

View file

@ -0,0 +1,19 @@
<?php
final class AlmanacDeviceEditConduitAPIMethod
extends PhabricatorEditEngineAPIMethod {
public function getAPIMethodName() {
return 'almanac.device.edit';
}
public function newEditEngine() {
return new AlmanacDeviceEditEngine();
}
public function getMethodSummary() {
return pht(
'Apply transactions to create a new device or edit an existing one.');
}
}