Citrix Application Delivery Management

使用 API 创建配置以上传证书和密钥文件

可使用样本 API 基于此样本创建配置。您可以使用任何工具(如 curl 命令行工具或 Postman Chrome 浏览器扩展)将 HTTP 请求发送到 Citrix Application Delivery Management (ADM)。

考虑在 如何创建用于将 SSL 证书和证书密钥文件上载到 Citrix ADM 的样本中为上传证书和密钥文件而创建的样书示例。使用 REST API 从此样书创建配置包,如下所示:

POST

https://<MAS_IP_Address>/stylebook/nitro/v1/config/stylebooks/com.citrix.adc.stylebooks/1.0/lb-mon/configpacks?mode=async
<!--NeedCopy-->
Content-Type: application/jsonAccept: 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"
      }
    ]
  }
}
<!--NeedCopy-->

此配置包通过使用 id 8c158e7a-0087-423F-91b0-0ccf16de552a 进行唯一标识。可以使用此 ID 查询、更新或删除该配置。成功更新配置包后,证书和密钥文件将上载到 Citrix ADM 文件系统。

使用 API 创建配置以上传证书和密钥文件

在本文中