I am very new to the Google engine and endpoints and wrote the basic functions of endpoints and deployments in the cloud. I successfully deployed the HelloWorld endpoint and tested it through the API: http: // localhost: 8080 / _ah / api / explorer
But now that I have created a new endpoint API and followed the same steps (i.e., deployed using the new APP kernel application name in appengine-web.xml, run it as appengine: update), api explorer still shows my endpoint HelloWorld instead of my new API "yourfirstendpoint".
I searched and tried to find the answer to no avail - and I'm sorry if this is a very simple and stupid question on my part (I'm sure it is), but I would be very happy if someone could point me in the right direction what i have to do.
My API
package com.example.zinglife;
import com.google.api.server.spi.config.Api;
import com.google.api.server.spi.config.ApiMethod;
import com.google.api.server.spi.config.ApiMethod.HttpMethod;
import com.google.api.server.spi.response.NotFoundException;
import com.google.appengine.api.datastore.Key;
import com.google.appengine.api.datastore.KeyFactory;
@Api(name = "yourfirstapi", version = "v1",
scopes = {Constants.EMAIL_SCOPE },
clientIds = {Constants.API_EXPLORER_CLIENT_ID},
description = "API for hello world endpoints.")
public class YourFirstAPI
{
@ApiMethod(name = "storeUserModel")
private User storeUserModel(User user) throws NotFoundException
{
String email = user.getEmail();
Key key = KeyFactory.createKey("User",email);
User userEntity = null;
try
{
if (userEntity==null)
{
userEntity = new User();
userEntity.setName(user.getName());
userEntity.setEmail(user.getEmail());
userEntity.setCountry(user.getCountry());
}
return userEntity;
}
finally
{
}
}
}
Run codeHide resultApp Engine Admin Log After Code Run:
Enter Image Description Here
Please let me know if any other information is needed :)
source
share