/AWS1/IF_MPM=>REGISTERUSAGE()¶
About RegisterUsage¶
Paid container software products sold through Amazon Web Services Marketplace must integrate with the Amazon Web Services Marketplace
Metering Service and call the RegisterUsage operation for software
entitlement and metering. Free and BYOL products for Amazon ECS or Amazon EKS aren't required to call RegisterUsage, but you may choose to
do so if you would like to receive usage data in your seller reports. The sections below
explain the behavior of RegisterUsage. RegisterUsage performs
two primary functions: metering and entitlement.
-
Entitlement:
RegisterUsageallows you to verify that the customer running your paid software is subscribed to your product on Amazon Web Services Marketplace, enabling you to guard against unauthorized use. Your container image that integrates withRegisterUsageis only required to guard against unauthorized use at container startup, as such aCustomerNotSubscribedExceptionorPlatformNotSupportedExceptionwill only be thrown on the initial call toRegisterUsage. Subsequent calls from the same Amazon ECS task instance (e.g. task-id) or Amazon EKS pod will not throw aCustomerNotSubscribedException, even if the customer unsubscribes while the Amazon ECS task or Amazon EKS pod is still running. -
Metering:
RegisterUsagemeters software use per ECS task, per hour, or per pod for Amazon EKS with usage prorated to the second. A minimum of 1 minute of usage applies to tasks that are short lived. For example, if a customer has a 10 node Amazon ECS or Amazon EKS cluster and a service configured as a Daemon Set, then Amazon ECS or Amazon EKS will launch a task on all 10 cluster nodes and the customer will be charged for 10 tasks. Software metering is handled by the Amazon Web Services Marketplace metering control plane—your software is not required to perform metering-specific actions other than to callRegisterUsageto commence metering. The Amazon Web Services Marketplace metering control plane will also bill customers for running ECS tasks and Amazon EKS pods, regardless of the customer's subscription state, which removes the need for your software to run entitlement checks at runtime. For containers,RegisterUsageshould be called immediately at launch. If you don’t register the container within the first 6 hours of the launch, Amazon Web Services Marketplace Metering Service doesn’t provide any metering guarantees for previous months. Metering will continue, however, for the current month forward until the container ends.RegisterUsageis for metering paid hourly container products.For Amazon Web Services Regions that support
RegisterUsage, see RegisterUsage Region support.
Method Signature¶
METHODS /AWS1/IF_MPM~REGISTERUSAGE
IMPORTING
!IV_PRODUCTCODE TYPE /AWS1/MPMPRODUCTCODE OPTIONAL
!IV_PUBLICKEYVERSION TYPE /AWS1/MPMVERSIONINTEGER OPTIONAL
!IV_NONCE TYPE /AWS1/MPMNONCE OPTIONAL
RETURNING
VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_mpmregusageresult
RAISING
/AWS1/CX_MPMCUSNOTENTITLEDEX
/AWS1/CX_MPMDISABLEDAPIEX
/AWS1/CX_MPMINTERNALSVCERROREX
/AWS1/CX_MPMINVPRODUCTCODEEX
/AWS1/CX_MPMINVPUBLICKEYVRSEX
/AWS1/CX_MPMINVALIDREGIONEX
/AWS1/CX_MPMPLATFORMNOTSUPPE00
/AWS1/CX_MPMTHROTTLINGEX
/AWS1/CX_MPMCLIENTEXC
/AWS1/CX_MPMSERVEREXC
/AWS1/CX_RT_TECHNICAL_GENERIC
/AWS1/CX_RT_SERVICE_GENERIC.
IMPORTING¶
Required arguments:¶
iv_productcode TYPE /AWS1/MPMPRODUCTCODE /AWS1/MPMPRODUCTCODE¶
Product code is used to uniquely identify a product in Amazon Web Services Marketplace. The product code should be the same as the one used during the publishing of a new product.
iv_publickeyversion TYPE /AWS1/MPMVERSIONINTEGER /AWS1/MPMVERSIONINTEGER¶
Public Key Version provided by Amazon Web Services Marketplace
Optional arguments:¶
iv_nonce TYPE /AWS1/MPMNONCE /AWS1/MPMNONCE¶
(Optional) To scope down the registration to a specific running software instance and guard against replay attacks.
RETURNING¶
oo_output TYPE REF TO /aws1/cl_mpmregusageresult /AWS1/CL_MPMREGUSAGERESULT¶
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->registerusage(
iv_nonce = |string|
iv_productcode = |string|
iv_publickeyversion = 123
).
This is an example of reading all possible response values
lo_result = lo_result.
IF lo_result IS NOT INITIAL.
lv_timestamp = lo_result->get_publickeyrotationtsmp( ).
lv_nonemptystring = lo_result->get_signature( ).
ENDIF.