123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113 |
- <?php
- use Silex\Application;
- use Silex\Provider\AssetServiceProvider;
- use Silex\Provider\HttpFragmentServiceProvider;
- use Silex\Provider\ServiceControllerServiceProvider;
- use Silex\Provider\TwigServiceProvider;
- use Symfony\Component\HttpFoundation\Request;
- use Symfony\Component\HttpFoundation\Response;
- $app = new Application();
- $app->register(new ServiceControllerServiceProvider());
- $app->register(new AssetServiceProvider());
- $app->register(new TwigServiceProvider());
- $app->register(new HttpFragmentServiceProvider());
- $app->register(new HttpFragmentServiceProvider());
- //$app['twig'] = $app->extend('twig', function ($twig, $app) {
- // return $twig;
- //});
- // se muestra el readme.
- $app->get('/docs', function () {
- $file = file_get_contents("./docs/READMEv1.md");
- $Parsedown = new Parsedown();
- return $Parsedown->text($file);
- });
- // captura todos los options y responde con un 200 para que despues haga la peticion correcta.
- $app->options("/{anything}", function () {
- return new Response("", 200);
- })->assert("anything", ".*");
- // escribo el encabezado para evitar el cors
- $app->after(function (Request $req, Response $resp) {
- $resp->headers->set('Access-Control-Allow-Credentials', 'true');
- $resp->headers->set('Access-Control-Allow-Headers', 'Origin, Content-Type, Accept, Authorization');
- $resp->headers->set('Access-Control-Allow-Origin', '*');
- $resp->headers->set('Access-Control-Allow-Methods', 'POST, GET, PUT, DELETE, PATCH, OPTIONS');
- });
- $base = new \Swagger\Client\Base\Services();
- $base->getTenancyId($app);
- $base->getTenancies($app);
- $base->getClientId($app);
- $base->getClients($app);
- $base->postClient($app);
- $base->putClient($app);
- $base->deleteClient($app);
- $base->getClientActive($app);
- $base->getClientDisable($app);
- $ftth = new \Swagger\Client\FTTH\Services();
- $ftth->getNAPId($app);
- $ftth->getNAPs($app);
- $ftth->getOLTId($app);
- $ftth->getOLTs($app);
- $ftth->getONUModelId($app);
- $ftth->getONUModels($app);
- $ftth->getOLTModelId($app);
- $ftth->getOLTModels($app);
- $ftth->getONUProfileId($app);
- $ftth->getONUProfiles($app);
- $ftth->getVLanProfileId($app);
- $ftth->getVLanProfiles($app);
- $ftth->getONUTemplateId($app);
- $ftth->getONUTemplates($app);
- $ftth->getTContProfileId($app);
- $ftth->getTContProfiles($app);
- $ftth->getTrafficProfileId($app);
- $ftth->getTrafficProfiles($app);
- $ftth->getVLanIDId($app);
- $ftth->getVLanIDs($app);
- $ftth->getProfileId($app);
- $ftth->getProfiles($app);
- $ftth->getONUId($app);
- $ftth->getONUs($app);
- $ftth->postONU($app);
- $ftth->putONU($app);
- $ftth->deleteONU($app);
- $ftth->getONUActive($app);
- $ftth->getONUSuspend($app);
- $ftth->getONUEnable($app);
- $ftth->getONUDisable($app);
- $ftth->getONUSupply($app);
- $cablemodem = new \Swagger\Client\Cablemodem\Services();
- $cablemodem->getNodeId($app);
- $cablemodem->getNodes($app);
- $cablemodem->getModelId($app);
- $cablemodem->getModels($app);
- $cablemodem->getProfileId($app);
- $cablemodem->getProfiles($app);
- $cablemodem->getCablemodemId($app);
- $cablemodem->getCablemodems($app);
- $cablemodem->postCablemodem($app);
- $cablemodem->putCablemodem($app);
- $cablemodem->deleteCablemodem($app);
- $cablemodem->getCablemodemActive($app);
- $cablemodem->getCablemodemDisable($app);
- $cablemodem->getCablemodemSupply($app);
- $radius = new \Swagger\Client\Radius\Services();
- $radius->getProfileId($app);
- $radius->getProfiles($app);
- $radius->getAccessId($app);
- $radius->getAccesses($app);
- $radius->postAccess($app);
- $radius->putAccess($app);
- $radius->deleteAccess($app);
- $app->flush();
- return $app;
- ?>
|