putInventory method
Bulk update custom inventory items on one or more managed nodes. The request adds an inventory item, if it doesn't already exist, or updates an inventory item, if it does exist.
May throw CustomSchemaCountLimitExceededException.
May throw InternalServerError.
May throw InvalidInstanceId.
May throw InvalidInventoryItemContextException.
May throw InvalidItemContentException.
May throw InvalidTypeNameException.
May throw ItemContentMismatchException.
May throw ItemSizeLimitExceededException.
May throw SubTypeCountLimitExceededException.
May throw TotalSizeLimitExceededException.
May throw UnsupportedInventoryItemContextException.
May throw UnsupportedInventorySchemaVersionException.
Parameter instanceId :
An managed node ID where you want to add or update inventory items.
Parameter items :
The inventory items that you want to add or update on managed nodes.
Implementation
Future<PutInventoryResult> putInventory({
required String instanceId,
required List<InventoryItem> items,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'AmazonSSM.PutInventory'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'InstanceId': instanceId,
'Items': items,
},
);
return PutInventoryResult.fromJson(jsonResponse.body);
}