Certificates ============ .. role:: green Manage symBalancer certificates. Certificate List ---------------- **Type:** :guilabel:`GET` .. py:function:: https://cloud.syminet.com/api/v1/symbalancers/{SYMBALANCER_ID}/certs List installed certificates. Cert id is a **UUID** value. **Required URL Parameters:** SYMBALANCER_ID Symbalancer ID .. code-block:: shell :caption: Curl curl --request GET \ --url https://cloud.syminet.com/api/v1/symbalancers/SYMBALANCER_ID/certs \ --header "content-type: application/json" \ --header "authorization:bearer $API_TOKEN" .. code-block:: json :caption: Response { "data": [ { "cert_name": "example.com.crt", "fingerprint": "B2:FB:36:D5:CF:0E:A9:41:32:DC:B3:3E:44:9C:66:37", "id": "0a600f35-67ad-4674-b621-5a25a4eda0e1" }, { "cert_name": "example-pet-store.com.crt", "fingerprint": "AF:A9:ED:EA:E1:54:EC:D2:98:13:1E:65:03:0A:DC:A9", "id": "2d98df50-ca69-4fa1-914a-17450ec7ffc4" } ] } Add Certificate --------------- **Type:** :guilabel:`POST` .. py:function:: https://cloud.syminet.com/api/v1/symbalancers/{SYMBALANCER_ID}/certs/add Add backend server to SYMBALANCER_ID **Required URL Parameters:** SYMBALANCER_ID Symbalancer ID to add a certificate to. **Required JSON Properties:** cert_name Certificate name. Typically domain name of the cert although it is free-form. .. Note:: Certificate name must be unique from other certificates on the same balancer. certificate Full plaintext certificate, including the key. .. Important:: JSON does not allow raw linebreaks, so certificate must be a single long line with printed "\\n" escape sequences for newlines. Also, many certificates have DOS style carriage returns ("\\r") which need to be stripped out. The command below might be helpful in converting these files into the single string you need: .. code-block:: shell :caption: Convert PEM file into a single string, with newlines printed inline. cat MY_CERTIFICATE_FILE.pem |sed 's/\r//' |sed 's/$/\\n/' | tr -d '\n' Example request: .. code-block:: shell :caption: Curl curl --request POST \ --url https://cloud.syminet.com/api/v1/symbalancers/SYMBALANCER_ID/certs/add \ --header "content-type: application/json" \ --header "authorization:bearer $API_TOKEN" \ --data ' { "cert_name": "example.com", "cert": "[...full certificate text...]" } ' **Response:** :green:`202 OK` Delete Certificate ------------------ **Type:** :guilabel:`DELETE` .. py:function:: https://cloud.syminet.com/api/v1/symbalancers/{SYMBALANCER_ID}/certs/delete/{CERT_ID} Delete a port from a symBalancer. **Required URL Parameters:** SYMBALANCER_ID symBalancer ID to add port to. CERT_ID Certificate ID to delete. It is a **UUID** value as provided by Certificate List. .. code-block:: shell :caption: Curl curl --request DELETE \ --url https://cloud.syminet.com/api/v1/symbalancers/SYMBALANCER_ID/certs/delete/CERT_ID \ --header "content-type: application/json" \ --header "authorization:bearer $API_TOKEN" **Response:** :green:`202 OK`