-
Notifications
You must be signed in to change notification settings - Fork 0
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
Amazon SNS #28
Comments
Thanks @electic! Yes, it's on my todo list, I just haven't managed to find time to get there. SNS uses the |
No problem. Thank you! |
... I completely missed this issue before doing my PRs. Apologies if I've wasted time, @jkakar. |
@brentonannan Not a waste at all, please ask questions whenever they come up, I'm happy to try and help if I can! I'm not expecting to get to this issue anytime in the next few weeks, so if you have energy to put here, I'd welcome contributions. The same kind of issue that exists for SNS also exists for SQS and there's some discussion about that in jkakar/aws-elixir#27. Basically, we need to figure out how to convert from XML to map and back again. My current thinking is to implement that logic in aws-erlang and then re-use it in aws-elixir. |
It would be great to have a solution. I ended up using erlcloud and doing something like this: ` token = token_arn |> String.to_char_list
But would love for this to be in Elixir. I would write it myself and PR it but I just started off in Elixir and frankly, I am really bad at it so far. |
Is the same reason that there is no |
@slashmili Yes, exactly. |
@jkakar I might find some time to work on query protocol support. Do you mind if I open a dedicated issue about this and close this one ? |
@dstendardi and @jkakar I'd be interesting in working on this as well if I can be of any help. |
@dstendardi Closing this one and opening a dedicated issue sounds great, thanks! |
@kingoftheknoll I think there is enough work for both. I see mainly two parts (serializing the query, and deserialize the response). I'll open an issue and start working on it during this week. |
Agreed. I spent some time last night looking at the XML format and it looks like it should be possible to build up the full DOM tree described by the spec and then collapse it into xpath selectors and use sweetXML. About a month ago I started playing around with using SweetXML for use with ex_aws because it also doesn't deserialize the response. Result looks like this: import SweetXml
def xml_to_map(xml) do
xml |> xpath(~x"//instancesSet"l,
instance_id: ~x".//instanceId/text()"s,
image_id: ~x".//imageId/text()"s,
state: ~x".//instanceState/name/text()"s,
private_dns_name: ~x"./item/privateDnsName/text()"s,
dns_name: ~x".//dnsName/text()"s,
key_name: ~x".//keyName/text()"s,
instance_type: ~x".//instanceType/text()"s,
launch_time: ~x".//launchTime/text()"s,
availability_zone: ~x".//placement/availabilityZone/text()"s,
subnet_id: ~x"./item/subnetId/text()"s,
vpc_id: ~x"./item/vpcId/text()"s,
private_ip_address: ~x"./item/privateIpAddress/text()"s,
public_ip_address: ~x"./item/ipAddress/text()"s,
access_lists: [
~x"./item/groupSet"l,
access_list_id: ~x".//groupId/text()"s,
access_list_name: ~x".//groupName/text()"s
]
)
end Granted here I'm only doing the InstanceSet rather than the whole reservationSet but you get the idea. Because AWS doesn't use attributes in the xml elements this makes everything much easier. So it should be possible to have a very clear one-to-one bi-directional translation between a Map and the XML. I think I good first step would be a take the |
Great library. Any plans to support SNS?
The text was updated successfully, but these errors were encountered: