Ошибка: ApiConfigurationError: попытка реализовать служебное эхо версии v2 с несколькими классами, которые несовместимы. См. Docstring для api() для примеров того, как реализовать API с несколькими классами.Google Cloud Endpoints V2 многоуровневая ошибка API App Engine Standard
Код:
import logging
import endpoints
from protorpc import message_types
from protorpc import messages
from protorpc import remote
class EchoRequest(messages.Message):
content = messages.StringField(1)
class EchoResponse(messages.Message):
content = messages.StringField(1)
ECHO_RESOURCE = endpoints.ResourceContainer(
EchoRequest, n=messages.IntegerField(2, default=1))
@endpoints.api(name='echo', version='v1',description='description')
class EchoApi(remote.Service):
@endpoints.method(
# This method takes a ResourceContainer defined above.
ECHO_RESOURCE,
# This method returns an Echo message.
EchoResponse,
path='echo',
http_method='POST',
name='echo')
def echo(self, request):
logging.info("echo1"+ str(request.content))
output_content = ' '.join([request.content] * request.n)
return EchoResponse(content=output_content)
@endpoints.api(name='echo', version='v2', description='description2')
class EchoApi2(remote.Service):
@endpoints.method(
# This method takes a ResourceContainer defined above.
ECHO_RESOURCE,
# This method returns an Echo message.
EchoResponse,
path='echo',
http_method='POST',
name='echo')
def echo(self, request):
logging.info("echo2" + str(request.content))
output_content = ' '.join([request.content] * request.n)
return EchoResponse(content=output_content)
api = endpoints.api_server([EchoApi, EchoApi2])
ХОРОШО, если только: версия = 'v1' (EchoApi)
еслиОШИБКА: версия = 'v2' добавляется (EchoApi2)
ERROR CODE : ApiConfigurationError: попытка реализовать служебное эхо, версия v2, с несколькими классами, которые несовместимы. См. Docstring для api() для примеров того, как реализовать API с несколькими классами.
спасибо.