Skip to content

Commit fea85b0

Browse files
author
AWS
committed
AWSMarketplace Metering Update: Adding Vendor Tagging Support in MeterUsage and BatchMeterUsage API.
1 parent a7c79b0 commit fea85b0

File tree

2 files changed

+107
-7
lines changed

2 files changed

+107
-7
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"type": "feature",
3+
"category": "AWSMarketplace Metering",
4+
"contributor": "",
5+
"description": "Adding Vendor Tagging Support in MeterUsage and BatchMeterUsage API."
6+
}

services/marketplacemetering/src/main/resources/codegen-resources/service-2.json

Lines changed: 101 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,14 @@
2525
{"shape":"InternalServiceErrorException"},
2626
{"shape":"InvalidProductCodeException"},
2727
{"shape":"InvalidUsageDimensionException"},
28+
{"shape":"InvalidTagException"},
29+
{"shape":"InvalidUsageAllocationsException"},
2830
{"shape":"InvalidCustomerIdentifierException"},
2931
{"shape":"TimestampOutOfBoundsException"},
3032
{"shape":"ThrottlingException"},
3133
{"shape":"DisabledApiException"}
3234
],
33-
"documentation":"<p>BatchMeterUsage is called from a SaaS application listed on the AWS Marketplace to post metering records for a set of customers.</p> <p>For identical requests, the API is idempotent; requests can be retried with the same records or a subset of the input records.</p> <p>Every request to BatchMeterUsage is for one product. If you need to meter usage for multiple products, you must make multiple calls to BatchMeterUsage.</p> <p>BatchMeterUsage can process up to 25 UsageRecords at a time.</p>"
35+
"documentation":"<p>BatchMeterUsage is called from a SaaS application listed on the AWS Marketplace to post metering records for a set of customers.</p> <p>For identical requests, the API is idempotent; requests can be retried with the same records or a subset of the input records.</p> <p>Every request to BatchMeterUsage is for one product. If you need to meter usage for multiple products, you must make multiple calls to BatchMeterUsage.</p> <p>BatchMeterUsage can process up to 25 UsageRecords at a time.</p> <p>A UsageRecord can optionally include multiple usage allocations, to provide customers with usagedata split into buckets by tags that you define (or allow the customer to define).</p> <p>BatchMeterUsage requests must be less than 1MB in size.</p>"
3436
},
3537
"MeterUsage":{
3638
"name":"MeterUsage",
@@ -44,13 +46,15 @@
4446
{"shape":"InternalServiceErrorException"},
4547
{"shape":"InvalidProductCodeException"},
4648
{"shape":"InvalidUsageDimensionException"},
49+
{"shape":"InvalidTagException"},
50+
{"shape":"InvalidUsageAllocationsException"},
4751
{"shape":"InvalidEndpointRegionException"},
4852
{"shape":"TimestampOutOfBoundsException"},
4953
{"shape":"DuplicateRequestException"},
5054
{"shape":"ThrottlingException"},
5155
{"shape":"CustomerNotEntitledException"}
5256
],
53-
"documentation":"<p>API to emit metering records. For identical requests, the API is idempotent. It simply returns the metering record ID.</p> <p>MeterUsage is authenticated on the buyer's AWS account using credentials from the EC2 instance, ECS task, or EKS pod.</p>"
57+
"documentation":"<p>API to emit metering records. For identical requests, the API is idempotent. It simply returns the metering record ID.</p> <p>MeterUsage is authenticated on the buyer's AWS account using credentials from the EC2 instance, ECS task, or EKS pod.</p> <p>MeterUsage can optionally include multiple usage allocations, to provide customers with usage data split into buckets by tags that you define (or allow the customer to define).</p>"
5458
},
5559
"RegisterUsage":{
5660
"name":"RegisterUsage",
@@ -91,6 +95,11 @@
9195
}
9296
},
9397
"shapes":{
98+
"AllocatedUsageQuantity":{
99+
"type":"integer",
100+
"max":2147483647,
101+
"min":0
102+
},
94103
"BatchMeterUsageRequest":{
95104
"type":"structure",
96105
"required":[
@@ -127,7 +136,8 @@
127136
"CustomerIdentifier":{
128137
"type":"string",
129138
"max":255,
130-
"min":1
139+
"min":1,
140+
"pattern":"[\\s\\S]+"
131141
},
132142
"CustomerNotEntitledException":{
133143
"type":"structure",
@@ -210,6 +220,14 @@
210220
"documentation":"<p>RegisterUsage must be called in the same AWS Region the ECS task was launched in. This prevents a container from hardcoding a Region (e.g. withRegion(“us-east-1”) when calling RegisterUsage.</p>",
211221
"exception":true
212222
},
223+
"InvalidTagException":{
224+
"type":"structure",
225+
"members":{
226+
"message":{"shape":"errorMessage"}
227+
},
228+
"documentation":"<p>The tag is invalid, or the number of tags is greater than 5.</p>",
229+
"exception":true
230+
},
213231
"InvalidTokenException":{
214232
"type":"structure",
215233
"members":{
@@ -218,6 +236,14 @@
218236
"documentation":"<p>Registration token is invalid.</p>",
219237
"exception":true
220238
},
239+
"InvalidUsageAllocationsException":{
240+
"type":"structure",
241+
"members":{
242+
"message":{"shape":"errorMessage"}
243+
},
244+
"documentation":"<p>The usage allocation objects are invalid, or the number of allocations is greater than 500 for a single usage record.</p>",
245+
"exception":true
246+
},
221247
"InvalidUsageDimensionException":{
222248
"type":"structure",
223249
"members":{
@@ -253,6 +279,10 @@
253279
"DryRun":{
254280
"shape":"Boolean",
255281
"documentation":"<p>Checks whether you have the permissions required for the action, but does not make the request. If you have the permissions, the request returns DryRunOperation; otherwise, it returns UnauthorizedException. Defaults to <code>false</code> if not specified.</p>"
282+
},
283+
"UsageAllocations":{
284+
"shape":"UsageAllocations",
285+
"documentation":"<p>The set of UsageAllocations to submit.</p> <p>The sum of all UsageAllocation quantities must equal the UsageQuantity of the MeterUsage request, and each UsageAllocation must have a unique set of tags (include no tags).</p>"
256286
}
257287
}
258288
},
@@ -267,11 +297,12 @@
267297
},
268298
"NonEmptyString":{
269299
"type":"string",
270-
"pattern":"\\S+"
300+
"pattern":"[\\s\\S]+"
271301
},
272302
"Nonce":{
273303
"type":"string",
274-
"max":255
304+
"max":255,
305+
"pattern":"[\\s\\S]*"
275306
},
276307
"PlatformNotSupportedException":{
277308
"type":"structure",
@@ -284,7 +315,8 @@
284315
"ProductCode":{
285316
"type":"string",
286317
"max":255,
287-
"min":1
318+
"min":1,
319+
"pattern":"[\\s\\S]+"
288320
},
289321
"RegisterUsageRequest":{
290322
"type":"structure",
@@ -346,6 +378,42 @@
346378
"documentation":"<p>The result of the ResolveCustomer operation. Contains the CustomerIdentifier and product code.</p>"
347379
},
348380
"String":{"type":"string"},
381+
"Tag":{
382+
"type":"structure",
383+
"required":[
384+
"Key",
385+
"Value"
386+
],
387+
"members":{
388+
"Key":{
389+
"shape":"TagKey",
390+
"documentation":"<p>One part of a key-value pair that makes up a tag. A key is a label that acts like a category for the specific tag values.</p>"
391+
},
392+
"Value":{
393+
"shape":"TagValue",
394+
"documentation":"<p>One part of a key-value pair that makes up a tag. A value acts as a descriptor within a tag category (key). The value can be empty or null.</p>"
395+
}
396+
},
397+
"documentation":"<p>Metadata assigned to an allocation. Each tag is made up of a key and a value.</p>"
398+
},
399+
"TagKey":{
400+
"type":"string",
401+
"max":100,
402+
"min":1,
403+
"pattern":"^[a-zA-Z0-9+ -=._:\\/@]+$"
404+
},
405+
"TagList":{
406+
"type":"list",
407+
"member":{"shape":"Tag"},
408+
"max":5,
409+
"min":1
410+
},
411+
"TagValue":{
412+
"type":"string",
413+
"max":256,
414+
"min":1,
415+
"pattern":"^[a-zA-Z0-9+ -=._:\\/@]+$"
416+
},
349417
"ThrottlingException":{
350418
"type":"structure",
351419
"members":{
@@ -363,10 +431,32 @@
363431
"documentation":"<p>The timestamp value passed in the meterUsage() is out of allowed range.</p>",
364432
"exception":true
365433
},
434+
"UsageAllocation":{
435+
"type":"structure",
436+
"required":["AllocatedUsageQuantity"],
437+
"members":{
438+
"AllocatedUsageQuantity":{
439+
"shape":"AllocatedUsageQuantity",
440+
"documentation":"<p>The total quantity allocated to this bucket of usage.</p>"
441+
},
442+
"Tags":{
443+
"shape":"TagList",
444+
"documentation":"<p>The set of tags that define the bucket of usage. For the bucket of items with no tags, this parameter can be left out.</p>"
445+
}
446+
},
447+
"documentation":"<p>Usage allocations allow you to split usage into buckets by tags.</p> <p>Each UsageAllocation indicates the usage quantity for a specific set of tags.</p>"
448+
},
449+
"UsageAllocations":{
450+
"type":"list",
451+
"member":{"shape":"UsageAllocation"},
452+
"max":500,
453+
"min":1
454+
},
366455
"UsageDimension":{
367456
"type":"string",
368457
"max":255,
369-
"min":1
458+
"min":1,
459+
"pattern":"[\\s\\S]+"
370460
},
371461
"UsageQuantity":{
372462
"type":"integer",
@@ -396,6 +486,10 @@
396486
"Quantity":{
397487
"shape":"UsageQuantity",
398488
"documentation":"<p>The quantity of usage consumed by the customer for the given dimension and time. Defaults to <code>0</code> if not specified.</p>"
489+
},
490+
"UsageAllocations":{
491+
"shape":"UsageAllocations",
492+
"documentation":"<p>The set of UsageAllocations to submit. The sum of all UsageAllocation quantities must equal the Quantity of the UsageRecord.</p>"
399493
}
400494
},
401495
"documentation":"<p>A UsageRecord indicates a quantity of usage for a given product, customer, dimension and time.</p> <p>Multiple requests with the same UsageRecords as input will be deduplicated to prevent double charges.</p>"

0 commit comments

Comments
 (0)