<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>www.collazo.ws &#187; linux</title>
	<atom:link href="http://www.collazo.ws/tag/linux/feed" rel="self" type="application/rss+xml" />
	<link>http://www.collazo.ws</link>
	<description>A little nothing about something</description>
	<lastBuildDate>Tue, 30 Aug 2011 20:52:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Using Rackspace DNSaaS with curl (part 1)</title>
		<link>http://www.collazo.ws/2011/07/08/using-rackspace-dnsaas-with-curl-part-1</link>
		<comments>http://www.collazo.ws/2011/07/08/using-rackspace-dnsaas-with-curl-part-1#comments</comments>
		<pubDate>Fri, 08 Jul 2011 20:35:02 +0000</pubDate>
		<dc:creator>robert</dc:creator>
				<category><![CDATA[Cloud]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Rackspace]]></category>
		<category><![CDATA[curl]]></category>
		<category><![CDATA[dnsaas]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[rackspace]]></category>

		<guid isPermaLink="false">http://www.collazo.ws/?p=1074</guid>
		<description><![CDATA[<a href="http://www.collazo.ws/2011/07/08/using-rackspace-dnsaas-with-curl-part-1" title="Using Rackspace DNSaaS with curl (part 1)"></a>With the release of Rackspace DNSaaS (blog post here), I thought I would put together some examples of using curl with the service. With this release, you now have programmatic access to DNS via the API where you can set &#8230;<p class="read-more"><a href="http://www.collazo.ws/2011/07/08/using-rackspace-dnsaas-with-curl-part-1">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://www.collazo.ws/2011/07/08/using-rackspace-dnsaas-with-curl-part-1" title="Using Rackspace DNSaaS with curl (part 1)"></a><p>With the release of <a target="_blank" href="http://www.rackspace.com/cloud/cloud_hosting_products/dns/" title="Rackspace DNSaaS" target="_blank">Rackspace DNSaaS</a> (blog post <a target="_blank" href="http://www.rackspace.com/cloud/blog/2011/07/07/rackspace-cloud-dns-beta-now-available-for-us-uk-cloud-customers/" title="Rackspace Blog Post about DNSaaS" target="_blank">here</a>), I thought I would put together some examples of using curl with the service. With this release, you now have programmatic access to DNS via the <a target="_blank" href="http://docs.rackspace.com/api/" title="Rackspace API documentation" target="_blank">API</a> where you can set TTLs, create and delete various record types, and create and delete domains.<br />
<span id="more-1074"></span></p>
<h3>Authentication</h3>
<p>First, you&#8217;ll have to authenticate. To do this, you will need your API key and username.</p>
<div class="geshi no bash">
<ol>
<li class="li1">
<div class="de1">$ curl -D &#8211; -H <span class="st0">&quot;X-Auth-Key: yourAPIKey&quot;</span> -H <span class="st0">&quot;X-Auth-User: yourUsername&quot;</span> https:<span class="sy0">//</span>auth.api.rackspacecloud.com<span class="sy0">/</span>v1<span class="nu0">.0</span></div>
</li>
</ol>
</div>
<p>You should receive the following response:</p>
<pre class="qoate-code">
HTTP/1.1 204 No Content
Server: Apache/2.2.3 (Mosso Engineering)
X-Storage-Url: https://storage101.dfw1.clouddrive.com/v1/yourAccountHash
Content-Type: application/octet-stream
Date: Date and Time
X-Auth-Token: yourAuthToken
X-Storage-Token: yourStorageToken
X-Server-Management-Url: https://servers.api.rackspacecloud.com/v1.0/yourAccountNumber
Connection: Keep-Alive
X-CDN-Management-Url: https://cdn1.clouddrive.com/v1/yourAccountHash
Content-Length: 0
</pre>
<h3>Listing Domain Information</h3>
<p>To see a list of your current domains, run the following command. Don&#8217;t forget to replace your auth token and account number.</p>
<div class="geshi no bash">
<ol>
<li class="li1">
<div class="de1">$ curl -X GET -H <span class="st0">&quot;X-Auth-Token: yourAuthToken&quot;</span> -H <span class="st0">&quot;Accept: application/xml&quot;</span> https:<span class="sy0">//</span>dns.api.rackspacecloud.com<span class="sy0">/</span>v1<span class="nu0">.0</span><span class="sy0">/</span>yourAccountNumber<span class="sy0">/</span>domains</div>
</li>
</ol>
</div>
<p>Your output will be XML formatted and look like:</p>
<pre class="qoate-code">
&lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt;
&lt;domains xmlns="http://docs.rackspacecloud.com/dns/api/v1.0" xmlns:ns2="http://www.w3.org/2005/Atom" xmlns:ns3="http://docs.rackspacecloud.com/dns/api/management/v1.0" totalEntries="2"&gt;
    &lt;domain id="1697941" accountId="yourAccountNumber" name="collazo.ws" updated="2011-06-28T04:18:17Z" created="2009-12-11T01:01:26Z" /&gt;
    &lt;domain id="4062964" accountId="yourAccountNumber" name="deployitron.com" updated="2011-03-19T08:10:31Z" created="2011-01-21T23:24:44Z" /&gt;
&lt;/domains&gt;
</pre>
<p>To see the same thing formatted as JSON output, run the following:</p>
<div class="geshi no bash">
<ol>
<li class="li1">
<div class="de1">$ curl -X GET -H <span class="st0">&quot;X-Auth-Token: yourAuthToken&quot;</span> -H <span class="st0">&quot;Accept: application/json&quot;</span> https:<span class="sy0">//</span>dns.api.rackspacecloud.com<span class="sy0">/</span>v1<span class="nu0">.0</span><span class="sy0">/</span>yourAccountNumber<span class="sy0">/</span>domains</div>
</li>
</ol>
</div>
<pre class="qoate-code">
{
   "domains":[
      {
         "name":"collazo.ws",
         "id":1697941,
         "accountId":yourAccountNumber,
         "updated":"2011-06-28T04:18:17.000+0000",
         "created":"2009-12-11T01:01:26.000+0000"
      },
      {
         "name":"deployitron.com",
         "id":4062964,
         "accountId":yourAccountNumber,
         "updated":"2011-03-19T08:10:31.000+0000",
         "created":"2011-01-21T23:24:44.000+0000"
      }
   ],
   "totalEntries":2
}
</pre>
<p>To get details about a particular domain, you&#8217;ll enter the following:</p>
<div class="geshi no bash">
<ol>
<li class="li1">
<div class="de1">$ curl -X GET -H <span class="st0">&quot;X-Auth-Token: yourAuthToken&quot;</span> -H <span class="st0">&quot;Accept: application/xml&quot;</span> https:<span class="sy0">//</span>dns.api.rackspacecloud.com<span class="sy0">/</span>v1<span class="nu0">.0</span><span class="sy0">/</span>yourAccountNumber<span class="sy0">/</span>domains<span class="sy0">/</span><span class="nu0">4062964</span> <span class="co0"># &lt;- make sure you replace this with your domain ID</span></div>
</li>
</ol>
</div>
<p>This will output the following in XML format:</p>
<pre class="qoate-code">
&lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt;
&lt;domain xmlns="http://docs.rackspacecloud.com/dns/api/v1.0" xmlns:ns2="http://www.w3.org/2005/Atom" xmlns:ns3="http://docs.rackspacecloud.com/dns/api/management/v1.0" id="4062964" accountId="yourAccountNumber" name="deployitron.com" ttl="3600" emailAddress="ipadmin@stabletransit.com" updated="2011-03-19T08:10:31Z" created="2011-01-21T23:24:44Z"&gt;
    &lt;nameservers&gt;
        &lt;nameserver name="ns.rackspace.com" /&gt;
        &lt;nameserver name="ns1.rackspace.com" /&gt;
    &lt;/nameservers&gt;
    &lt;recordsList totalEntries="5"&gt;
        &lt;record id="A-1234567" type="A" name="deployitron.com" data="174.143.174.233" ttl="3600" updated="2011-01-22T11:28:10Z" created="2011-01-22T11:28:10Z" /&gt;
        &lt;record id="NS-2345678" type="NS" name="deployitron.com" data="dns1.stabletransit.com" ttl="3600" updated="2011-01-21T23:24:44Z" created="2011-01-21T23:24:44Z" /&gt;
        &lt;record id="NS-2345680" type="NS" name="deployitron.com" data="dns2.stabletransit.com" ttl="3600" updated="2011-01-21T23:24:44Z" created="2011-01-21T23:24:44Z" /&gt;
        &lt;record id="CNAME-4567890" type="CNAME" name="www.deployitron.com" data="deployitron.com" ttl="3600" updated="2011-01-22T11:30:35Z" created="2011-01-22T11:30:35Z" /&gt;
        &lt;record id="CNAME-5678901" type="CNAME" name="www2.deployitron.com" data="deployitron.com" ttl="600" updated="2011-03-19T08:10:31Z" created="2011-03-19T08:10:31Z" /&gt;
    &lt;/recordsList&gt;
&lt;/domain&gt;
</pre>
<p>To get the same thing JSON formatted:</p>
<div class="geshi no bash">
<ol>
<li class="li1">
<div class="de1">$ curl -X GET -H <span class="st0">&quot;X-Auth-Token: yourAuthToken&quot;</span> -H <span class="st0">&quot;Accept: application/json&quot;</span> https:<span class="sy0">//</span>dns.api.rackspacecloud.com<span class="sy0">/</span>v1<span class="nu0">.0</span><span class="sy0">/</span>yourAccountNumber<span class="sy0">/</span>domains<span class="sy0">/</span><span class="nu0">4062964</span></div>
</li>
</ol>
</div>
<pre class="qoate-code">
{
   "name":"deployitron.com",
   "id":4062964,
   "accountId":yourAccountNumber,
   "nameservers":[
      {
         "name":"ns.rackspace.com"
      },
      {
         "name":"ns1.rackspace.com"
      }
   ],
   "updated":"2011-03-19T08:10:31.000+0000",
   "ttl":3600,
   "recordsList":{
      "records":[
         {
            "name":"deployitron.com",
            "id":"A-1234567",
            "type":"A",
            "data":"174.143.174.233",
            "updated":"2011-01-22T11:28:10.000+0000",
            "ttl":3600,
            "created":"2011-01-22T11:28:10.000+0000"
         },
         {
            "name":"deployitron.com",
            "id":"NS-2345678",
            "type":"NS",
            "data":"dns1.stabletransit.com",
            "updated":"2011-01-21T23:24:44.000+0000",
            "ttl":3600,
            "created":"2011-01-21T23:24:44.000+0000"
         },
         {
            "name":"deployitron.com",
            "id":"NS-2345680",
            "type":"NS",
            "data":"dns2.stabletransit.com",
            "updated":"2011-01-21T23:24:44.000+0000",
            "ttl":3600,
            "created":"2011-01-21T23:24:44.000+0000"
         },
         {
            "name":"www.deployitron.com",
            "id":"CNAME-4567890",
            "type":"CNAME",
            "data":"deployitron.com",
            "updated":"2011-01-22T11:30:35.000+0000",
            "ttl":3600,
            "created":"2011-01-22T11:30:35.000+0000"
         },
         {
            "name":"www2.deployitron.com",
            "id":"CNAME-5678901",
            "type":"CNAME",
            "data":"deployitron.com",
            "updated":"2011-03-19T08:10:31.000+0000",
            "ttl":600,
            "created":"2011-03-19T08:10:31.000+0000"
         }
      ],
      "totalEntries":5
   },
   "emailAddress":"ipadmin@stabletransit.com",
   "created":"2011-01-21T23:24:44.000+0000"
}
</pre>
<h3>Creating Domains</h3>
<p>To create a domain, we issue the following JSON formatted command:</p>
<div class="geshi no bash">
<ol>
<li class="li1">
<div class="de1">$ curl -D &#8211; -X POST -d <span class="st0">&#39;{ &quot;domains&quot;:[ { &quot;name&quot;:&quot;aeVo8AiHeesh.ws&quot;, &quot;emailAddress&quot;:&quot;robert@aeVo8AiHeesh.ws&quot;, &quot;comment&quot;:&quot;This is the first domain created via API&quot;, &quot;recordsList&quot;: { &quot;records&quot;:[ { &quot;ttl&quot;:600, &quot;data&quot;:&quot;127.0.0.1&quot;, &quot;name&quot;:&quot;aeVo8AiHeesh.ws&quot;, &quot;type&quot;:&quot;A&quot; },{ &quot;priority&quot;: 10, &quot;ttl&quot;:86400, &quot;data&quot;:&quot;mail.aeVo8AiHeesh.ws&quot;, &quot;name&quot;:&quot;aeVo8AiHeesh.ws&quot;, &quot;type&quot;:&quot;MX&quot; },{ &quot;ttl&quot;:300, &quot;data&quot;:&quot;v=spf1 mx -all&quot;, &quot;name&quot;:&quot;aeVo8AiHeesh.ws&quot;, &quot;type&quot;:&quot;TXT&quot; } ] } } ] }&#39;</span> -H <span class="st0">&quot;X-Auth-Token: yourAuthToken&quot;</span> -H <span class="st0">&quot;Content-Type: application/json&quot;</span> https:<span class="sy0">//</span>dns.api.rackspacecloud.com<span class="sy0">/</span>v1<span class="nu0">.0</span><span class="sy0">/</span>yourAccountNumber<span class="sy0">/</span>domains</div>
</li>
</ol>
</div>
<p>And the following is returned:</p>
<pre class="qoate-code">
HTTP/1.1 202 Accepted
X-API-VERSION: 1.0.8
Content-Type: application/json
Date: Fri, 08 Jul 2011 15:18:12 GMT
Content-Length: 155
Server: Jetty(7.3.1.v20110307)

{"jobId":"yourJobID","callbackUrl":"https://dns.api.rackspacecloud.com/v1.0/yourAccountNumber/status/yourJobID"}
</pre>
<p>It&#8217;s important to note your job ID so that you can check the status of your job by issuing the following command:</p>
<div class="geshi no bash">
<ol>
<li class="li1">
<div class="de1">$ curl -X GET -H <span class="st0">&quot;X-Auth-Token: yourAuthToken&quot;</span> -H <span class="st0">&quot;Accept: application/json&quot;</span> https:<span class="sy0">//</span>dns.api.rackspacecloud.com<span class="sy0">/</span>v1<span class="nu0">.0</span><span class="sy0">/</span>yourAccountNumber<span class="sy0">/</span>status<span class="sy0">/</span>yourJobID</div>
</li>
</ol>
</div>
<p>If your job completed successfully, you should see something similar to the following:</p>
<pre class="qoate-code">
{"domains":[{"name":"aevo8aiheesh.ws","id":2841222,"comment":"This is the first domain created via API","accountId":yourAccountNumber,"nameservers":[{"name":"ns.rackspace.com"},{"name":"ns1.rackspace.com"}],"updated":"2011-07-08T15:21:46.000+0000","ttl":3600,"recordsList":{"records":[{"name":"aevo8aiheesh.ws","id":"A-7088731","type":"A","data":"127.0.0.1","updated":"2011-07-08T15:21:47.000+0000","ttl":600,"created":"2011-07-08T15:21:47.000+0000"},{"name":"aevo8aiheesh.ws","id":"MX-3272903","priority":10,"type":"MX","data":"mail.aeVo8AiHeesh.ws","updated":"2011-07-08T15:21:48.000+0000","ttl":86400,"created":"2011-07-08T15:21:48.000+0000"},{"name":"aevo8aiheesh.ws","id":"TXT-243256","type":"TXT","data":"v=spf1 mx -all","updated":"2011-07-08T15:21:49.000+0000","ttl":300,"created":"2011-07-08T15:21:49.000+0000"}]},"emailAddress":"robert@aeVo8AiHeesh.ws","created":"2011-07-08T15:21:45.000+0000"}]}
</pre>
<p>I see that it was created and I can verify via dig by running:</p>
<div class="geshi no bash">
<ol>
<li class="li1">
<div class="de1">$ dig aevo8aiheesh.ws <span class="sy0">@</span>ns.rackspace.com any</div>
</li>
</ol>
</div>
<p>Which returns:</p>
<pre class="qoate-code">
; &lt;&lt;&gt;&gt; DiG 9.6.0-APPLE-P2 &lt;&lt;&gt;&gt; aevo8aiheesh.ws @ns.rackspace.com any
;; global options: +cmd
;; Got answer:
;; -&gt;&gt;HEADER&lt;&lt;- opcode: QUERY, status: NOERROR, id: 40475
;; flags: qr aa rd; QUERY: 1, ANSWER: 6, AUTHORITY: 0, ADDITIONAL: 2
;; WARNING: recursion requested but not available

;; QUESTION SECTION:
;aevo8aiheesh.ws.               IN      ANY

;; ANSWER SECTION:
aevo8aiheesh.ws.        3600    IN      SOA     ns1.rackspace.com. robert.aevo8aiheesh.ws. 1310138509 3600 3600 3600 3600
aevo8aiheesh.ws.        86400   IN      MX      10 mail.aevo8aiheesh.ws.
aevo8aiheesh.ws.        3600    IN      NS      dns1.stabletransit.com.
aevo8aiheesh.ws.        3600    IN      NS      dns2.stabletransit.com.
aevo8aiheesh.ws.        300     IN      TXT     "v=spf1 mx -all"
aevo8aiheesh.ws.        600     IN      A       127.0.0.1

;; ADDITIONAL SECTION:
dns1.stabletransit.com. 86400   IN      A       69.20.95.4
dns2.stabletransit.com. 86400   IN      A       65.61.188.4

;; Query time: 35 msec
;; SERVER: 69.20.95.4#53(69.20.95.4)
;; WHEN: Fri Jul  8 10:45:38 2011
;; MSG SIZE  rcvd: 241
</pre>
<p>We can accomplish the same thing via XML by running the following:</p>
<div class="geshi no bash">
<ol>
<li class="li1">
<div class="de1">$ curl -D - -X POST -d <span class="st0">&#39;&lt;domains xmlns=&quot;http://docs.rackspacecloud.com/dns/api/v1.0&quot;&gt;&lt;domain name=&quot;paingeez7uec.com&quot; ttl=&quot;5600&quot; emailAddress=&quot;robert@paingeez7uec.com&quot; comment=&quot;This is the second domain created via API&quot;&gt;&lt;recordsList&gt;&lt;record type=&quot;A&quot; data=&quot;127.0.0.1&quot; name=&quot;paingeez7uec.com&quot;/&gt;&lt;record type=&quot;MX&quot; data=&quot;mail.paingeez7uec.com&quot; priority=&quot;10&quot; ttl=&quot;5000&quot; name=&quot;paingeez7uec.com&quot;/&gt;&lt;record type=&quot;TXT&quot; data=&quot;v=spf1 mx -all&quot; name=&quot;paingeez7uec.com&quot; ttl=&quot;600&quot;/&gt;&lt;/recordsList&gt;&lt;/domain&gt;&lt;/domains&gt;&#39;</span> -H <span class="st0">&quot;X-Auth-Token: yourAuthToken&quot;</span> -H <span class="st0">&quot;Content-Type: application/xml&quot;</span> https:<span class="sy0">//</span>dns.api.rackspacecloud.com<span class="sy0">/</span>v1<span class="nu0">.0</span><span class="sy0">/</span>yourAccountID<span class="sy0">/</span>domains</div>
</li>
</ol>
</div>
<p>Which outputs:</p>
<pre class="qoate-code">
HTTP/1.1 202 Accepted
X-API-VERSION: 1.0.8
Content-Type: application/json
Date: Fri, 08 Jul 2011 19:35:22 GMT
Content-Length: 155
Server: Jetty(7.3.1.v20110307)

{"jobId":"yourJobID","callbackUrl":"https://dns.api.rackspacecloud.com/v1.0/yourAccountNumber/status/yourJobID"}
</pre>
<p>Checking the status:</p>
<div class="geshi no bash">
<ol>
<li class="li1">
<div class="de1">$ curl -X GET -H <span class="st0">&quot;X-Auth-Token: yourAuthToken&quot;</span> -H <span class="st0">&quot;Accept: application/xml&quot;</span> https:<span class="sy0">//</span>dns.api.rackspacecloud.com<span class="sy0">/</span>v1<span class="nu0">.0</span><span class="sy0">/</span>yourAccountID<span class="sy0">/</span>status<span class="sy0">/</span>yourJobID</div>
</li>
</ol>
</div>
<p>Which returns:</p>
<pre class="qoate-code">
&lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt;&lt;domains xmlns="http://docs.rackspacecloud.com/dns/api/v1.0" xmlns:ns2="http://www.w3.org/2005/Atom" xmlns:ns3="http://docs.rackspacecloud.com/dns/api/management/v1.0"&gt;&lt;domain id="2841642" accountId="yourAccountID" name="paingeez7uec.com" ttl="5600" emailAddress="robert@paingeez7uec.com" updated="2011-07-08T19:35:23Z" created="2011-07-08T19:35:23Z" comment="This is the second domain created via API"&gt;&lt;nameservers&gt;&lt;nameserver name="ns.rackspace.com"/&gt;&lt;nameserver name="ns1.rackspace.com"/&gt;&lt;/nameservers&gt;&lt;recordsList&gt;&lt;record id="A-7089765" type="A" name="paingeez7uec.com" data="127.0.0.1" ttl="5600" updated="2011-07-08T19:35:24Z" created="2011-07-08T19:35:24Z"/&gt;&lt;record id="MX-3274128" type="MX" name="paingeez7uec.com" data="mail.paingeez7uec.com" ttl="5000" priority="10" updated="2011-07-08T19:35:25Z" created="2011-07-08T19:35:25Z"/&gt;&lt;record id="TXT-243385" type="TXT" name="paingeez7uec.com" data="v=spf1 mx -all" ttl="600" updated="2011-07-08T19:35:26Z" created="2011-07-08T19:35:26Z"/&gt;&lt;/recordsList&gt;&lt;/domain&gt;&lt;/domains&gt;
</pre>
<p>To verify the domain exists via dig:</p>
<div class="geshi no bash">
<ol>
<li class="li1">
<div class="de1">$ dig paingeez7uec.com <span class="sy0">@</span>ns.rackspace.com any</div>
</li>
</ol>
</div>
<p>Which outputs:</p>
<pre class="qoate-code">
; &lt;&lt;&gt;&gt; DiG 9.6.0-APPLE-P2 &lt;&lt;&gt;&gt; paingeez7uec.com @ns.rackspace.com any
;; global options: +cmd
;; Got answer:
;; -&gt;&gt;HEADER&lt;&lt;- opcode: QUERY, status: NOERROR, id: 45478
;; flags: qr aa rd; QUERY: 1, ANSWER: 6, AUTHORITY: 0, ADDITIONAL: 2
;; WARNING: recursion requested but not available

;; QUESTION SECTION:
;paingeez7uec.com.              IN      ANY

;; ANSWER SECTION:
paingeez7uec.com.       5600    IN      SOA     ns1.rackspace.com. robert.paingeez7uec.com. 1310153726 5600 5600 5600 5600
paingeez7uec.com.       5000    IN      MX      10 mail.paingeez7uec.com.
paingeez7uec.com.       5600    IN      NS      dns1.stabletransit.com.
paingeez7uec.com.       5600    IN      NS      dns2.stabletransit.com.
paingeez7uec.com.       600     IN      TXT     "v=spf1 mx -all"
paingeez7uec.com.       5600    IN      A       127.0.0.1

;; ADDITIONAL SECTION:
dns1.stabletransit.com. 86400   IN      A       69.20.95.4
dns2.stabletransit.com. 86400   IN      A       65.61.188.4

;; Query time: 42 msec
;; SERVER: 69.20.95.4#53(69.20.95.4)
;; WHEN: Fri Jul  8 14:49:55 2011
;; MSG SIZE  rcvd: 239
</pre>
<p>Now you can create domains in using both JSON and XML formatted responses.</p>
<h3>Deleting Domains</h3>
<p>To delete a domain using curl follow these simple steps. You will need your account ID (yourAccountID in previous examples) and the domain ID from a domain list.</p>
<p>JSON:</p>
<div class="geshi no bash">
<ol>
<li class="li1">
<div class="de1">$ curl -X DELETE -H <span class="st0">&quot;X-Auth-Token: yourAuthToken&quot;</span> -H <span class="st0">&quot;Accept: application/json&quot;</span> https:<span class="sy0">//</span>dns.api.rackspacecloud.com<span class="sy0">/</span>v1<span class="nu0">.0</span><span class="sy0">/</span>yourAccountID<span class="sy0">/</span>domains<span class="sy0">/</span><span class="nu0">2841222</span></div>
</li>
</ol>
</div>
<pre class="qoate-code">
{"jobId":"yourJobID","callbackUrl":"https://dns.api.rackspacecloud.com/v1.0/yourAccountID/status/yourJobID"}
</pre>
<p>XML:</p>
<div class="geshi no bash">
<ol>
<li class="li1">
<div class="de1">$ curl -X DELETE -H <span class="st0">&quot;X-Auth-Token: yourAuthToken&quot;</span> -H <span class="st0">&quot;Accept: application/xml&quot;</span> https:<span class="sy0">//</span>dns.api.rackspacecloud.com<span class="sy0">/</span>v1<span class="nu0">.0</span><span class="sy0">/</span>yourAccountID<span class="sy0">/</span>domains<span class="sy0">/</span><span class="nu0">2841642</span></div>
</li>
</ol>
</div>
<pre class="qoate-code">
&lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt;&lt;asyncResponse xmlns="http://docs.rackspacecloud.com/dns/api/v1.0"&gt;&lt;jobId&gt;yourJobID&lt;/jobId&gt;&lt;callbackUrl&gt;https://dns.api.rackspacecloud.com/v1.0/yourAccountID/status/yourJobID&lt;/callbackUrl&gt;&lt;/asyncResponse&gt;
</pre>
<p>Stay tuned for part 2 where I will show how to modify domains, and add/delete/modify records.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.collazo.ws/2011/07/08/using-rackspace-dnsaas-with-curl-part-1/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Edge Purge Content from Rackspace Cloud Files via curl</title>
		<link>http://www.collazo.ws/2011/06/29/edge-purge-content-from-rackspace-cloud-files-via-curl</link>
		<comments>http://www.collazo.ws/2011/06/29/edge-purge-content-from-rackspace-cloud-files-via-curl#comments</comments>
		<pubDate>Wed, 29 Jun 2011 21:10:16 +0000</pubDate>
		<dc:creator>robert</dc:creator>
				<category><![CDATA[Cloud]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[curl]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[rackspace]]></category>

		<guid isPermaLink="false">http://www.collazo.ws/?p=1052</guid>
		<description><![CDATA[<a href="http://www.collazo.ws/2011/06/29/edge-purge-content-from-rackspace-cloud-files-via-curl" title="Edge Purge Content from Rackspace Cloud Files via curl"></a>When the Rackspace Cloud Files product received Edge Purge functionality via the API, I didn&#8217;t give it much thought as I didn&#8217;t use the CDN functionality for any of my personal projects. That changed recently and I started doing some &#8230;<p class="read-more"><a href="http://www.collazo.ws/2011/06/29/edge-purge-content-from-rackspace-cloud-files-via-curl">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://www.collazo.ws/2011/06/29/edge-purge-content-from-rackspace-cloud-files-via-curl" title="Edge Purge Content from Rackspace Cloud Files via curl"></a><p>When the Rackspace Cloud Files product received <a target="_blank" href="http://www.rackspace.com/cloud/blog/2011/02/25/cloud-files-cdn-gets-edge-purge/">Edge Purge functionality via the API</a>, I didn&#8217;t give it much thought as I didn&#8217;t use the CDN functionality for any of my personal projects. That changed recently and I started doing some work with the CDN (powered by <a target="_blank" href="http://www.akamai.com/">Akamai</a>). All was fine until I realized I had set the TTL for the objects too high for my testing and wasn&#8217;t receiving the right content. Below you&#8217;ll find the appropriate methods for doing an edge purge of an object and container via curl using the API.<br />
<span id="more-1052"></span><br />
First, you&#8217;ll need to authenticate using your API key and username.</p>
<div class="geshi no bash">
<ol>
<li class="li1">
<div class="de1">$ curl -D &#8211; -H <span class="st0">&quot;X-Auth-Key: yourAPIkey&quot;</span> -H <span class="st0">&quot;X-Auth-User: yourUsername&quot;</span> https:<span class="sy0">//</span>auth.api.rackspacecloud.com<span class="sy0">/</span>v1<span class="nu0">.0</span></div>
</li>
</ol>
</div>
<p>You should receive the following:</p>
<div class="geshi no bash">
<ol>
<li class="li1">
<div class="de1">HTTP<span class="sy0">/</span><span class="nu0">1.1</span> <span class="nu0">204</span> No Content</div>
</li>
<li class="li1">
<div class="de1">Server: Apache<span class="sy0">/</span><span class="nu0">2.2</span><span class="nu0">.13</span> <span class="br0">&#40;</span>Red Hat<span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">X-Storage-Url: https:<span class="sy0">//</span>storage.clouddrive.com<span class="sy0">/</span>v1<span class="sy0">/</span>yourAccountHash</div>
</li>
<li class="li1">
<div class="de1">Content-Type: application<span class="sy0">/</span>octet-stream</div>
</li>
<li class="li1">
<div class="de1">Date: Date <span class="sy0">&amp;</span> Time</div>
</li>
<li class="li1">
<div class="de1">X-Auth-Token: yourAuthToken</div>
</li>
<li class="li1">
<div class="de1">X-Storage-Token: yourStorageToken</div>
</li>
<li class="li1">
<div class="de1">X-Server-Management-Url: https:<span class="sy0">//</span>servers.api.rackspacecloud.com<span class="sy0">/</span>v1<span class="nu0">.0</span><span class="sy0">/</span>yourAccountNumber</div>
</li>
<li class="li1">
<div class="de1">Connection: Keep-Alive</div>
</li>
<li class="li1">
<div class="de1">X-CDN-Management-Url: https:<span class="sy0">//</span>cdn1.clouddrive.com<span class="sy0">/</span>v1<span class="sy0">/</span>yourAccountHash</div>
</li>
<li class="li1">
<div class="de1">Content-Length: <span class="nu0">0</span></div>
</li>
</ol>
</div>
<p>You now have the information you need to do the Edge Purge from the Akamai fronted CDN. To delete an object, you&#8217;ll need the &#8220;X-Auth-Token&#8221; and &#8220;X-CDN-Management-Url&#8221;.</p>
<p>To do an Edge Purge of the given object “foo.txt” in the container “bar”, send the following via curl:</p>
<div class="geshi no bash">
<ol>
<li class="li1">
<div class="de1">$ curl -D &#8211; -X DELETE -H <span class="st0">&quot;X-Auth-Token: yourAuthToken&quot;</span> -H <span class="st0">&quot;X-Purge-Email: your@email.address&quot;</span> &nbsp;https:<span class="sy0">//</span>cdn1.clouddrive.com<span class="sy0">/</span>v1<span class="sy0">/</span>yourAccountHash<span class="sy0">/</span>bar<span class="sy0">/</span>foo.txt</div>
</li>
</ol>
</div>
<p>You&#8217;ll receive the following in response as well as an email to your@email.address.</p>
<div class="geshi no bash">
<ol>
<li class="li1">
<div class="de1">HTTP<span class="sy0">/</span><span class="nu0">1.1</span> <span class="nu0">204</span> No Content</div>
</li>
<li class="li1">
<div class="de1">Date: Date <span class="sy0">&amp;</span> Time</div>
</li>
<li class="li1">
<div class="de1">Server: Apache</div>
</li>
<li class="li1">
<div class="de1">X-Akam-Est-Time: <span class="nu0">420</span></div>
</li>
<li class="li1">
<div class="de1">X-Akam-Result-Code: <span class="nu0">100</span></div>
</li>
<li class="li1">
<div class="de1">Content-Length: <span class="nu0">0</span></div>
</li>
<li class="li1">
<div class="de1">Connection: close</div>
</li>
<li class="li1">
<div class="de1">Content-Type: text<span class="sy0">/</span>plain; <span class="re2">charset=</span>UTF<span class="nu0">-8</span></div>
</li>
</ol>
</div>
<p>To do an Edge Purge of the container &#8220;bar&#8221;, send the following via curl:</p>
<div class="geshi no bash">
<ol>
<li class="li1">
<div class="de1">curl -D &#8211; -H <span class="st0">&quot;X-Auth-Token: yourAuthToken&quot;</span> -H <span class="st0">&quot;X-Purge-Email: your@email.address&quot;</span> -X DELETE https:<span class="sy0">//</span>cdn1.clouddrive.com<span class="sy0">/</span>v1<span class="sy0">/</span>yourAccountHash<span class="sy0">/</span>bar<span class="sy0">/</span></div>
</li>
</ol>
</div>
<p>You should receive a response identical to the one you did for object Edge Purge.</p>
<p>That&#8217;s it!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.collazo.ws/2011/06/29/edge-purge-content-from-rackspace-cloud-files-via-curl/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Palm Pre impressions</title>
		<link>http://www.collazo.ws/2009/06/29/palm-pre-impressions</link>
		<comments>http://www.collazo.ws/2009/06/29/palm-pre-impressions#comments</comments>
		<pubDate>Mon, 29 Jun 2009 13:19:55 +0000</pubDate>
		<dc:creator>robert</dc:creator>
				<category><![CDATA[Palm]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[opensource]]></category>
		<category><![CDATA[pre]]></category>
		<category><![CDATA[smartphone]]></category>
		<category><![CDATA[sprint]]></category>
		<category><![CDATA[webos]]></category>

		<guid isPermaLink="false">http://www.collazo.ws/?p=344</guid>
		<description><![CDATA[<a href="http://www.collazo.ws/2009/06/29/palm-pre-impressions" title="Palm Pre impressions"></a>Disclaimer: I&#8217;m a Palm fanboy. I&#8217;ve had a Palm device in some form or fashion since the Palm OS 3.0 days. I think that I could still probably write in Graffiti if I needed to. It all started with a &#8230;<p class="read-more"><a href="http://www.collazo.ws/2009/06/29/palm-pre-impressions">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://www.collazo.ws/2009/06/29/palm-pre-impressions" title="Palm Pre impressions"></a><p>Disclaimer: I&#8217;m a Palm fanboy. I&#8217;ve had a Palm device in some form or fashion since the Palm OS 3.0 days. I think that I could still probably write in Graffiti if I needed to. It all started with a Handspring Visor Deluxe, upgraded into the Handspring Visor Edge, morphed into the Palm Treo 650 and finally my last PDA, the Palm Centro.  Occasionally I would dip into the Microsoft WindowsCE, Pocket PC and Windows Mobile worlds but I always went back to my trusty Handspring or Palm devices. I even have carried a Blackberry simultaneously for work because I didn&#8217;t want to give up the features my Palm devices gave me. In addition to being a Palm enthusiast, I&#8217;m also a big fan of all things Apple. I have a first generation Mac Pro (dual dual-core Xeon), a <a target="_blank" href="http://www.apple.com/macbook/">Macbook</a> (courtesy of <a target="_blank" href="http://www.therackspacecloud.com">my employer</a>), and various <a target="_blank" href="http://www.apple.com/ipodnano/">iPod</a> <a target="_blank" href="http://www.apple.com/ipodclassic/">flavors</a>. I&#8217;m also a Linux systems administrator (Gentoo, Red Hat, Fedora, Ubuntu, and Debian).  With that said, here&#8217;s a somewhat biased review of the new Palm Pre.</p>
<p>I really like the Palm Pre. Even the service plan from Sprint. While Sprint isn&#8217;t my favorite provider, they have been much better from a service perspective than anytime I have had to deal with ATT. Everything you&#8217;ve <a target="_blank" href="http://www.engadget.com/2009/06/03/palm-pre-review/">read</a> <a target="_blank" href="http://reviews.cnet.com/smartphones/palm-pre-sprint/4505-6452_7-33490473.html?tag=mncol;txt">is</a> <a target="_blank" href="http://palmgoon.com/gizmodo-eleven-things-you-should-know-about-the-palm-pre/">true</a>. It&#8217;s missing some features (not copy &#038; paste but almost).  There aren&#8217;t many things you can&#8217;t do with this phone.<br />
<span id="more-344"></span></p>
<h2>Things I like</h2>
<h3>USB Modes</h3>
<p>When you plug your Palm Pre into your Mac, you will be presented with three options: <em>Media Sync</em>, <em>USB Drive</em>, and <em>Just Charge</em>. While the phone is in <em>Media Sync</em> or <em>USB Drive mode</em>, you can not make or receive calls or text messages. When I plugged the phone into my Macbook and selected <em>Media Sync</em> or <em>USB Drive</em>, I was presented with a Finder window that looked like:
<div id="attachment_364" class="wp-caption aligncenter" style="width: 780px"><img src="http://cdn.collazo.ws/wp-content/uploads/2009/06/finder-palmpre.png" alt="A view of the Finder window when Media Sync mode is selected." title="finder-palmpre" width="770" height="256" class="size-full wp-image-364" />
<p class="wp-caption-text">A view of the Finder window when Media Sync mode is selected.</p>
</div>
<p>The only difference between <em>Media Sync</em> and <em>USB Drive</em> modes (as far as I can tell on my Mac machines) is that when <em>Media Sync</em> mode is selected, iTunes starts and the icon looks likes it does when my iPod is plugged in. In <em>USB Drive</em> mode, iPhoto starts and the device looks like a generic mass storage device. Otherwise, the Finder view is the same. In <em>Just Charge</em> mode, the Pre does just that and nothing shows up on my Mac.</p>
<h3>The Linux Connection</h3>
<p>You&#8217;ll notice that the Finder window shows a PDF named &#8220;Open Source Information.pdf&#8221;.  This PDF has copies of the <a target="_blank" href="http://www.gnu.org/licenses/gpl-2.0.html">Gnu Public License</a> (GPL) v2, <a target="_blank" href="http://www.gnu.org/licenses/lgpl-2.1.html">LGPL</a> v2.1, <a target="_blank" href="http://www.apache.org/licenses/LICENSE-2.0">Apache License</a>, Prototype JavaScript Framework, Flex, Bzip2, Openssl, Curl, SSLeay, Libpcap, Fontconfig, libxml2, Bitstream Vera Fonts, Uriparser, Giflib, Ksoap, Poly9’s polyvalent URLParser class, Wbxml.java , Wbxmlparser.java , and WbxmlSerializer.java, Liboil, stlport, Sudo, Icu, Dhcp-client, NTP, PPP, Licence (sic) for libxslt except libexslt, jpeg-6b, Expat, c-ares, Freetype, Putty, Dropbear, Ncurses, Md5, Libpng, Strace, zlib, Datejs, libspeex, speex, Ncurses, Cairo, Prototype JavaScript framework, libunwind, Wpa_supplicant, Pmipclib, tiff, JSON-C, AGG, JSON, The Legion Of The Bouncy Castle, script.aculo.us, Jemalloc, Npruntime.h, The wxWindows Library Licence, dbus (Academic Free License 2.1), Host AP, File-backed USB Storage Gadget,  SQLiteJDBC, libvorbis, libogg, VLGothic Proportional Japanese Font, Minifier, CJK Unicode TrueType Fonts, and last, but not least the JArgs command line option parsing suite for Java licenses.</p>
<p>What does all that license info mean? It means that the Pre is built using <a target="_blank" href="http://opensource.palm.com/">open source software</a> on a Linux platform. Knowing that, <a target="_blank" href="http://predev.wikidot.com/">some people</a> have taken to exploring the phone and doing things that are not supported out of the box.</p>
<h3>Camera</h3>
<p>Another feature this phone has going for it is the 3 megapixel camera. It has a nice built-in flash that <a target="_blank" href="http://twitpic.com/8d09s">takes</a> <a target="_blank" href="http://twitpic.com/8d0b4">decent</a> <a target="_blank" href="http://twitpic.com/8jisn">pictures</a>. The camera lacks a couple of features like digital zoom and video recording which my Centro had. I don&#8217;t really miss the zoom but the video recording would be nice to have although the ultra bright flash almost makes up for it.</p>
<h3>Keyboard</h3>
<p>One of the reasons I never purchased an iPhone was the lack of a &#8220;real&#8221; keyboard. I tried out the onscreen keyboard and just couldn&#8217;t get used to the fact that there was no tactile feedback. While not perfect, the Pre has a usable keyboard and if you are upgrading from a Centro, it will be no problem for you. My only complaint on the keyboard is that Palm moved a few of the buttons around from where they were located on the Centro.</p>
<h3>Multitasking</h3>
<p>If there is one thing I really love about this phone, it&#8217;s the true multitasking capabilities. I&#8217;ve been listening to <a target="_blank" href="http://www.pandora.com">Pandora</a> while browsing the web and tweeting via <a target="_blank" href="http://www.pivotallabs.com/users/chris/blog/articles/899-tweed-update-v0-9-7">Tweed</a>. I can open up Google Maps and switch over to a contact&#8217;s card to check the address without having to close one or the other. It does this via &#8220;cards&#8221; which are the application windows and the center button at the bottom of the phone. Press the button once and you can see all of the running applications (think alt-tab). Press it again and it brings you back to the last application you were using. When you want to close an application, press the center button and swipe the card up. The application is closed. In addition to the cards, there is a notification bar for other applications that are running periodically like email which notifies you at the bottom of the screen when you have new mail (or new tweets).
<div id="attachment_417" class="wp-caption aligncenter" style="width: 160px"><img src="http://cdn.collazo.ws/wp-content/uploads/2009/06/tweed_2009-29-06_072640-150x150.jpg" alt="3 applications running simultaneously" title="Pre Multitasking Screen Capture" width="150" height="150" class="size-thumbnail wp-image-417" />
<p class="wp-caption-text">3 applications running simultaneously</p>
</div>
<h2>Things I don&#8217;t like</h2>
<h3>Battery life</h3>
<p>You have probably read about this issue in other places but battery life for the Pre stinks. Palm has addressed this in their <a target="_blank" href="http://kb.palm.com/wps/portal/kb/na/pre/p100eww/sprint/solutions/article/50607_en.html#N066192D0.0665F218">1.0.3 update</a> but I did not find any significant improvements. There are <a target="_blank" href="http://blog.treonauts.com/2009/06/palm-pre-battery-life-tips.html">some</a> <a target="_blank" href="http://cnettv.cnet.com/maximize-palm-pre-battery-life/9742-1_53-50072972.html">sites</a> that you can visit for tips on how to maximize your Pre&#8217;s battery life. Some of the suggestions I found most beneficial were setting the screen to turn off automatically after a shorter period of inactivity, lowering the screen brightness, and turning off the Wi-Fi, Bluetooth and GPS features when not using them. If you do not want to make these changes, <a target="_blank" href="http://www.seidioonline.com/product-p/basi13pmx3.htm">Seidio</a> makes a battery that offers more charging capability (yes, the Palm Pre has a replaceable battery).</p>
<h3>Copy &#038; Paste</h3>
<p>Yes, the Palm Pre has copy and paste. Does it work? Kinda. You can&#8217;t copy and paste from text messages, IM&#8217;s, web pages but you can copy and paste from URL bar, address book and text messages (as you type them). In my Centro, you could copy and paste from everything.</p>
<h3>Download from the browser</h3>
<p>You can&#8217;t download from the browser on the Pre. That means no saving mp3&#8242;s or images to your phone (yet another thing I could do on my Centro). I don&#8217;t know why Palm removed these features but hopefully they&#8217;ll give them back in a future update.</p>
<h3>Notification sounds can&#8217;t be changed</h3>
<p>Yes, that&#8217;s right, you can not have different notification sounds for different events. A new tweet sounds like a new email which sounds like a new voicemail (minus the initial ringing of course). Hopefully Palm will release an update that will allow this to be modified but until then, you can always try to change it <a target="_blank" href="http://predev.wikidot.com/alerts-from-usb">yourself</a>.</p>
<h3>Classic emulation</h3>
<p>Being a long time Palm user, I was really excited that I would be able to use my old Garnet applications on my new webOS phone. Unfortunately, I was never able to get <a target="_blank" href="http://www.motionapps.com/classic/">Classic from MotionApps</a> to work and now my trial period is over. I can&#8217;t see myself spending $29.95 on an application that I&#8217;m not even sure will run my applications. I have a ticket open with them to see if they can expand my trial so we&#8217;ll see where that goes.</p>
<h3>App Catalog</h3>
<p>While there are some great applications in the App Catalog (Fandango, Accuweather, Tweed), it just doesn&#8217;t have the quantity that the iPhone has. Granted, the iPhone has been around for a few years but Palm hasn&#8217;t even released the SDK (codenamed Mojo) publicly yet. I understand the need to test but how could this have not been ready in time for launch? On the plus side, it&#8217;s very easy to use and install applications. </p>
<h2>Conclusion</h2>
<p>Get this phone. I don&#8217;t think you&#8217;ll be disappointed. <a target="_blank" href="http://smartphones.about.com/od/wheretobuy/a/iphone_vs_palm_pre_price.htm">Here</a> is a link detailing some cost comparisons too and you&#8217;ll see that Sprint is cheaper for unlimited everything.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.collazo.ws/2009/06/29/palm-pre-impressions/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk: enhanced
Database Caching 11/30 queries in 0.280 seconds using apc
Object Caching 636/656 objects using disk: basic
Content Delivery Network via Rackspace Cloud Files: cdn.collazo.ws

Served from: www.collazo.ws @ 2012-02-06 02:15:02 -->
