Friends,
As I’ve mentioned before, I’m still a newbie to Elixir world, although a very excited newbie
I’m building a script which I’m supposed to iterate through my S3 buckets at Amazon. I’ve already managed to get the list and transform it into a collection, by using Quinn lib, which is pretty nice.
Now I’m having quite an ordeal to get to pattern_match this generated collection. I just can’t seem to get passed that array.
I need to extract the buckets names into an array and later on iterate over them.
Do you guys know how I get passed it? All the attempts I did - by using the documentation along side with me - failed. I didn’t really find something that would kind of match that seemingly weird structure.
Here’s my collection:
[%{attr: [], name: :Owner, value: [%{attr: [], name: :ID, value:
["bhjrhrfdfh5435h 345h35j3h5j35h3jh53j2h53h53255h2"]},
%{attr: [], name: :DisplayName, value: ["xxxxx"]}]},
%{attr: [], name: :Buckets, value:
[%{attr: [], name: :Bucket, value: [
%{attr: [], name: :Name, value: ["consbr-files"]},
%{attr: [], name: :CreationDate, value: ["2013-11-20T20:04:25.000Z"]}]}, %{attr: [], name: :Bucket, value: [%{attr: [], name: :Name, value: ["consbr-files-develop"]},
%{attr: [], name: :CreationDate, value: ["2015-05-27T00:32:24.000Z"]}]}, %{attr: [], name: :Bucket, value: [%{attr: [], name: :Name, value: ["consbr-files-staging"]},
%{attr: [], name: :CreationDate, value: ["2015-05-26T20:48:04.000Z"]}]}, %{attr: [], name: :Bucket, value:
[%{attr: [], name: :Name, value: ["consbr-mysql-backup"]}, %{attr: [], name: :CreationDate, value: ["2016-05-09T22:49:37.000Z"]}]}]}]
I’d like to retrieve something like so:
buckets = ["consbr-files", "consbr-files-develop", "consbr-files-staging", "consbr-mysql-backup"]
Any ideas?