Skip to content

Commit

Permalink
Added Lightsail example for get-instance-metric-data
Browse files Browse the repository at this point in the history
  • Loading branch information
bisdavid committed May 8, 2019
1 parent 085ff76 commit 7641980
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions awscli/examples/lightsail/get-instance-metric-data.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
**To get instance NetworkOut metric data for a month period**

The following ``get-instance-metric-data`` example outputs the total ``NetworkOut`` metric data in bytes for an approximate month-long period.

We recommend that you use an epoch time converter to identify the start and end times. If the time between the ``--start-time`` and ``--end-time`` is greater than 2628000 seconds (approximately one month), then multiple results are returned for each 2628000 interval, as shown in the following sample response. ::

aws lightsail get-instance-metric-data \
--instance-name InstanceName \
--metric-name NetworkOut \
--period 2628000 \
--start-time 1546304400 \
--end-time 1577840400
--unit Bytes
--statistics Sum

Output::

{
"metricData": [
{
"timestamp": 1556812800.0,
"sum": 22359134.0,
"unit": "Bytes"
},
{
"timestamp": 1554184800.0,
"sum": 5968238.0,
"unit": "Bytes"
}
],
"metricName": "NetworkOut"
}

0 comments on commit 7641980

Please sign in to comment.