You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cloudstack.apache.org by GitBox <gi...@apache.org> on 2022/09/20 18:26:28 UTC

[GitHub] [cloudstack-go] mlsorensen opened a new pull request, #42: Add explicit POST functions

mlsorensen opened a new pull request, #42:
URL: https://github.com/apache/cloudstack-go/pull/42

   Eventually CloudStack could advertise which APIs prefer POST (set via annotations on the API classes), this will make that easier to integrate by pushing the selection of which method to use into the code gen.  Right now this PR still decides POST based off of a few API command names, but it does so in code gen rather than in the generated client.
   
   Also allows to select POST for custom APIs, in the even that a user needs to manually build a POST call.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack-go] mlsorensen commented on a diff in pull request #42: Add explicit POST functions

Posted by GitBox <gi...@apache.org>.
mlsorensen commented on code in PR #42:
URL: https://github.com/apache/cloudstack-go/pull/42#discussion_r989227715


##########
generate/generate.go:
##########
@@ -1629,7 +1651,11 @@ func (s *service) generateNewAPICallFunc(a *API) {
 		pn("		time.Sleep(500 * time.Millisecond)")
 		pn("	}")
 	} else {
-		pn("	resp, err := s.cs.newRequest(\"%s\", p.toURLValues())", a.Name)
+		if a.Name == "deployVirtualMachine" || a.Name == "login" || a.Name == "updateVirtualMachine" {

Review Comment:
   That's a good point. I'm hesitant to default async APIs to use POST just yet, that might need more thorough testing.  Definitely something that can be refined though, rather than sticking to just these few named APIs.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack-go] rohityadavcloud merged pull request #42: Add explicit POST functions

Posted by GitBox <gi...@apache.org>.
rohityadavcloud merged PR #42:
URL: https://github.com/apache/cloudstack-go/pull/42


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack-go] rohityadavcloud commented on a diff in pull request #42: Add explicit POST functions

Posted by GitBox <gi...@apache.org>.
rohityadavcloud commented on code in PR #42:
URL: https://github.com/apache/cloudstack-go/pull/42#discussion_r989696659


##########
generate/generate.go:
##########
@@ -1629,7 +1651,11 @@ func (s *service) generateNewAPICallFunc(a *API) {
 		pn("		time.Sleep(500 * time.Millisecond)")
 		pn("	}")
 	} else {
-		pn("	resp, err := s.cs.newRequest(\"%s\", p.toURLValues())", a.Name)
+		if a.Name == "deployVirtualMachine" || a.Name == "login" || a.Name == "updateVirtualMachine" {

Review Comment:
   Makes sense, we can do that in the next iteration.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack-go] rohityadavcloud commented on a diff in pull request #42: Add explicit POST functions

Posted by GitBox <gi...@apache.org>.
rohityadavcloud commented on code in PR #42:
URL: https://github.com/apache/cloudstack-go/pull/42#discussion_r988598277


##########
generate/generate.go:
##########
@@ -1629,7 +1651,11 @@ func (s *service) generateNewAPICallFunc(a *API) {
 		pn("		time.Sleep(500 * time.Millisecond)")
 		pn("	}")
 	} else {
-		pn("	resp, err := s.cs.newRequest(\"%s\", p.toURLValues())", a.Name)
+		if a.Name == "deployVirtualMachine" || a.Name == "login" || a.Name == "updateVirtualMachine" {

Review Comment:
   Just one suggestion, a.Isasync can be used to determine if a Post request be made as for most async APIs, POST can be used.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org