@datafire/amazonaws_metering_marketplace

5.0.0 • Public • Published

@datafire/amazonaws_metering_marketplace

Client library for AWSMarketplace Metering

Installation and Usage

npm install --save @datafire/amazonaws_metering_marketplace
let amazonaws_metering_marketplace = require('@datafire/amazonaws_metering_marketplace').create({
  accessKeyId: "",
  secretAccessKey: "",
  region: ""
});

amazonaws_metering_marketplace.BatchMeterUsage({
  "UsageRecords": [],
  "ProductCode": ""
}).then(data => {
  console.log(data);
});

Description

AWS Marketplace Metering Service

This reference provides descriptions of the low-level AWS Marketplace Metering Service API.

AWS Marketplace sellers can use this API to submit usage data for custom usage dimensions.

Submitting Metering Records

  • MeterUsage- Submits the metering record for a Marketplace product. MeterUsage is called from an EC2 instance.

  • BatchMeterUsage- Submits the metering record for a set of customers. BatchMeterUsage is called from a software-as-a-service (SaaS) application.

Accepting New Customers

  • ResolveCustomer- Called by a SaaS application during the registration process. When a buyer visits your website during the registration process, the buyer submits a Registration Token through the browser. The Registration Token is resolved through this API to obtain a CustomerIdentifier and Product Code.

Actions

BatchMeterUsage

amazonaws_metering_marketplace.BatchMeterUsage({
  "UsageRecords": [],
  "ProductCode": ""
}, context)

Input

Output

MeterUsage

amazonaws_metering_marketplace.MeterUsage({
  "ProductCode": "",
  "Timestamp": "",
  "UsageDimension": "",
  "UsageQuantity": 0,
  "DryRun": true
}, context)

Input

Output

ResolveCustomer

amazonaws_metering_marketplace.ResolveCustomer({
  "RegistrationToken": ""
}, context)

Input

Output

Definitions

BatchMeterUsageRequest

  • BatchMeterUsageRequest object: A BatchMeterUsageRequest contains UsageRecords, which indicate quantities of usage within your application.

BatchMeterUsageResult

  • BatchMeterUsageResult object: Contains the UsageRecords processed by BatchMeterUsage and any records that have failed due to transient error.

Boolean

  • Boolean boolean

CustomerIdentifier

  • CustomerIdentifier string

DuplicateRequestException

  • DuplicateRequestException object: A metering record has already been emitted by the same EC2 instance for the given {usageDimension, timestamp} with a different usageQuantity.

ExpiredTokenException

  • ExpiredTokenException object: The submitted registration token has expired. This can happen if the buyer's browser takes too long to redirect to your page, the buyer has resubmitted the registration token, or your application has held on to the registration token for too long. Your SaaS registration website should redeem this token as soon as it is submitted by the buyer's browser.

InternalServiceErrorException

  • InternalServiceErrorException object: An internal error has occurred. Retry your request. If the problem persists, post a message with details on the AWS forums.

InvalidCustomerIdentifierException

  • InvalidCustomerIdentifierException object: You have metered usage for a CustomerIdentifier that does not exist.

InvalidEndpointRegionException

  • InvalidEndpointRegionException object: The endpoint being called is in a region different from your EC2 instance. The region of the Metering service endpoint and the region of the EC2 instance must match.

InvalidProductCodeException

  • InvalidProductCodeException object: The product code passed does not match the product code used for publishing the product.

InvalidTokenException

InvalidUsageDimensionException

  • InvalidUsageDimensionException object: The usage dimension does not match one of the UsageDimensions associated with products.

MeterUsageRequest

MeterUsageResult

  • MeterUsageResult object

NonEmptyString

  • NonEmptyString string

ProductCode

  • ProductCode string

ResolveCustomerRequest

  • ResolveCustomerRequest object: Contains input to the ResolveCustomer operation.

ResolveCustomerResult

  • ResolveCustomerResult object: The result of the ResolveCustomer operation. Contains the CustomerIdentifier and product code.

String

  • String string

ThrottlingException

  • ThrottlingException object: The calls to the MeterUsage API are throttled.

Timestamp

  • Timestamp string

TimestampOutOfBoundsException

  • TimestampOutOfBoundsException object: The timestamp value passed in the meterUsage() is out of allowed range.

UsageDimension

  • UsageDimension string

UsageQuantity

  • UsageQuantity integer

UsageRecord

  • UsageRecord object:

    A UsageRecord indicates a quantity of usage for a given product, customer, dimension and time.

    Multiple requests with the same UsageRecords as input will be deduplicated to prevent double charges.

UsageRecordList

UsageRecordResult

  • UsageRecordResult object: A UsageRecordResult indicates the status of a given UsageRecord processed by BatchMeterUsage.

UsageRecordResultList

UsageRecordResultStatus

  • UsageRecordResultStatus string (values: Success, CustomerNotSubscribed, DuplicateRecord)

errorMessage

  • errorMessage string

Readme

Keywords

none

Package Sidebar

Install

npm i @datafire/amazonaws_metering_marketplace

Weekly Downloads

1

Version

5.0.0

License

MIT

Unpacked Size

35.2 kB

Total Files

5

Last publish

Collaborators

  • datafire