ターゲット ADC インスタンスをデータソースとして使用
また、構成自体のターゲット ADC を構成のデータソース入力として使用することもできます。このシナリオでは、ターゲット ADC 上の既存の構成を参照して、その ADC に新しい構成を作成したい場合があります。
ターゲットインスタンスをデータソースとして使用する場合、StyleBookユーザーがADCインスタンスを選択する必要がないため、 datum
組み込みのタイプパラメーターを使用する必要はありません。ターゲットのADCインスタンスからデータを取得する式をStyleBookのcomponents
セクションに直接記述できます。
次の式を使用して、ターゲット ADC インスタンスから以下を取得します。
-
コレクション:
$current-target-as-datasource.collections.<collection-name> <!--NeedCopy-->
例:
$current-target-as-datasource.collections.lbvserver <!--NeedCopy-->
-
属性:
$current-target-as-datasource.collections.attributes.<attribute> <!--NeedCopy-->
ターゲットのADCインスタンスをデータソースとして使用するStyleBookの例
以下は、ターゲットのADCインスタンスをデータソースとして使用する方法を示すStyleBookの例です。
---
name: lb-add-service-with-target-adc
namespace: com.citrix.adc.stylebooks
version: "1.1"
display-name: "HTTP/SSL LoadBalancing StyleBook with Service Binding"
description: "This stylebook defines a typical Load Balanced Application configuration."
schema-version: "1.0"
import-stylebooks:
-
namespace: netscaler.nitro.config
prefix: ns
version: "10.5"
components:
-
name: servicegroup-comp
type: ns::servicegroup
properties:
servicegroupname: "lb-demo-svcgrp"
servicetype: "HTTP"
components:
-
name: lbvserver-svg-binding
type: ns::lbvserver_servicegroup_binding
repeat: $current-target-as-datasource.collections.lbvserver
repeat-item: lbvsrvr
repeat-condition: $lbvsrvr.attributes.name == "lb-demo-lb"
properties:
name: $lbvsrvr.attributes.name
servicegroupname: $parent.properties.servicegroupname
<!--NeedCopy-->
この例では、構成パックはターゲット ADC インスタンス内の負荷分散仮想サーバーをチェックします。また、指定された負荷分散仮想サーバーのIPアドレスが一致すると、名前とサービスグループ名を取得します。
ターゲット ADC インスタンスをデータソースとして使用
コピー完了
コピー失敗