Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EC2 DescribeInstances API doesn't work (and likely many others) #70

Closed
steveniemitz opened this issue Jan 7, 2016 · 12 comments
Closed

Comments

@steveniemitz
Copy link
Contributor

I was attempting to use EC2Client::DescribeInstances, but never got any reservations back.

Digging into the code, it looks like the generated parsers are incorrect. DescribeInstancesResult looks for a "Reservations" XML node, however the actual XML response is "reservationsSet". It looks like the generated code isn't looking for the locationName as specified in the API JSON descriptors, and instead only using the member key.

@steveniemitz
Copy link
Contributor Author

It looks like this patch to the code generator template was enough to fix most places:

diff --git a/code-generation/generator/src/main/resources/com/amazonaws/util/awsclientgenerator/velocity/cpp/xml/ModelClassMembersDeserializeXml.vm b/code-generation/generator/src/main/resources/com/amazonaws/util/awsclientgenerator/velocity/cpp/xml/ModelClassMembersDeserializeXml.vm
index 6208d31..b01a4c7 100644
--- a/code-generation/generator/src/main/resources/com/amazonaws/util/awsclientgenerator/velocity/cpp/xml/ModelClassMembersDeserializeXml.vm
+++ b/code-generation/generator/src/main/resources/com/amazonaws/util/awsclientgenerator/velocity/cpp/xml/ModelClassMembersDeserializeXml.vm
@@ -29,7 +29,11 @@
 #set($listVarName = $CppViewHelper.computeVariableName($memberName) + "Member")
 #set($listMemberName = "member")
 #end##location specified in model
+#if($member.locationName)##location specified
+    XmlNode ${lowerCaseVarName}Node = resultNode.FirstChild("${member.locationName}");
+#else##no location specified
     XmlNode ${lowerCaseVarName}Node = resultNode.FirstChild("${memberName}");
+#end##

I'll submit a PR soon. Based on the diff, it looks like this mostly impacted EC2 APIs, but there were some changes in S3 as well.

@steveniemitz
Copy link
Contributor Author

Looks like there's a similar problem on the request side as well. For instance the InstanceIds filter is serialized incorrectly.

@JonathanHenson
Copy link
Contributor

thanks for your work on this, after you submit the pull request, I'll rerun the integration tests and make sure we didn't break anything. Ec2 is a special snowflake when it comes to protocol and is unfortunately an edge case we haven't tested too much.

@steveniemitz
Copy link
Contributor Author

Cool, will do. How do you prefer the commits for this? Should I do one for the code-gen change and one with the new cpp files, or just all at once?

@JonathanHenson
Copy link
Contributor

just the code-gen change. I'll regenerate clients on my end. Once we've verified the fix, we'll regenerate all clients and push them out.

steveniemitz pushed a commit to tellapart/aws-sdk-cpp that referenced this issue Jan 7, 2016
This primarily impacts the EC2 APIs.
See issue aws#70
@steveniemitz
Copy link
Contributor Author

Any luck on this / the pull request?

@JonathanHenson
Copy link
Contributor

Im testing it now. Should finish today some time.
On Jan 13, 2016 7:03 AM, "Steven Niemitz" notifications@github.com wrote:

Any luck on this / the pull request?


Reply to this email directly or view it on GitHub
#70 (comment).

@steveniemitz
Copy link
Contributor Author

Great! I'll probably have another PR coming up too to fix the filter serialization.

steveniemitz pushed a commit to tellapart/aws-sdk-cpp that referenced this issue Jan 13, 2016
This primarily impacts the EC2 APIs.
See issue aws#70
@steveniemitz
Copy link
Contributor Author

I submitted a preliminary PR for fixing filters, but I'm pretty sure its not 100% correct. I'd appreciate if you could check it out at some point and comment on it? Thanks!

#80

steveniemitz pushed a commit to tellapart/aws-sdk-cpp that referenced this issue Jan 14, 2016
This primarily impacts the EC2 APIs.
See issue aws#70
steveniemitz pushed a commit to tellapart/aws-sdk-cpp that referenced this issue Jan 14, 2016
This primarily impacts the EC2 APIs.
See issue aws#70
@steveniemitz
Copy link
Contributor Author

ping?

@JonathanHenson
Copy link
Contributor

so I merged in this pull request, but your other one is almost correct (though breaks SNS). I'm going to regenerate everything and push the new clients up. If you can look at my comments on the other PR, I can get that merged in as soon as it is ready.

@JonathanHenson
Copy link
Contributor

just pushed the updates along with fixes for SNS

krzysztof-trzepla pushed a commit to krzysztof-trzepla/aws-sdk-cpp that referenced this issue May 21, 2016
…-to-cluster-manager to develop

# By Michał Żmuda
# Via Michał Żmuda
* commit 'b605f933fc0c4c4d76a250e63b8afc6c4b423760':
  VFS-1457 facilitating acceptance testing
  VFS-1457 PR issues: refactoring starting cluster workers
  VFS-1457 fix ccm app name
  VFS-1457 initial cluster-manager renaming
JonathanHenson added a commit that referenced this issue Jan 31, 2017
cobookman pushed a commit to cobookman/aws-sdk-cpp that referenced this issue Jan 17, 2022
* Use github actions for OSX

* Update deps to get mac fixes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants