Insert excerpt | ||||||||
---|---|---|---|---|---|---|---|---|
|
In order to To process usage using printing the Printing as a service Service stream with metering, you must create the meter type (the product you want to meter) and the meters (the bucket to measure the usage per customer for the product). This step is usually done using APIs which are called from the an external system. For convenience, there have been additional streams provided which can be executed to do this configuration.
Here is a step-by-step guide on how you can provision meters and meter types for the example stream Printing As A Service with Metering.
...
Provisioning Meter Types - This stream helps to create the meter type Pay-per-print, which is a product definition for measuring prints done by each printer. It uses the aggregation type SUM and has the reset interval set to Monthly meaning that the golden record is sent downstream once the month has ended.
Provisioning Meters - This stream provisions the meters for printers with the printer id ID as the key (user IdID).
Purge Meters - This is an additional stream to clean - up meters post-processing.
Step 1
Create a new application access for your account. This is needed for authenticating with the Usage Engine APIs, see Application Access.
...
Create a new secret in the secrets wallet of type OAuth 2.0 containing your application credentials. Select the authentication type “Client credentials“ and add the client ID and client secret which was created in the previous step, see Secret Wallets.
...
Update the authentication in all streams with your new secret. Ensure that the audience and access token URL of the OAuth2 authentication is configured to match your Environments API base URL.
Step 5
Run stream 1. Provisioning Meter Types. After the stream has completed you will have a new meter type named "Pay-per-print" in the Usage metering view.
...
Open the stream configuration of stream 2. Provisioning Meters and open the script named "Prepare Meters". Paste in the meter key that you got from the previous step.
Step 8
Run stream 2. Provisioning Meters. When the stream has completed, you will have 5 meters across your newly created meter type.
...
If you want to delete your meters. Navigate to the stream configuration of stream 3. Purge Meters. Paste the meter key into the script "Prepare Filter". Run the stream. Now all meters related to Printing As A Service with Metering have been deleted.