tag:blogger.com,1999:blog-43591211169075056222024-03-18T02:47:46.184-07:00Avoiding Tech-sandTech-sand is my moniker for technology that keeps us from delivering value...Jimmy Rayhttp://www.blogger.com/profile/14276730603257237473noreply@blogger.comBlogger80125tag:blogger.com,1999:blog-4359121116907505622.post-35011008926326763442018-05-15T10:21:00.000-07:002018-08-01T06:05:02.581-07:00JSON Parsing with gron<div style="background-color: white; border: 0px; color: #021829; font-family: "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif; font-size: 14px; padding: 0px; vertical-align: baseline;">
While jq is powerful, its major shortcoming is that it requires one to know the JSON structure being parsed. <a href="https://github.com/tomnomnom/gron" rel="nofollow" target="_blank">gron</a><span id="goog_534992124"></span><a href="https://www.blogger.com/"></a><span id="goog_534992125"></span> is less restrictive and can be combined easily with Linux tools, such as grep, sed, and awk to build very powerful parsing pipelines, without having to know exactly where to expect a particular structure or value.</div>
<div style="background-color: white; border: 0px; color: #021829; font-family: "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif; font-size: 14px; min-height: 8pt; padding: 0px; vertical-align: baseline;">
<br /></div>
<h2 style="background-color: white; border: 0px; color: #d03027; font-family: proxima_nova_rgregular; font-size: 20px; margin: 0px; padding: 0px; vertical-align: baseline;">
Using the Right Tools</h2>
<div style="background-color: white; border: 0px; color: #021829; font-family: "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif; font-size: 14px; padding: 0px; vertical-align: baseline;">
As a polyglot programmer I strive to employ the simplest approach, the best tool for the job. I have parsed JSON in Java, Python, and Go, but I think too many times we ignore the UNIX/Linux tools (sed, awk, cut, etc.). Too many programmers ignore these tools, and write hulking data parsers that are just overkill. With gron, I find it easier to utilize these strong text editing, manipulation, and filtering tools.</div>
<div style="background-color: white; border: 0px; color: #021829; font-family: "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif; font-size: 14px; min-height: 8pt; padding: 0px; vertical-align: baseline;">
<br /></div>
<h2 style="background-color: white; border: 0px; color: #d03027; font-family: proxima_nova_rgregular; font-size: 20px; margin: 0px; padding: 0px; vertical-align: baseline;">
Installing gron</h2>
<div style="background-color: white; border: 0px; color: #021829; font-family: "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif; font-size: 14px; padding: 0px; vertical-align: baseline;">
Instructions can be found <a class="jive-link-external-small" href="https://github.com/tomnomnom/gron#installation" rel="nofollow" style="border: 0px; color: #043561; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px calc(12px + 0.35ex) 0px 0px; text-decoration-line: none; vertical-align: baseline;">here</a> for installing gron. I used <span style="border: 0px; font-family: "courier new" , "courier"; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">brew install gron</span>. And then, for reasons that will be apparent later, I added the following alias:</div>
<div style="background-color: white; border: 0px; color: #021829; font-family: "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif; font-size: 14px; padding: 0px; vertical-align: baseline;">
<span style="border: 0px; font-family: "courier new" , "courier"; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">alias norg="gron --ungron"</span>.</div>
<div style="background-color: white; border: 0px; color: #021829; font-family: "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif; font-size: 14px; padding: 0px; vertical-align: baseline;">
<br /></div>
<h2 style="background-color: white; border: 0px; color: #d03027; font-family: proxima_nova_rgregular; font-size: 20px; margin: 0px; padding: 0px; vertical-align: baseline;">
Make JSON greppable</h2>
<div style="background-color: white; border: 0px; color: #021829; font-family: "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif; font-size: 14px; padding: 0px; vertical-align: baseline;">
Obviously, being text-based, JSON is already "greppable". However, the strength of <span style="border: 0px; font-family: "courier new" , "courier"; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">gron</span> comes from it's ability to split JSON into lines of what is referred to as "discrete assignments". Given the JSON snippet below (from an aws ec2 CLI call):</div>
<div style="background-color: white; border: 0px; color: #021829; font-family: "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif; font-size: 14px; padding: 0px; vertical-align: baseline;">
<br /></div>
<ol class="dp-c" start="1" style="background-color: white; border: none; color: #5c5c5c; font-family: Consolas, "Courier New", Courier, mono, serif; font-size: 12px; list-style-image: initial; list-style-position: initial; margin: 0px 0px 1px 45px !important; padding: 0px; vertical-align: baseline;">
<li class="alt" style="border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; color: inherit; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> { </span></span></li>
<li class="" style="background-color: #f6f6f6; border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> <span class="string" style="background-color: inherit; border: 0px; color: blue; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">"Reservations"</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">: [ </span></span></li>
<li class="alt" style="border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; color: inherit; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> { </span></li>
<li class="" style="background-color: #f6f6f6; border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> <span class="string" style="background-color: inherit; border: 0px; color: blue; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">"OwnerId"</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">: </span><span class="string" style="background-color: inherit; border: 0px; color: blue; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">"<OWNER_ID>"</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">, </span></span></li>
<li class="alt" style="border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; color: inherit; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> <span class="string" style="background-color: inherit; border: 0px; color: blue; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">"ReservationId"</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">: </span><span class="string" style="background-color: inherit; border: 0px; color: blue; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">"<RES_ID>"</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">, </span></span></li>
<li class="" style="background-color: #f6f6f6; border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> <span class="string" style="background-color: inherit; border: 0px; color: blue; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">"Groups"</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">: [], </span></span></li>
<li class="alt" style="border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; color: inherit; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> <span class="string" style="background-color: inherit; border: 0px; color: blue; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">"Instances"</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">: [ </span></span></li>
<li class="" style="background-color: #f6f6f6; border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> { </span></li>
<li class="alt" style="border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; color: inherit; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> <span class="string" style="background-color: inherit; border: 0px; color: blue; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">"Monitoring"</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">: { </span></span></li>
<li class="" style="background-color: #f6f6f6; border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> <span class="string" style="background-color: inherit; border: 0px; color: blue; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">"State"</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">: </span><span class="string" style="background-color: inherit; border: 0px; color: blue; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">"disabled"</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> </span></span></li>
<li class="alt" style="border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; color: inherit; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> }, </span></li>
<li class="" style="background-color: #f6f6f6; border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> <span class="string" style="background-color: inherit; border: 0px; color: blue; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">"PublicDnsName"</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">: </span><span class="string" style="background-color: inherit; border: 0px; color: blue; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">""</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">, </span></span></li>
<li class="alt" style="border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; color: inherit; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> <span class="string" style="background-color: inherit; border: 0px; color: blue; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">"State"</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">: { </span></span></li>
<li class="" style="background-color: #f6f6f6; border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> <span class="string" style="background-color: inherit; border: 0px; color: blue; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">"Code"</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">: </span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">16</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">, </span></span></li>
<li class="alt" style="border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; color: inherit; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> <span class="string" style="background-color: inherit; border: 0px; color: blue; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">"Name"</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">: </span><span class="string" style="background-color: inherit; border: 0px; color: blue; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">"running"</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> </span></span></li>
<li class="" style="background-color: #f6f6f6; border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> }, </span></li>
<li class="alt" style="border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; color: inherit; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> <span class="string" style="background-color: inherit; border: 0px; color: blue; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">"EbsOptimized"</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">: </span><span class="keyword" style="background-color: inherit; border: 0px; color: #006699; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">false</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">, </span></span></li>
<li class="" style="background-color: #f6f6f6; border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> <span class="string" style="background-color: inherit; border: 0px; color: blue; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">"LaunchTime"</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">: </span><span class="string" style="background-color: inherit; border: 0px; color: blue; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">"2016-08-31T22:39:37.000Z"</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">, </span></span></li>
<li class="alt" style="border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; color: inherit; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> <span class="string" style="background-color: inherit; border: 0px; color: blue; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">"PublicIpAddress"</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">: </span><span class="string" style="background-color: inherit; border: 0px; color: blue; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">"<PUBLIC_IP>"</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">, </span></span></li>
<li class="" style="background-color: #f6f6f6; border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> <span class="string" style="background-color: inherit; border: 0px; color: blue; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">"PrivateIpAddress"</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">: </span><span class="string" style="background-color: inherit; border: 0px; color: blue; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">"<PRIVATE_IP>"</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">, </span></span></li>
<li class="alt" style="border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; color: inherit; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> <span class="string" style="background-color: inherit; border: 0px; color: blue; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">"ProductCodes"</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">: [], </span></span></li>
<li class="" style="background-color: #f6f6f6; border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> <span class="string" style="background-color: inherit; border: 0px; color: blue; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">"VpcId"</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">: </span><span class="string" style="background-color: inherit; border: 0px; color: blue; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">"<VPC_ID>"</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">, </span></span></li>
<li class="alt" style="border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; color: inherit; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> <span class="string" style="background-color: inherit; border: 0px; color: blue; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">"StateTransitionReason"</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">: </span><span class="string" style="background-color: inherit; border: 0px; color: blue; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">""</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">, </span></span></li>
<li class="" style="background-color: #f6f6f6; border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> <span class="string" style="background-color: inherit; border: 0px; color: blue; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">"InstanceId"</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">: </span><span class="string" style="background-color: inherit; border: 0px; color: blue; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">"<ID>"</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">, </span></span></li>
<li class="alt" style="border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; color: inherit; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> <span class="string" style="background-color: inherit; border: 0px; color: blue; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">"ImageId"</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">: </span><span class="string" style="background-color: inherit; border: 0px; color: blue; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">"<AMI_ID>"</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">, </span></span></li>
<li class="" style="background-color: #f6f6f6; border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> <span class="string" style="background-color: inherit; border: 0px; color: blue; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">"PrivateDnsName"</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">: </span><span class="string" style="background-color: inherit; border: 0px; color: blue; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">"<PRIVATE_DNS_NAME>"</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">, </span></span></li>
<li class="alt" style="border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; color: inherit; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> <span class="string" style="background-color: inherit; border: 0px; color: blue; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">"KeyName"</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">: </span><span class="string" style="background-color: inherit; border: 0px; color: blue; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">"<KEY_NAME>"</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">, </span></span></li>
<li class="" style="background-color: #f6f6f6; border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> <span class="string" style="background-color: inherit; border: 0px; color: blue; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">"SecurityGroups"</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">: [... </span></span></li>
</ol>
<div>
<span style="font-family: "consolas" , "courier new" , "courier" , "mono" , serif;"><span style="font-size: 12px; white-space: nowrap;"><br /></span></span></div>
<div>
<span style="font-family: "consolas" , "courier new" , "courier" , "mono" , serif;"><span style="font-size: 12px; white-space: nowrap;"><br /></span></span></div>
<div>
<div style="background-color: white; border: 0px; color: #021829; font-family: "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif; font-size: 14px; padding: 0px; vertical-align: baseline;">
gron will parse (<span style="border: 0px; font-family: "courier new" , "courier"; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">cat ~/ec2.json | gron</span>) and convert the JSON to lines of discrete assignments:</div>
<div class="dp-highlighter" style="background-color: #e7e5dc; border: 0px; color: #021829; font-family: Consolas, "Courier New", Courier, mono, serif; font-size: 12px; margin: 0px !important; overflow: visible; padding: 1px 0px 0px; vertical-align: baseline; width: auto;">
<div class="bar" style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px 0px 0px 45px; vertical-align: baseline;">
<div style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">
</div>
</div>
<ol class="dp-c" start="1" style="background-color: white; border: none; color: #5c5c5c; font-family: inherit; font-style: inherit; font-weight: inherit; list-style-image: initial; list-style-position: initial; margin: 0px 0px 1px 45px !important; padding: 0px; vertical-align: baseline;">
<li class="alt" style="border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; color: inherit; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">json = {}; </span></span></li>
<li class="" style="background-color: #f6f6f6; border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">json.Reservations = []; </span></li>
<li class="alt" style="border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; color: inherit; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">json.Reservations[<span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">] = {}; </span></span></li>
<li class="" style="background-color: #f6f6f6; border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">json.Reservations[<span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Groups = []; </span></span></li>
<li class="alt" style="border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; color: inherit; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">json.Reservations[<span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Instances = []; </span></span></li>
<li class="" style="background-color: #f6f6f6; border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">json.Reservations[<span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Instances[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">] = {}; </span></span></li>
<li class="alt" style="border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; color: inherit; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">json.Reservations[<span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Instances[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].AmiLaunchIndex = </span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">; </span></span></li>
<li class="" style="background-color: #f6f6f6; border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">json.Reservations[<span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Instances[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Architecture = </span><span class="string" style="background-color: inherit; border: 0px; color: blue; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">"x86_64"</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">; </span></span></li>
<li class="alt" style="border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; color: inherit; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">json.Reservations[<span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Instances[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].BlockDeviceMappings = []; </span></span></li>
<li class="" style="background-color: #f6f6f6; border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">json.Reservations[<span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Instances[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].BlockDeviceMappings[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">] = {}; </span></span></li>
<li class="alt" style="border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; color: inherit; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">json.Reservations[<span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Instances[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].BlockDeviceMappings[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].DeviceName = </span><span class="string" style="background-color: inherit; border: 0px; color: blue; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">"/dev/xvda"</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">; </span></span></li>
<li class="" style="background-color: #f6f6f6; border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">json.Reservations[<span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Instances[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].BlockDeviceMappings[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Ebs = {}; </span></span></li>
<li class="alt" style="border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; color: inherit; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">json.Reservations[<span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Instances[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].BlockDeviceMappings[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Ebs.AttachTime = </span><span class="string" style="background-color: inherit; border: 0px; color: blue; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">"2016-08-21T22:00:41.000Z"</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">; </span></span></li>
<li class="" style="background-color: #f6f6f6; border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">json.Reservations[<span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Instances[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].BlockDeviceMappings[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Ebs.DeleteOnTermination = </span><span class="keyword" style="background-color: inherit; border: 0px; color: #006699; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">true</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">; </span></span></li>
<li class="alt" style="border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; color: inherit; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">json.Reservations[<span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Instances[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].BlockDeviceMappings[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Ebs.Status = </span><span class="string" style="background-color: inherit; border: 0px; color: blue; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">"attached"</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">; </span></span></li>
<li class="" style="background-color: #f6f6f6; border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">json.Reservations[<span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Instances[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].BlockDeviceMappings[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Ebs.VolumeId = </span><span class="string" style="background-color: inherit; border: 0px; color: blue; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">"<VOL_ID>"</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">; </span></span></li>
<li class="alt" style="border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; color: inherit; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">json.Reservations[<span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Instances[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].ClientToken = </span><span class="string" style="background-color: inherit; border: 0px; color: blue; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">"<CLIENT_TOKEN>"</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">; </span></span></li>
<li class="" style="background-color: #f6f6f6; border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">json.Reservations[<span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Instances[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].EbsOptimized = </span><span class="keyword" style="background-color: inherit; border: 0px; color: #006699; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">false</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">; </span></span></li>
<li class="alt" style="border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; color: inherit; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">json.Reservations[<span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Instances[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Hypervisor = </span><span class="string" style="background-color: inherit; border: 0px; color: blue; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">"xen"</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">; </span></span></li>
<li class="" style="background-color: #f6f6f6; border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">json.Reservations[<span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Instances[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].ImageId = </span><span class="string" style="background-color: inherit; border: 0px; color: blue; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">"<AMI_ID>"</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">; </span></span></li>
<li class="alt" style="border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; color: inherit; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">json.Reservations[<span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Instances[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].InstanceId = </span><span class="string" style="background-color: inherit; border: 0px; color: blue; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">"<ID>"</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">; </span></span></li>
<li class="" style="background-color: #f6f6f6; border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">json.Reservations[<span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Instances[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].InstanceType = </span><span class="string" style="background-color: inherit; border: 0px; color: blue; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">"t2.small"</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">; </span></span></li>
<li class="alt" style="border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; color: inherit; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">json.Reservations[<span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Instances[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].KeyName = </span><span class="string" style="background-color: inherit; border: 0px; color: blue; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">"<KEY_NAME>"</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">; </span></span></li>
<li class="" style="background-color: #f6f6f6; border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">json.Reservations[<span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Instances[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].LaunchTime = </span><span class="string" style="background-color: inherit; border: 0px; color: blue; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">"2016-08-31T22:39:37.000Z"</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">; </span></span></li>
<li class="alt" style="border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; color: inherit; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">json.Reservations[<span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Instances[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Monitoring = {}; </span></span></li>
<li class="" style="background-color: #f6f6f6; border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">json.Reservations[<span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Instances[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Monitoring.State = </span><span class="string" style="background-color: inherit; border: 0px; color: blue; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">"disabled"</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">; </span></span></li>
<li class="alt" style="border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; color: inherit; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">json.Reservations[<span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Instances[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].NetworkInterfaces = []; </span></span></li>
<li class="" style="background-color: #f6f6f6; border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">json.Reservations[<span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Instances[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].NetworkInterfaces[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">] = {}; </span></span></li>
<li class="alt" style="border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; color: inherit; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">json.Reservations[<span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Instances[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].NetworkInterfaces[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Association = {}; </span></span></li>
<li class="" style="background-color: #f6f6f6; border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">json.Reservations[<span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Instances[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].NetworkInterfaces[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Association.IpOwnerId = </span><span class="string" style="background-color: inherit; border: 0px; color: blue; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">"<OWNER_ID>"</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">; </span></span></li>
<li class="alt" style="border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; color: inherit; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">json.Reservations[<span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Instances[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].NetworkInterfaces[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Association.PublicDnsName = </span><span class="string" style="background-color: inherit; border: 0px; color: blue; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">""</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">; </span></span></li>
<li class="" style="background-color: #f6f6f6; border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">json.Reservations[<span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Instances[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].NetworkInterfaces[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Association.PublicIp = </span><span class="string" style="background-color: inherit; border: 0px; color: blue; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">"<PUBLIC_IP>"</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">; </span></span></li>
<li class="alt" style="border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; color: inherit; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">json.Reservations[<span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Instances[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].NetworkInterfaces[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Attachment = {}; </span></span></li>
<li class="" style="background-color: #f6f6f6; border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">json.Reservations[<span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Instances[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].NetworkInterfaces[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Attachment.AttachTime = </span><span class="string" style="background-color: inherit; border: 0px; color: blue; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">"2016-08-21T22:00:40.000Z"</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">; </span></span></li>
<li class="alt" style="border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; color: inherit; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">json.Reservations[<span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Instances[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].NetworkInterfaces[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Attachment.AttachmentId = </span><span class="string" style="background-color: inherit; border: 0px; color: blue; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">"<ENI_ID>"</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">; </span></span></li>
<li class="" style="background-color: #f6f6f6; border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">json.Reservations[<span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Instances[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].NetworkInterfaces[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Attachment.DeleteOnTermination = </span><span class="keyword" style="background-color: inherit; border: 0px; color: #006699; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">true</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">; </span></span></li>
<li class="alt" style="border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; color: inherit; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">json.Reservations[<span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Instances[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].NetworkInterfaces[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Attachment.DeviceIndex = </span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">; </span></span></li>
<li class="" style="background-color: #f6f6f6; border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">json.Reservations[<span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Instances[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].NetworkInterfaces[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Attachment.Status = </span><span class="string" style="background-color: inherit; border: 0px; color: blue; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">"attached"</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">; </span></span></li>
<li class="alt" style="border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; color: inherit; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">json.Reservations[<span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Instances[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].NetworkInterfaces[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Description = </span><span class="string" style="background-color: inherit; border: 0px; color: blue; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">"Primary network interface"</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">; </span></span></li>
<li class="" style="background-color: #f6f6f6; border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">json.Reservations[<span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Instances[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].NetworkInterfaces[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Groups = []; </span></span></li>
<li class="alt" style="border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; color: inherit; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">json.Reservations[<span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Instances[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].NetworkInterfaces[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Groups[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">] = {}; </span></span></li>
<li class="" style="background-color: #f6f6f6; border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">json.Reservations[<span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Instances[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].NetworkInterfaces[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Groups[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].GroupId = </span><span class="string" style="background-color: inherit; border: 0px; color: blue; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">"<SG_ID>"</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">; </span></span></li>
<li class="alt" style="border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; color: inherit; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">json.Reservations[<span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Instances[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].NetworkInterfaces[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Groups[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].GroupName = </span><span class="string" style="background-color: inherit; border: 0px; color: blue; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">"Bastion"</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">; </span></span></li>
<li class="" style="background-color: #f6f6f6; border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">json.Reservations[<span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Instances[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].NetworkInterfaces[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].MacAddress = </span><span class="string" style="background-color: inherit; border: 0px; color: blue; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">"<MAC_ADDRESS>"</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">; </span></span></li>
<li class="alt" style="border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; color: inherit; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">json.Reservations[<span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Instances[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].NetworkInterfaces[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].NetworkInterfaceId = </span><span class="string" style="background-color: inherit; border: 0px; color: blue; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">"<ENI_ID>"</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">; </span></span></li>
<li class="" style="background-color: #f6f6f6; border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">json.Reservations[<span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Instances[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].NetworkInterfaces[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].OwnerId = </span><span class="string" style="background-color: inherit; border: 0px; color: blue; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">"<OWNER_ID>"</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">; </span></span></li>
<li class="alt" style="border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; color: inherit; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">json.Reservations[<span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Instances[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].NetworkInterfaces[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].PrivateIpAddress = </span><span class="string" style="background-color: inherit; border: 0px; color: blue; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">"<PRIVATE_IP>"</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">; </span></span></li>
<li class="" style="background-color: #f6f6f6; border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">json.Reservations[<span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Instances[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].NetworkInterfaces[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].PrivateIpAddresses = []; </span></span></li>
<li class="alt" style="border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; color: inherit; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">json.Reservations[<span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Instances[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].NetworkInterfaces[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].PrivateIpAddresses[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">] = {}; </span></span></li>
<li class="" style="background-color: #f6f6f6; border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">json.Reservations[<span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Instances[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].NetworkInterfaces[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].PrivateIpAddresses[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Association = {}; </span></span></li>
<li class="alt" style="border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; color: inherit; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">json.Reservations[<span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Instances[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].NetworkInterfaces[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].PrivateIpAddresses[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Association.IpOwnerId = </span><span class="string" style="background-color: inherit; border: 0px; color: blue; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">"<OWNER_ID>"</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">; </span></span></li>
<li class="" style="background-color: #f6f6f6; border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">json.Reservations[<span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Instances[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].NetworkInterfaces[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].PrivateIpAddresses[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Association.PublicDnsName = </span><span class="string" style="background-color: inherit; border: 0px; color: blue; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">""</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">; </span></span></li>
<li class="alt" style="border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; color: inherit; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">json.Reservations[<span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Instances[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].NetworkInterfaces[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].PrivateIpAddresses[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Association.PublicIp = </span><span class="string" style="background-color: inherit; border: 0px; color: blue; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">"<PUBLIC_IP>"</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">; </span></span></li>
<li class="" style="background-color: #f6f6f6; border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">json.Reservations[<span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Instances[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].NetworkInterfaces[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].PrivateIpAddresses[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Primary = </span><span class="keyword" style="background-color: inherit; border: 0px; color: #006699; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">true</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">; </span></span></li>
<li class="alt" style="border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; color: inherit; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">json.Reservations[<span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Instances[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].NetworkInterfaces[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].PrivateIpAddresses[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].PrivateIpAddress = </span><span class="string" style="background-color: inherit; border: 0px; color: blue; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">"<PRIVATE_IP>"</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">; </span></span></li>
<li class="" style="background-color: #f6f6f6; border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">json.Reservations[<span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Instances[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].NetworkInterfaces[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].SourceDestCheck = </span><span class="keyword" style="background-color: inherit; border: 0px; color: #006699; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">true</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">; </span></span></li>
<li class="alt" style="border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; color: inherit; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">json.Reservations[<span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Instances[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].NetworkInterfaces[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Status = </span><span class="string" style="background-color: inherit; border: 0px; color: blue; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">"in-use"</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">; </span></span></li>
<li class="" style="background-color: #f6f6f6; border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">json.Reservations[<span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Instances[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].NetworkInterfaces[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].SubnetId = </span><span class="string" style="background-color: inherit; border: 0px; color: blue; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">"<SUBNET_ID>"</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">; </span></span></li>
<li class="alt" style="border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; color: inherit; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">json.Reservations[<span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Instances[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].NetworkInterfaces[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].VpcId = </span><span class="string" style="background-color: inherit; border: 0px; color: blue; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">"<VPC_ID>"</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">; </span></span></li>
<li class="" style="background-color: #f6f6f6; border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">json.Reservations[<span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Instances[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Placement = {}; </span></span></li>
<li class="alt" style="border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; color: inherit; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">json.Reservations[<span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Instances[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Placement.AvailabilityZone = </span><span class="string" style="background-color: inherit; border: 0px; color: blue; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">"us-east-1a"</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">; </span></span></li>
<li class="" style="background-color: #f6f6f6; border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">json.Reservations[<span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Instances[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Placement.GroupName = </span><span class="string" style="background-color: inherit; border: 0px; color: blue; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">""</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">; </span></span></li>
<li class="alt" style="border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; color: inherit; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">json.Reservations[<span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Instances[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Placement.Tenancy = </span><span class="string" style="background-color: inherit; border: 0px; color: blue; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">"default"</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">; </span></span></li>
<li class="" style="background-color: #f6f6f6; border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">json.Reservations[<span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Instances[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].PrivateDnsName = </span><span class="string" style="background-color: inherit; border: 0px; color: blue; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">"<DNS_NAME>"</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">; </span></span></li>
<li class="alt" style="border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; color: inherit; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">json.Reservations[<span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Instances[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].PrivateIpAddress = </span><span class="string" style="background-color: inherit; border: 0px; color: blue; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">"<PRIVATE_IP>"</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">; </span></span></li>
<li class="" style="background-color: #f6f6f6; border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">json.Reservations[<span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Instances[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].ProductCodes = []; </span></span></li>
<li class="alt" style="border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; color: inherit; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">json.Reservations[<span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Instances[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].PublicDnsName = </span><span class="string" style="background-color: inherit; border: 0px; color: blue; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">""</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">; </span></span></li>
<li class="" style="background-color: #f6f6f6; border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">json.Reservations[<span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Instances[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].PublicIpAddress = </span><span class="string" style="background-color: inherit; border: 0px; color: blue; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">"<PUBLIC_IP>"</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">; </span></span></li>
<li class="alt" style="border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; color: inherit; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">json.Reservations[<span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Instances[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].RootDeviceName = </span><span class="string" style="background-color: inherit; border: 0px; color: blue; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">"/dev/xvda"</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">; </span></span></li>
<li class="" style="background-color: #f6f6f6; border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">json.Reservations[<span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Instances[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].RootDeviceType = </span><span class="string" style="background-color: inherit; border: 0px; color: blue; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">"ebs"</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">; </span></span></li>
<li class="alt" style="border-bottom: none; border-image: initial; border-left: 3px solid rgb(108, 226, 108); border-right: none; border-top: none; color: inherit; font-family: inherit; font-style: inherit; font-weight: inherit; height: 12pt; line-height: 12pt; list-style-image: initial; list-style-position: outside !important; list-style-type: decimal-leading-zero; margin: 0px !important; padding: 0px 3px 0px 10px !important; position: relative; vertical-align: baseline; white-space: nowrap;"><span style="background-color: inherit; border: 0px; color: black; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">json.Reservations[<span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].Instances[</span><span class="number" style="background-color: inherit; border: 0px; color: green; font-size: 9pt; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span style="background-color: inherit; border: 0px; font-size: 9pt !important; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">].SecurityGroups = [];... </span></span></li>
</ol>
</div>
</div>
<div>
<span style="font-family: "consolas" , "courier new" , "courier" , "mono" , serif;"><span style="font-size: 12px; white-space: nowrap;"><br /></span></span></div>
<div>
<span style="font-family: "consolas" , "courier new" , "courier" , "mono" , serif;"><span style="font-size: 12px; white-space: nowrap;"><br /></span></span></div>
<div>
<h2 style="background-color: white; border: 0px; color: #d03027; font-family: proxima_nova_rgregular; font-size: 20px; margin: 0px; padding: 0px; vertical-align: baseline;">
Munging gron Output Through Command Line Pipelining</h2>
<div style="background-color: white; border: 0px; color: #021829; font-family: "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif; font-size: 14px; padding: 0px; vertical-align: baseline;">
JSON is more compact than the gron output, and suited for data structuring for transport and integration. While more verbose, the gron output is a more usable format for text searching, filtering, and manipulation via Linux's text manipulation and filtering tools, or even <a href="https://www.gnu.org/software/sed/manual/sed.html" rel="nofollow" target="_blank">sed</a> and <a href="https://www.gnu.org/software/gawk/manual/gawk.html" rel="nofollow" target="_blank">awk</a>. For example, consider the following commands:</div>
</div>
<div>
<span style="font-family: "consolas" , "courier new" , "courier" , "mono" , serif;"><span style="font-size: 12px; white-space: nowrap;"><br /></span></span></div>
<div>
<div style="background-color: white; border: 0px; color: #021829; font-family: "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif; font-size: 14px; min-height: 8pt; padding: 0px; vertical-align: baseline;">
<br /></div>
<blockquote class="jive-quote" style="background: rgb(246, 246, 246); border-bottom-color: initial; border-bottom-style: initial; border-image: initial; border-left-color: rgb(204, 204, 204); border-left-style: solid; border-right-color: initial; border-right-style: initial; border-top-color: initial; border-top-style: initial; border-width: 0px 0px 0px 2px; color: #021829; font-family: "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif; font-size: 14px; margin: 10px 0px; overflow-x: auto; padding: 10px 20px; quotes: "" ""; vertical-align: baseline;">
<div style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; padding: 0px; vertical-align: baseline;">
<span style="border: 0px; font-family: "courier new" , "courier"; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">$ cat ~/ec2.json | gron | grep AvailabilityZone</span></div>
<div style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; padding: 0px; vertical-align: baseline;">
<span style="border: 0px; font-family: "courier new" , "courier"; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">json.Reservations[0].Instances[0].Placement.AvailabilityZone = "us-east-1a";</span></div>
</blockquote>
<div style="background-color: white; border: 0px; color: #021829; font-family: "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif; font-size: 14px; padding: 0px; vertical-align: baseline;">
The above command "pipeline" searches the gronned JSON for the text "AvailabilityZone" value, and returns the discrete assignment line.</div>
<div style="background-color: white; border: 0px; color: #021829; font-family: "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif; font-size: 14px; min-height: 8pt; padding: 0px; vertical-align: baseline;">
<br /></div>
<blockquote class="jive-quote" style="background: rgb(246, 246, 246); border-bottom-color: initial; border-bottom-style: initial; border-image: initial; border-left-color: rgb(204, 204, 204); border-left-style: solid; border-right-color: initial; border-right-style: initial; border-top-color: initial; border-top-style: initial; border-width: 0px 0px 0px 2px; color: #021829; font-family: "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif; font-size: 14px; margin: 10px 0px; overflow-x: auto; padding: 10px 20px; quotes: "" ""; vertical-align: baseline;">
<div style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; padding: 0px; vertical-align: baseline;">
<span style="border: 0px; font-family: "courier new" , "courier"; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">$ cat ~/ec2.json | gron | grep AvailabilityZone|cut -d\" -f2</span></div>
<div style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; padding: 0px; vertical-align: baseline;">
<span style="border: 0px; font-family: "courier new" , "courier"; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">us-east-1a</span></div>
</blockquote>
<div style="background-color: white; border: 0px; color: #021829; font-family: "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif; font-size: 14px; padding: 0px; vertical-align: baseline;">
The above pipeline extracts the AvailabilityZone value via the Linux <span style="border: 0px; font-family: "courier new" , "courier"; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">cut</span> command.</div>
<div style="background-color: white; border: 0px; color: #021829; font-family: "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif; font-size: 14px; min-height: 8pt; padding: 0px; vertical-align: baseline;">
<br /></div>
<blockquote class="jive-quote" style="background: rgb(246, 246, 246); border-bottom-color: initial; border-bottom-style: initial; border-image: initial; border-left-color: rgb(204, 204, 204); border-left-style: solid; border-right-color: initial; border-right-style: initial; border-top-color: initial; border-top-style: initial; border-width: 0px 0px 0px 2px; color: #021829; font-size: 14px; margin: 10px 0px; overflow-x: auto; padding: 10px 20px; quotes: "" ""; vertical-align: baseline;">
<div style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; padding: 0px; vertical-align: baseline;">
<span style="border: 0px; font-family: "courier new" , "courier"; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">$ cat ~/ec2s.json | gron | grep InstanceId | cut -d\" -f2</span></div>
<div style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; padding: 0px; vertical-align: baseline;">
<span style="border: 0px; font-family: "courier new" , "courier"; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">...</span></div>
<div style="border: 0px; font-style: inherit; font-weight: inherit; padding: 0px; vertical-align: baseline;">
<span style="font-family: "courier new" , "courier";"><ID_1></span></div>
<div style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; padding: 0px; vertical-align: baseline;">
<span style="font-family: "courier new" , "courier";"><ID_2></span></div>
<div style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; padding: 0px; vertical-align: baseline;">
<span style="font-family: "courier new" , "courier";"><ID_3></span></div>
<div style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; padding: 0px; vertical-align: baseline;">
<span style="border: 0px; font-family: "courier new" , "courier"; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">...</span></div>
</blockquote>
<div style="background-color: white; border: 0px; color: #021829; font-family: "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif; font-size: 14px; padding: 0px; vertical-align: baseline;">
The above pipeline pulls all the EC2 instance IDs from the aws ec2 cli output, and creates a list of IDs.</div>
<div style="background-color: white; border: 0px; color: #021829; font-family: "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif; font-size: 14px; min-height: 8pt; padding: 0px; vertical-align: baseline;">
<br /></div>
<h2 style="background-color: white; border: 0px; color: #d03027; font-family: proxima_nova_rgregular; font-size: 20px; margin: 0px; padding: 0px; vertical-align: baseline;">
Transforming JSON with gron and ungron (a.k.a. norg)</h2>
<div style="background-color: white; border: 0px; color: #021829; font-family: "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif; font-size: 14px; padding: 0px; vertical-align: baseline;">
Earlier, I referenced the <span style="border: 0px; font-family: "courier new" , "courier"; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">norg</span> alias, that pointed to the <span style="border: 0px; font-family: "courier new" , "courier"; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">ungron</span> command. With this command, gron will transform gron discrete assignments back into JSON. Consider the commands below:</div>
<blockquote class="jive-quote" style="background: rgb(246, 246, 246); border-bottom-color: initial; border-bottom-style: initial; border-image: initial; border-left-color: rgb(204, 204, 204); border-left-style: solid; border-right-color: initial; border-right-style: initial; border-top-color: initial; border-top-style: initial; border-width: 0px 0px 0px 2px; color: #021829; font-family: "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif; font-size: 14px; margin: 10px 0px; overflow-x: auto; padding: 10px 20px; quotes: "" ""; vertical-align: baseline;">
<div style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; padding: 0px; vertical-align: baseline;">
<span style="border: 0px; font-family: inherit; font-style: inherit; font-weight: 700; margin: 0px; padding: 0px; vertical-align: baseline;">Note:</span> <span style="border: 0px; font-family: "courier new" , "courier"; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">cat</span> was removed and <span style="border: 0px; font-family: "courier new" , "courier"; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">gron</span> was called directly.</div>
</blockquote>
<div style="background-color: white; border: 0px; color: #021829; font-family: "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif; font-size: 14px; min-height: 8pt; padding: 0px; vertical-align: baseline;">
<br /></div>
<blockquote class="jive-quote" style="background: rgb(246, 246, 246); border-bottom-color: initial; border-bottom-style: initial; border-image: initial; border-left-color: rgb(204, 204, 204); border-left-style: solid; border-right-color: initial; border-right-style: initial; border-top-color: initial; border-top-style: initial; border-width: 0px 0px 0px 2px; color: #021829; font-family: "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif; font-size: 14px; margin: 10px 0px; overflow-x: auto; padding: 10px 20px; quotes: "" ""; vertical-align: baseline;">
<div style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; padding: 0px; vertical-align: baseline;">
<span style="border: 0px; font-family: "courier new" , "courier"; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">$ gron ~/ec2s.json | grep InstanceId | norg</span></div>
<div style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; padding: 0px; vertical-align: baseline;">
<span style="border: 0px; font-family: "courier new" , "courier"; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">...</span></div>
<div style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; padding: 0px; vertical-align: baseline;">
<span style="border: 0px; font-family: "courier new" , "courier"; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">{</span></div>
<div style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; padding: 0px; vertical-align: baseline;">
<span style="border: 0px; font-family: "courier new" , "courier"; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> "Instances": [</span></div>
<div style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; padding: 0px; vertical-align: baseline;">
<span style="border: 0px; font-family: "courier new" , "courier"; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> {</span></div>
<div style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; padding: 0px; vertical-align: baseline;">
<span style="border: 0px; font-family: "courier new" , "courier"; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> "InstanceId": "<ID>"</span></div>
<div style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; padding: 0px; vertical-align: baseline;">
<span style="border: 0px; font-family: "courier new" , "courier"; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> }</span></div>
<div style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; padding: 0px; vertical-align: baseline;">
<span style="border: 0px; font-family: "courier new" , "courier"; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> ]</span></div>
<div style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; padding: 0px; vertical-align: baseline;">
<span style="border: 0px; font-family: "courier new" , "courier"; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> },</span></div>
<div style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; padding: 0px; vertical-align: baseline;">
<span style="border: 0px; font-family: "courier new" , "courier"; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> {</span></div>
<div style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; padding: 0px; vertical-align: baseline;">
<span style="border: 0px; font-family: "courier new" , "courier"; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> "Instances": [</span></div>
<div style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; padding: 0px; vertical-align: baseline;">
<span style="border: 0px; font-family: "courier new" , "courier"; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> {</span></div>
<div style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; padding: 0px; vertical-align: baseline;">
<span style="border: 0px; font-family: "courier new" , "courier"; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> "InstanceId": "<ID>"</span></div>
<div style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; padding: 0px; vertical-align: baseline;">
<span style="border: 0px; font-family: "courier new" , "courier"; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> }</span></div>
<div style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; padding: 0px; vertical-align: baseline;">
<span style="border: 0px; font-family: "courier new" , "courier"; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> ]</span></div>
<div style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; padding: 0px; vertical-align: baseline;">
<span style="border: 0px; font-family: "courier new" , "courier"; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> },</span></div>
<div style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; padding: 0px; vertical-align: baseline;">
<span style="border: 0px; font-family: "courier new" , "courier"; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">...</span></div>
</blockquote>
<div style="background-color: white; border: 0px; color: #021829; font-family: "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif; font-size: 14px; padding: 0px; vertical-align: baseline;">
The above pipeline grons the JSON, greps for the InstanceId field, and then converts the lines of discrete assignments (<span style="border: 0px; font-family: "courier new" , "courier"; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">json.Reservations[999].Instances[0].InstanceId = "<ID>";</span>) from the grepped gron output back into usable and simplified JSON.</div>
<div style="background-color: white; border: 0px; color: #021829; font-family: "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif; font-size: 14px; min-height: 8pt; padding: 0px; vertical-align: baseline;">
<br /></div>
<blockquote class="jive-quote" style="background: rgb(246, 246, 246); border-bottom-color: initial; border-bottom-style: initial; border-image: initial; border-left-color: rgb(204, 204, 204); border-left-style: solid; border-right-color: initial; border-right-style: initial; border-top-color: initial; border-top-style: initial; border-width: 0px 0px 0px 2px; color: #021829; font-family: "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif; font-size: 14px; margin: 10px 0px; overflow-x: auto; padding: 10px 20px; quotes: "" ""; vertical-align: baseline;">
<div style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; padding: 0px; vertical-align: baseline;">
<span style="border: 0px; font-family: "courier new" , "courier"; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">$ gron ~/ec2s.json | egrep InstanceId\|ImageId | norg</span></div>
<div style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; padding: 0px; vertical-align: baseline;">
<span style="border: 0px; font-family: "courier new" , "courier"; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">...</span></div>
<div style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; padding: 0px; vertical-align: baseline;">
<span style="border: 0px; font-family: "courier new" , "courier"; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> {</span></div>
<div style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; padding: 0px; vertical-align: baseline;">
<span style="border: 0px; font-family: "courier new" , "courier"; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> "Instances": [</span></div>
<div style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; padding: 0px; vertical-align: baseline;">
<span style="border: 0px; font-family: "courier new" , "courier"; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> {</span></div>
<div style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; padding: 0px; vertical-align: baseline;">
<span style="border: 0px; font-family: "courier new" , "courier"; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> "ImageId": "<AMI_ID>",</span></div>
<div style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; padding: 0px; vertical-align: baseline;">
<span style="border: 0px; font-family: "courier new" , "courier"; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> "InstanceId": "<ID>"</span></div>
<div style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; padding: 0px; vertical-align: baseline;">
<span style="border: 0px; font-family: "courier new" , "courier"; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> }</span></div>
<div style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; padding: 0px; vertical-align: baseline;">
<span style="border: 0px; font-family: "courier new" , "courier"; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> ]</span></div>
<div style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; padding: 0px; vertical-align: baseline;">
<span style="border: 0px; font-family: "courier new" , "courier"; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> },</span></div>
<div style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; padding: 0px; vertical-align: baseline;">
<span style="border: 0px; font-family: "courier new" , "courier"; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> {</span></div>
<div style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; padding: 0px; vertical-align: baseline;">
<span style="border: 0px; font-family: "courier new" , "courier"; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> "Instances": [</span></div>
<div style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; padding: 0px; vertical-align: baseline;">
<span style="border: 0px; font-family: "courier new" , "courier"; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> {</span></div>
<div style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; padding: 0px; vertical-align: baseline;">
<span style="border: 0px; font-family: "courier new" , "courier"; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> "ImageId": "<AMI_ID>",</span></div>
<div style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; padding: 0px; vertical-align: baseline;">
<span style="border: 0px; font-family: "courier new" , "courier"; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> "InstanceId": "<ID>"</span></div>
<div style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; padding: 0px; vertical-align: baseline;">
<span style="border: 0px; font-family: "courier new" , "courier"; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> }</span></div>
<div style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; padding: 0px; vertical-align: baseline;">
<span style="border: 0px; font-family: "courier new" , "courier"; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> ]</span></div>
<div style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; padding: 0px; vertical-align: baseline;">
<span style="border: 0px; font-family: "courier new" , "courier"; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> },</span></div>
<div style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; padding: 0px; vertical-align: baseline;">
<span style="border: 0px; font-family: "courier new" , "courier"; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">...</span></div>
</blockquote>
<div style="background-color: white; border: 0px; color: #021829; font-family: "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif; font-size: 14px; padding: 0px; vertical-align: baseline;">
The above pipeline adds ImageId to the transformed JSON using <span style="border: 0px; font-family: "courier new" , "courier"; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">egrep</span> (Yes, I know GNU has deprecated <span style="border: 0px; font-family: "courier new" , "courier"; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">egrep</span> in lieu of <span style="border: 0px; font-family: "courier new" , "courier"; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">grep -E.</span>) .</div>
<div style="background-color: white; border: 0px; color: #021829; font-family: "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif; font-size: 14px; min-height: 8pt; padding: 0px; vertical-align: baseline;">
<br /></div>
<h2 style="background-color: white; border: 0px; color: #d03027; font-family: proxima_nova_rgregular; font-size: 20px; margin: 0px; padding: 0px; vertical-align: baseline;">
sed</h2>
<div style="background-color: white; border: 0px; color: #021829; font-family: "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif; font-size: 14px; padding: 0px; vertical-align: baseline;">
sed is a powerful stream editor, and is handy for executing find/replace algorithms on text files.</div>
<blockquote class="jive-quote" style="background: rgb(246, 246, 246); border-bottom-color: initial; border-bottom-style: initial; border-image: initial; border-left-color: rgb(204, 204, 204); border-left-style: solid; border-right-color: initial; border-right-style: initial; border-top-color: initial; border-top-style: initial; border-width: 0px 0px 0px 2px; color: #021829; font-family: "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif; font-size: 14px; margin: 10px 0px; overflow-x: auto; padding: 10px 20px; quotes: "" ""; vertical-align: baseline;">
<div style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; padding: 0px; vertical-align: baseline;">
<span style="border: 0px; font-family: "courier new" , "courier"; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">$ gron ~/ec2s.json | egrep InstanceId\|ImageId\|InstanceType | sed -e 's/Instances/node/g;s/ImageId/ami/g;s/InstanceType/type/g;s/InstanceId/id/g' | norg</span></div>
<div style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; padding: 0px; vertical-align: baseline;">
<span style="border: 0px; font-family: "courier new" , "courier"; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">...</span></div>
<div style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; padding: 0px; vertical-align: baseline;">
<span style="border: 0px; font-family: "courier new" , "courier"; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">{</span></div>
<div style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; padding: 0px; vertical-align: baseline;">
<span style="border: 0px; font-family: "courier new" , "courier"; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> "node": [</span></div>
<div style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; padding: 0px; vertical-align: baseline;">
<span style="border: 0px; font-family: "courier new" , "courier"; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> {</span></div>
<div style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; padding: 0px; vertical-align: baseline;">
<span style="border: 0px; font-family: "courier new" , "courier"; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> "ami": "<AMI_ID>",</span></div>
<div style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; padding: 0px; vertical-align: baseline;">
<span style="border: 0px; font-family: "courier new" , "courier"; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> "id": "<ID>",</span></div>
<div style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; padding: 0px; vertical-align: baseline;">
<span style="border: 0px; font-family: "courier new" , "courier"; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> "type": "t2.small"</span></div>
<div style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; padding: 0px; vertical-align: baseline;">
<span style="border: 0px; font-family: "courier new" , "courier"; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> }</span></div>
<div style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; padding: 0px; vertical-align: baseline;">
<span style="border: 0px; font-family: "courier new" , "courier"; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> ]</span></div>
<div style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; padding: 0px; vertical-align: baseline;">
<span style="border: 0px; font-family: "courier new" , "courier"; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> },</span></div>
<div style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; padding: 0px; vertical-align: baseline;">
<span style="border: 0px; font-family: "courier new" , "courier"; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> {</span></div>
<div style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; padding: 0px; vertical-align: baseline;">
<span style="border: 0px; font-family: "courier new" , "courier"; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> "node": [</span></div>
<div style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; padding: 0px; vertical-align: baseline;">
<span style="border: 0px; font-family: "courier new" , "courier"; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> {</span></div>
<div style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; padding: 0px; vertical-align: baseline;">
<span style="border: 0px; font-family: "courier new" , "courier"; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> "ami": "<AMI_ID>",</span></div>
<div style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; padding: 0px; vertical-align: baseline;">
<span style="border: 0px; font-family: "courier new" , "courier"; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> "id": "<ID>",</span></div>
<div style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; padding: 0px; vertical-align: baseline;">
<span style="border: 0px; font-family: "courier new" , "courier"; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> "type": "t2.micro"</span></div>
<div style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; padding: 0px; vertical-align: baseline;">
<span style="border: 0px; font-family: "courier new" , "courier"; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> }</span></div>
<div style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; padding: 0px; vertical-align: baseline;">
<span style="border: 0px; font-family: "courier new" , "courier"; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> ]</span></div>
<div style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; padding: 0px; vertical-align: baseline;">
<span style="border: 0px; font-family: "courier new" , "courier"; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> },</span></div>
<div style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; padding: 0px; vertical-align: baseline;">
<span style="border: 0px; font-family: "courier new" , "courier"; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">...</span></div>
</blockquote>
<div style="background-color: white; border: 0px; color: #021829; font-family: "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif; font-size: 14px; padding: 0px; vertical-align: baseline;">
The above pipeline adds stream editing with <span style="border: 0px; font-family: "courier new" , "courier"; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">sed</span> to perform multiple inline string replacements.</div>
<div style="background-color: white; border: 0px; color: #021829; font-family: "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif; font-size: 14px; min-height: 8pt; padding: 0px; vertical-align: baseline;">
<br /></div>
<blockquote class="jive-quote" style="background: rgb(246, 246, 246); border-bottom-color: initial; border-bottom-style: initial; border-image: initial; border-left-color: rgb(204, 204, 204); border-left-style: solid; border-right-color: initial; border-right-style: initial; border-top-color: initial; border-top-style: initial; border-width: 0px 0px 0px 2px; color: #021829; font-family: "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif; font-size: 14px; margin: 10px 0px; overflow-x: auto; padding: 10px 20px; quotes: "" ""; vertical-align: baseline;">
<div style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; padding: 0px; vertical-align: baseline;">
<span style="border: 0px; font-family: "courier new" , "courier"; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">$ gron ~/ec2s.json | egrep InstanceId\|ImageId\|InstanceType | sed -e 's/Instances/node/g;s/ImageId/ami/g;s/InstanceType/type/g;s/InstanceId/id/g' | norg | tr -d '\n' | sed "s/ //g"</span></div>
<div style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; padding: 0px; vertical-align: baseline;">
<span style="border: 0px; font-family: "courier new" , "courier"; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">...</span></div>
<div style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; padding: 0px; vertical-align: baseline;">
<span style="border: 0px; font-family: "courier new" , "courier"; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">{"node":[{"ami":"<AMI_ID>","id":"<ID>","type":"t2.small"}]},{"node":[{"ami":"<AMI_ID>","id":"<ID>","type":"t2.micro"}]},</span></div>
<div style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; padding: 0px; vertical-align: baseline;">
<span style="border: 0px; font-family: "courier new" , "courier"; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">...</span></div>
</blockquote>
<div style="background-color: white; border: 0px; color: #021829; font-family: "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif; font-size: 14px; padding: 0px; vertical-align: baseline;">
The above pipeline adds the translate command, <span style="border: 0px; font-family: "courier new" , "courier"; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">tr<span style="border: 0px; font-family: "helvetica"; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">,</span></span> to remove newline characters and then another <span style="border: 0px; font-family: "courier new" , "courier"; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">sed</span> command to remove remaining whitespace. This is handy for minimizing JSON files.</div>
<div style="background-color: white; border: 0px; color: #021829; font-family: "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif; font-size: 14px; min-height: 8pt; padding: 0px; vertical-align: baseline;">
<br /></div>
<h2 style="background-color: white; border: 0px; color: #d03027; font-family: proxima_nova_rgregular; font-size: 20px; margin: 0px; padding: 0px; vertical-align: baseline;">
Summary</h2>
<div style="background-color: white; border: 0px; color: #021829; font-family: "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif; font-size: 14px; padding: 0px; vertical-align: baseline;">
<span style="border: 0px; font-family: "courier new" , "courier"; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">gron</span> converts structured JSON into lines of discrete assignments. This makes it easier to pipeline text to native tools like <span style="border: 0px; font-family: "courier new" , "courier"; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">grep</span> and <span style="border: 0px; font-family: "courier new" , "courier"; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">sed</span> to perform powerful text manipulation. Once manipulated, the discrete assignments can be transformed back into JSON via the <span style="border: 0px; font-family: "courier new" , "courier"; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">gron -u|--ungron</span> command. This makes <span style="border: 0px; font-family: "courier new" , "courier"; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">gron</span> a complement to existing tools like <span style="border: 0px; font-family: "courier new" , "courier"; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">grep</span> and <span style="border: 0px; font-family: "courier new" , "courier"; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">sed</span>, for munging (a.k.a. manipulating) JSON data.</div>
</div>
Jimmy Rayhttp://www.blogger.com/profile/14276730603257237473noreply@blogger.com44tag:blogger.com,1999:blog-4359121116907505622.post-7896978416092457032016-05-21T13:26:00.005-07:002016-06-06T07:50:42.764-07:00Speaking at Jenkins World 2016I will be speaking at Jenkins World 2016, in Santa Clara, CA in September.<br />
<br />
<a href="https://www.cloudbees.com/juc/event-details" rel="nofollow" target="_blank">https://www.cloudbees.com/juc/event-details</a><br />
<a href="https://www.cloudbees.com/jenkinsworld/home" rel="nofollow" target="_blank">https://www.cloudbees.com/jenkinsworld/home</a><br />
<a href="https://www.cloudbees.com/pipelining-devops-jenkins-and-aws" rel="nofollow" target="_blank">https://www.cloudbees.com/pipelining-devops-jenkins-and-aws</a><br />
<br />Jimmy Rayhttp://www.blogger.com/profile/14276730603257237473noreply@blogger.com9tag:blogger.com,1999:blog-4359121116907505622.post-31061179627813376262016-05-12T06:23:00.002-07:002016-05-12T06:23:25.473-07:00Speaking at RVA Java Users Meetup (RJUG) on 5/18/16 at VCU<span style="font-family: Arial, Helvetica, sans-serif;"><span style="background-color: #fefdfa; color: #333333; font-size: 13px; line-height: 18.2px;">Meetup Link: </span></span><span style="color: #272727; font-family: Graphik Meetup, helvetica, arial, sans-serif;"><span style="font-size: 13px; line-height: 17.42px;"><a href="http://www.meetup.com/Richmond-Java-Users-Group/events/230924145/" rel="nofollow" target="_blank">http://www.meetup.com/Richmond-Java-Users-Group/events/230924145/</a></span></span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="background-color: #fefdfa; color: #333333; font-size: 13px; line-height: 18.2px;"><br /></span></span>
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="background-color: #fefdfa; color: #333333; font-size: 13px; line-height: 18.2px;">I will be speaking about using the AWS Java SDK to apply governance processes.</span></span><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span><br />
<span style="font-family: Arial, Helvetica, sans-serif;">Location:</span><span style="font-family: Arial, Helvetica, sans-serif;"><span style="color: #333333;"><span style="font-size: 13px; line-height: 18.2px;">VCU Engineering, East Hall room E1232</span></span></span><br />
<span style="color: #333333; font-family: Arial, Helvetica, sans-serif;"><span style="font-size: 13px; line-height: 18.2px;">601 W Main St #331, Richmond, VA</span></span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="color: #333333;"><span style="font-size: 13px; line-height: 18.2px;"><br /></span></span></span><span style="color: #333333; font-family: Arial, Helvetica, sans-serif;"><span style="font-size: 13px; line-height: 18.2px;">"<i>As organizations clamor to reach the cloud, with their infrastructure, data, and applications, Cloud Governance becomes an operational imperative. Amazon Web Services (AWS) equips DevOps practitioners with the tools needed to automate governance controls. We will present an example of using AWS CloudTrail, CloudWatch, Lambda, and Dynamo to automate Cloud Governance around the AWS Simple Storage Service (S3) operations, with the AWS Java SDK</i>."</span></span>Jimmy Rayhttp://www.blogger.com/profile/14276730603257237473noreply@blogger.com1tag:blogger.com,1999:blog-4359121116907505622.post-26648820359893843262016-05-12T06:13:00.000-07:002016-05-12T06:13:07.398-07:00Jenkins Consul K/V Builder Plugin Released<span style="background-color: white; color: #6d7072; font-family: "helvetica neue" , "helvetica" , "arial" , "lucida grande" , sans-serif; font-size: 13.3333px; line-height: 20px;">Do you use <a href="https://www.consul.io/" rel="nofollow" target="_blank">HashiCorp’s Consul</a> </span><span style="background-color: white; color: #6d7072; font-family: "helvetica neue" , "helvetica" , "arial" , "lucida grande" , sans-serif; font-size: 13.3333px; line-height: 20px;">software for Service Discovery or Key/Value configuration management? </span><span style="background-color: white; color: #6d7072; font-family: "helvetica neue" , "helvetica" , "arial" , "lucida grande" , sans-serif; font-size: 13px; line-height: 19.5px;">One of the core features of Consul is the ability to store Key/Value data, and allow applications to retrieve said data for configuration-lookup or service discovery needs. And, as a Jenkins user, I routinely need to lookup configurations and set environment variables for build execution. The Consul K/V Builder Plugin allows me to do just that. With this plugin I can read, write, and delete Key/Value data from and to the Consul servers or clusters, even if local Access Control List (ACL) security is enabled in the Consul software.</span><br />
<span style="background-color: white; color: #6d7072; font-family: "helvetica neue" , "helvetica" , "arial" , "lucida grande" , sans-serif; font-size: 13px; line-height: 19.5px;"><br /></span>
<span style="background-color: white; color: #6d7072; font-family: "helvetica neue" , "helvetica" , "arial" , "lucida grande" , sans-serif; font-size: 13px; line-height: 19.5px;">The plugin is written in Java with the Jenkins Open Source plugin framework (</span><a class="jive-link-external-small" href="https://wiki.jenkins-ci.org/display/JENKINS/Plugin+tutorial" rel="nofollow" style="background-color: white; border: 0px; color: #043561; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; line-height: 19.5px; margin: 0px; padding: 0px calc(12px + 0.35ex) 0px 0px; text-decoration: none; vertical-align: baseline;" target="_blank">https://wiki.jenkins-ci.org/display/JENKINS/Plugin+tutorial</a><span style="background-color: white; color: #6d7072; font-family: "helvetica neue" , "helvetica" , "arial" , "lucida grande" , sans-serif; font-size: 13px; line-height: 19.5px;">) and libraries. It is a Maven project, and the source is found here: </span><span style="color: #6d7072; font-family: "helvetica neue" , "helvetica" , "arial" , "lucida grande" , sans-serif;"><span style="font-size: 13px; line-height: 19.5px;"><a href="https://github.com/jenkinsci/consul-kv-builder-plugin" rel="nofollow" target="_blank">https://github.com/jenkinsci/consul-kv-builder-plugin</a></span></span><br />
<span style="color: #6d7072; font-family: "helvetica neue" , "helvetica" , "arial" , "lucida grande" , sans-serif;"><br /></span>
<span style="background-color: white; color: #6d7072; font-family: "helvetica neue" , "helvetica" , "arial" , "lucida grande" , sans-serif; font-size: 13.3333px; line-height: 20px;">The plugin Wiki page is here: <a href="https://wiki.jenkins-ci.org/display/JENKINS/Consul-KV-Builder+Plugin" rel="nofollow" target="_blank">https://wiki.jenkins-ci.org/display/JENKINS/Consul-KV-Builder+Plugin</a></span>Jimmy Rayhttp://www.blogger.com/profile/14276730603257237473noreply@blogger.com0tag:blogger.com,1999:blog-4359121116907505622.post-54710929472345235462016-04-01T20:32:00.000-07:002016-04-01T20:51:07.601-07:00Abandon All Servers Ye Who Enter HereSo, you still have on-premise servers, and you want to move to the cloud. Or perhaps, you have moved to the cloud, but you have kept your server-centric mindset, and used Infrastructure-as-a-Service (IaaS) to build your servers in the cloud, directly mimicking what you had on premises. <br />
<br />
You are doing in incorrectly, and you are not helping your organization as much as you think. Sure, there might be a modicum of cost-savings related to moving to the cloud. However, maintaining a server-centric mindset, while consuming cloud resources is an anti-pattern.<br />
<br />
<b>Server Centricity</b><br />
How do you know if you are still trapped in server-centricity? Let's take a short quiz:<br />
<br />
Question #1: Do you name your servers?<br />
<br />
Question #2: When clients must integrate to your applications, do they need to know the name of your servers, or worse yet, their IP addresses?<br />
<br />
Question #3: Do you even have cloud resources that you label as "servers"?<br />
<br />
Question #4: When the servers fail, how do you respond? Do you manually build a new server and manually reconnect clients? Even if you have a hot/warm/cold standby server, was it built with at least some manual intervention?<br />
<br />
Question #5: When you need additional capacity, do you manually scale horizontally, or vertically?<br />
<br />
If you answered yes to any of these questions, your cloud usage is still immature. How immature is relative, and a matter of opinion, but most would agree that manual intervention should be minimal, and a last resort.<br />
<br />
<b>Abandon Your Servers</b><br />
To use the cloud effectively and move towards maturity, your organization must lessen, and eventually remove, the importance of individual servers. Servers are fleeting; applications are more important. In the realm of IaaS, instances and/or containers replace servers. Instances, and even more so, containers, are designed to be volatile. In fact, with proper automation in place, instances and containers come and go with little or no impact to applications. Applications stick around, underpinned by instances, containers, and automation. Availability and partition tolerance are easily achieved with proper automation and design.<br />
<br />
Platform-as-a-Service (PaaS), underpinned by IaaS, is even more application centric, and relies on automation even more so than IaaS. In a properly designed PaaS implementation, automation allows the end users, the application owners, to place their applications into the cloud without having to build the instances and/or containers. PaaS users either supply the deployment artifacts, or use PaaS Ci/CD services to build and deploy the artifacts. In fact, for PaaS subscribers, the term "environment" takes on new meaning; it is the intersection of code and logical application definition, controlled by CI/CD processes and automation. They don't care where their applications run, just as long as they run and their users can successfully use them to complete their respective tasks.<br />
<br />
<b>Automation and Indirection</b><br />
Automation is in place to abstract the need for PaaS users to build and maintain IaaS resources. There is also a layer of indirection that exists between the applications and the underlying infrastructure. With PaaS, application owners never need to worry about that underlying infrastructure; instead, they focus on code and application definitions. Overtime, this places them in the same category with application users, or even SaaS subscribers.<br />
<br />
This PaaS-like abstraction and layer of indirection should also be the goal of cloud-enablement teams that are using IaaS resources to deliver services to application teams. With automation, and well-defined practices, and well-designed stacks, cloud-enablement teams are now able to deliver more self-service resources with IaaS. This self-service allows development and deployment teams to consume IaaS similarly to PaaS users. With proper automation, there is little to no manual configuration or intervention needed by the application teams.<br />
<b><br /></b>
<b>Where are the Servers?</b><br />
And, where are the servers? They are forgotten, replaced by instances, containers, and stacks, whose count shrinks and grows with the needs of the individual teams consuming them. Configuration-as-code and automation, for resource formation and autoscaling have reduced the need for manual intervention.<br />
<br />
So, if you really want to enter the cloud and be successful, be prepared to abandon your servers.Jimmy Rayhttp://www.blogger.com/profile/14276730603257237473noreply@blogger.com29tag:blogger.com,1999:blog-4359121116907505622.post-54711495651803248692016-03-20T18:13:00.001-07:002016-04-12T10:28:02.303-07:00A Prototyping Platform with Jenkins PipelineSo, I have been using the Jenkins Pipeline Plugin (formerly known as Workflow) for a few months now. I like the idea of being able to code Groovy and Java directly into the Jenkins jobs, as Pipeline scripts. Though I have not used it yet, I can also store the scripts in an SCM. I think that I will eventually transition to that mode, having used inline scripting to prototype the jobs first.<br />
<br />
<b><span style="font-size: large;">MongoDB Pipeline</span></b><br />
My latest Pipeline script parses a JSON file from an upstream job, munges the data, and then writes a new JSON document into MongoDB. For MongoDB integration, I chose to NOT use the existing Jenkins MongoDB plugins; I needed more flexibility. Since I know my way around Mongo and Java integration (<a href="http://www.slideshare.net/jimmyray5832/mongodb-24-and-spring-data" rel="nofollow" target="_blank">MongoDB and SpringData</a>), and I have admin rights to my Jenkins instance, I simply added the MongoDB Java Driver Jar file (mongo-java-driver-3.0.4.jar) to the Jenkins classpath via the WEB-INF/lib directory. This enables me to use the MongoDB Java Driver class files in my Groovy pipeline scripts, as seen below.<br />
<br />
<span style="color: blue;">import com.mongodb.*</span><br />
<span style="color: blue;"><br /></span>
<span style="color: blue;">stage 'parseData'</span><br />
<span style="color: blue;">node {</span><br />
<span style="color: blue;"> String path = env.HOME + "/Home/jobs/DataAPI/jobs/" + upstreamJob + "/workspace/" + file</span><br />
<span style="color: blue;"> if (fileExists(path)) {</span><br />
<span style="color: blue;"> println "File Exists"</span><br />
<span style="color: blue;"><br /></span>
<span style="color: blue;"> def file = readFile path</span><br />
<span style="color: blue;"> def jsonSlurper = new groovy.json.JsonSlurper()</span><br />
<span style="color: blue;"> def object = jsonSlurper.parseText(file)</span><br />
<span style="color: blue;"> </span><br />
<span style="color: blue;"> def target = object.get(0).target</span><br />
<span style="color: blue;"> def dataPoints = object.get(0).datapoints</span><br />
<span style="color: blue;"> </span><br />
<span style="color: blue;"> if (dataPoints.size == 0) {</span><br />
<span style="color: blue;"> error 'No data found.'</span><br />
<span style="color: blue;"> } else {</span><br />
<span style="color: blue;"> println "Datapoints: " + dataPoints.size</span><br />
<span style="color: blue;"> </span><br />
<span style="color: blue;"> Map<String,Object> dataMap = new HashMap<String,Object>()</span><br />
<span style="color: blue;"> List<Integer> seriesData = new ArrayList<Integer>()</span><br />
<span style="color: blue;"> List<List<Integer>> seriesList = new ArrayList<List<Integer>>()</span><br />
<span style="color: blue;"> </span><br />
<span style="color: blue;"> dataMap.put("target",target)</span><br />
<span style="color: blue;"><br /></span>
<span style="color: blue;"> for (Object x:dataPoints) {</span><br />
<span style="color: blue;"> if (x[0] != null) {</span><br />
<span style="color: blue;"> seriesData.add(Integer.valueOf(x[0].intValue()))</span><br />
<span style="color: blue;"> seriesData.add(x[1])</span><br />
<span style="color: blue;"> seriesList.add(seriesData)</span><br />
<span style="color: blue;"> seriesData = new ArrayList<Integer>()</span><br />
<span style="color: blue;"> }</span><br />
<span style="color: blue;"> }</span><br />
<span style="color: blue;"> </span><br />
<span style="color: blue;"> dataMap.put("series", seriesList)</span><br />
<span style="color: blue;"> </span><br />
<span style="color: blue;"> if (new Boolean(writeToMongo) == true) {</span><br />
<span style="color: blue;"> def mongoClient = new MongoClient("localhost", 29009)</span><br />
<span style="color: blue;"> def collection = mongoClient.getDB("jenkins").getCollection("apiLogs")</span><br />
<span style="color: blue;"> collection.insert(new BasicDBObject(dataMap))</span><br />
<span style="color: blue;"> mongoClient.close()</span><br />
<span style="color: blue;"> }</span><br />
<span style="color: blue;"> }</span><br />
<span style="color: blue;"> </span><br />
<span style="color: blue;"> } else {</span><br />
<span style="color: blue;"> error 'Data file does not exist at ' + path</span><br />
<span style="color: blue;"> }</span><br />
<span style="color: blue;">}</span><br />
<br />
In the above script, I used a Groovy JSON Slurper to parse the JSON from a file and build an object. Then I needed to munge the data into a more suitable Java object that could then be persisted directly to MongoDB via the Java API.<br />
<br />
As a developer, I see this as a very strong case for Jenkins pipeline scripting. Without this approach, being able to write Groovy and Java code directly into the Pipeline project, I would be at the mercy of integrating other Jenkins plugins to make this work, probably spanning multiple jobs. <br />
<br />
Now, I get it; part of the strength of Jenkins is its collection of plugins. However, as a long time Jenkins user and developer, I have had my share of plugin issues. It's a freeing experience to be able to "roll-my-own" customization. And, never has it been easier to integrate Groovy and Java then with the Pipeline plugin.<br />
<br />
As a matter of fact, this project is part of an orchestration, two parameterized projects, triggered by a third. The "master" project is also a pipeline project; the script is below.<br />
<br />
<span style="color: blue;">stage 'collect'</span><br />
<span style="color: blue;">node {</span><br />
<span style="color: blue;"> build job: 'CollectData', parameters: [[$class: 'StringParameterValue', name: 'target', value: '<TOPIC_VALUE>'], [$class: 'StringParameterValue', name: 'from', value: '-15min'], [$class: 'StringParameterValue', name: 'format', value: 'json']]</span><br />
<span style="color: blue;">}</span><br />
<span style="color: blue;"><br /></span>
<span style="color: blue;">stage 'parse'</span><br />
<span style="color: blue;">node {</span><br />
<span style="color: blue;"> build job: 'ParseData', parameters: [[$class: 'StringParameterValue', name: 'file', value: 'data.json'], [$class: 'StringParameterValue', name: 'upstreamJob', value: 'CollectData']]</span><br />
<span style="color: blue;">}</span><br />
<br />
Of course, this is made very easy by using the <b>Snippet Generator</b> that is part of every pipeline project.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://2.bp.blogspot.com/-_mGXzk8y_n0/VuyrqgMZNBI/AAAAAAAAASo/5t1Kl3o9hioFVBoSI0RSXbD4OTVc1zDig/s1600/Screen%2BShot%2B2016-03-18%2Bat%2B9.29.52%2BPM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="https://2.bp.blogspot.com/-_mGXzk8y_n0/VuyrqgMZNBI/AAAAAAAAASo/5t1Kl3o9hioFVBoSI0RSXbD4OTVc1zDig/s640/Screen%2BShot%2B2016-03-18%2Bat%2B9.29.52%2BPM.png" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br />
You can also use the DSL reference, found here: http://<JENKINS_URL>/workflow-cps-snippetizer/dslReference, and the introduction found on GitHub: <a href="https://github.com/jenkinsci/workflow-plugin" rel="nofollow" target="_blank">https://github.com/jenkinsci/workflow-plugin</a>. The plugin page is found here: <a href="https://wiki.jenkins-ci.org/display/JENKINS/Pipeline+Plugin" rel="nofollow" target="_blank">https://wiki.jenkins-ci.org/display/JENKINS/Pipeline+Plugin</a>. And, fianlly, Andy Pemberton has written a reference card found here: <a href="https://dzone.com/refcardz/continuous-delivery-with-jenkins-workflow" rel="nofollow" target="_blank">https://dzone.com/refcardz/continuous-delivery-with-jenkins-workflow</a>.<br />
<br />
<b><span style="font-size: large;">A Paradigm Shift</span></b><br />
In my opinion, the ability to freeform program so easily in the Pipeline project is a game changer for Jenkins users. With this functionality, Jenkins is now a prototyping platform for CI/CD/DevOps as well as Integration and Monitoring. Sure, we will still use and write plugins. For example, in my orchestration, I used the HTTP Request Plugin in my Parameterized Build.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://4.bp.blogspot.com/-ZR_vRwim73Q/Vuy1tTgJgLI/AAAAAAAAAS4/AZBbxXYd92g-206ofaqv177k7tvhMw9rw/s1600/Screen%2BShot%2B2016-03-18%2Bat%2B10.12.16%2BPM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="328" src="https://4.bp.blogspot.com/-ZR_vRwim73Q/Vuy1tTgJgLI/AAAAAAAAAS4/AZBbxXYd92g-206ofaqv177k7tvhMw9rw/s640/Screen%2BShot%2B2016-03-18%2Bat%2B10.12.16%2BPM.png" width="640" /></a></div>
I used this plugin to make an HTTP API call, and passed the build parameters directly to the HTTP GET call as query_string arguments. Now, you may ask why, if I am so stoked about Jenkins Pipeline, did I not use "curl" in a shell block in the pipeline. Simple, I did not want blocking IO in the pipeline script. Instead, I chose to isolate this call into a separate upstream job, and use a downstream pipeline script to munge the downloaded data. <br />
<br />
<b><span style="font-size: large;">Security</span></b><br />
Using the Jenkins Pipeline plugin does not mean that we abandon all we know about Jenkins security and best practices. In fact, users without Overall/Run Scripts will use the Groovy Sandbox with pre-approved scripts. Of course, users can elect to not use the sandbox. However, doing so means that all scripts require admin approval.<br />
<br />
<b><span style="font-size: large;">The Jenkins Reactor</span></b><br />
In the example above, I have used Jenkins as a "batch reactor". With the Pipeline Plugin and orchestrated jobs, I have built a reactor that allows me to run multiple processes without leaving the context of the Jenkins environment. Who knows, in the future this orchestration may move to it's own application space. However, for now I am incubating the prototype in my "Jenkins Reactor". Using Jenkins this way provides me with the container and services I need to quickly integrate to other systems, and build a prototype application.<br />
<br />Jimmy Rayhttp://www.blogger.com/profile/14276730603257237473noreply@blogger.com0tag:blogger.com,1999:blog-4359121116907505622.post-31449289545441229752016-02-17T11:36:00.002-08:002016-02-23T07:19:18.383-08:00Speaking at RVA AWS Meetup on 2016-02-17 about Jenkins and AWS Integration for CI/CD<a href="http://www.meetup.com/Central-Virginia-AWS-cloud-user-group/events/228580572/?rv=ea1&_af=event&_af_eid=228580572&https=off" rel="nofollow" target="_blank">Central VA AWS User Group - 2016-02-17</a><br />
<br />
I will be speaking on Jenkins integration to AWS EC2, CodeCommit, CodeDeploy, and CodePipeline. The talk location is:<br />
<br />
Tuckahoe Library<br />
1901 Starling Dr., Henrico, VA (map)<br />
<br />
Jimmy Ray with AuthX Consulting will present Jenkins usage with AWS.<br />
<br />
• Jenkins concepts<br />
<br />
• Options for Jenkins in AWS (yum, AWS Marketplace, etc.)<br />
<br />
• Configuring Jenkins in AWS (Setup, Plugins, Proxies(NGINX), Route 53/ELB, Security (Jenkins, Groups, SSL, etc.))<br />
<br />
• EC2 Roles<br />
<br />
• Jenkins Slaves<br />
<br />
• AWS CodeDeploy<br />
<br />
• AWS CodeCommit<br />
<br />
• AWS CodePipeline<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen="" class="YOUTUBE-iframe-video" data-thumbnail-src="https://i.ytimg.com/vi/lJtGdaN19U0/0.jpg" frameborder="0" height="266" src="https://www.youtube.com/embed/lJtGdaN19U0?feature=player_embedded" width="320"></iframe></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<a href="http://www.slideshare.net/jimmyray5832/jenkins-and-aws-devops-tools" rel="nofollow" target="_blank">Slides</a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://1.bp.blogspot.com/-AzjuBgP4RKo/VsZaC9IWU5I/AAAAAAAAASM/iHCsoQswIp0/s1600/me.2016-02-17.AWS-UG.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://1.bp.blogspot.com/-AzjuBgP4RKo/VsZaC9IWU5I/AAAAAAAAASM/iHCsoQswIp0/s320/me.2016-02-17.AWS-UG.jpg" width="240" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Jenkins has it own Pipeline plugin (formerly know as Workflow). Information can be found here:</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<a href="https://wiki.jenkins-ci.org/display/JENKINS/Workflow+Plugin" rel="nofollow" target="_blank">Jenkins Workflow</a></div>
<div class="separator" style="clear: both; text-align: left;">
<a href="https://wiki.jenkins-ci.org/display/JENKINS/Pipeline+Plugin" rel="nofollow" target="_blank">Jenkins Pipeline</a></div>
<div class="separator" style="clear: both; text-align: left;">
<a href="https://github.com/jenkinsci/workflow-plugin/blob/master/TUTORIAL.md" rel="nofollow" target="_blank">Getting Started (GitHub)</a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Below is an example pipeline Groovy script that I wrote to build and deploy a CMS application from code in GitHub. Maven builds the project, and then shell scripts perform the deployment to AWS EC2 instances. Without Jenkins Pipeline, this would have been more complex involving multiple jobs. Though it still can be broken down into multiple jobs, this particular example was done in a single Jenkins job.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both;">
<span style="background-color: white; color: #20124d;">stage 'build'</span></div>
<div class="separator" style="clear: both;">
<span style="background-color: white; color: #20124d;">node {</span></div>
<div class="separator" style="clear: both;">
<span style="background-color: white; color: #20124d;"> git url: 'git@github.com:co/XYZ.git', credentialsId: 'co-XYZ-jenkins', branch: 'develop'</span></div>
<div class="separator" style="clear: both;">
<span style="background-color: white; color: #20124d;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="background-color: white; color: #20124d;"> def v = version()</span></div>
<div class="separator" style="clear: both;">
<span style="background-color: white; color: #20124d;"> if (v) {</span></div>
<div class="separator" style="clear: both;">
<span style="background-color: white; color: #20124d;"> echo "Building version ${v}"</span></div>
<div class="separator" style="clear: both;">
<span style="background-color: white; color: #20124d;"> }</span></div>
<div class="separator" style="clear: both;">
<span style="background-color: white; color: #20124d;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="background-color: white; color: #20124d;"> def mvnHome = tool 'Maven 3.3.3'</span></div>
<div class="separator" style="clear: both;">
<span style="background-color: white; color: #20124d;"> sh "export JAVA_HOME=/opt/jdk1.8.0_60/ && ${mvnHome}/bin/mvn -f hippo/pom.xml clean verify -Dbuild.number=" + env.BUILD_NUMBER</span></div>
<div class="separator" style="clear: both;">
<span style="background-color: white; color: #20124d;"> step([$class: 'ArtifactArchiver', artifacts: '**/target/site.war,**/target/cms.war', fingerprint: true])</span></div>
<div class="separator" style="clear: both;">
<span style="background-color: white; color: #20124d;">}</span></div>
<div class="separator" style="clear: both;">
<span style="background-color: white; color: #20124d;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="background-color: white; color: #20124d;">stage 'tag'</span></div>
<div class="separator" style="clear: both;">
<span style="background-color: white; color: #20124d;">node {</span></div>
<div class="separator" style="clear: both;">
<span style="background-color: white; color: #20124d;"> echo "Build-" + env.BUILD_TAG</span></div>
<div class="separator" style="clear: both;">
<span style="background-color: white; color: #20124d;"> dir(env.HOME + '/workspace/XYZ-CMS/TEST/TestWF/hippo') {</span></div>
<div class="separator" style="clear: both;">
<span style="background-color: white; color: #20124d;"> sh 'git tag -a ' + env.BUILD_TAG + ' -m "Auto-tagging build number ' + env.BUILD_TAG + ' from Jenkins."'</span></div>
<div class="separator" style="clear: both;">
<span style="background-color: white; color: #20124d;"> sh 'git push origin ' + env.BUILD_TAG</span></div>
<div class="separator" style="clear: both;">
<span style="background-color: white; color: #20124d;"> }</span></div>
<div class="separator" style="clear: both;">
<span style="background-color: white; color: #20124d;">}</span></div>
<div class="separator" style="clear: both;">
<span style="background-color: white; color: #20124d;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="background-color: white; color: #20124d;">stage 'undeploy'</span></div>
<div class="separator" style="clear: both;">
<span style="background-color: white; color: #20124d;">node {</span></div>
<div class="separator" style="clear: both;">
<span style="background-color: white; color: #20124d;"> sh "ssh -i " + env.G_BUILD_TEST_KEY + " " + env.G_EC2_USER + "@" + env.G_XYZ_CMS_TEST_IP + " 'sudo rm -rf /usr/share/tomcat8/webapps/cms.war'"</span></div>
<div class="separator" style="clear: both;">
<span style="background-color: white; color: #20124d;"> sh "ssh -i " + env.G_BUILD_TEST_KEY + " " + env.G_EC2_USER + "@" + env.G_XYZ_CMS_TEST_IP + " 'sudo rm -rf /usr/share/tomcat8/webapps/cms'"</span></div>
<div class="separator" style="clear: both;">
<span style="background-color: white; color: #20124d;"> sh "ssh -i " + env.G_BUILD_TEST_KEY + " " + env.G_EC2_USER + "@" + env.G_XYZ_CMS_TEST_IP + " 'sudo rm -rf /usr/share/tomcat8/webapps/site.war'"</span></div>
<div class="separator" style="clear: both;">
<span style="background-color: white; color: #20124d;"> sh "ssh -i " + env.G_BUILD_TEST_KEY + " " + env.G_EC2_USER + "@" + env.G_XYZ_CMS_TEST_IP + " 'sudo rm -rf /usr/share/tomcat8/webapps/site'"</span></div>
<div class="separator" style="clear: both;">
<span style="background-color: white; color: #20124d;">}</span></div>
<div class="separator" style="clear: both;">
<span style="background-color: white; color: #20124d;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="background-color: white; color: #20124d;">stage 'restartTomcat8'</span></div>
<div class="separator" style="clear: both;">
<span style="background-color: white; color: #20124d;">node {</span></div>
<div class="separator" style="clear: both;">
<span style="background-color: white; color: #20124d;"> sh "ssh -i " + env.G_BUILD_TEST_KEY + " " + env.G_EC2_USER + "@" + env.G_XYZ_CMS_TEST_IP + " 'sudo service tomcat8 restart'"</span></div>
<div class="separator" style="clear: both;">
<span style="background-color: white; color: #20124d;">}</span></div>
<div class="separator" style="clear: both;">
<span style="background-color: white; color: #20124d;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="background-color: white; color: #20124d;">stage 'restartNGINX'</span></div>
<div class="separator" style="clear: both;">
<span style="background-color: white; color: #20124d;">node {</span></div>
<div class="separator" style="clear: both;">
<span style="background-color: white; color: #20124d;"> sh "ssh -i " + env.G_BUILD_TEST_KEY + " " + env.G_EC2_USER + "@" + env.G_XYZ_CMS_TEST_IP + " 'sudo nginx -s reload'"</span></div>
<div class="separator" style="clear: both;">
<span style="background-color: white; color: #20124d;">}</span></div>
<div class="separator" style="clear: both;">
<span style="background-color: white; color: #20124d;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="background-color: white; color: #20124d;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="background-color: white; color: #20124d;">stage 'deployCms'</span></div>
<div class="separator" style="clear: both;">
<span style="background-color: white; color: #20124d;">node {</span></div>
<div class="separator" style="clear: both;">
<span style="background-color: white; color: #20124d;"> sh "scp -i " + env.G_BUILD_TEST_KEY + " " + env.HOME + "/workspace/XYZ-CMS/TEST/TestWF/hippo/cms/target/cms.war " + env.G_EC2_USER + "@" + env.G_XYZ_CMS_TEST_IP + ":~"</span></div>
<div class="separator" style="clear: both;">
<span style="background-color: white; color: #20124d;"> sh "ssh -i " + env.G_BUILD_TEST_KEY + " " + env.G_EC2_USER + "@" + env.G_XYZ_CMS_TEST_IP + " 'sudo chmod 755 ~ec2-user/cms.war'"</span></div>
<div class="separator" style="clear: both;">
<span style="background-color: white; color: #20124d;"> sh "ssh -i " + env.G_BUILD_TEST_KEY + " " + env.G_EC2_USER + "@" + env.G_XYZ_CMS_TEST_IP + " 'sudo cp ~ec2-user/cms.war /usr/share/tomcat8/webapps'"</span></div>
<div class="separator" style="clear: both;">
<span style="background-color: white; color: #20124d;"> sleep 120</span></div>
<div class="separator" style="clear: both;">
<span style="background-color: white; color: #20124d;">}</span></div>
<div class="separator" style="clear: both;">
<span style="background-color: white; color: #20124d;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="background-color: white; color: #20124d;">stage 'deploySite'</span></div>
<div class="separator" style="clear: both;">
<span style="background-color: white; color: #20124d;">node {</span></div>
<div class="separator" style="clear: both;">
<span style="background-color: white; color: #20124d;"> sh "scp -i " + env.G_BUILD_TEST_KEY + " " + env.HOME + "/workspace/XYZ-CMS/TEST/TestWF/hippo/site/target/site.war " + env.G_EC2_USER + "@" + env.G_XYZ_CMS_TEST_IP + ":~"</span></div>
<div class="separator" style="clear: both;">
<span style="background-color: white; color: #20124d;"> sh "ssh -i " + env.G_BUILD_TEST_KEY + " " + env.G_EC2_USER + "@" + env.G_XYZ_CMS_TEST_IP + " 'sudo chmod 755 ~ec2-user/site.war'"</span></div>
<div class="separator" style="clear: both;">
<span style="background-color: white; color: #20124d;"> sh "ssh -i " + env.G_BUILD_TEST_KEY + " " + env.G_EC2_USER + "@" + env.G_XYZ_CMS_TEST_IP + " 'sudo cp ~ec2-user/site.war /usr/share/tomcat8/webapps'"</span></div>
<div class="separator" style="clear: both;">
<span style="background-color: white; color: #20124d;">}</span></div>
<div class="separator" style="clear: both;">
<span style="background-color: white; color: #20124d;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="background-color: white; color: #20124d;">stage 'testCms'</span></div>
<div class="separator" style="clear: both;">
<span style="background-color: white; color: #20124d;">node {</span></div>
<div class="separator" style="clear: both;">
<span style="background-color: white; color: #20124d;"> def sout = new StringBuilder(), serr = new StringBuilder()</span></div>
<div class="separator" style="clear: both;">
<span style="background-color: white; color: #20124d;"> def proc = "curl -s -o /dev/null -I -w '%{http_code}' http://cms-test.xyz.com/cms".execute()</span></div>
<div class="separator" style="clear: both;">
<span style="background-color: white; color: #20124d;"> proc.consumeProcessOutput(sout, serr)</span></div>
<div class="separator" style="clear: both;">
<span style="background-color: white; color: #20124d;"> proc.waitForOrKill(30000)</span></div>
<div class="separator" style="clear: both;">
<span style="background-color: white; color: #20124d;"> //println "out> $sout err> $serr"</span></div>
<div class="separator" style="clear: both;">
<span style="background-color: white; color: #20124d;"> echo sout.toString()</span></div>
<div class="separator" style="clear: both;">
<span style="background-color: white; color: #20124d;">}</span></div>
<div class="separator" style="clear: both;">
<span style="background-color: white; color: #20124d;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="background-color: white; color: #20124d;">stage 'testSite'</span></div>
<div class="separator" style="clear: both;">
<span style="background-color: white; color: #20124d;">node {</span></div>
<div class="separator" style="clear: both;">
<span style="background-color: white; color: #20124d;"> def sout = new StringBuilder(), serr = new StringBuilder()</span></div>
<div class="separator" style="clear: both;">
<span style="background-color: white; color: #20124d;"> def proc = "curl -s -o /dev/null -I -w '%{http_code}' http://site-test.xyz.com".execute()</span></div>
<div class="separator" style="clear: both;">
<span style="background-color: white; color: #20124d;"> proc.consumeProcessOutput(sout, serr)</span></div>
<div class="separator" style="clear: both;">
<span style="background-color: white; color: #20124d;"> proc.waitForOrKill(30000)</span></div>
<div class="separator" style="clear: both;">
<span style="background-color: white; color: #20124d;"> //println "out> $sout err> $serr"</span></div>
<div class="separator" style="clear: both;">
<span style="background-color: white; color: #20124d;"> echo sout.toString()</span></div>
<div class="separator" style="clear: both;">
<span style="background-color: white; color: #20124d;">}</span></div>
<div class="separator" style="clear: both;">
<span style="background-color: white; color: #20124d;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="background-color: white; color: #20124d;">def version() {</span></div>
<div class="separator" style="clear: both;">
<span style="background-color: white; color: #20124d;"> def matcher = readFile('hippo/pom.xml') =~ '<version>(.+)</version>'</span></div>
<div class="separator" style="clear: both;">
<span style="background-color: white; color: #20124d;"> matcher ? matcher[1][1] : null</span></div>
<div class="separator" style="clear: both;">
<span style="background-color: white; color: #20124d;">}</span></div>
Jimmy Rayhttp://www.blogger.com/profile/14276730603257237473noreply@blogger.com0tag:blogger.com,1999:blog-4359121116907505622.post-65136072731860173242015-10-04T16:22:00.000-07:002015-10-09T05:59:19.867-07:00CMS Centric Architecture<b>Hippo Connect 2015</b><br />
Thursday I attended a very successful <a href="http://www.onehippo.com/connect/boston" target="_blank">Hippo Connect 2015</a> single-day conference in Somerville, MA. I found the conference very informative, via the sessions and the impromptu discussions and knowledge sharing. Based on learnings from Thursday, and my personal experience, I think we need to rethink application architecture.<br />
<br />
<b>Traditional IT Architecture</b><br />
In grad-school our professors stressed the need for Business and IT alignment. Many times, however, IT concerns seem to compete with, or even against, business concerns. As architects, we want to take enough time to properly design and architect systems so that they are both reliable and accessible. We also create rigor around chance processing so that our systems are not constantly under change. This approach does not align well with modern businesses that need to move quickly to capture market share by reacting to or overcoming opportunities and threats.<br />
<br />
There is a reason we create or otherwise implement seemingly rigid monolithic systems; these systems often become Systems of Record (SoRs) that the business relies upon to manage transactions and business processes. Given the importance of these systems to the business, pace of change of these systems must remain controlled. And the more control that is applied, the slower a system reacts to change. This slow pace is inherit to SoRs.<br />
<br />
<b>Pace-Layering Architecture</b><br />
Slow is not good for Marketing. When they act, they must act quickly with relevant and timely content designed to shape and direct the customer experience. Marketing simply moves at a faster pace, and so must their applications and tools. This is a clear argument for <a href="http://www.gartner.com/newsroom/id/1923014" target="_blank">Pace-Layering Architecture</a> , and I have designed systems for years with this concept in mind. In my opinion, IT simply cannot align with business if pace-layering is not used.<br />
<br />
Every company has an SoR of some type. In that way, these systems have become more commoditized, and less relevant to a business's competitive advantage. However, they, as well as the data they contain, are still very important to the business. Businesses are collecting more and more data everyday, and retaining and mining those data are complicated and full-time processes. In fact, according to Jeroen van Rotterdam, CTO of EMC ECD, those data will remain, after the systems are outdated and replaced.<br />
<br />
According to Gartner, there is a direct correlation between the pace of an application layer, and the level of differentiation and innovation the layers provide to the business. The fastest pace of change is the innovation layer. Applications in this layer address competitive threats and opportunities. In this layer, applications help enable and realize the the newest ideas and allow the business the most flexibility and agility.<br />
<br />
In the differentiation layer, the business benefits from ideas that are more mature. This is where real competitive advantage lives, as much as it can in an application layer.<br />
<br />
Finally in the lowest layer the lowest pace of change occurs. These are the applications with the most rigidity. This is where the SoRs live. The applications are commodities and in no way move at the pace of the business, nor do they provide much differentiation or innovation. However, they are still very important to business operations.<br />
<br />
<b>CMS Centric Architecture</b><br />
So, what does all this boring architecture approach have to do with Hippo CMS? What I heard at Hippo Connect yesterday was that marketers do a good job of creating content, in general. However, they sometimes fail with the holistic approach to delivering timely and relevant content, in a non-isolated fashion. To me this means that we must do a better job at enabling the business to more quickly generate content, and deliver that content across multiple channels. We must also decide on the data we need to collect about our customers, and use those data in personalization efforts with targeted content.<br />
<br />
I also heard that the "Customer owns the Customer Experience". After all, they can decide what channel to use or not use. I agree with this idea, and I think that content both shapes and directs the so-called "Customer Experience". Seeding control of the experience to the customer does not reduce our load. In fact, it applies even more emphasis on relevant and timely content delivery. Marketers need tools that allow them, and their IT solution providers, to more quickly develop and publish the content across multiple channels, in a data-driven fashion.<br />
<br />
Finally, I heard that some companies are shifting from a transaction-centric application layer to a CMS-centric application layer, with added functionality for transaction processing, if needed. To me this means that the CMS application layer, let's say Hippo, would be the center of the innovation or differentiation layers.<br />
<br />
So, with the CMS centric approach, Hippo makes even more sense to me as an architect. Hippo is built with mature and extensible application frameworks and libraries, such as Freemarker, Spring, Wicket, JAX RS, and Angular JS. So, in the innovation layer, IT will have a tool-set that allows them to more quickly build application components that help Marketers move as quickly as they need. Hippo provides both enterprise class content modeling, authoring, editing, and publishing tools, underpinned by industry standard technologies, needed to quickly generate and deliver relevant content.<br />
<br />
Using Hippo as their substrate, IT can add new integrations to a Hippo CMS implementation via the exposed REST API, or by extending the Spring configuration, or even at the web application level utilizing Java web container standard components. And, if need be, transaction processing, like that of ecommerce can be had by integrating to SaaS providers, other cloud offerings, or even on-premise tools.<br />
<br />
With this in mind, Hippo is uniquely positioned to build applications in the innovation or differentiation layers of a pace layering architecture. In fact, because of its robust integration approach, and the standard technologies employed by, Hippo CMS, the slower moving SoRs can also be used. Hippo CMS can integrate to most SoRs utilizing industry standard techniques and APIs. The bulk of this integration is completed in the Hippo CMS application, within the differentiation layer of a pace-layered architecture. This means less change to the slower-moving and rigid SoR layer. All the while, Marketers move faster, and content leads the way to a better customer experience.Jimmy Rayhttp://www.blogger.com/profile/14276730603257237473noreply@blogger.com0tag:blogger.com,1999:blog-4359121116907505622.post-27038286224026941082014-06-06T11:18:00.002-07:002014-06-17T06:24:01.684-07:00Speaking at RJUG on 2014-06-18 - Java PaaS and WildFly8 integration to CloudBees<div style="background-color: white; margin-bottom: 18px; padding: 0px;">
<span style="color: rgba(0, 0, 0, 0.6705882352941176); font-family: Whitney, helvetica, arial, sans-serif;"><span style="line-height: 22.399999618530273px;"><b><a href="http://www.meetup.com/Richmond-Java-Users-Group/events/165885402/">http://www.meetup.com/Richmond-Java-Users-Group/events/165885402/</a></b></span></span></div>
<div style="background-color: white; color: rgba(0, 0, 0, 0.670588); font-family: Whitney, helvetica, arial, sans-serif; font-size: 16px; line-height: 22.399999618530273px; margin-bottom: 18px; padding: 0px;">
<span style="font-weight: 700;">Session Abstract:</span> The CloudBees PaaS platform from a user perspective. Wildfly integration is done primarily as a clickstack (<a class="linkified" href="https://github.com/CloudBees-community/wildfly-clickstack" style="color: #3987cb; cursor: pointer; display: inline; text-decoration: none; word-break: break-all; word-wrap: break-word;">https://github.com/CloudBees-community/wildfly-clickstack</a>) which is open to the OSS community. This will be a demonstration of the PaaS platform and the Wildfly clickstack integration.</div>
<div style="background-color: white; color: rgba(0, 0, 0, 0.670588); font-family: Whitney, helvetica, arial, sans-serif; font-size: 16px; line-height: 22.399999618530273px; margin-bottom: 18px; padding: 0px;">
<span style="font-weight: 700;">Presenter:</span> Jimmy Ray, Director/Sr. Architect at AuthX.</div>
<div style="background-color: white; color: rgba(0, 0, 0, 0.670588); font-family: Whitney, helvetica, arial, sans-serif; font-size: 16px; line-height: 22.399999618530273px; margin-bottom: 18px; padding: 0px;">
Until recently, Jimmy Ray was a solutions architect with CloudBees, Inc., an industry leader in on-premise and cloud-based PaaS, CI, CD, and DevOps solutions. The majority of his 20+ years in IT has been spent developing software and architecting enterprise Java solutions. Ray is a leader in the Richmond, VA Java community, and has spoken at several Java user groups and other conferences in the US and Europe. He is passionate about Java PaaS, and DevOps underpinned by open source software. Ray is also an impassioned Java and MongoDB integrator and has spoken on related topics across the US He is considered a thought leader in agile software development, and has led organizations toward successfully realizing business value through agile development. </div>
Jimmy Rayhttp://www.blogger.com/profile/14276730603257237473noreply@blogger.com1tag:blogger.com,1999:blog-4359121116907505622.post-36089558141648610302014-03-31T09:55:00.003-07:002014-03-31T09:55:45.209-07:00Speaking at Java One 2014I will speaking at Java One 2014, in September. My session will be on "Java PaaS - Truly enabling CI, CD, and DevOps". <br />
<br />
This talk will focus on development and deployment using a Java PaaS. I will explain CI, CD, DevOps, and how it differs from what we do today. I will show how PaaS is the next generation of cloud services, underpinned by IaaS, and how it also relates to SaaS. I will show an example of real-world, currently available, tools to build CI, CD, and DevOps on PaaS.<br />
Jimmy Rayhttp://www.blogger.com/profile/14276730603257237473noreply@blogger.com0tag:blogger.com,1999:blog-4359121116907505622.post-75770742364746171002014-01-07T11:39:00.001-08:002014-02-17T13:55:32.870-08:00Richmond MongoDB User Group - Speaking on MongoDB and Spring DataI am scheduled to speak about MongoDB and Spring Data at the Richmond MongoDB User Group Meetup at Snagajob on Thursday, February 20th, 2014.<br />
<div>
<br /></div>
<div>
<a href="http://www.meetup.com/Richmond-MongoDB-User-Group/events/159204222/?a=ea1_grp&rv=ea1&_af_eid=159204222&_af=event">http://www.meetup.com/Richmond-MongoDB-User-Group/events/159204222/?a=ea1_grp&rv=ea1&_af_eid=159204222&_af=event</a></div>
<div>
<br /></div>
Jimmy Rayhttp://www.blogger.com/profile/14276730603257237473noreply@blogger.com0tag:blogger.com,1999:blog-4359121116907505622.post-36012182779867012272013-05-09T12:17:00.000-07:002013-05-12T18:35:26.017-07:00Simple Pagination for MongoDB Queries Using QueryDSLSo, I have looked at several Java APIs for MongoDB integration; my favorite by far is <a href="http://www.springsource.org/spring-data" target="_blank">Spring Data</a>. That said, Spring has API classes for paging and sorting. Even with those classes, I find the <a href="http://www.querydsl.com/" target="_blank">QueryDSL </a>API from <a href="http://www.mysema.com/" target="_blank">mysema </a>to be very functional. To work with my <a href="http://maven.apache.org/" target="_blank">Maven </a>projects, I add the below plugin and dependencies:<br />
<br />
<pre class="brush: java;first-line: 1;">...<plugin>
<groupId>com.mysema.maven</groupId>
<artifactId>maven-apt-plugin</artifactId>
<version>1.0</version>
<executions>
<execution>
<goals>
<goal>process</goal>
</goals>
<configuration>
<outputDirectory>target/generated-sources/java</outputDirectory>
<processor>com.mysema.query.apt.QuerydslAnnotationProcessor</processor>
</configuration>
</execution>
</executions>
</plugin>
...
<dependency>
<groupId>com.mysema.querydsl</groupId>
<artifactId>querydsl-apt</artifactId>
<version>2.2.3</version>
</dependency>
<dependency>
<groupId>com.mysema.querydsl</groupId>
<artifactId>querydsl-mongodb</artifactId>
<version>2.2.3</version>
</dependency>
...
</pre>
Once my Maven configuration is set, I need to update the domain model objects that I will be using with QueryDSL. Below is a snippet from my <i>Employee </i>model object with the <i>@QueryEntity</i> annotation added:<br />
<br />
<br />
<pre class="brush: java;first-line: 1;">...
@QueryEntity
@Document(collection = "employees")
public class Employee extends Person {
...
</pre>
<br />
Next I need to update the Spring Data <i>Employee Repository</i> interface to extend the <i>QueryDslPredicateExecutor </i>interface, type by my <i>Employee </i>model class. At this point it is important to note that for the this integration, I had to switch from the annotated Mongo Repository definition to extending the <i>MongoRepository </i>interface. The <i>@RepositoryDefinition</i> annotation did not want to play nice with the <i>QueryDslPredicateExecutor </i>extension.<br />
<br />
<br />
<pre class="brush: java;first-line: 1;">...
// @RepositoryDefinition(domainClass = Employee.class, idClass = String.class)
public interface EmployeeRepository extends MongoRepository<Employee, String>,
QueryDslPredicateExecutor<Employee> {
...
</pre>
Next, I need to update my <i>EmployeeService </i>interface and <i>EmployeeServiceImpl </i>implementation class to add a new method to access the generated find...() methods added for me by <i>QueryDSL</i>.<br />
<br />
<br />
<pre class="brush: java;first-line: 1;">...
public Page<Employee> findAllWithPages(int pageStart, int pageSize,
Sort.Direction sortDirection, String sortField) {
PageRequest pageRequest = new PageRequest(pageStart, pageSize,
new Sort(Sort.Direction.ASC, "employeeId"));
return this.employeeRepository.findAll(pageRequest);
}
...
</pre>
In this new method, I build a <i>org.springframework.data.domain.PageRequest</i> object and a <i>org.springframework.data.domain.Sort</i> object to pass into the newly provisioned <i>findAll(..)</i> method on the <i>EmployeeRepository</i>. I did not write this new <i>findAll(...)</i> method, it was generated for me by QueryDSL and Spring Data. Additionally, QueryDSL created the <i>QEmployee </i>class for me and placed it into <i>target/generated-soutces/java</i> in my Maven project. <i>QEmployee </i>is a query type and is seen in its entirety below.<br />
<br />
<br />
<pre class="brush: java;first-line: 1;">import static com.mysema.query.types.PathMetadataFactory.*;
import com.mysema.query.types.*;
import com.mysema.query.types.path.*;
/**
* QEmployee is a Querydsl query type for Employee
*/
public class QEmployee extends EntityPathBase<Employee> {
private static final long serialVersionUID = -236647047;
public static final QEmployee employee = new QEmployee("employee");
public final QPerson _super = new QPerson(this);
public final SimplePath<Address> address = createSimple("address", Address.class);
//inherited
public final DateTimePath<java.util.Date> birthDate = _super.birthDate;
public final SimplePath<Department> department = createSimple("department", Department.class);
public final StringPath employeeId = createString("employeeId");
//inherited
public final StringPath firstName = _super.firstName;
public final DateTimePath<java.util.Date> hireDate = createDateTime("hireDate", java.util.Date.class);
//inherited
public final StringPath id = _super.id;
//inherited
public final StringPath lastName = _super.lastName;
//inherited
public final StringPath middleName = _super.middleName;
public final NumberPath<Integer> salary = createNumber("salary", Integer.class);
public final StringPath title = createString("title");
public QEmployee(String variable) {
super(Employee.class, forVariable(variable));
}
public QEmployee(BeanPath<? extends Employee> entity) {
super(entity.getType(), entity.getMetadata());
}
public QEmployee(PathMetadata<?> metadata) {
super(Employee.class, metadata);
}
}
</pre>
<br />
Finally, below is the JUnit test that calls the pagination code generated for me.
<br />
<pre class="brush: java;first-line: 1;">package com.icfi.mongo;
import static org.junit.Assert.assertEquals;
import java.util.List;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.GenericXmlApplicationContext;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Sort;
import org.springframework.data.mongodb.core.MongoOperations;
import com.icfi.mongo.data.loaders.EmployeeShortLoader;
import com.icfi.mongo.data.model.Employee;
import com.icfi.mongo.services.EmployeeService;
public class PagingQueryTest {
private static Logger log = LoggerFactory.getLogger(PagingQueryTest.class);
private ApplicationContext ctx;
MongoOperations mongoOps;
List<Employee> employees;
EmployeeService employeeService;
@Before
public void setup() {
ctx = new GenericXmlApplicationContext("context/main.xml");
mongoOps = (MongoOperations) ctx.getBean("mongoTemplate");
employeeService = (EmployeeService) ctx.getBean("employeeService");
EmployeeShortLoader.main(null);
}
@Test
public void testPaging() {
String[] lastNames = new String[] { "Stanfel", "Gustavson", "Lortz",
"Marquardt", "Unno", "Savasere", "Spelt", "Wynblatt",
"Danecki", "Weedman", "Hartvigsen", "Menhoudj", "Heyers",
"Willoner", "Shumilov", "Zuberek", "Boguraev" };
int pageCount = 10;
int pageNumber = 0;
String sortField = "employeeId";
Sort.Direction sortOrder = Sort.Direction.ASC;
Page<Employee> employeesPage = employeeService.findAllWithPages(
pageNumber, pageCount, sortOrder, sortField);
while (employeesPage.hasNextPage()) {
assertEquals("List size is incorrect.", pageCount,
employeesPage.getSize());
log.info("Page Number = " + pageNumber);
if (employeesPage.hasContent()) {
log.info(employeesPage.getContent()
.get(employeesPage.getSize() - 1).getLastName());
assertEquals(
"Last name was incorrect.",
lastNames[pageNumber],
employeesPage.getContent()
.get(employeesPage.getSize() - 1).getLastName());
}
pageNumber++;
employeesPage = employeeService.findAllWithPages(pageNumber,
pageCount, sortOrder, sortField);
}
log.info("Page Number = " + pageNumber);
employeesPage = employeeService.findAllWithPages(pageNumber, pageCount,
sortOrder, sortField);
log.info(employeesPage.getContent()
.get(employeesPage.getContent().size() - 1).getLastName());
assertEquals(
"Last name was incorrect.",
lastNames[pageNumber],
employeesPage.getContent()
.get(employeesPage.getContent().size() - 1)
.getLastName());
}
@After
public void tearDown() {
this.mongoOps.getCollection("employees").drop();
}
}
</pre>
<br />
With this approach I have quickly added pagination to my MongoDB queries, while writing minimal code.Jimmy Rayhttp://www.blogger.com/profile/14276730603257237473noreply@blogger.com21tag:blogger.com,1999:blog-4359121116907505622.post-26373791779084223762013-05-07T09:01:00.001-07:002013-05-07T09:01:48.977-07:00Speaking at Twin Cities JUG - MongoDB and Spring DataI am scheduled to speak at the <a href="http://www.intertech.com/Free-Developer-Training/JavaUserGroup.aspx" target="_blank">Twin Cities JUG</a> on June 10th. My topic, near and dear to my heart, is Spring Data and MongoDB. I have incorporated some new content, including MongoDB 2.4.Jimmy Rayhttp://www.blogger.com/profile/14276730603257237473noreply@blogger.com0tag:blogger.com,1999:blog-4359121116907505622.post-60810344232703442092013-05-07T08:56:00.000-07:002013-05-07T08:56:00.648-07:002dsphere Indexes in Mongo 2.4MongoDB 2.4 has added new spherical index, <a href="http://docs.mongodb.org/manual/core/2dsphere/" target="_blank">2dsphere</a>. This index allows for more precise geo-spatial querying within Mongo by taking into the account the spherical shape of the earth and the fact that the distances between lines of longitude shrink and grow, depending on the latitude. Here is a good link to understand the Earth's spherical nature: <a href="http://www.learner.org/jnorth/tm/LongitudeIntro.html">http://www.learner.org/jnorth/tm/LongitudeIntro.html</a><br />
<br />
A simple application of this 2dsphere index is seen below. Given the "locations" collection with the given "typical" document shape:<br />
<br />
<pre class="brush: java;first-line: 1;">/* 0 */
{
"_id" : ObjectId("51887218c0aa488a0394002f"),
"_class" : "com.icfi.mongo.data.model.Location",
"city" : "Wheeling",
"state" : "WV",
"coords" : [40.071472, -80.6868],
"timeZone" : -5,
"zipCode" : "26003",
"dstObserved" : true
}
</pre>
I will apply a 2dsphere index on the "coords" (short for coordinates) element. This element is an array of double precision numbers representing the longitude and latitude (in that order) of a given city. The command is below:
<br />
<pre class="brush: java;first-line: 1;">db.locations.ensureIndex( { "coords" : "2dsphere" } )
</pre>
Next we can run query using a geo-spatial operator, like <a href="http://docs.mongodb.org/manual/reference/operator/near/#op._S_near" target="_blank">$near</a>. The $near command syntax is seen below:<br />
<br />
<br />
<pre class="brush: java;first-line: 1;">db.collection<collection>.find( { <location field=""> :
{ $near :
{ $geometry :
{ type : "Point" ,
coordinates : [ <longitude> , <latitude> ] } },
$maxDistance : <distance in="" meters="">
} } )
</pre>
<br />
My actual command to search for cities near Wheeling, WV 26003 is:
<br />
<br />
<pre class="brush: java;first-line: 1;">db.locations.find({ 'coords' : { $near : { $geometry : { type : 'Point' ,coordinates : [ 40.071472 , -80.6868 ] } }, $maxDistance : 10000} })
</pre>
This search returns documents that are within a circular distance of 10000 meters for the given Long/Lat coordinates.<br />
<br />
<br />
To make this more friendly in Java, I added the utility to convert miles to meters; I don't use meters much.
<br />
<br />
<pre class="brush: java;first-line: 1;">public class GeoUtils {
public static final double MILES_METERS_DIVISOR = 0.00062137;
public static double milesToMeters(double miles) {
return miles / GeoUtils.MILES_METERS_DIVISOR;
}
}
</pre>
<br />
A JUnit test is seen below. First I get the location object from which I want to harvest the coordinates (point). Then I call the <i>LocationService </i>method to find the nearest cities. I have also include the <i>Location </i>model class and the <a href="http://www.springsource.org/spring-data/mongodb" target="_blank">Spring Data</a> <i>LocationRepository </i>class.<br />
<br />
<br />
<pre class="brush: java;first-line: 1;">@Test
public void testNearMiles() {
log.info("<<<<<<<<<<<<<<<<< testNearMiles >>>>>>>>>>>>>>>>>>>>");
List<Location> locations = locationService.findByCityAndState(
"Wheeling", "WV");
assertNotNull("locations[0] was null.", locations.get(0));
assertEquals("City was not correct.", "Wheeling", locations.get(0)
.getCity());
assertEquals("State was not correct.", "WV", locations.get(0)
.getState());
assertEquals("ZipCode was not correct.", "26003", locations.get(0)
.getZipCode());
List<Location> locales = this.locationService.findNear(
locations.get(0), 5);
for (Location locale : locales) {
log.info(locale.toString());
}
assertEquals("City was not correct.","Yorkville",locales.get(2).getCity());
assertEquals("City was not correct.","Glen Dale",locales.get(14).getCity());
}
</pre>
<br />
Location service class:
<br />
<br />
<pre class="brush: java;first-line: 1;">...
@Override
public List<Location> findNear(double lon, double lat, double distance) {
return this.locationRepository.findByGeoNear(lon, lat, distance);
}
@Override
public List<Location> findNear(Location location, double distanceInMiles) {
return this.findNear(location.getLongitude(), location.getLatitude(),
GeoUtils.milesToMeters(distanceInMiles));
}
...
</pre>
<br />
In the LocationRepository class I have the following annotated method:
<br />
<br />
<pre class="brush: java;first-line: 1;">...
@Query("{ 'coords' : { $near : { $geometry : { type : 'Point' ,coordinates : [ ?0 , ?1 ] } }, $maxDistance : ?2} }")
List<Location> findByGeoNear(double lon, double lat, double distance);
</pre>
Since I am using Spring Data, I can add a new method to my LocationService like so:<br />
<br />
<br />
<pre class="brush: java;first-line: 1;">@Override
public GeoResults<Location> findNearPoint(Location location,
double distanceInMiles) {
Point point = new Point(location.getLongitude(), location.getLatitude());
NearQuery query = NearQuery.near(point).maxDistance(
new Distance(distanceInMiles, Metrics.MILES));
GeoResults<Location> results = this.mongoOps.geoNear(query,
Location.class);
return results;
}
</pre>
This new method uses a new <i>Point </i>class and the <i>Distance </i>class that handles the miles appropriately. This approach is considered a "GEO Near" query. It finds the locations near the given point and calculates the actual distance from the original point to each resultant location. Results are returned in a parameterized <i>GeoResults </i>object.Jimmy Rayhttp://www.blogger.com/profile/14276730603257237473noreply@blogger.com0tag:blogger.com,1999:blog-4359121116907505622.post-7985130348620635502013-05-07T07:07:00.001-07:002013-05-07T07:19:01.063-07:00MongoDB 2.4 - Text IndexesFull text indexes were added with MongoDB 2.4. I am working with MongoDB 2.4.3 and I have tested the functionality on my local Windows box. I have not tested the performance.<br />
<br />
For the "employees" collection with the given "typical" document shape:<br />
<br />
<br />
<pre class="brush: java;first-line: 1;">/* 0 */
{
"_id" : ObjectId("5189056ab38f56933e7224bb"),
"_class" : "com.icfi.mongo.data.model.Employee",
"address" : {
"_id" : null,
"addressLine1" : "227 Clifton Ave #-4",
"city" : "Darby",
"county" : "Delaware",
"state" : "PA",
"zipCode" : "19023"
},
"employeeId" : "28241",
"hireDate" : ISODate("1988-01-28T05:00:00Z"),
"department" : {
"_id" : "d004",
"name" : "Production",
"managerId" : "110420"
},
"title" : "Senior Engineer",
"salary" : 82927,
"lastName" : "Baik",
"firstName" : "Yuguang",
"middleName" : "M",
"birthDate" : ISODate("1959-01-04T05:00:00Z")
}
</pre>
I want to perform full-text searches on the "title" field. First, I need to ensure that the proper "text" index is applied to that field. The following "ensureIndex" command takes care of that.
<br />
<pre class="brush: java;first-line: 1;">db["employees"].ensureIndex({"title":"text"})
</pre>
<br />
Next I can perform a "<a href="http://docs.mongodb.org/manual/reference/command/text/" target="_blank">text</a>" search in the Mongo Shell with the format seen below:<br />
<br />
<br />
<pre class="brush: java;first-line: 1;">db.collection.runCommand( "text", { search: <string>,
filter: <document>,
project: <document>,
limit: <number>,
language: <string> } )
</string></number></document></document></string></pre>
<br />
My search command is:<br />
<br />
<pre class="brush: java;first-line: 1;">db.employees.runCommand( "text", { search: "senior" } )
</pre>
<br />
This runs a case-insensitive full-text search and returns documents containing the word "senior", based on the "title" field. The default limit is 100 docs returned. This can be overridden by the limit argument in the text command. In the Java API it would look something like this:<br />
<br />
<pre class="brush: java;first-line: 1;">final DBObject command = new BasicDBObject();
command.put("text", "employees");
command.put("search", "SeNiOr");
// command.put("limit", 2);
final CommandResult result = db.command(command);
</pre>
<br />
<a href="http://www.10gen.com/" target="_blank">10gen</a> warns about the "<a href="http://docs.mongodb.org/manual/core/indexes/#index-feature-text" target="_blank">text index</a>". They can grow very large and can adversely effect performance. At this time, the text index and text command are in beta and not recommended for production use.Jimmy Rayhttp://www.blogger.com/profile/14276730603257237473noreply@blogger.com0tag:blogger.com,1999:blog-4359121116907505622.post-46995004843558728372013-04-24T07:46:00.001-07:002013-04-24T07:46:38.561-07:00Speaking at VCU on Project Risk ManagementLast night I was a "guest lecturer" on Project Risk Management at the <a href="http://business.vcu.edu/" target="_blank">VCU School of Business</a>. I found the students to be interested and engaging.Jimmy Rayhttp://www.blogger.com/profile/14276730603257237473noreply@blogger.com0tag:blogger.com,1999:blog-4359121116907505622.post-12563428143637297042013-01-15T08:41:00.001-08:002013-01-15T08:44:40.360-08:00Speaking about MongoDB and Spring Data: RJUG, TriJUG, and SeaJUGIn the next several weeks I will Speaking on MongoDB and Spring Data integration at the following Java User Groups:<br />
<br />
<a href="http://www.richmondjug.com/" target="_blank">Richmond Java Users' Group (RJUG) - http://www.richmondjug.com/</a> - 1/16/2013<br />
<a href="http://trijug.org/" target="_blank">Triangle Java User's Group (TriJUG) - http://trijug.org/</a> - 1/21/2013<br />
<a href="http://www.seajug.org/" target="_blank">Seattle Java User's Group (SeaJUG) - http://www.seajug.org/</a> - 2/19/2013<br />
<br />
<a href="http://jimmyraywv.blogspot.com/2012/05/mongodb-and-spring-data.html" target="_blank">MongoDB and Spring Data - http://jimmyraywv.blogspot.com/2012/05/mongodb-and-spring-data.html</a>Jimmy Rayhttp://www.blogger.com/profile/14276730603257237473noreply@blogger.com0tag:blogger.com,1999:blog-4359121116907505622.post-14958958366676274952012-10-31T17:02:00.004-07:002023-07-31T09:41:30.900-07:00Java-based BDD with CucumberRecently we have been looking at creating tighter collaboration between our Developers, Testers, and Business Analysts (BAs). They all have the common project-level goal of delivering high quality, but they each fill different roles in the development cycle. The key to successful collaboration is the evolution of business requirements to stories to features to executable behavioral specifications in the form of unit tests.<br />
<br />
Our projects are primarily Java-based (with some Groovy thrown in for fun), so we have been looking primarily at tools for <a href="http://en.wikipedia.org/wiki/Behavior-driven_development" target="_blank">Behavioral Driven Development</a> (BDD) in Java. To that end, we first looked at <a href="http://code.google.com/p/spock/" target="_blank">Spock</a>. Spock is very powerful and integrated well with Groovy. This makes it very expressive and easy for our developers to learn, and quickly leverage. There in lies the issue. Spock, at least in our experience, is very developer-centric. Feature specifications written in Groovy with Spock <a href="http://en.wikipedia.org/wiki/Domain-specific_language" target="_blank">Domain Specific Language</a> (DSL) are done by the developer, mostly without the BA or tester. <br />
<br />
One can argue that pairing developers with testers and BAs would solve the developer centricity of Spock. I have read the arguments for <a href="http://en.wikipedia.org/wiki/Pair_programming" target="_blank">pair programming</a> with regards to less defects overcoming combined resources. However, while pair programming would help developers build the specs in Spock, it does not erase the fact that Spock is mostly for developers.<br />
<br />
Developer centricity was always my argument against <a href="http://en.wikipedia.org/wiki/Test-driven_development" target="_blank">Test Driven Development</a> (TDD). While I understand the ideas behind TDD, it seemed to me that it was always lacking that collaboration, key input, from the folks capturing and testing the business requirements. Writing <a href="http://www.junit.org/" target="_blank">JUnit </a>tests to meet a requirement, then writing code to pass the JUnit tests is good, but still decoupled from the requirements and true behaviors of the system under development. <br />
<br />
With BDD, the BAs can build the User Stories. From these stories, the testers and developers can distill the features. Testers can also derive the behavioral specifications that should be the foundations for testing the behaviors of features in the context of user stories. Finally, it would be very nice if the testers, after agreeing on a standard DSL, could help the developers generate <a href="http://en.wikipedia.org/wiki/Unit_testing" target="_blank">unit tests</a> in an automated fashion, thereby reducing variability from the behavioral specification. Enter <a href="http://en.wikipedia.org/wiki/Cucumber_(software)" target="_blank">Cucumber</a>.<br />
<br />
Cucumber was originally written in <a href="http://www.ruby-lang.org/en/" target="_blank">Ruby</a>. I am not a Ruby developer, so I never used the tool. I heard really good things about it and how successful BDD was with it. Finally, this year, <a href="http://aslakhellesoy.com/" target="_blank">Aslak Hellesoy</a> ported Cucumber to Java (<a href="https://github.com/cucumber/cucumber-jvm" target="_blank">cucumber-jvm</a>). I was aware of <a href="https://groups.google.com/forum/?fromgroups=#!topic/cukes/KZ2U04UA6MM" target="_blank">Cuke4Duke</a>, but I was just not eager to use <a href="http://jruby.org/" target="_blank">JRuby</a>. So when I heard about Cucumber in Java, I started my research. What follows is my initial research and impression of the tool and measure of utility for BDD in Java.<br />
<br />
<b><u>Getting Started</u></b><br />
To get started with Cucumber, I highly recommend the book, <a href="http://pragprog.com/book/hwcuc/the-cucumber-book" target="_blank">"The Cucumber Book: Behaviour-Driven Development for Testers and Developers"</a>. Though it is written for Ruby development, its coverage of Cucumber concepts and <a href="https://github.com/cucumber/cucumber/wiki/Gherkin" target="_blank">Gherkin </a>are well worth the read. The Gherkin examples in the book, work in the Java port of cucumber. <br />
<br />
For the uninitiated, Gherkin is the line-based language that Cucumber uses to define behaviors in the form of features, scenarios, and steps. Gherkin files are feature files with the ".feature" file extension. One of the first conventions to learn is that only one feature can be specified in a feature file. The next is the <a href="https://github.com/cucumber/cucumber/wiki/Gherkin" rel="nofollow" target="_blank">Gherkin </a>syntax.<br />
<br />
<pre class="brush: java;first-line: 1;">Feature: Password Manager
Scenario: Change password
Given User is logged in
And User is on edit profile page
When User presses Edit Password button
And User enters "value" for new password and repeats "value" for new password confirmation
And User presses "Change password"
Then User should see "Password changed"
</pre>
In this example, the <i>Password Manager</i> feature contains the <i>Change Password</i> scenario. This scenario is comprised of 6 steps arranged in typical <i>Given</i>, <i>When</i>, and <i>Then </i>Gherkin syntax. <br />
<br />
<b><u>Converting Gherkin to Java</u></b><br />
After analysts or testers create the Gherkin feature definitions, the files can be used to generate the Java unit tests that get execute via JUnit. The first step is to add the cucumber-jvm libraries to your Java project. Below are the Maven dependencies from my project.<br />
<br />
<pre class="brush: xml;first-line: 1;"><dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-core</artifactId>
<version>1.0.14</version>
</dependency>
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-junit</artifactId>
<version>1.0.14</version>
</dependency>
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-java</artifactId>
<version>1.0.14</version>
</dependency>
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-groovy</artifactId>
<version>1.0.14</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.10</version>
</dependency>
</pre>
<pre class="brush: xml;first-line: 1;"></pre>
Next, a unit test runner class is created to hook Cucumber into JUnit. Below is an example class.<br />
<br />
<pre class="brush: java;first-line: 1;">package com.icfi.cuke;
import org.junit.runner.RunWith;
import cucumber.junit.Cucumber;
@RunWith(Cucumber.class)
public class Test {
}
</pre>
<pre class="brush: java;first-line: 1;"></pre>
The Test.java file executes as a JUnit test case using the <a href="https://github.com/cucumber/cucumber-jvm/blob/master/junit/src/main/java/cucumber/api/junit/Cucumber.java" rel="nofollow" target="_blank">Cucumber</a>.class. When the the class is executed as a JUnit test case, cucumber-jvm reads the feature files in the same package as the test, or as specified by the <i>@Cucumber.Options</i> annotation. During execution cucumber-jvm examines the behavioral specifications in the feature files and tries to match them Java test files. <br />
<br />
When first executed, typically there is no matching Java code for the test steps. At this point, cucumber-jvm outputs what it thinks the Java and Ruby method stubs should be, based on the steps defined in the feature files. Below is the output (Ruby code removed) from the first run with no matching methods.<br />
<br />
<pre class="brush: java;first-line: 1;">@Given("^User is logged in$")
public void User_is_logged_in() throws Throwable {
// Express the Regexp above with the code you wish you had
throw new PendingException();
}
@Given("^User is on edit profile page$")
public void User_is_on_edit_profile_page() throws Throwable {
// Express the Regexp above with the code you wish you had
throw new PendingException();
}
@When("^User presses Edit Password button$")
public void User_presses_Edit_Password_button() throws Throwable {
// Express the Regexp above with the code you wish you had
throw new PendingException();
}
@When("^User enters \"([^\"]*)\" for new password and repeats \"([^\"]*)\" for new password confirmation$")
public void User_enters_for_new_password_and_repeats_for_new_password_confirmation(String arg1, String arg2) throws Throwable {
// Express the Regexp above with the code you wish you had
throw new PendingException();
}
@When("^User presses \"([^\"]*)\"$")
public void User_presses(String arg1) throws Throwable {
// Express the Regexp above with the code you wish you had
throw new PendingException();
}
@Then("^User should see \"([^\"]*)\"$")
public void User_should_see(String arg1) throws Throwable {
// Express the Regexp above with the code you wish you had
throw new PendingException();
}
</pre>
At this point the reader gets the idea that Cucumber matches step methods to steps within the the feature files via <a href="http://www.regular-expressions.info/" rel="nofollow" target="_blank">Regular Expressions</a> (RegEx). In fact, the JUnit output indicates that the step definitions defined in the Gherkin feature file(s) have yet to be implemented. Below is the JUnit output indicating that the step definitions were not executed. This also points out that the JUnit execution with the Cucumber Class uses the Features, Scenarios, and Steps defined in the features files, and looks for those implementations in the Java unit test code.<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEjr1jWoJdyvIJZqE5L70mvkWzg-xA5R-SL_vYiGx-zL4F_nOj6-TRpTvOt7qs9uX9ucMFjXNox_li_-SFwYeQJTMNzJghL1No0ey1FGNFFfYrmgVmlWxXhjOfj12eyPM8q-e8Hidt7MnH0uE0pBvobuJVzcehmVZ0nE1Cmd-CORYXZSR_4qCbhEs_LXbqA" style="margin-left: 1em; margin-right: 1em;"><img data-original-height="703" data-original-width="1349" height="209" src="https://blogger.googleusercontent.com/img/a/AVvXsEjr1jWoJdyvIJZqE5L70mvkWzg-xA5R-SL_vYiGx-zL4F_nOj6-TRpTvOt7qs9uX9ucMFjXNox_li_-SFwYeQJTMNzJghL1No0ey1FGNFFfYrmgVmlWxXhjOfj12eyPM8q-e8Hidt7MnH0uE0pBvobuJVzcehmVZ0nE1Cmd-CORYXZSR_4qCbhEs_LXbqA=w400-h209" width="400" /></a></div><br /><br /></div>
<b><u>Writing the Java Unit Tests</u></b><br />
To get started with the Java implementation of the Cucumber unit tests, we only need to paste the recommended code from above. Once pasted, we execute the Test.java to pick up the Cucumber unit tests. Only one executes and throws the PendingException, seen below. These are the stubs that we now have to implement.<br />
<br />
<pre class="brush: java;first-line: 1;">cucumber.runtime.PendingException: TODO: implement me
at com.icfi.cuke.PasswordManagerTest.User_is_logged_in(PasswordManagerTest.java:13)
at ?.Given User is logged in(com\icfi\cuke\PasswordManager.feature:3)
</pre>
<pre class="brush: java;first-line: 1;"></pre>
At this point it is important to realize that Cucumber does not enforce how we implement the unit tests. We could write any number of assertions that would pass or fail. Cucumber only tries to link the steps defined in the features files with RegEx matches to annotated methods in the unit test classes. Cucumber also enforces that the steps are executed in the order that they are defined. The RegEx matches can be spread across multiple unit test classes as well. Cucumber does not care where the tests actually are, just that they actually are there and in the right order. Cucumber will arrange the multiple java unit test files in the correct order, if need be.<br />
<br />
<b><u>Matching Steps</u></b><br />
The key to getting Gherkin steps to match Java test methods is using the correct statements, within your features files, that convey the correct RegEx in your Java annotations. It is possible to use two different statements that actually result in the same RegEx annotations in Java. For example, given the feature file below:<br />
<br />
<pre class="brush: java;first-line: 1;">Feature: Password Manager
Scenario: Change password
Given User is logged in
And User is on edit profile page
When User presses Edit Password button
And User enters "value" for new password and repeats "value" for new password confirmation
And User presses "Validate password"
And User presses "Change password"
Then User should see "Password changed"
</pre>
The step containing the strings "Validate password" and "Change password" would result in the same RegEx pattern: <b>"^User presses \"([^\"]*)\"$"
</b><br />
<b><br /></b>
However, Cucumber would only recommend this method once, for two reasons. First, even though the Cucumber feature file has two similar statements, with the same RegEx pattern result, only one corresponding Java method is needed. Cucumber will execute the Java method twice, to satisfy the defined steps. The second reason is that if the Java method is actually written twice (same RegEx pattern and different Java method signature for Java compile reasons), an exception is thrown by the cucumber-jvm runtime, see below.<br />
<br />
<pre class="brush: java;first-line: 1;">cucumber.runtime.DuplicateStepDefinitionException: Duplicate step definitions in
com.icfi.cuke.PasswordManagerTest.User_presses(String) in
file:/C:/UserData/Workspaces/TOMCAT/Cucumber/target/test-classes/ and
com.icfi.cuke.PasswordManagerTest.User_presses1(String) in
file:/C:/UserData/Workspaces/TOMCAT/Cucumber/target/test-classes/
</pre>
<br />
So, even if the defined feature steps cause the same RegEx pattern, Cucumber is smart enough to reuse the same Java method.
<br />
<br />
<b><u>Implementing Tests - The Rigor-Gap Remains</u></b><br />
Obviously, Cucumber cannot reach into the test case and force the Java developer to write proper unit tests. In fact, since Cucumber is underpinned by JUnit, the same rigor gaps can occur. Cucumber will check that defined steps are covered with tests by matching steps to Java method RegEx annotations, and JUnit will check for assertions and other exceptions thrown during execution. However, this does not force the Java developer to actually write a valid test. That rigor is still up to the Java developer and he/she that reviews his/her code. Unit test coverage of code can also be enforced with <a href="http://www.sonarsource.org/" rel="nofollow" target="_blank">Sonar</a> and other static code analysis tools.<br />
<br />
<b><u>Completing the Cycle</u></b><br />
With Cucumber in your teams' toolboxes, they will be better at completing the collaboration cycle to succeed with BDD. Cucumber allows your BA's and Testers's to write the Gherkin feature files that can be used to help the Java developer stub-out the Java behavioral specifications in the form of JUnit tests. While the rigor-gap still exists for actually implementing the unit tests, this is partially overcome by using static code analysis.Jimmy Rayhttp://www.blogger.com/profile/14276730603257237473noreply@blogger.com1tag:blogger.com,1999:blog-4359121116907505622.post-2741878558537371422012-09-19T08:13:00.001-07:002012-09-19T08:13:28.100-07:00PMI CVC PMP 2012 Fall Workshop - Communications and Risk Modules<span style="background-color: #fefdfa; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;">I will be presenting on Sunday, October 7th, for the </span><a href="http://www.pmi.org/" style="background-color: #fefdfa; color: #7d181e; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px; text-decoration: none;">PMI </a><a href="http://www.pmicvc.org/" style="background-color: #fefdfa; color: #7d181e; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px; text-decoration: none;">Central Va Chapter</a><span style="background-color: #fefdfa; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;"> during their <a href="http://www.pmicvc.org/index.php?option=com_content&view=article&id=650:fall-2012-pmp-prep-workshop&catid=160" target="_blank">Fall 2012 PMI Certification Workshop</a>. My topics will be Project Communications Management and Project Risk Management.</span>Jimmy Rayhttp://www.blogger.com/profile/14276730603257237473noreply@blogger.com0tag:blogger.com,1999:blog-4359121116907505622.post-30603407724915798742012-09-19T08:07:00.003-07:002012-09-19T08:13:51.658-07:00PMI CVC PMP 2012 Fall Workshop - Framework Talk<span style="background-color: #fefdfa; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;">I will be presenting on September 22nd for the </span><a href="http://www.pmi.org/" style="background-color: #fefdfa; color: #7d181e; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px; text-decoration: none;">PMI </a><a href="http://www.pmicvc.org/" style="background-color: #fefdfa; color: #7d181e; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px; text-decoration: none;">Central Va Chapter</a><span style="background-color: #fefdfa; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;"> during their Fall 2012 PMI Certification Workshop. My topic will be the Project Management Framework. My talk goes from 10:15 AM to 11:45 AM and touches on items found in sections 1 & 2, chapters 1, 2, & 3, of the PMBOK, version 4.</span><br />
<br style="background-color: #fefdfa; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;" />
<span style="background-color: #fefdfa; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;">In my session I will be discussing these topics and more:</span><br />
<br />
<br />
<ul style="background-color: #fefdfa; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px; list-style-image: initial; list-style-position: initial; margin: 0.5em 0px; padding: 0px 2.5em;">
<li style="border: none; margin: 0px 0px 0.25em; padding: 0.25em 0px;">Projects, Portfolios, and Program</li>
</ul>
<ul style="background-color: #fefdfa; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px; list-style-image: initial; list-style-position: initial; margin: 0.5em 0px; padding: 0px 2.5em;">
<li style="border: none; margin: 0px 0px 0.25em; padding: 0.25em 0px;">Process Groups, Knowledge Areas, and Processes</li>
</ul>
<ul style="background-color: #fefdfa; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px; list-style-image: initial; list-style-position: initial; margin: 0.5em 0px; padding: 0px 2.5em;">
<li style="border: none; margin: 0px 0px 0.25em; padding: 0.25em 0px;">PMO</li>
</ul>
<ul style="background-color: #fefdfa; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px; list-style-image: initial; list-style-position: initial; margin: 0.5em 0px; padding: 0px 2.5em;">
<li style="border: none; margin: 0px 0px 0.25em; padding: 0.25em 0px;">Project Life Cycle vs. Product Life Cycle</li>
</ul>
<ul style="background-color: #fefdfa; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px; list-style-image: initial; list-style-position: initial; margin: 0.5em 0px; padding: 0px 2.5em;">
<li style="border: none; margin: 0px 0px 0.25em; padding: 0.25em 0px;">Stakeholder Management</li>
</ul>
<ul style="background-color: #fefdfa; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px; list-style-image: initial; list-style-position: initial; margin: 0.5em 0px; padding: 0px 2.5em;">
<li style="border: none; margin: 0px 0px 0.25em; padding: 0.25em 0px;">Organizational Structure</li>
</ul>
<br />
<span style="background-color: #fefdfa; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;">Ever wondered how PMI keeps the PMP exam current and relevant? This year we have also added information of the PMI Role Delineation Study and the Crosswalk.</span><br />
<br style="background-color: #fefdfa; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;" />
<span style="background-color: #fefdfa; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;">This workshop is a great way to come up to speed for the PMP exam as well as gain valuable study tips from fellow project managers that have already passed the exam. The workshop is also a great opportunity to gain the PDUs needed to maintain existing PMP certifications. Best of all, attendees receive copies of all the slides presented at the workshop as well as other resources to help them study for the exam.</span>
<br />
<span style="background-color: #fefdfa; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;"><br /></span>
<span style="background-color: #fefdfa; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;"><b>Integration Module</b></span><br />
<span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"><span style="line-height: 18px;">I will also be supporting the Integration Module session that starts at 11:45 and continues after lunch to 14:00.</span></span>Jimmy Rayhttp://www.blogger.com/profile/14276730603257237473noreply@blogger.com10tag:blogger.com,1999:blog-4359121116907505622.post-78399291433125758002012-09-06T12:38:00.001-07:002012-09-06T12:38:42.089-07:00Spring Provisional/Conditional Bean Loading (Part 2)In <a href="http://jimmyraywv.blogspot.com/2012/09/spring-provisionalconditional-bean.html" target="_blank">Part1</a> I explained two solutions for dynamically loading beans based on environments. In this Part 2, I (quickly) extend the solution to handle conditional Bean Definition File imports. Below is my new <i>main.xml</i> with a new custom tag, <i><profile:importIf></i>. This new tag, along with the <i><profile:if></i> tag, will allow me to control individual bean and entire bean definition file loads via properties files.<br />
<div>
<br /></div>
<pre class="brush: xml;first-line: 1;"><?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:oxm="http://www.springframework.org/schema/oxm" xmlns:lang="http://www.springframework.org/schema/lang"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:profile="http://icfi.com/springbeans/profile"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://icfi.com/springbeans/profile http://icfi.com/springbeans/profile/profile.xsd">
<import resource="beans.xml" />
<import resource="beans2.xml" />
<profile:if test="${Spring.ENV=='TEST'}" src="config.properties">
<bean id="testBean" class="com.icfi.spring.init.beans.TestBean"
name="ibean">
<property name="valueOne" value="This is TEST." />
</bean>
</profile:if>
<profile:if test="${Spring.ENV=='PROD'}" src="config">
<bean id="prodBean" class="com.icfi.spring.init.beans.ProdBean"
name="ibean">
<property name="valueOne" value="This is PROD." />
</bean>
</profile:if>
<profile:importIf test="${Spring.ENV=='DEV'}" src="config.properties"
resource="context/DEV-beans.xml" />
</beans></pre>
To make this work I have to modify some additional artifacts, profile.xsd, ProfileBeanNamespaceHandler.java, and ProfileBeanDefinitionParser.java. These new artifacts are seen below.<br />
<pre class="brush: xml;first-line: 1;"><?xml version="1.0" encoding="UTF-8" standalone="no"?>
<xsd:schema xmlns="http://icfi.com/springbeans/profile"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:beans="http://www.springframework.org/schema/beans"
targetNamespace="http://icfi.com/springbeans/profile"
elementFormDefault="qualified" attributeFormDefault="unqualified">
<xsd:element name="if">
<xsd:complexType>
<xsd:sequence>
<xsd:any minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="test" type="xsd:string" use="required" />
<xsd:attribute name="src" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
<xsd:element name="importIf">
<xsd:complexType>
<xsd:sequence>
<xsd:any minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="test" type="xsd:string" use="required" />
<xsd:attribute name="src" type="xsd:string" use="required" />
<xsd:attribute name="resource" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:schema>
</pre>
<hr />
<pre class="brush: java;first-line: 1;">package com.icfi.springbeans.profile;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.xml.NamespaceHandlerSupport;
public class ProfileBeanNamespaceHandler extends NamespaceHandlerSupport {
private static Logger log = LoggerFactory
.getLogger(ProfileBeanNamespaceHandler.class);
public void init() {
log.debug(this.getClass().getSimpleName()+"::initStart");
super.registerBeanDefinitionParser("if",
new ProfileBeanDefinitionParser());
super.registerBeanDefinitionParser("importIf",
new ProfileBeanDefinitionParser());
log.debug(this.getClass().getSimpleName()+"::initEnd");
}
}</pre>
<hr />
<pre class="brush: java;first-line: 1;">package com.icfi.springbeans.profile;
import java.io.InputStream;
import java.util.HashMap;
import java.util.Map;
import java.util.ResourceBundle;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.config.BeanDefinitionHolder;
import org.springframework.beans.factory.support.BeanDefinitionReaderUtils;
import org.springframework.beans.factory.xml.BeanDefinitionParser;
import org.springframework.beans.factory.xml.BeanDefinitionParserDelegate;
import org.springframework.beans.factory.xml.ParserContext;
import org.springframework.util.xml.DomUtils;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
public class ProfileBeanDefinitionParser implements BeanDefinitionParser {
private static Logger log = LoggerFactory
.getLogger(ProfileBeanDefinitionParser.class);
private ResourceBundle bundle;
/** SpEL prefix: "${" */
public static final String PREFIX = "${";
/** SpEL suffix: "}" */
public static final String SUFFIX = "}";
/**
* Parse the "if" element, check for the required "test" and "src"
* attributes.
*/
public BeanDefinition parse(Element element, ParserContext parserContext) {
try {
if (DomUtils.nodeNameEquals(element, "if")
|| DomUtils.nodeNameEquals(element, "importIf")) {
String test = element.getAttribute("test");
String src = element.getAttribute("src");
if (StringUtils.isNotEmpty(src)) {
if (src.indexOf(".") > 0) {
src = src.substring(0, src.indexOf("."));
}
bundle = ResourceBundle.getBundle(src);
} else {
throw new IllegalArgumentException(
"src attribute not found.");
}
if (StringUtils.isNotEmpty(test)) {
Map<String, String> map = this.getExpressionMap(test);
String left = this.bundle.getString(map.get("left"));
String right = map.get("right");
if (left != null && right != null && left.equals(right)) {
if (DomUtils.nodeNameEquals(element, "if")) {
Element beanElement = DomUtils
.getChildElementByTagName(element, "bean");
return registerBean(beanElement, parserContext);
} else if (DomUtils.nodeNameEquals(element, "importIf")) {
String resource = element.getAttribute("resource");
InputStream is = parserContext.getReaderContext()
.getResourceLoader().getResource(resource)
.getInputStream();
Document doc = this.parse(is);
NodeList elements = doc
.getElementsByTagName("bean");
for (int x = 0; x < elements.getLength(); x++) {
Element bean = (Element) elements.item(x);
this.registerBean(bean, parserContext);
}
}
}
} else {
throw new IllegalArgumentException(
"test attribute not found.");
}
}
} catch (Exception e) {
log.error(e.getMessage());
}
return null;
}
private Map<String, String> getExpressionMap(String value) {
Map<String, String> map = new HashMap<String, String>();
if (StringUtils.isEmpty(value)) {
return null;
}
String entire = value.substring(PREFIX.length(), value.length()
- SUFFIX.length());
String left = entire.substring(0, entire.indexOf("=="));
String right = entire.substring(entire.indexOf('\'') + 1,
entire.lastIndexOf('\''));
map.put("left", left);
map.put("right", right);
return map;
}
/*
* Register Bean
*
* @param element
*
* @param parserContext
*
* @return
*/
private BeanDefinition registerBean(Element element,
ParserContext parserContext) {
BeanDefinitionParserDelegate delegate = parserContext.getDelegate();
BeanDefinitionHolder holder = delegate
.parseBeanDefinitionElement(element);
BeanDefinitionReaderUtils.registerBeanDefinition(holder,
parserContext.getRegistry());
return holder.getBeanDefinition();
}
/*
* JAXP Parser
*
* @param is
*
* @return
*
* @throws Exception
*/
private Document parse(InputStream is) throws Exception {
DocumentBuilderFactory dbfactory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = dbfactory.newDocumentBuilder();
Document doc = builder.parse(is);
return doc;
}
}</pre>
This new solution will load individual beans based on conditions defined in Bean Definition Files, and will now import entire Bean Definition Files based on those same declared conditions. Of course the same caveats apply. Developers must manage bean ID and NAME collisions when using multiple conditions and imports.
Jimmy Rayhttp://www.blogger.com/profile/14276730603257237473noreply@blogger.com0tag:blogger.com,1999:blog-4359121116907505622.post-66579973442435267082012-09-06T09:30:00.000-07:002012-09-11T10:04:20.417-07:00Spring Provisional/Conditional Bean Loading (Part 1)In <a href="http://www.springsource.org/" target="_blank">Spring</a> 3.1 (2011), profiles were introduced. These <i>Bean Definition Profiles</i> allow Spring developers to set up different profiles for loading different beans in different environments. I know several developers that are moving to 3.1 just for that feature.<br />
<br />
However, what does one do if one needs to load different beans for different environments, but he/she cannot immediately upgrade to Spring 3.1? In this blog entry I will cover that scenario with two solutions from long ago that still work today in Spring 3.0.x.<br />
<br />
<b><u>Solution #1:</u></b><br />
<br />
Far and away the easiest solution is to use config file properties, the Spring <i>PropertyPlaceholderConfigurer</i>, and Spring Expression Language (<a href="http://static.springsource.org/spring/docs/3.0.x/reference/expressions.html" target="_blank">SpEL</a>). Below is an XML snippet from a bean definition file. The code uses SpEL to get at the Spring.ENV property found in the config.properties, and referenced as the Spring container starts to load.<br />
<pre class="brush: xml;first-line: 1;">…<bean id="icfi.propertyConfigurer"
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>classpath:config.properties</value>
</list>
</property>
<property name="ignoreUnresolvablePlaceholders" value="false" />
</bean>
…
<import resource="beans.xml" />
<import resource="beans2.xml" />
<import resource="${Spring.ENV}-beans.xml" />…
</pre>
As long as the property is located before the Spring Container starts to load bean definitions, this will work to load files whose names match the resource arguments. This solution has issues, not the least of which are that properties must be used and they must be coordinated to match file names related to bean definition files.<br />
<br />
System properties can also be used in lieu of the <i>PropertyPlaceholderConfigurer</i>.<br />
<br />
<b><u>Solution #2:</u></b><br />
<br />
This next solution is way more involved, requiring custom extensions to the Spring Container API, but is configuration properties file driven instead of system property driven. To understand this approach, we start with what we would like to see in the bean definition file. Below is the <profile:if> custom tag that will test whether certain beans are to be loaded.<br />
<br />
<pre class="brush: xml;first-line: 1;"><profile:if test="${Spring.ENV=='DEV'}" src="config.properties">
<bean id="devBean" class="com.icfi.spring.init.beans.DevBean" name="ibean">
<property name="valueOne" value="This is DEV." />
</bean>
</profile:if>
</pre>
In this example, the <profile:if> tag tests to see if the Spring.ENV property has the required value of "DEV" to load this bean. The Spring.ENV property should be found in the <i>config.properties</i> resource bundle that is declared in the <i>src </i>attribute of the <profile:if> tag. If the test passes (Spring.ENV == 'DEV') then the devBean will be loaded.<br />
<br />
The plumbing for this solution extends the Spring Container API via the Extensible <a href="http://static.springsource.org/spring/docs/2.0.x/reference/extensible-xml.html" target="_blank">XML Authoring API</a> with Java and XML Schema (XSD), along with two additional Spring configuration files. It is rather complex, but I will try to simplify it here.<br />
<br />
The Extensible XML Authoring API (EXAA for short) has been around since Spring 2.0. However, it never really got the visibility that other Spring features enjoyed. With EXAA, there are four steps to extending the API:<br />
<br />
<ol>
<li>Authoring XML schemas</li>
<li>Coding Namespace handlers</li>
<li>Coding BeanDefinitionParser extensions</li>
<li>Registering the XSD and code artifacts with the Spring Container</li>
</ol>
<div>
<br /></div>
<hr />
<div>
I will start will authoring the schema. Below is the XSD that defines the new custom tags we want to use. As a point of reference, I built this solution in Eclipse Helios SR2 using Maven. I placed the new <i>profile.xsd</i> into directory in the image below.<br />
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-sTMAblKSh4o/UEi2ZMpuKwI/AAAAAAAAAIg/wjfaK8fRbKg/s1600/Capture.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="http://1.bp.blogspot.com/-sTMAblKSh4o/UEi2ZMpuKwI/AAAAAAAAAIg/wjfaK8fRbKg/s400/Capture.JPG" width="388" /></a></div>
<div>
<br /></div>
<div>
The contents of the schema are seen below. In this XSD I defined the target namespace (http://icfi.com/springbeans/profile) and the custom tag (if) with required attributes, <i>test </i>and <i>src</i>.</div>
<br />
<pre class="brush: xml;first-line: 1;"><?xml version="1.0" encoding="UTF-8" standalone="no"?>
<xsd:schema xmlns="http://icfi.com/springbeans/profile"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:beans="http://www.springframework.org/schema/beans"
targetNamespace="http://icfi.com/springbeans/profile"
elementFormDefault="qualified" attributeFormDefault="unqualified">
<xsd:element name="if">
<xsd:complexType>
<xsd:sequence>
<xsd:any minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="test" type="xsd:string" use="required" />
<xsd:attribute name="src" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:schema>
</pre>
Once the XSD was done, I needed to register the schema using the appropriate properties file, <i>spring.schemas</i>, in the <i>META-INF</i> directory.<br />
<pre class="brush: xml;first-line: 1;">http\://icfi.com/springbeans/profile/profile.xsd=com/icfi/springbeans/profile/profile.xsd
</pre>
Next, I needed to code the handler and parser. The handler, a simple class as it turns out, is used by the Spring Container to register the new custom Bean Definition Parser. My handler is below.
<br />
<pre class="brush: java;first-line: 1;">package com.icfi.springbeans.profile;
import org.springframework.beans.factory.xml.NamespaceHandlerSupport;
public class ProfileBeanNamespaceHandler extends NamespaceHandlerSupport {
public void init() {
super.registerBeanDefinitionParser("if",
new ProfileBeanDefinitionParser());
}
}
</pre>
Next I needed to register the handler. For this I created the appropriate properties file, <i>spring.handlers</i>, in the <i>META-INF</i> directory.
<br />
<pre class="brush: xml;first-line: 1;">http\://icfi.com/springbeans/profile=com.icfi.springbeans.profile.ProfileBeanNamespaceHandler
</pre>
Below is the location in my Maven layout for both registration properties files mentioned so far.
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-F5LXfuhqAG0/UEi_gbiw4zI/AAAAAAAAAIw/G-L6DSsqFVE/s1600/Capture.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="http://2.bp.blogspot.com/-F5LXfuhqAG0/UEi_gbiw4zI/AAAAAAAAAIw/G-L6DSsqFVE/s400/Capture.JPG" width="351" /></a></div>
<br />
The ProfileBeanDefinitionParser is referenced in the handler. This parser does all the heavy lifting of parsing the custom tag, verifying the attributes, loading the defined resource bundle (properties file), testing the condition for bean load, parsing the bean definition, and then registering the bean with Spring. Below is the custom Bean Definition Parser that I wrote.<br />
<pre class="brush: java;first-line: 1;">package com.icfi.springbeans.profile;
import java.util.HashMap;
import java.util.Map;
import java.util.ResourceBundle;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.config.BeanDefinitionHolder;
import org.springframework.beans.factory.support.BeanDefinitionReaderUtils;
import org.springframework.beans.factory.xml.BeanDefinitionParser;
import org.springframework.beans.factory.xml.BeanDefinitionParserDelegate;
import org.springframework.beans.factory.xml.ParserContext;
import org.springframework.util.xml.DomUtils;
import org.w3c.dom.Element;
public class ProfileBeanDefinitionParser implements BeanDefinitionParser {
private static Logger log = LoggerFactory
.getLogger(ProfileBeanDefinitionParser.class);
private ResourceBundle bundle;
/** SpEL prefix: "${" */
public static final String PREFIX = "${";
/** SpEL suffix: "}" */
public static final String SUFFIX = "}";
/**
* Parse the "if" element, check for the required "test" and "src" attributes.
*/
public BeanDefinition parse(Element element, ParserContext parserContext) {
try {
if (DomUtils.nodeNameEquals(element, "if")) {
String test = element.getAttribute("test");
String src = element.getAttribute("src");
if (StringUtils.isNotEmpty(src)) {
if (src.indexOf(".") > 0) {
src = src.substring(0, src.indexOf("."));
}
bundle = ResourceBundle.getBundle(src);
} else {
throw new IllegalArgumentException(
"src attribute not found.");
}
if (StringUtils.isNotEmpty(test)) {
Map<String, String> map = this.getExpressionMap(test);
String left = this.bundle.getString(map.get("left"));
String right = map.get("right");
if (left != null && right != null && left.equals(right)) {
Element beanElement = DomUtils
.getChildElementByTagName(element, "bean");
return parseRegisterBean(beanElement, parserContext);
}
} else {
throw new IllegalArgumentException(
"test attribute not found.");
}
}
} catch (Exception e) {
log.error(e.getMessage());
}
return null;
}
private Map<String, String> getExpressionMap(String value) {
Map<String, String> map = new HashMap<String, String>();
if (StringUtils.isEmpty(value)) {
return null;
}
String entire = value.substring(PREFIX.length(),
value.length() - SUFFIX.length());
String left = entire.substring(0, entire.indexOf("=="));
String right = entire.substring(entire.indexOf('\'') + 1,
entire.lastIndexOf('\''));
map.put("left", left);
map.put("right", right);
return map;
}
private BeanDefinition parseRegisterBean(Element element,
ParserContext parserContext) {
BeanDefinitionParserDelegate delegate = parserContext.getDelegate();
BeanDefinitionHolder holder = delegate
.parseBeanDefinitionElement(element);
BeanDefinitionReaderUtils.registerBeanDefinition(holder,
parserContext.getRegistry());
return holder.getBeanDefinition();
}
}</pre>
The <i>config.properties</i> file contains the <i>Spring.ENV</i> property that will be used to test the condition defined in the <profile:if> tag, <i>test</i> attribute. This file is found at the root of the <i>src/main/resources</i> Maven layout.</profile:if><br />
<profile:if><br /></profile:if>
<profile:if>Below is a test class, <i>SpringInitMotivator</i>, that I used to exercise this solution, Also seen below is the <i>main.xml</i> used to configure Spring in my application. The <i>SpringInitMotivator </i>uses a helper class, <i>SpringBeanFactory</i>, to get at beans. For this demo, I use the IBeans interface, implemented by the <i>DevBean </i>and <i>ProdBean </i>classes. I load the beans via the <i>name </i>attribute and not the <i>id</i>, as multiple beans can not have the same ID, and I wanted to use a common name for both bean load conditions.</profile:if><br />
<pre class="brush: java;first-line: 1;">package com.icfi.spring;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.GenericXmlApplicationContext;
import com.icfi.spring.init.beans.IBeans;
public class SpringInitMotivator {
private static Logger log = LoggerFactory
.getLogger(SpringInitMotivator.class);
public static void main(String[] args) {
ApplicationContext ctx = new GenericXmlApplicationContext(
"context/main.xml"); // Spring 3.0
IBeans ibean = (IBeans) SpringBeanFactory.getBean("ibean");
log.info(ibean.getValueOne());
}
}</pre>
<br />
<pre class="brush: java;first-line: 1;"><?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:oxm="http://www.springframework.org/schema/oxm" xmlns:lang="http://www.springframework.org/schema/lang"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:profile="http://icfi.com/springbeans/profile"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://icfi.com/springbeans/profile http://icfi.com/springbeans/profile/profile.xsd">
<import resource="beans.xml" />
<import resource="beans2.xml" />
<profile:if test="${Spring.ENV=='DEV'}" src="config.properties">
<!-- <import resource="development-beans.xml" /> -->
<bean id="devBean" class="com.icfi.spring.init.beans.DevBean" name="ibean">
<property name="valueOne" value="This is DEV." />
</bean>
</profile:if>
<profile:if test="${Spring.ENV=='PROD'}" src="config">
<!-- <import resource="development-beans.xml" /> -->
<bean id="prodBean" class="com.icfi.spring.init.beans.ProdBean" name="ibean">
<property name="valueOne" value="This is PROD." />
</bean>
</profile:if>
</beans></pre>
Jimmy Rayhttp://www.blogger.com/profile/14276730603257237473noreply@blogger.com5tag:blogger.com,1999:blog-4359121116907505622.post-75869607952437750672012-08-29T14:54:00.000-07:002012-09-05T13:20:09.534-07:00Storing Documents in MarkLogic via XCCIntegrating Java applications to MarkLogic involves using the <a href="http://developer.marklogic.com/pubs/4.0/books/xcc.pdf" target="_blank">MarkLogic XCC</a> (XML Contentbase Connector). XCC is a set of APIs that support Java, .Net, etc. XCC uses a MarkLogic XDBC server embedded in the MarkLogic server to connect to the XML databases on the <a href="http://developer.marklogic.com/learn/technical-overview" target="_blank">MarkLogic server</a>.<br />
<br />
After the XDBC server is created in MarkLogic, you can test connectivity via a simple Hello World call, seen below. Note that I use the admin/admin credentials that I set up when I installed MarkLogic. In truth, MarkLogic has a very granular security scheme that can be used to control access and privileges. SSL should also be used. The Hello World example is from the XCC Developers Guide.<br />
<pre class="brush: java;first-line: 1;">package com.icfi.marklogic;
import java.net.URI;
import java.net.URISyntaxException;
import com.marklogic.xcc.ContentSource;
import com.marklogic.xcc.ContentSourceFactory;
import com.marklogic.xcc.Request;
import com.marklogic.xcc.ResultSequence;
import com.marklogic.xcc.Session;
import com.marklogic.xcc.exceptions.RequestException;
import com.marklogic.xcc.exceptions.XccConfigException;
public class HelloWorld {
public static void main(String[] args) throws URISyntaxException,
XccConfigException, RequestException {
URI uri = new URI("xcc://admin:admin@localhost:8050/Documents");
ContentSource contentSource = ContentSourceFactory.newContentSource(uri);
Session session = contentSource.newSession();
Request request = session.newAdhocQuery("\"Hello World\"");
ResultSequence rs = session.submitRequest(request);
System.out.println(rs.asString());
session.close();
}
}
</pre>
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
Once connectivity has been tested, you are ready to start storing documents. Another example from the XCC Guide (customized for my use) can be seen below. In this example, I again connect to the XDBC server that I created and get a session object. It is important to state here that connection pooling is done automatically for you by XCC. The API also supports <a href="http://java.sun.com/products/jta/" target="_blank">JTA</a>.<br />
<br />
<br />
<pre class="brush: java;first-line: 1;">package com.icfi.marklogic;
import java.net.URI;
import java.net.URISyntaxException;
import com.icfi.marklogic.content.XmlContent;
import com.marklogic.xcc.ContentSource;
import com.marklogic.xcc.ContentSourceFactory;
import com.marklogic.xcc.Session;
import com.marklogic.xcc.exceptions.RequestException;
import com.marklogic.xcc.exceptions.RetryableXQueryException;
import com.marklogic.xcc.exceptions.XccConfigException;
public class ContentAdder {
public static final int MAX_RETRY_ATTEMPTS = 5;
public static final int RETRY_WAIT_TIME = 1000;
public static void main(String[] args) throws URISyntaxException,
XccConfigException, RequestException {
URI uri = new URI("xcc://admin:admin@localhost:8050/Documents");
ContentSource contentSource = ContentSourceFactory
.newContentSource(uri);
Session session = contentSource.newSession();
session.setTransactionMode(Session.TransactionMode.UPDATE);
// Re-try logic for a multi-statement transaction
for (int i = 0; i < MAX_RETRY_ATTEMPTS; i++) {
try {
session.submitRequest(session
.newAdhocQuery("xdmp:document-insert('/docs/catalog.xml', "
+ XmlContent.CATALOG + ")"));
session.submitRequest(session
.newAdhocQuery("xdmp:document-insert('/docs/bookstore.xml', "
+ XmlContent.BOOKSTORE + ")"));
session.commit();
break;
} catch (RetryableXQueryException e) {
try {
Thread.sleep(RETRY_WAIT_TIME);
} catch (InterruptedException ie) {
// Ignore
}
}
}
session.close();
}
}
</pre>
<div class="separator" style="clear: both; text-align: center;">
</div>
In this example I also use the recommended approach to retrying operations against the XDBC server. The code that does the "heavy-lifting" to store the documents is seen below. In this code, the XCC API uses the session object to make a request to the XDBC server with a new ad-hoc query that uses the xdmp:document-insert function which is a built-in markLogic XQuery function. In its simplest form the document-insert function takes a unique document URI and the XML document content. In this example the XML content is provided by a <a href="http://groovy.codehaus.org/Strings+and+GString" target="_blank"><i>Groovy-String</i> (G-String)</a> in <i>XmlContent.groovy</i> class. I use Groovy string constants because G-Strings preclude me from having to write all that nasty <i>java.lang.String</i> concatenation.<br />
<pre class="brush: java;first-line: 1;">session.submitRequest(session
.newAdhocQuery("xdmp:document-insert('/docs/catalog.xml', "
+ XmlContent.CATALOG + ")"));
</pre>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
To verify that the docs were stored, I will go out to the <a href="http://developer.marklogic.com/pubs/5.0/books/qconsole.pdf" target="_blank">MarkLogic Query Console</a> (http://localhost:8000/qconsole/). In the console, I can run XQuery queries to verify that I stored the documents in the database. Note: When MarkLogic installs, it creates several databases, and when you create an XDBC server, you must choose a database to connect to. I chose the "Documents" database, but I could have created a new one for this purpose. Below is a screenshot of the Query Console. I clicked on the "Explore" button to view a list of all the documents in this database.
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-jqVGWswZ2Jw/UD0ce1fmcKI/AAAAAAAAAG8/v2u-UUipbLs/s1600/Capture.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="518" src="http://3.bp.blogspot.com/-jqVGWswZ2Jw/UD0ce1fmcKI/AAAAAAAAAG8/v2u-UUipbLs/s640/Capture.JPG" width="640" /></a></div>
If I wanted to view the contents of a document, I could run an XQuery as seen below, or I could also simply click on the document in the list.
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-NTfxMs53FxE/UD0dH_aGDMI/AAAAAAAAAHE/vKl85lLnniM/s1600/Capture.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="606" src="http://4.bp.blogspot.com/-NTfxMs53FxE/UD0dH_aGDMI/AAAAAAAAAHE/vKl85lLnniM/s640/Capture.JPG" width="640" /></a></div>
The value in the XQuery doc function is the unique URI for the document in the MarkLogic database.
This was a simple example of storing documents in MarkLogic. In reality, considerable thought should be exercised to create the proper structures (Directories and Collections, etc.) that would be used to house and organize documents. Organizing documents into directories and collections makes them easier to handle en masse if that requirement exists. Another important point to make is that these docs were already XML. Going forward, I will be serializing Java objects into XML via XStream.
Before I can store Java objects as serialized XML, I need to map important attributes of my model objects to the MarkLogic container model. To do this I wrote a custom <a href="http://docs.oracle.com/javase/tutorial/java/javaOO/annotations.html" target="_blank">Java Annotation</a>, seen below.
<br />
<pre class="brush: java;first-line: 1;">package com.icfi.marklogic;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface Document {
String documentUriPrefix() default "";
String documentUriSuffix() default "";
String collections() default "";
String directory() default "";
String properties() default "";
}
</pre>
The <i>Employee.java </i>model class seen below uses the <i>Document </i>annotation to define the MarkLogic container specific semantics that would be used when the document representing the Java object is stored in MarkLogic.
<br />
<pre class="brush: java;first-line: 1;">package com.icfi.model;
import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.Date;
import com.icfi.framework.Strings;
import com.icfi.marklogic.Document;
/**
* Employee model object.
*
* @author jimmyray
* @version 1.0
*/
@Document(documentUriSuffix = "/employee.xml",
collections = "http://employees.none.com", directory = "/Employees/", properties="<status>NEW</status>")
public class Employee extends Person implements Serializable {
private static final long serialVersionUID = 2523764855390968707L;
private String id;
private Address address;
private String employeeId;
private Date hireDate;
private Department department;
private String title;
private int salary;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
...
</pre>
<br />
Seen below, the <i>EmployeeServiceImpl </i>processes the annotations on the <i>Employee </i>class to get at the metadata needed to process the documents in MarkLogic.<br />
<pre class="brush: java;first-line: 1;">...
private void processAnnotations(Employee employee)
throws ClassNotFoundException {
this.documentMap = new HashMap<String, String>();
Class clas = Class.forName("com.icfi.marklogic.Document");
Document document = (Document) employee.getClass().getAnnotation(clas);
String uri = document.directory() + employee.getId()
+ document.documentUriSuffix();
String collections = document.collections();
String properties = document.properties();
this.documentMap.put(URI_KEY, uri);
if (null != collections && !collections.equals("")) {
this.documentMap.put(COLLECTIONS_KEY, collections);
}
if (null != properties && !properties.equals("")) {
this.documentMap.put(PROPERTIES_KEY, properties);
}
}...
</pre>
<br />
<br />
<br />
Below is a JUnit test that exercises the <i>EmployeeServiceImpl</i> class. This test loads employees and stores them in the MarkLogic database using the employee service.<br />
<pre class="brush: java;first-line: 1;">package com.icfi.marklogic;
import java.util.List;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.GenericXmlApplicationContext;
import com.icfi.model.Employee;
import com.icfi.services.EmployeeService;
public class EmployeeServiceTest {
private static Logger log = LoggerFactory
.getLogger(EmployeeServiceTest.class);
@Test
public void testEmployeeService() throws Exception {
ApplicationContext ctx = new GenericXmlApplicationContext(
"context/main.xml");
EmployeeService employeeService = (EmployeeService) ctx
.getBean("employeeService");
List<employee> employees = employeeService.buildEmployees();
for (Employee employee : employees) {
System.out.println(employee);
}
employeeService.persistEmployees(employees);
//employeeService.removeEmployees(employees);
}
}
</pre>
The <i>persistEmployee()</i> method (Seen below) of the <i>EmployeeServiceImpl</i> class persists employees documents into MarkLogic via the <i>MarkLogicDao</i> class.<br />
<pre class="brush: java;first-line: 1;">public void persistEmployee(Employee employee) {
try {
this.processAnnotations(employee);
dao.storeDocument(this.serialize(employee), this.documentMap);
} catch (XccConfigException xce) {
log.error(Strings.getStackTraceAsString(xce));
} catch (RequestException re) {
log.error(Strings.getStackTraceAsString(re));
} catch (URISyntaxException use) {
log.error(Strings.getStackTraceAsString(use));
} catch (ClassNotFoundException cnfe) {
log.error(Strings.getStackTraceAsString(cnfe));
} catch (TransformerConfigurationException tce) {
log.error(Strings.getStackTraceAsString(tce));
} catch (TransformerFactoryConfigurationError tfce) {
log.error(Strings.getStackTraceAsString(tfce));
}
}
</pre>
This method performs an inline serialization using <i>XStream</i>.<br />
<pre class="brush: java;first-line: 1;">private String serialize(Employee employee)
throws TransformerConfigurationException,
TransformerFactoryConfigurationError {
XStream xstream = new XStream(new DomDriver());
String xml = xstream.toXML(employee);
return xml;
}
</pre>
The <i>MarkLogicDao</i> class does the heavy lifting and interfaces with the MarkLogic database. Its methods use the <i>documentMap</i> to get access to the metadata attached to the <i>Employee</i> objects via the <i>Document</i> annotation.<br />
<pre class="brush: java;first-line: 1;">package com.icfi.marklogic;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.icfi.services.EmployeeService;
import com.marklogic.xcc.ContentSource;
import com.marklogic.xcc.ContentSourceFactory;
import com.marklogic.xcc.Session;
import com.marklogic.xcc.exceptions.RequestException;
import com.marklogic.xcc.exceptions.RetryableXQueryException;
import com.marklogic.xcc.exceptions.XccConfigException;
/**
* DAO class to abstract the database layer from the Java application.
*
* @author jimmyray
* @version 1.0
*/
public class MarkLogicDao {
private static Logger log = LoggerFactory.getLogger(MarkLogicDao.class);
public static final int MAX_RETRY_ATTEMPTS = 5;
public static final int RETRY_WAIT_TIME = 1;
private Session session;
/**
* Store multiple XML documents
*
* @param data
* @param map
* @throws XccConfigException
* @throws RequestException
* @throws URISyntaxException
*/
public void storeDocuments(String[] data, Map<String, String> map)
throws XccConfigException, RequestException, URISyntaxException {
for (String doc : data) {
this.storeDocument(doc, map);
}
}
/**
* Store a single XML document.
*
* @param data
* @param map
* @throws URISyntaxException
* @throws XccConfigException
* @throws RequestException
*/
public void storeDocument(String data, Map<String, String> map)
throws URISyntaxException, XccConfigException, RequestException {
log.debug("Storing " + map.get(EmployeeService.URI_KEY));
this.buildSession();
session.setTransactionMode(Session.TransactionMode.AUTO);
// Re-try logic for a multi-statement transaction
for (int i = 0; i < MAX_RETRY_ATTEMPTS; i++) {
try {
log.debug("request 1");
session.submitRequest(session
.newAdhocQuery("xdmp:document-insert('"
+ map.get(EmployeeService.URI_KEY) + "', "
+ data + ")"));
if (map.containsKey(EmployeeService.COLLECTIONS_KEY)) {
log.debug("request 2");
session.submitRequest(session
.newAdhocQuery("xdmp:document-set-collections('"
+ map.get(EmployeeService.URI_KEY) + "', '"
+ map.get(EmployeeService.COLLECTIONS_KEY)
+ "')"));
}
if (map.containsKey(EmployeeService.PROPERTIES_KEY)) {
log.debug("request 3");
session.submitRequest(session
.newAdhocQuery("xdmp:document-set-properties('"
+ map.get(EmployeeService.URI_KEY) + "', "
+ map.get(EmployeeService.PROPERTIES_KEY)
+ ")"));
}
//session.commit();
break;
} catch (RetryableXQueryException e) {
try {
Thread.sleep(RETRY_WAIT_TIME);
} catch (InterruptedException ie) {
Thread.currentThread().interrupt();
}
}
}
session.close();
}
/**
* Delete an XML document
*
* @param docUri
* @throws URISyntaxException
* @throws XccConfigException
* @throws RequestException
*/
public void deleteDocument(String docUri) throws URISyntaxException,
XccConfigException, RequestException {
this.buildSession();
// session.setTransactionMode(Session.TransactionMode.UPDATE);
// Re-try logic for a multi-statement transaction
for (int i = 0; i < MAX_RETRY_ATTEMPTS; i++) {
try {
session.submitRequest(session
.newAdhocQuery("xdmp:document-delete('" + docUri + "')"));
// session.commit();
break;
} catch (RetryableXQueryException e) {
try {
Thread.sleep(RETRY_WAIT_TIME);
} catch (InterruptedException ie) {
Thread.currentThread().interrupt();
}
}
}
session.close();
}
/*
* Build the MarkLogic session needed for other operations.
*
* @throws URISyntaxException
*
* @throws XccConfigException
*/
private void buildSession() throws URISyntaxException, XccConfigException {
if (null != session && !session.isClosed()) {
return;
}
URI uri = new URI("xcc://admin:admin@localhost:8050/Documents");
ContentSource contentSource = ContentSourceFactory
.newContentSource(uri);
this.session = contentSource.newSession();
}
}
</pre>
The purpose of the MarkLogicDao is to abstract the access layer and prototype the <i>XDMP</i> calls to the <i>MarkLogic XCC API</i>. The screen shot below shows the documents loaded by their unique URIs and their collections.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-TIWZ9L8YMRY/UEeqvRMsq4I/AAAAAAAAAIM/bmb7Mut3rV0/s1600/Capture.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="144" src="http://3.bp.blogspot.com/-TIWZ9L8YMRY/UEeqvRMsq4I/AAAAAAAAAIM/bmb7Mut3rV0/s640/Capture.JPG" width="640" /></a></div>
By clicking on the <i>(properties)</i> link, you can access the document properties metadata. These metadata are helpful when you want to process documents and keep track of which ones have been processed or other in process statuses. Below are the properties for one of the employee docs.<br />
<br />
<pre class="brush: xml;first-line: 1;"><prop:properties xmlns:prop="http://marklogic.com/xdmp/property">
<status>NEW</status>
<prop:last -modified="-modified">2012-09-05T15:24:28-04:00</prop:last>
</prop:properties>
</pre>
Going forward I will discuss the power behind XPath and XQuery embedded in MarkLogic.Jimmy Rayhttp://www.blogger.com/profile/14276730603257237473noreply@blogger.com0tag:blogger.com,1999:blog-4359121116907505622.post-8226731388729042092012-08-28T11:14:00.001-07:002012-08-29T14:15:54.713-07:00MarkLogic - NoSQL for XMLLately my application designs have included more solutions for in-flight "data durability". Like durability in <a href="http://en.wikipedia.org/wiki/ACID" target="_blank">ACID</a>, users need their data stored between when they start a process and when they finish it, within an application. And these data are of course contained in the application domain model object graph.<br />
<br />
One of the ideas I have been working on is to swap out the traditional object model and bind my forms to XML with JAXB. In fact, modeling forms and data captured as XML documents, that are munged or translated and exposed as Java objects when needed, increases flexibility in my designs. This approach makes it easier to stuff the entire XML blob into a database, and recall it later to re-inflate the objects for the users' sessions.<br />
<br />
For this approach to work, I need a way to quickly serialize and deserialize (<a href="http://xstream.codehaus.org/" target="_blank">XStream</a>) my Java objects into XML, and I need a fully functional XML data store (<a href="http://www.marklogic.com/" target="_blank">MarkLogic</a>). I chose MarkLogic over a RDBMS solution because I wanted access to the XML content beyond storing/retrieving XML BLOB/CLOB fields. Yes, Oracle has XML DB, but I wanted a more schema-less approach that could be offered by NoSQL.<br />
<br />
MarkLogic is a great solution for this approach, as it offers the performance needed for document storage and retrieval en masse, coupled with the flexibility to search, read, and modify XML document internals (documents and nodes) with <a href="http://www.w3.org/TR/xpath/" target="_blank">XPath </a>and <a href="http://www.w3.org/TR/xquery/" target="_blank">XQuery</a>.<br />
<br />
In future blogs, I will detail my integration to MarkLogic via available Java APIs and usage of the MarkLogic server tools, XPath and XQuery asd well as the MarkLogic XCC API.Jimmy Rayhttp://www.blogger.com/profile/14276730603257237473noreply@blogger.com0tag:blogger.com,1999:blog-4359121116907505622.post-77697727336189347182012-08-07T20:08:00.002-07:002012-08-08T04:30:42.530-07:00Speaking at JavaMUG in Dallas, TX on 8/8/12I am speaking in Dallas, TX at the <a href="http://www.javamug.org/" target="_blank">JavaMUG</a> on 8/8/12. My topic is MongoDB integration with Spring Data. The abstract and agenda are below.<br />
<div>
<br /></div>
<div>
<div class="MsoNormal">
<b>Abstract</b></div>
<div class="MsoNormal">
MongoDB (short for Humongous Database) is a
document-oriented NoSQL database written in C++ that stores data in JSON-like
(BSON) documents into dynamic schemas.
MongoDB is emerging as one of the leaders in the document-oriented NoSQL
space. Spring Data is one of the latest
offerings from the Spring Source Community, and is focused on improving data
access and persistence. Leveraging the
venerable power of the Spring Framework, Spring Data purports to deliver a “familiar
and consistent” programming model underpinned by the Spring Services and its IOC
container. <o:p></o:p></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
This session will explore Spring Data integration to MongoDB
while covering the following key points:
Intro to MongoDB, Intro to MongoVIEW, Intro to Spring Data, SpringData
and MongoDB configuration, Spring Data templates , repositories, Query Method
Conventions, Custom queries (custom finders), Customizing repositories, Meta
Data Mapping, Indexes, and Database References.<o:p></o:p></div>
<div>
<br /></div>
</div>
<div>
<b>Agenda</b></div>
<div>
<div>
Quick introduction to NoSQL and MongoDB</div>
<div>
Configuration</div>
<div>
MongoView</div>
<div>
Introduction to Spring Data and MongoDB support</div>
<div>
Spring Data and MongoDB configuration</div>
<div>
Templates</div>
<div>
Repositories</div>
<div>
Query Method Conventions</div>
<div>
Custom Finders</div>
<div>
Customizing Repositories</div>
<div>
Metadata Mapping (including nested docs and DBRef)</div>
<div>
Aggregation Functions</div>
<div>
Advanced Querying</div>
<div>
GridFS File Storage</div>
<div>
Indexes</div>
</div>
<div>
<br /></div>Jimmy Rayhttp://www.blogger.com/profile/14276730603257237473noreply@blogger.com0