This repository was archived by the owner on Apr 2, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathReadMe.html
208 lines (180 loc) · 6.5 KB
/
ReadMe.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>CloudWatch PERL Library</title>
<style type="text/css">
body, div, p, td, th {
font-family : helvetica,sans-serif, arial;
font-size : 12px;
color : #000000;
}
.aws-h1, h1{
font-family: verdana, arial, helvetica, sans-serif;
font-size: 18px;
font-weight: bold;
color: #000000;
}
.aws-h2, h2{
font-family: verdana, arial, helvetica, sans-serif;
font-size: 14px;
color: #c60;
}
.aws-h3, h3{
font-family: verdana, arial, helvetica, sans-serif;
font-size: 12px;
font-weight: bold;
color: #333333;
}
/*table ID selector styles*/
#aws-table {
border-top: 1px solid #cccccc;
border-left: 1px solid #cccccc;
width:95%;
}
#aws-table td{
font-size: 12px;
padding: 5px 5px 5px 5px;
border-bottom: 1px solid #cccccc;
border-right: 1px solid #cccccc;
vertical-align:top;
}
#aws-table th {
font-size: 12px;
padding: 5px 5px 5px 5px;
border-bottom: 1px solid #cccccc;
border-right: 1px solid #cccccc;
vertical-align:top;
background-color: #eeeeee;
color: #333333;
font-size: 12px;
font-weight: bold;
text-align: left;
}
/*code, note, and example styles*/
pre {
font-family: "Courier New", Courier, mono;
font-size: 12px;
margin-top: 5px;
margin-bottom: 5px;
color: #000066;
padding: 5px;
background-color: #eff7ff;
border: 1px dashed #333;
width:75%;
display:block;
}
</style>
</head>
<body>
<h2>About this Library</h2>
<ul><li>Based on the 2009-05-15 API version.</li></ul>
<h2>What's New?</h2>
<ul>
<li><b>2009-05-17</b>:
<ul>
<li>Initial release</li>
</ul>
</li>
</ul>
<h2>Prerequisites</h2>
<ul>
<li>Amazon EC2 account (<a href="http://aws.amazon.com/ec2">http://aws.amazon.com/ec2</a>).</li>
<li>Perl 5.6.0 or newer (<a href="http://www.perl.org/">http://www.perl.org/</a>)</li>
<li>Depending on the version of PERL you are using, you may need to install additional packages.
To install additional packages, run following command:
<ul>
<li>perl -MCPAN -e 'install Digest::SHA'</li>
<li>perl -MCPAN -e 'install XML::Simple'</li>
<li>perl -MCPAN -e 'install Bundle::LWP'</li>
<li>perl -MCPAN -e 'install XML::LibXSLT'</li>
<li>perl -MCPAN -e 'install Crypt::SSLeay'</li>
</ul>
</li>
</ul>
<h2>Package Content</h2>
<table id="aws-table">
<tbody>
<tr>
<th>Directory</th>
<th>Overview</th>
</tr>
<tr>
<td>
src
</td>
<td>
Source distribution of library.
</td>
</tr>
</tbody>
</table>
<h2>Quick Start</h2>
Library comes with code samples for each available service API.
To get started with the library, follow these steps:
<ol>
<li>Extract the <strong>amazon-cloudwatch-2009-05-15-perl-library.zip</strong> file into a working directory.</li>
<li>Edit desired sample. For example: <b>src/Amazon/CloudWatch/Samples/ListMetricsSample.pl</b></li>
<br/>
<br/>
<ul>
<li>Set AWS Access Key ID and AWS Secret Access Key</li>
<pre>
my $AWS_ACCESS_KEY_ID = "<Your Access Key ID>";
my $AWS_SECRET_ACCESS_KEY = "<Your Secret Access Key>";
</pre>
</ul>
<br/>
<br/>
<ul>
<li>Set request parameters. For example, find following pre-generated snippet:</li>
<pre>
use Amazon::CloudWatch::Model::ListMetricsRequest;
# @TODO: set action. Action can be passed as Amazon::CloudWatch::Model::ListMetricsRequest
# object or hash of parameters
# invokeListMetrics($service, $request);
</pre>
</ul>
<br/>
<br/>
<ul>
<li>And set action with ImageId parameter:</li>
<pre>
use Amazon::CloudWatch::Model::ListMetrics;
my $request = Amazon::CloudWatch::Model::ListMetricsRequest->new;
invokeListMetrics($service, $request);
</pre>
</ul>
<br/>
<li>Run ListMetrics sample:</li>
<pre>
perl src/Amazon/CloudWatch/Samples/ListMetricsSample.pl
</pre>
<li>You should see the output
similar to the following:</li>
<br/>
<br/>
<pre>
ListMetricsResponse
ListMetricsResult
...
</pre>
<br/>
<li>Experiment with samples. When ready, install library in the perl include path and use it. <p/></li>
</ol>
<h2>Notes</h2>
You can use alternative hash-based interface with the library. For example, instead of:
<p/>
<pre>
my $request = Amazon::CloudWatch::Model::ListMetricsRequest->new;
my $response = $service->ListMetrics($request);
</pre>
You can write:
<pre>
my $response = $service->ListMetrics({});
</pre>
<p/>
<strong>Happy coding!</strong>
<h2>Comments, Questions or Feedback</h2>
If you have any comments, questions or feedback on the library, please start discussion here.
</body>
</html>