http://<your_app_id>.appspot.com
, where the app ID is part of the hostname. If an app is served from a custom domain, it may be necessary to retrieve the entire hostname component. You can do this using the app_identity.get_default_version_hostname()
method....Hello,
Please look into this document, which describes using the app_identity.get_default_version_hostname() method you can retrieve the entire hostname component if an app is served from a custom domain where the app ID is part of the hostname (i.e. http://<your_app_id>.appspot.com). So as George mentioned earlier you are getting expected behavior from the app_identity.get_default_version_hostname() method.
Regarding your second question, if your domain is mapped to your App Engine app you can use the apps.domainMappings.list method to list your resource records. You can also achieve this using Console or gcloud command "gcloud app domain-mappings list". You can get more details on this at number four point of this document and on gcloud command “gcloud app domain-mappings” here. If your domain is not mapped, to programmatically map your domain to your App Engine app you can use the app.domainMappings.create method. You can find more about the methods available with REST Resource: apps.domainMappings here.