/AWS1/IF_LSA=>GETBUCKETMETRICDATA()¶
About GetBucketMetricData¶
Returns the data points of a specific metric for an Amazon Lightsail bucket.
Metrics report the utilization of a bucket. View and collect metric data regularly to monitor the number of objects stored in a bucket (including object versions) and the storage space used by those objects.
Method Signature¶
METHODS /AWS1/IF_LSA~GETBUCKETMETRICDATA
IMPORTING
!IV_BUCKETNAME TYPE /AWS1/LSABUCKETNAME OPTIONAL
!IV_METRICNAME TYPE /AWS1/LSABUCKETMETRICNAME OPTIONAL
!IV_STARTTIME TYPE /AWS1/LSAISODATE OPTIONAL
!IV_ENDTIME TYPE /AWS1/LSAISODATE OPTIONAL
!IV_PERIOD TYPE /AWS1/LSAMETRICPERIOD OPTIONAL
!IT_STATISTICS TYPE /AWS1/CL_LSAMETTATISTICLIST_W=>TT_METRICSTATISTICLIST OPTIONAL
!IV_UNIT TYPE /AWS1/LSAMETRICUNIT OPTIONAL
RETURNING
VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_lsagetbktmetricdatars
RAISING
/AWS1/CX_LSAACCESSDENIEDEX
/AWS1/CX_LSAINVALIDINPUTEX
/AWS1/CX_LSANOTFOUNDEXCEPTION
/AWS1/CX_LSARGNSETUPINPRGSSEX
/AWS1/CX_LSASERVICEEXCEPTION
/AWS1/CX_LSAUNAUTHNTCTDEX
/AWS1/CX_LSACLIENTEXC
/AWS1/CX_LSASERVEREXC
/AWS1/CX_RT_TECHNICAL_GENERIC
/AWS1/CX_RT_SERVICE_GENERIC.
IMPORTING¶
Required arguments:¶
iv_bucketname TYPE /AWS1/LSABUCKETNAME /AWS1/LSABUCKETNAME¶
The name of the bucket for which to get metric data.
iv_metricname TYPE /AWS1/LSABUCKETMETRICNAME /AWS1/LSABUCKETMETRICNAME¶
The metric for which you want to return information.
Valid bucket metric names are listed below, along with the most useful statistics to include in your request, and the published unit value.
These bucket metrics are reported once per day.
BucketSizeBytes- The amount of data in bytes stored in a bucket. This value is calculated by summing the size of all objects in the bucket (including object versions), including the size of all parts for all incomplete multipart uploads to the bucket.Statistics: The most useful statistic is
Maximum.Unit: The published unit is
Bytes.
NumberOfObjects- The total number of objects stored in a bucket. This value is calculated by counting all objects in the bucket (including object versions) and the total number of parts for all incomplete multipart uploads to the bucket.Statistics: The most useful statistic is
Average.Unit: The published unit is
Count.
iv_starttime TYPE /AWS1/LSAISODATE /AWS1/LSAISODATE¶
The timestamp indicating the earliest data to be returned.
iv_endtime TYPE /AWS1/LSAISODATE /AWS1/LSAISODATE¶
The timestamp indicating the latest data to be returned.
iv_period TYPE /AWS1/LSAMETRICPERIOD /AWS1/LSAMETRICPERIOD¶
The granularity, in seconds, of the returned data points.
Bucket storage metrics are reported once per day. Therefore, you should specify a period of 86400 seconds, which is the number of seconds in a day.
it_statistics TYPE /AWS1/CL_LSAMETTATISTICLIST_W=>TT_METRICSTATISTICLIST TT_METRICSTATISTICLIST¶
The statistic for the metric.
The following statistics are available:
Minimum- The lowest value observed during the specified period. Use this value to determine low volumes of activity for your application.
Maximum- The highest value observed during the specified period. Use this value to determine high volumes of activity for your application.
Sum- The sum of all values submitted for the matching metric. You can use this statistic to determine the total volume of a metric.
Average- The value ofSum/SampleCountduring the specified period. By comparing this statistic with theMinimumandMaximumvalues, you can determine the full scope of a metric and how close the average use is to theMinimumandMaximumvalues. This comparison helps you to know when to increase or decrease your resources.
SampleCount- The count, or number, of data points used for the statistical calculation.
iv_unit TYPE /AWS1/LSAMETRICUNIT /AWS1/LSAMETRICUNIT¶
The unit for the metric data request.
Valid units depend on the metric data being requested. For the valid units with each available metric, see the
metricNameparameter.
RETURNING¶
oo_output TYPE REF TO /aws1/cl_lsagetbktmetricdatars /AWS1/CL_LSAGETBKTMETRICDATARS¶
Domain /AWS1/RT_ACCOUNT_ID Primitive Type NUMC
Examples¶
Syntax Example¶
This is an example of the syntax for calling the method. It includes every possible argument and initializes every possible value. The data provided is not necessarily semantically accurate (for example the value "string" may be provided for something that is intended to be an instance ID, or in some cases two arguments may be mutually exclusive). The syntax shows the ABAP syntax for creating the various data structures.
DATA(lo_result) = lo_client->getbucketmetricdata(
it_statistics = VALUE /aws1/cl_lsamettatisticlist_w=>tt_metricstatisticlist(
( new /aws1/cl_lsamettatisticlist_w( |string| ) )
)
iv_bucketname = |string|
iv_endtime = '20150101000000.0000000'
iv_metricname = |string|
iv_period = 123
iv_starttime = '20150101000000.0000000'
iv_unit = |string|
).
This is an example of reading all possible response values
lo_result = lo_result.
IF lo_result IS NOT INITIAL.
lv_bucketmetricname = lo_result->get_metricname( ).
LOOP AT lo_result->get_metricdata( ) into lo_row.
lo_row_1 = lo_row.
IF lo_row_1 IS NOT INITIAL.
lv_double = lo_row_1->get_average( ).
lv_double = lo_row_1->get_maximum( ).
lv_double = lo_row_1->get_minimum( ).
lv_double = lo_row_1->get_samplecount( ).
lv_double = lo_row_1->get_sum( ).
lv_timestamp = lo_row_1->get_timestamp( ).
lv_metricunit = lo_row_1->get_unit( ).
ENDIF.
ENDLOOP.
ENDIF.