Re: [google-appengine] Help migrating from Files API

2015-08-03 Thread Carlos Lallana
As a quick response:

uuid1() http://docs.python.org/2/library/uuid.html#uuid.uuid1 may 
compromise privacy since it creates a UUID containing the computer’s 
network address. 
uuid4() http://docs.python.org/2/library/uuid.html#uuid.uuid4 creates a 
random UUID.

Refer to this answer http://stackoverflow.com/a/1785592/1880872 from 
Stackoverflow for further details.

On Sunday, August 2, 2015 at 10:04:33 PM UTC+2, Leon Prouger wrote:

 Thanks for answering, it should solve my problem. I wonder if it's safer 
 to use uuid1 on GAE, but the collision chance of uuid4 seems small enough 
 for my case.

 Also I added content type as you advised 



 On Sunday, July 26, 2015 at 7:43:50 PM UTC+3, Alex Martelli wrote:

 To generate a unique filename, I recommend the technique suggested at 
 http://stackoverflow.com/questions/22156030/google-cloud-storage-create-file-name-automatically
  
 .

 However, on an unrelated note, take care: your code seems to be missing 
 the content_type named parameter to the open call, and you'll probably want 
 to add it, as you did in the previous version in the create call.

 Alex

 On Sat, Jul 25, 2015 at 5:44 AM, Leon Prouger leon...@gmail.com wrote:

 Hey folks, I'm learning the new Cloud Storage and question how to I 
 migrate my app with a least friction.

 Now I'm using this sample piece of code to save images:

 from google.appengine.api import images, files


 def upload(ext, stream):

 file_name = files.blobstore.create(mime_type=mimetypes.types_map
 [ext])


 with files.open(file_name, 'a') as f:

 f.write(stream.getvalue())


 files.finalize(file_name)

 return 
 images.get_serving_url(files.blobstore.get_blob_key(file_name))


 Which I'm thinking to change to the next:


 def upload(ext, stream):

 filename = /images/my_file

 with gcs.open(filename, 'w') as f:

 f.write(stream.getvalue())


 # Blobstore API requires extra /gs to distinguish against blobstore 
 files.

 blobstore_filename = '/gs' + filename

 # This blob_key works with blobstore APIs that do not expect a

 # corresponding BlobInfo in datastore.

 blob_key = blobstore.create_gs_key(blobstore_filename)

 return images.get_serving_url(blob_key)


 Which seems to work.

 The problem that in the old version I don't have to worry about 
 filenames, Files API job was to assign me one. Now I need to give a name 
 myself. Any way the new api should do it for me? Or maybe I should just 
 hash the file. 


 -- 
 You received this message because you are subscribed to the Google 
 Groups Google App Engine group.
 To unsubscribe from this group and stop receiving emails from it, send 
 an email to google-appengi...@googlegroups.com.
 To post to this group, send email to google-a...@googlegroups.com.
 Visit this group at http://groups.google.com/group/google-appengine.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/google-appengine/145ce87c-e299-4d7f-8c8c-83f2959b5548%40googlegroups.com
  
 https://groups.google.com/d/msgid/google-appengine/145ce87c-e299-4d7f-8c8c-83f2959b5548%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.




-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at http://groups.google.com/group/google-appengine.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/1c7de523-d9d0-4682-a37e-7312621ed8f1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[google-appengine] Re: Spring components or EJB or other object, you recommend for processing in Google Endpoint API.

2015-03-24 Thread Carlos Lallana
Hey Maciej,

You may want to take a look to this article 
https://cloud.google.com/appengine/kb/general#frameworks from the docs, 
that explains what frameworks does Google App Engine support.

On Monday, February 2, 2015 at 12:48:15 PM UTC+1, Maciej Pietroń wrote:

 I started learning google claud platform. I want to try write some 
 application. I wonder what frameworks are compatible and work well on 
 google app engine. I didnt find a word on 
 https://cloud.google.com/appengine/docs that says anything about external 
 frameworks. I assume that most of them will work, but I also sure that one 
 of them work better (or are suited better) that the others. Mostly I'm 
 interest what is the best suited for processing request in google endpoints 
 api. 

 *I would like to have some predefined java object, that probably needs 
 some earlier initialization, that will provide business logic in Google 
 endpoints api. Just like Spring components or EJB provide. *

 Is there something that you recommend? What are drawbacks or benefits? Can 
 you share some links with guids or any information how google apps work 
 with othere technologies?


-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at http://groups.google.com/group/google-appengine.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/c281244d-33c9-4d3e-9cf2-24187cb819a2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [google-appengine] Search API Cost question

2015-02-27 Thread Carlos Lallana
Hi Kaan,

It is indeed not easy to reach the 10 GB size for an index, but yet not 
impossible. As you can read here 
https://cloud.google.com/appengine/docs/quotas#search, when an app tries 
to exceed this amount, an insufficient quota error is returned.

Note that if you have purchased one of our Silver, Gold, or Platinum support 
https://cloud.google.com/support/packages packages, you'll be able to 
request a quota increase for this limit.

But before that, I would suggest to shard (divide or split) your index into 
multiple indexes. In order to do so, you should:

1. Create an additional index.
2. Store a new document in the second index if needed.
3. When you need to search for a document, search both indexes. For better 
performance, you can make asynchronous search calls.

According to what my colleague David (Google wise man) explained to me, 
this approach will not scale indefinitely. Beyond two or maybe three 
sharded indexes, this technique will become relatively inefficient. The 
Search API is not designed for infinitely large document collections, so if 
you plan to scale a great deal then you would need to consider alternative 
architectures. However this technique will at least allow you to double 
your search capacity.

Hope that info helps!

On Thursday, February 26, 2015 at 9:17:31 PM UTC+1, Kaan Soral wrote:

 Thanks for the reply

 I don't think 10gb is easy to reach, but growing is probably the aim of 
 most of the appengine apps, and reaching that limit would probably be a 
 nightmare

 What exactly happens at that point?

 I hope the system automatically purges the low-rank documents on it's own

 Is it also a hard-limit, or does an internal bell goes off, and someone 
 warns you that you're first to reach the limit, and starts discussing what 
 to do

 I really wish it was unlimited, just for the sake of the mind


-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at http://groups.google.com/group/google-appengine.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/63d06e8b-c843-4dfb-b38f-31d92ef1db0b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [google-appengine] Search API Cost question

2015-02-26 Thread Carlos Lallana
Hey Kaan,

As stated in this section of the documentation [1], the maximum size per 
index is 10 GB, with an unlimited number of indexes allowed.

[1] 
https://cloud.google.com/appengine/docs/python/search/#Python_Search_API_quotas


On Thursday, February 19, 2015 at 9:55:52 PM UTC+1, Kaan Soral wrote:

 Are there any upper limits on the index size? (It was either 1gb or 1tb a 
 while ago, they increased/decreased it, I couldn't keep track)

 I have a lot of stuff indexed, including all movies/tvshows and their 
 descriptions, and my usage is 0.52gb's (Stored Data :)

 While I was pre-speculating like kj, I thought I would easily hit the 
 limits, yet I see now that, it will only happen if my usage/user content 
 really explodes


-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at http://groups.google.com/group/google-appengine.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/43133be7-3884-4055-b8cc-dae261258e8e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[google-appengine] Re: [Report bug]Bug on the documentation

2015-02-10 Thread Carlos Lallana
Quick update!

Changes have been submitted and they will take 1 or 2 days to be visible.

Thanks again for keeping an eye on the small details!

On Saturday, February 7, 2015 at 2:57:50 AM UTC+1, Jonas Mayer wrote:

 Hi, I found a bug on the page
 https://console.developers.google.com/start/appengine

 Python  Django
 Step 5 shows:
 appcfg.py -A 0 update appengine-try-python

 should be appengine-try-python-django

 This field depends on the chosen framework.

 NNTR
 Thanks.


-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at http://groups.google.com/group/google-appengine.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/b9cb6510-cc29-4ce1-9b79-0f7136377b1f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.