このStyleBookに基づいて構成を作成するには、StyleBook APIを使用します。cURLコマンドラインツールやPostman Chromeブラウザ拡張機能などの任意のツールを使用して、NetScaler ConsoleにHTTPリクエストを送信できます。
POST
https://<ADM-endpoint-name>/stylebook/nitro/v2/config/configpacks?mode=async
{
"configpack": {
"stylebook": {
"name": "lb",
"namespace": "com.citrix.adc.stylebooks",
"version": "1.1"
},
"parameters": {
"lb-appname": "lbapp1",
"lb-virtual-ip": "192.168.1.1",
"lb-virtual-port": "443",
"lb-service-type": "SSL",
"svc-service-type": "HTTP",
"svc-servers": [
{
"ip": "193.1.1.1",
"port": "80"
}
],
"certificates": [
{
"cert-name": "cert1",
"cert-file": {
"name": "c3.pem",
"contents": "<base64 encoded content>",
"encoding_type": "base64"
},
"ssl-inform": "PEM",
"key-file": {
"name": "c3.key",
"contents": "<base64 encoded content>",
"encoding_type": "base64"
}
}
]
},
"targets": [
{
"instance_id": "1b322685-3b23-4111-a9ce-56dd1c659e4c"
}
]
}
}
}
これにより、構成ジョブの完了を追跡するために使用できるジョブIDが返されます。
{
"job": {
"job_id": "388922985"
}
}
ジョブのステータスと構成ジョブが完了した時期を確認するには、ジョブポーリングAPIを使用します。
GET
https://<ADM-endpoint-name>/stylebook/nitro/v2/config/jobs/388922985
200 OK
{
"job": {
"job_id": "388922985",
"status": "completed",
"progress_info": [...],
"result": {
"config_key": "388922985",
"created_by": "nsroot",
"created_datetime": "2023-01-14 01:46:05.410998",
"created_datetimestamp": "2023-01-14 01:46:05",
"id": "388922985",
"incarnation_number": "0",
"last_modified_by": "nsroot",
"last_modified_datetime": "2023-01-14 01:46:05",
"lock": "Y",
"name": "sample-dns-stylebook",
"namespace": "com.citrix.adc.tests",
"primary_keys": "{}",
"sb_id": "samp4ed0c4c90aefaadaff6422b0c395f67f",
"status": "completed",
"target_devices_json": "[{\"instance_id\": \"49a45044-ceb3-4e9d-8a5d-e3fe225d90ed\", \"id\": \"1833061454\", \"group_id\": \"\", \"instance_ip\": \"192.168.153.165\", \"hostname\": \"ctx-adc-dc01-v-prod-54\", \"instance_role\": \"[\\\"default\\\"]\", \"incarnation_number\": \"0\"}]",
"tenant_id": "1a45fd70-7ce3-4bff-8642-1bd7f7e97673",
"version": "1.0"
}
}
}
ジョブID (388922985) は構成パックを識別します。このIDを使用して、構成を照会、更新、または削除できます。