Created add, edit, remove location and edit, remove services to the API (#11080)

* Created add, edit, remove location and edit, remove services to the v0 API and added their corresponding routes

* Changed repeating code by adding a function that checks for missing parameters

* Reduced the lines of add_service_for_host, modified a little more the missing fields function

* Changed True and False to true and false, erased an unused var called $missing

* Solved merged confict

Deleted duplicate functions generated when solving merge conflicts

* fixed more conficts

Deleting duplicate entries produced by trying to solve a merge conflict

* fixing more duplicate functions

This merge conflict created more duplicates

* Update api_functions.inc.php

* Update api_functions.inc.php
This commit is contained in:
gabrielRojasNew
2020-02-26 06:12:36 -04:00
committed by GitHub
parent ecd57ff34f
commit 6d22a885af
2 changed files with 100 additions and 22 deletions

View File

@@ -78,6 +78,11 @@ Route::group(['prefix' => 'v0', 'namespace' => '\App\Api\Controllers'], function
Route::post('devicegroups', 'LegacyApiController@add_device_group')->name('add_device_group');
Route::post('devices/{id}/parents', 'LegacyApiController@add_parents_to_host')->name('add_parents_to_host');
Route::delete('/devices/{id}/parents', 'LegacyApiController@del_parents_from_host')->name('del_parents_from_host');
Route::post('locations', 'LegacyApiController@add_location')->name('add_location');
Route::patch('locations/{location_id_or_name}', 'LegacyApiController@edit_location')->name('edit_location');
Route::delete('locations/{location}', 'LegacyApiController@del_location')->name('del_location');
Route::delete('services/{id}', 'LegacyApiController@del_service_from_host')->name('del_service_from_host');
Route::patch('services/{id}', 'LegacyApiController@edit_service_for_host')->name('edit_service_for_host');
});
// restricted by access