Product Documentation

Use API to create configurations to upload certificate and key files

May 24, 2018

Use the StyleBook APIs to create configurations based on this StyleBook. You can use any tool such as the curl command line tool or the Postman chrome browser extension to send HTTP requests to NetScaler MAS.

Consider the StyleBook example you created to upload certificate and key files in How to Create a StyleBook to Upload SSL Certificate and Certificate Key Files to NetScaler MAS. Use REST API to create a configpack from this StyleBook as follows:

POST

https://<>/stylebook/nitro/v1/config/stylebooks/com.citrix.adc.stylebooks/1.0/lb-mon/configpacks?mode=async

Content-Type: application/json

Accept: application/json

 {

  "configpack": {

    "parameters": {

      "lb-appname": "lbmon",

      "lb-virtual-ip": "13.1.11.10",

      "lb-virtual-port": "80",

      "lb-service-type": "HTTP",

      "svc-service-type": "HTTP",

      "svc-servers": [

        {

          "ip": "14.1.1.15",

          "port": "80"

        }

      ],

      "certificates": [

        {

          "cert-name": "server_cert",

          "cert-file": "server_cert.pem",

          "ssl-inform": "PEM",

          "key-name": "server_key",

          "key-file": "server_key.pem",

          "cert-password": "secret",

          "cert-advanced": {

            "is-ca-cert": false,

            "skip-ca-name": false

          }

        }

      ],

      "lb-advanced": {

        "flush-on-state-down": "ENABLED",

        "auth-params": {

          "authentication": "OFF",

          "authentication-http-401": "OFF"

        },

        "appflow-log": "ENABLED",

        "algorithm": "LEASTCONNECTION"

      },

      "svcg-advanced": {

        "svc-client-ip": "DISABLED",

        "svc-use-source-ip": "NO",

        "svc-use-proxy-port": "NO",

        "svc-surge-protection": "OFF",

        "svc-client-keepalive": "NO",

        "svc-tcp-buffering": "NO",

        "svc-compression": "NO",

        "svc-state": "ENABLED",

        "svc-downstate-flush": "DISABLED",

        "svc-enable-health-monitor": "NO"

      }

    },

    "targets": [

      {

        "id": "8c158e7a-0087-423f-91b0-0ccf16de552a"

      }

    ]

  }

}

This configpack is uniquely identified by using the id 8c158e7a-0087-423f-91b0-0ccf16de552a. You can use this ID to query, update, or delete the configuration. On successful update of the configpack, the certificate and key files are uploaded to NetScaler MAS file system.