CloudFront 的 create_invalidation 调用中的 Quantity 字段有什么意义?

tur*_*ang 7 amazon-web-services amazon-cloudfront boto3

CloudFront create_invalidationAPI 允许您指定一个Quantity看似多余的值。Quantity是否有设置不同于 的长度的用例Items

response = client.create_invalidation(
  DistributionId = 'string',
  InvalidationBatch = {
    'Paths': {
      'Quantity': 2,
      'Items': [
        '/index.html',
        '/image.png',
      ]
    },
    'CallerReference': 'string'
  }
)
Run Code Online (Sandbox Code Playgroud)

小智 0

文档说数量字段是必需的,并且是整数,以及为要失效的对象指定的失效路径的数量”。

提供比项目数量少的数量的一种用例可能是:向 AWS API 发送比所需数量更多的数据。

提供更大数字的用例可能是:尝试在 AWS API 中触发错误条件。

我建议只使用文档中的 API。

  • 问题是文档不清楚如何使用“Quantity”字段 (3认同)