Menu Close
8.7.8. プロダクトマッピングルールの定義
新しく作成した 3scale テナントで Openshift Container Platform を使用し、mappingRules
オブジェクトを使用してプロダクトカスタムリソースに必要なマッピングルールを定義します。
以下の点について考慮してください。
-
httpMethod
、pattern
、increment
、およびmetricMethodRef
は必須フィールドです。 -
metricMethodRef
は、既存のメトリクスまたはメソッドマップキー名system_name
への参照を保持します。以下の例では、hits
です。
手順
以下の例に示すように、新しい 3scale バックエンドにプロダクトマッピングルールを追加します。
apiVersion: capabilities.3scale.net/v1beta1 kind: Product metadata: name: product1 spec: name: "OperatedProduct 1" metrics: hits: description: Number of API hits friendlyName: Hits unit: "hit" methods: method01: friendlyName: Method01 mappingRules: - httpMethod: GET pattern: "/pets" increment: 1 metricMethodRef: hits - httpMethod: GET pattern: "/cars" increment: 1 metricMethodRef: method01