Cocoa‹‰¼·¼#45-AWS SimpleDB‚’½£¦‚‹

  • View
    306

  • Download
    1

Embed Size (px)

Text of Cocoa‹‰¼·¼#45-AWS...

  • ASW SimpleDB

    Cocoa#45July 9, 2011Masayuki Nii

    11179

  • Agenda

    SimpleDB

    API

    iOS

    21179

  • Amazon Web Services

    31179

  • AWS SimpleDB

    SELECT 0

    41179

  • SimpleDB

    51179

  • SimpleDB

    1

    ItemName

    61179

  • AWS

    API

    71179

  • API

    REST API iOS

    81179

  • URL ? eld1eld10eld11eld2base64

    XML

    91179

  • https://sdb.ap-northeast-1.amazonaws.com/?AWSAccessKeyId=AKIAJZ6KBTPPRMGJA6VA&Action=Select&SelectExpression=select%20familyname%2Cgivenname%2Cfamilyname_yomi%2Cgivenname_yomi%2Ctelephone%2Ccellphone%2Cemail%2Cbirthday%2Czip%2Cpref%2Ccity%2Caddress%2Cblood%20from%20CloudAddressBook&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2011-07-08T16%3A59%3A51Z&Version=2009-04-15&Signature=L%2FTow6%2FUt%2BiUBAdBboHt6RGYiOlzLUkDksyuqDzJH8A%3D

    101179

  • GET[return]sdb.ap-northeast-1.amazonaws.com[return]AWSAccessKeyId=AKIAJZ6KBTPPRMGJA6VA&Action=Select&SelectExpression=select%20familyname%2Cgivenname%2Cfamilyname_yomi%2Cgivenname_yomi%2Ctelephone%2Ccellphone%2Cemail%2Cbirthday%2Czip%2Cpref%2Ccity%2Caddress%2Cblood%20from%20CloudAddressBook&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2011-07-08T16%3A59%3A51Z&Version=2009-04-15[return]

    111179

  • 121179

  • https://sdb.ap-northeast-1.amazonaws.com/?AWSAccessKeyId=XXXXXXXXXXXXXXXXXXXX&Action=PutAttributes&Attribute.1.Name=familyname&Attribute.1.Value=%E6%9D%BE%E5%B1%85%E4%B9%85&Attribute.10.Name=pref&Attribute.10.Value=%E9%95%B7%E9%87%8E%E7%9C%8C&Attribute.11.Name=city&Attribute.11.Value=%E9%95%B7%E9%87%8E%E5%B8%82&Attribute.12.Name=address&Attribute.12.Value=%E4%BF%A1%E5%B7%9E%E6%96%B0%E7%94%BA%E5%B7%A6%E5%8F%B399-99-13&Attribute.13.Name=blood&Attribute.13.Value=B&Attribute.2.Name=givenname&Attribute.2.Value=%E6%97%A9%E7%B4%80&Attribute.3.Name=familyname_yomi&Attribute.3.Value=%E3%81%BE%E3%81%A4%E3%81%84%E3%81%8F&Attribute.4.Name=givenname_yomi&Attribute.4.Value=%E3%81%95%E3%81%8D&Attribute.5.Name=telephone&Attribute.5.Value=031-9876-5432&Attribute.6.Name=cellphone&Attribute.6.Value=090-0000-0000&Attribute.7.Name=email&Attribute.7.Value=dummy_addr%40example.com&Attribute.8.Name=birthday&Attribute.8.Value=31316&Attribute.9.Name=zip&Attribute.9.Value=381-2424&DomainName=CloudAddressBook&ItemName=1004&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2011-07-08T17%3A25%3A21Z&Version=2009-04-15&Signature=0qrWuMKoIVzWBIWaG%2Bpuhz%2B97kIAf0UXmZHCuq9Vqow%3D

    131179

  • [] Simple DB

    iOS AWS NSURLConnection

    141179

  • timestamp=`date -u +%Y-%m-%dT%H%%3A%M%%3A%SZ`params="AWSAccessKeyId=${accessKeyId}&Action=CreateDomain&DomainName=${domain}&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=${timestamp}&Version=2009-04-15"sign=`echo -n -e "GET\n${endpoint}\n/\n${params}" | openssl dgst -sha256 -binary -hmac ${secretAccessKey} | openssl base64 | sed -e 's/+/%2B/g' | sed -e 's/=/%3D/g' `curl "https://${endpoint}/?${params}&Signature=${sign}"

    openssl base64

    151179

  • SimpleDB

    161179