0

This is my code. In the Api Explorer I see only the prenotazioni.list api, I can't understand why I don't see the others two. I have tried to change name and path. To change Versions. To remove part of the code. Everytime I see only the prenotazioni.list.

import endpoints

from google.appengine.ext import ndb
from google.appengine.ext import db
from protorpc import remote

from endpoints_proto_datastore.ndb import EndpointsModel
from modelliapi import *
from relazioniapi import *
import logging
from datetime import datetime, timedelta


@endpoints.api(name='meraviglieapi', version='v3', description='meraviglieapi', scopes = ['https://www.googleapis.com/auth/userinfo.email'],
    allowed_client_ids= ['...'],
             audiences = ['...', endpoints.API_EXPLORER_CLIENT_ID])
class MeraviglieApi(remote.Service):
#---------- PRENOTAZIONI -----------------------------
    @PRENOTAZIONI.query_method(user_required=True,
        query_fields=('limit', 'order', 'pageToken','tipo', 'speciale', 'macro', 'prenotazione', 'servizio', 'anno', 'prenotazioneid', 'area'),
        path='prenotazioni', name='prenotazioni.list')
    def prenotazionilist(self, query):
        area = ''
        utente = UTENTI.query(UTENTI.utente == str(endpoints.get_current_user().user_id()))
        for ut in utente:
            area = str(ut.area)
        return query.filter(PRENOTAZIONI.area == area)

#---------- PASSEGGERI -----------------------------
    @PASSEGGERI.method(request_fields=('id',),
        path='passeggerisingolo/{id}', http_method='GET', name='passeggeri.get')
    def passeggeriget(self, my_model):
        if not my_model.from_datastore:
            raise endpoints.NotFoundException('MyModel not found.')
        return my_model

#---------- SERVIZIOPAX -----------------------------
    @SERVIZIOPAX.query_method(query_fields=('servizio'),
        path='serviziopax', name='serviziopax.list')
    def serviziopaxlist(self, query):
        return query

application = endpoints.api_server([MeraviglieApi], restricted=False)
Grostein
  • 33
  • 1
  • 5
  • Is this dev_appserver or production? – bossylobster Feb 25 '15 at 17:33
  • This is in dev_appserver and production – Grostein Feb 25 '15 at 17:37
  • 1) Does it show up in dev_appserver? 2) What do the "Admin Logs" (https://appengine.google.com/adminlogs?&app_id=) say when you upload a new version? (It should be "Successfully updated API configuration") 3) You may need to force it by changing your app version. – bossylobster Feb 25 '15 at 17:41
  • 1) In dev_appserver (so in http://localhost:8080/_ah/api/explorer) I see only the first API. 2) I have: API configuration update serving 3)Done many times (and rigth now) – Grostein Feb 25 '15 at 17:46
  • You've only defiined one API: meraviglieapi The rest are subresources, so you should see "meraviglieapi.prenotazioni.list", "meraviglieapi.passeggeri.get", and "meraviglieapi.serviziopax.list". – bossylobster Feb 25 '15 at 18:06
  • You should also check out: https://cloud.google.com/appengine/docs/python/endpoints/create_api#creating_an_api_implemented_with_multiple_classes – bossylobster Feb 25 '15 at 18:15
  • Check your logs. I modded the "basic" sample with your config values and had no issues: https://gist.github.com/dhermes/959336803ac78922e8ff – bossylobster Feb 25 '15 at 18:23
  • Solved changing the version of the api and creating another class. – Grostein Feb 26 '15 at 13:36

0 Answers0