Endpoints version automation

76 views
Skip to first unread message

bbassingthwaite

unread,
Mar 1, 2017, 9:43:44 AM3/1/17
to Google Cloud Endpoints
Hi,

We are trying to automate the endpoints deployment so a person doesn't have to manually pull the endpoints version from the output. I haven't found a great way to do it without having to manually parse the stdout from the gcloud command.

When we are running:

gcloud beta service-management deploy ...

I would expect that I should be able to use

--format=json

which would allow me to get json output which would contain the endpoints version somewhere which can easily be parsed.  This isn't the case and it ignores the json format flag completely.  I think this is a bug with the command and I hope it can be fixed to output json.

The

gcloud beta service-management configs list

does output json when specified and I could use the latest one returned but it's not ideal.

Has anyone else automated this and how have they done it?

Thanks,
Braden


Lukas Karlsson

unread,
Mar 1, 2017, 9:51:31 AM3/1/17
to bbassingthwaite, Google Cloud Endpoints
I am also interested in programmatic access to the version string. 

--
You received this message because you are subscribed to the Google Groups "Google Cloud Endpoints" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-endpoints+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-endpoints/0570d550-caa6-4358-9332-e8242883ca08%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Lukas Karlsson, Cloud Architect / Developer Advocate

Broad Institute of MIT and Harvard
75 Ames Street, 11129, Cambridge, Massachusetts 02142
karl...@broadinstitute.org, +1.6177147142

Dan Ciruli

unread,
Mar 1, 2017, 1:25:04 PM3/1/17
to Lukas Karlsson, bbassingthwaite, Google Cloud Endpoints
Thanks for the report. I have filed a bug and will keep the group posted.

On Wed, Mar 1, 2017 at 6:51 AM, Lukas Karlsson <karl...@broadinstitute.org> wrote:
I am also interested in programmatic access to the version string. 
On Wed, Mar 1, 2017 at 9:43 AM, bbassingthwaite <bbassin...@vendasta.com> wrote:
Hi,

We are trying to automate the endpoints deployment so a person doesn't have to manually pull the endpoints version from the output. I haven't found a great way to do it without having to manually parse the stdout from the gcloud command.

When we are running:

gcloud beta service-management deploy ...

I would expect that I should be able to use

--format=json

which would allow me to get json output which would contain the endpoints version somewhere which can easily be parsed.  This isn't the case and it ignores the json format flag completely.  I think this is a bug with the command and I hope it can be fixed to output json.

The

gcloud beta service-management configs list

does output json when specified and I could use the latest one returned but it's not ideal.

Has anyone else automated this and how have they done it?

Thanks,
Braden


--
You received this message because you are subscribed to the Google Groups "Google Cloud Endpoints" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-endpoints+unsubscri...@googlegroups.com.
--
Lukas Karlsson, Cloud Architect / Developer Advocate

Broad Institute of MIT and Harvard
75 Ames Street, 11129, Cambridge, Massachusetts 02142
karl...@broadinstitute.org, +1.6177147142

--
You received this message because you are subscribed to the Google Groups "Google Cloud Endpoints" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-endpoints+unsub...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
DC

Brad Friedman

unread,
Mar 1, 2017, 3:13:46 PM3/1/17
to Dan Ciruli, Lukas Karlsson, bbassingthwaite, Google Cloud Endpoints
Yes, thanks for the report! The reason why the --format flag was ignored in the deploy command was that it applied only to returned "resources." For example, when you describe a service, it returns a service-like resource to the formatter, which honors the user's input. As of the most recent release of gcloud, the deploy command had only been writing a log of the newly-uploaded service config, rather than formatting a resource object.

I've now altered the command to return a resource when the user specifies a format. The changes will be getting some code reviews from our team soon. This improvement should come in a public gcloud release next week!

Thanks again,
Brad




--
DC

--
You received this message because you are subscribed to the Google Groups "Google Cloud Endpoints" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-endpoints+unsubscri...@googlegroups.com.

Shay Erlichmen

unread,
Mar 1, 2017, 3:35:46 PM3/1/17
to Brad Friedman, Dan Ciruli, Lukas Karlsson, bbassingthwaite, Google Cloud Endpoints
This is how we get the last error string when deploying (some bash magic):

last_service_deployed=$(gcloud beta service-management versions list --service=$1.appspot.com | head -n 2 | tail -n 1)
last_service_deployed_arr=(${last_service_deployed})

cat >./env.yaml <<EOF
env_variables:
  ENDPOINTS_SERVICE_NAME: $1.appspot.com
  GOOGLE_CLOUD_PROJECT: $1
  ENDPOINTS_SERVICE_VERSION: ${last_service_deployed_arr[0]}
EOF


To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-endpoints+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-endpoints/CAGPFb9js19tMzKng8Ls2E7JxmtJp%3D7LMR9wW_-hZ5L-_z1ZaxA%40mail.gmail.com.

bbassingthwaite

unread,
Mar 1, 2017, 4:16:35 PM3/1/17
to Google Cloud Endpoints, cir...@google.com, karl...@broadinstitute.org, bbassin...@vendasta.com
Perfect! Thanks for the speedy fix.


On Wednesday, March 1, 2017 at 2:13:46 PM UTC-6, Brad Friedman wrote:
Yes, thanks for the report! The reason why the --format flag was ignored in the deploy command was that it applied only to returned "resources." For example, when you describe a service, it returns a service-like resource to the formatter, which honors the user's input. As of the most recent release of gcloud, the deploy command had only been writing a log of the newly-uploaded service config, rather than formatting a resource object.

I've now altered the command to return a resource when the user specifies a format. The changes will be getting some code reviews from our team soon. This improvement should come in a public gcloud release next week!

Thanks again,
Brad
On Wed, Mar 1, 2017 at 10:24 AM, 'Dan Ciruli' via Google Cloud Endpoints <google-clou...@googlegroups.com> wrote:
Thanks for the report. I have filed a bug and will keep the group posted.
On Wed, Mar 1, 2017 at 6:51 AM, Lukas Karlsson <karl...@broadinstitute.org> wrote:
I am also interested in programmatic access to the version string. 
On Wed, Mar 1, 2017 at 9:43 AM, bbassingthwaite <bbassin...@vendasta.com> wrote:
Hi,

We are trying to automate the endpoints deployment so a person doesn't have to manually pull the endpoints version from the output. I haven't found a great way to do it without having to manually parse the stdout from the gcloud command.

When we are running:

gcloud beta service-management deploy ...

I would expect that I should be able to use

--format=json

which would allow me to get json output which would contain the endpoints version somewhere which can easily be parsed.  This isn't the case and it ignores the json format flag completely.  I think this is a bug with the command and I hope it can be fixed to output json.

The

gcloud beta service-management configs list

does output json when specified and I could use the latest one returned but it's not ideal.

Has anyone else automated this and how have they done it?

Thanks,
Braden


--
You received this message because you are subscribed to the Google Groups "Google Cloud Endpoints" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-endpoints+unsub...@googlegroups.com.
--
Lukas Karlsson, Cloud Architect / Developer Advocate

Broad Institute of MIT and Harvard
75 Ames Street, 11129, Cambridge, Massachusetts 02142
karl...@broadinstitute.org, +1.6177147142

--
You received this message because you are subscribed to the Google Groups "Google Cloud Endpoints" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-endpoints+unsub...@googlegroups.com.



--
DC

--
You received this message because you are subscribed to the Google Groups "Google Cloud Endpoints" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-endpoints+unsub...@googlegroups.com.

Brad Friedman

unread,
Mar 2, 2017, 2:49:27 PM3/2/17
to Google Cloud Endpoints, cir...@google.com, karl...@broadinstitute.org, bbassin...@vendasta.com
Just to close the loop on this, I've just submitted the addition of this functionality to our codebase. Because Google Cloud Next 2017 is next week, there won't be a gcloud release then, but this should go live on March 15. Thanks again for reporting this!

jer...@rhino.capital

unread,
Mar 3, 2017, 2:50:00 AM3/3/17
to Google Cloud Endpoints
we use this combo of scripts for ci

Rocco Ghielmini

unread,
Apr 4, 2017, 7:45:35 PM4/4/17
to Google Cloud Endpoints
I am interested in pragrammatic access, too.

Also, the command

gcloud service-management versions list --service=YOUR-PROJECT-ID.appspot.com

shown in


does not seem to work.

Sepehr Ebrahimzadeh

unread,
Apr 4, 2017, 7:52:58 PM4/4/17
to Rocco Ghielmini, Google Cloud Endpoints
Hi Rocco, that documentation page out of date and we will update it.

Please use this command instead of "versions":
gcloud service-management configs list --service=YOUR-PROJECT-ID.appspot.com
That gcloud command calls this API in case you'd rather call the API directly for automation:


--
You received this message because you are subscribed to the Google Groups "Google Cloud Endpoints" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-endpoints+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages