« blib/lib/Paws/MarketplaceEntitlement/GetEntitlementsResult.pm
↑ Summary
blib/lib/Paws/MarketplaceMetering/BatchMeterUsage.pm »
| 1 | package Paws::MarketplaceMetering; | ||
| 2 | use Moose; | ||
| 3 | sub service { 'metering.marketplace' } | ||
| 4 | sub signing_name { 'aws-marketplace' } | ||
| 5 | sub version { '2016-01-14' } | ||
| 6 | sub target_prefix { 'AWSMPMeteringService' } | ||
| 7 | sub json_version { "1.1" } | ||
| 8 | has max_attempts => (is => 'ro', isa => 'Int', default => 5); | ||
| 9 | has retry => (is => 'ro', isa => 'HashRef', default => sub { | ||
| 10 | { base => 'rand', type => 'exponential', growth_factor => 2 } | ||
| 11 | }); | ||
| 12 | has retriables => (is => 'ro', isa => 'ArrayRef', default => sub { [ | ||
| 13 | ] }); | ||
| 14 | |||
| 15 | with 'Paws::API::Caller', 'Paws::API::EndpointResolver', 'Paws::Net::V4Signature', 'Paws::Net::JsonCaller'; | ||
| 16 | |||
| 17 | |||
| 18 | sub BatchMeterUsage { | ||
| 19 | my $self = shift; | ||
| 20 | my $call_object = $self->new_with_coercions('Paws::MarketplaceMetering::BatchMeterUsage', @_); | ||
| 21 | return $self->caller->do_call($self, $call_object); | ||
| 22 | } | ||
| 23 | sub MeterUsage { | ||
| 24 | my $self = shift; | ||
| 25 | my $call_object = $self->new_with_coercions('Paws::MarketplaceMetering::MeterUsage', @_); | ||
| 26 | return $self->caller->do_call($self, $call_object); | ||
| 27 | } | ||
| 28 | sub RegisterUsage { | ||
| 29 | my $self = shift; | ||
| 30 | my $call_object = $self->new_with_coercions('Paws::MarketplaceMetering::RegisterUsage', @_); | ||
| 31 | return $self->caller->do_call($self, $call_object); | ||
| 32 | } | ||
| 33 | sub ResolveCustomer { | ||
| 34 | my $self = shift; | ||
| 35 | my $call_object = $self->new_with_coercions('Paws::MarketplaceMetering::ResolveCustomer', @_); | ||
| 36 | return $self->caller->do_call($self, $call_object); | ||
| 37 | } | ||
| 38 | |||
| 39 | |||
| 40 | |||
| 41 | sub operations { qw/BatchMeterUsage MeterUsage RegisterUsage ResolveCustomer / } | ||
| 42 | |||
| 43 | 1; | ||
| 44 | |||
| 45 | ### main pod documentation begin ### | ||
| 46 | |||
| 47 | =head1 NAME | ||
| 48 | |||
| 49 | Paws::MarketplaceMetering - Perl Interface to AWS AWSMarketplace Metering | ||
| 50 | |||
| 51 | =head1 SYNOPSIS | ||
| 52 | |||
| 53 | use Paws; | ||
| 54 | |||
| 55 | my $obj = Paws->service('MarketplaceMetering'); | ||
| 56 | my $res = $obj->Method( | ||
| 57 | Arg1 => $val1, | ||
| 58 | Arg2 => [ 'V1', 'V2' ], | ||
| 59 | # if Arg3 is an object, the HashRef will be used as arguments to the constructor | ||
| 60 | # of the arguments type | ||
| 61 | Arg3 => { Att1 => 'Val1' }, | ||
| 62 | # if Arg4 is an array of objects, the HashRefs will be passed as arguments to | ||
| 63 | # the constructor of the arguments type | ||
| 64 | Arg4 => [ { Att1 => 'Val1' }, { Att1 => 'Val2' } ], | ||
| 65 | ); | ||
| 66 | |||
| 67 | =head1 DESCRIPTION | ||
| 68 | |||
| 69 | AWS Marketplace Metering Service | ||
| 70 | |||
| 71 | This reference provides descriptions of the low-level AWS Marketplace | ||
| 72 | Metering Service API. | ||
| 73 | |||
| 74 | AWS Marketplace sellers can use this API to submit usage data for | ||
| 75 | custom usage dimensions. | ||
| 76 | |||
| 77 | For information on the permissions you need to use this API, see AWS | ||
| 78 | Marketing metering and entitlement API permissions | ||
| 79 | (https://docs.aws.amazon.com/marketplace/latest/userguide/iam-user-policy-for-aws-marketplace-actions.html) | ||
| 80 | in the I<AWS Marketplace Seller Guide.> | ||
| 81 | |||
| 82 | B<Submitting Metering Records> | ||
| 83 | |||
| 84 | =over | ||
| 85 | |||
| 86 | =item * | ||
| 87 | |||
| 88 | I<MeterUsage>- Submits the metering record for a Marketplace product. | ||
| 89 | MeterUsage is called from an EC2 instance or a container running on EKS | ||
| 90 | or ECS. | ||
| 91 | |||
| 92 | =item * | ||
| 93 | |||
| 94 | I<BatchMeterUsage>- Submits the metering record for a set of customers. | ||
| 95 | BatchMeterUsage is called from a software-as-a-service (SaaS) | ||
| 96 | application. | ||
| 97 | |||
| 98 | =back | ||
| 99 | |||
| 100 | B<Accepting New Customers> | ||
| 101 | |||
| 102 | =over | ||
| 103 | |||
| 104 | =item * | ||
| 105 | |||
| 106 | I<ResolveCustomer>- Called by a SaaS application during the | ||
| 107 | registration process. When a buyer visits your website during the | ||
| 108 | registration process, the buyer submits a Registration Token through | ||
| 109 | the browser. The Registration Token is resolved through this API to | ||
| 110 | obtain a CustomerIdentifier and Product Code. | ||
| 111 | |||
| 112 | =back | ||
| 113 | |||
| 114 | B<Entitlement and Metering for Paid Container Products> | ||
| 115 | |||
| 116 | =over | ||
| 117 | |||
| 118 | =item * | ||
| 119 | |||
| 120 | Paid container software products sold through AWS Marketplace must | ||
| 121 | integrate with the AWS Marketplace Metering Service and call the | ||
| 122 | RegisterUsage operation for software entitlement and metering. Free and | ||
| 123 | BYOL products for Amazon ECS or Amazon EKS aren't required to call | ||
| 124 | RegisterUsage, but you can do so if you want to receive usage data in | ||
| 125 | your seller reports. For more information on using the RegisterUsage | ||
| 126 | operation, see Container-Based Products | ||
| 127 | (https://docs.aws.amazon.com/marketplace/latest/userguide/container-based-products.html). | ||
| 128 | |||
| 129 | =back | ||
| 130 | |||
| 131 | BatchMeterUsage API calls are captured by AWS CloudTrail. You can use | ||
| 132 | Cloudtrail to verify that the SaaS metering records that you sent are | ||
| 133 | accurate by searching for records with the eventName of | ||
| 134 | BatchMeterUsage. You can also use CloudTrail to audit records over | ||
| 135 | time. For more information, see the I< AWS CloudTrail User Guide | ||
| 136 | (http://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-concepts.html) | ||
| 137 | >. | ||
| 138 | |||
| 139 | For the AWS API documentation, see L<https://docs.aws.amazon.com/marketplacemetering/latest/APIReference/Welcome.html> | ||
| 140 | |||
| 141 | |||
| 142 | =head1 METHODS | ||
| 143 | |||
| 144 | =head2 BatchMeterUsage | ||
| 145 | |||
| 146 | =over | ||
| 147 | |||
| 148 | =item ProductCode => Str | ||
| 149 | |||
| 150 | =item UsageRecords => ArrayRef[L<Paws::MarketplaceMetering::UsageRecord>] | ||
| 151 | |||
| 152 | |||
| 153 | =back | ||
| 154 | |||
| 155 | Each argument is described in detail in: L<Paws::MarketplaceMetering::BatchMeterUsage> | ||
| 156 | |||
| 157 | Returns: a L<Paws::MarketplaceMetering::BatchMeterUsageResult> instance | ||
| 158 | |||
| 159 | BatchMeterUsage is called from a SaaS application listed on the AWS | ||
| 160 | Marketplace to post metering records for a set of customers. | ||
| 161 | |||
| 162 | For identical requests, the API is idempotent; requests can be retried | ||
| 163 | with the same records or a subset of the input records. | ||
| 164 | |||
| 165 | Every request to BatchMeterUsage is for one product. If you need to | ||
| 166 | meter usage for multiple products, you must make multiple calls to | ||
| 167 | BatchMeterUsage. | ||
| 168 | |||
| 169 | BatchMeterUsage can process up to 25 UsageRecords at a time. | ||
| 170 | |||
| 171 | A UsageRecord can optionally include multiple usage allocations, to | ||
| 172 | provide customers with usagedata split into buckets by tags that you | ||
| 173 | define (or allow the customer to define). | ||
| 174 | |||
| 175 | BatchMeterUsage requests must be less than 1MB in size. | ||
| 176 | |||
| 177 | |||
| 178 | =head2 MeterUsage | ||
| 179 | |||
| 180 | =over | ||
| 181 | |||
| 182 | =item ProductCode => Str | ||
| 183 | |||
| 184 | =item Timestamp => Str | ||
| 185 | |||
| 186 | =item UsageDimension => Str | ||
| 187 | |||
| 188 | =item [DryRun => Bool] | ||
| 189 | |||
| 190 | =item [UsageAllocations => ArrayRef[L<Paws::MarketplaceMetering::UsageAllocation>]] | ||
| 191 | |||
| 192 | =item [UsageQuantity => Int] | ||
| 193 | |||
| 194 | |||
| 195 | =back | ||
| 196 | |||
| 197 | Each argument is described in detail in: L<Paws::MarketplaceMetering::MeterUsage> | ||
| 198 | |||
| 199 | Returns: a L<Paws::MarketplaceMetering::MeterUsageResult> instance | ||
| 200 | |||
| 201 | API to emit metering records. For identical requests, the API is | ||
| 202 | idempotent. It simply returns the metering record ID. | ||
| 203 | |||
| 204 | MeterUsage is authenticated on the buyer's AWS account using | ||
| 205 | credentials from the EC2 instance, ECS task, or EKS pod. | ||
| 206 | |||
| 207 | MeterUsage can optionally include multiple usage allocations, to | ||
| 208 | provide customers with usage data split into buckets by tags that you | ||
| 209 | define (or allow the customer to define). | ||
| 210 | |||
| 211 | |||
| 212 | =head2 RegisterUsage | ||
| 213 | |||
| 214 | =over | ||
| 215 | |||
| 216 | =item ProductCode => Str | ||
| 217 | |||
| 218 | =item PublicKeyVersion => Int | ||
| 219 | |||
| 220 | =item [Nonce => Str] | ||
| 221 | |||
| 222 | |||
| 223 | =back | ||
| 224 | |||
| 225 | Each argument is described in detail in: L<Paws::MarketplaceMetering::RegisterUsage> | ||
| 226 | |||
| 227 | Returns: a L<Paws::MarketplaceMetering::RegisterUsageResult> instance | ||
| 228 | |||
| 229 | Paid container software products sold through AWS Marketplace must | ||
| 230 | integrate with the AWS Marketplace Metering Service and call the | ||
| 231 | RegisterUsage operation for software entitlement and metering. Free and | ||
| 232 | BYOL products for Amazon ECS or Amazon EKS aren't required to call | ||
| 233 | RegisterUsage, but you may choose to do so if you would like to receive | ||
| 234 | usage data in your seller reports. The sections below explain the | ||
| 235 | behavior of RegisterUsage. RegisterUsage performs two primary | ||
| 236 | functions: metering and entitlement. | ||
| 237 | |||
| 238 | =over | ||
| 239 | |||
| 240 | =item * | ||
| 241 | |||
| 242 | I<Entitlement>: RegisterUsage allows you to verify that the customer | ||
| 243 | running your paid software is subscribed to your product on AWS | ||
| 244 | Marketplace, enabling you to guard against unauthorized use. Your | ||
| 245 | container image that integrates with RegisterUsage is only required to | ||
| 246 | guard against unauthorized use at container startup, as such a | ||
| 247 | CustomerNotSubscribedException/PlatformNotSupportedException will only | ||
| 248 | be thrown on the initial call to RegisterUsage. Subsequent calls from | ||
| 249 | the same Amazon ECS task instance (e.g. task-id) or Amazon EKS pod will | ||
| 250 | not throw a CustomerNotSubscribedException, even if the customer | ||
| 251 | unsubscribes while the Amazon ECS task or Amazon EKS pod is still | ||
| 252 | running. | ||
| 253 | |||
| 254 | =item * | ||
| 255 | |||
| 256 | I<Metering>: RegisterUsage meters software use per ECS task, per hour, | ||
| 257 | or per pod for Amazon EKS with usage prorated to the second. A minimum | ||
| 258 | of 1 minute of usage applies to tasks that are short lived. For | ||
| 259 | example, if a customer has a 10 node Amazon ECS or Amazon EKS cluster | ||
| 260 | and a service configured as a Daemon Set, then Amazon ECS or Amazon EKS | ||
| 261 | will launch a task on all 10 cluster nodes and the customer will be | ||
| 262 | charged: (10 * hourly_rate). Metering for software use is automatically | ||
| 263 | handled by the AWS Marketplace Metering Control Plane -- your software | ||
| 264 | is not required to perform any metering specific actions, other than | ||
| 265 | call RegisterUsage once for metering of software use to commence. The | ||
| 266 | AWS Marketplace Metering Control Plane will also continue to bill | ||
| 267 | customers for running ECS tasks and Amazon EKS pods, regardless of the | ||
| 268 | customers subscription state, removing the need for your software to | ||
| 269 | perform entitlement checks at runtime. | ||
| 270 | |||
| 271 | =back | ||
| 272 | |||
| 273 | |||
| 274 | |||
| 275 | =head2 ResolveCustomer | ||
| 276 | |||
| 277 | =over | ||
| 278 | |||
| 279 | =item RegistrationToken => Str | ||
| 280 | |||
| 281 | |||
| 282 | =back | ||
| 283 | |||
| 284 | Each argument is described in detail in: L<Paws::MarketplaceMetering::ResolveCustomer> | ||
| 285 | |||
| 286 | Returns: a L<Paws::MarketplaceMetering::ResolveCustomerResult> instance | ||
| 287 | |||
| 288 | ResolveCustomer is called by a SaaS application during the registration | ||
| 289 | process. When a buyer visits your website during the registration | ||
| 290 | process, the buyer submits a registration token through their browser. | ||
| 291 | The registration token is resolved through this API to obtain a | ||
| 292 | CustomerIdentifier and product code. | ||
| 293 | |||
| 294 | |||
| 295 | |||
| 296 | |||
| 297 | =head1 PAGINATORS | ||
| 298 | |||
| 299 | Paginator methods are helpers that repetively call methods that return partial results | ||
| 300 | |||
| 301 | |||
| 302 | |||
| 303 | |||
| 304 | =head1 SEE ALSO | ||
| 305 | |||
| 306 | This service class forms part of L<Paws> | ||
| 307 | |||
| 308 | =head1 BUGS and CONTRIBUTIONS | ||
| 309 | |||
| 310 | The source code is located here: L<https://github.com/pplu/aws-sdk-perl> | ||
| 311 | |||
| 312 | Please report bugs to: L<https://github.com/pplu/aws-sdk-perl/issues> | ||
| 313 | |||
| 314 | =cut | ||
| 315 |