Search code examples
pythongoogle-app-enginegoogle-cloud-platform

How do I download the code for a specific google cloud "service"


This doc show the command to download the source of an app I have in app engine:

appcfg.py -A [YOUR_APP_ID] -V [YOUR_APP_VERSION] download_app [OUTPUT_DIR]

That's fine, but I also have services that I deployed. Using this command I can only seem to download the "default" service. I also deployed "myservice01" and "myservice02" to app engine in my GCP project. How do I specify the code of a specific service to download?

I tried this command as suggested:

appcfg.py -A [YOUR_APP_ID] -M [YOUR_MODULE] -V [YOUR_APP_VERSION] download_app [OUTPUT_DIR]

It didn't fail but this is the output I got (and it didn't download anything)

01:30 AM Host: appengine.google.com
01:30 AM Fetching file list...
01:30 AM Fetching files...

Now as a test I tried it with the name of a module I know doesn't exist and I got this error:

Error 400: --- begin server output ---
Version ... of Module ... does not exist.

So I at least know it's successfully finding the module and version, but doesn't seem to want to download them.


Solution

  • Also specify the module (services used to be called modules):

    -M MODULE, --module=MODULE

    Set the module, overriding the module value from app.yaml.

    So something like:

    appcfg.py -A [YOUR_APP_ID] -M [YOUR_MODULE] -V [YOUR_APP_VERSION] download_app [OUTPUT_DIR]
    

    Side note: YOUR_APP_VERSION should really read YOUR_MODULE_VERSION :)

    Of course, the answer assumes the app code downloads were not permanently disabled from the Console's GAE App Settings page:

    Permanently prohibit code downloads

    Once this is set, no one, including yourself, will ever be able to download the code for this application using the appcfg download_app command.