Backend Servers =============== .. role:: green Manage backend servers using the API. Backend Server List ------------------- **Type:** :guilabel:`GET` .. py:function:: https://cloud.syminet.com/api/v1/symbalancers/detail/{SYMBALANCER_ID} Return backend server list for ``SYMBALANCER_ID``. **Parameters:** SYMBALANCER_ID symBalancer ID .. code-block:: shell :caption: Curl curl --request GET \ --url https://cloud.syminet.com/api/v1/symbalancers/detail/SYMBALANCER_ID \ --header "authorization:bearer $API_TOKEN" .. code-block:: json :caption: Response { "data": [ { "downtime": 0, "ip": "10.11.11.240", "slice_id": 4960, "slice_name": "web1", "status": "UP" }, { "downtime": 0, "ip": "10.11.11.127", "slice_id": 4961, "slice_name": "web2", "status": "UP" } ] } Add Server ---------- **Type:** :guilabel:`POST` .. py:function:: https://cloud.syminet.com/api/v1/symbalancers/{SYMBALANCER_ID}/servers/add Add backend server to SYMBALANCER_ID **Required URL Parameters:** SYMBALANCER_ID Symbalancer ID to add a slice to. **Required JSON Properties:** name Integer SLICE_ID to add. .. Note:: SLICE_ID to add: must be in the same region as the balancer, must have a private IPv4 assigned, and must not already be assigned to a balancer. .. code-block:: shell :caption: Curl curl --request POST \ --url https://cloud.syminet.com/api/v1/symbalancers/SYMBAALNCER_ID/servers/add \ --header "content-type: application/json" \ --header "authorization:bearer $API_TOKEN" \ --data ' { "name": 1234 } ' **Response:** :green:`202 OK` Remove Server ------------- **Type:** :guilabel:`DELETE` .. py:function:: https://cloud.syminet.com/api/v1/symbalancers/{SYMBALANCER_ID}/servers/remove/{SLICE_ID} Remove backend server ``SLICE_ID`` from symBalancer ``SYMBALANCER_ID`` **Required URL Parameters:** SYMBALANCER_ID smBalancer ID to remove the backend slice from. SLICE_ID Slice ID to remove. .. code-block:: shell :caption: Curl curl --request DELETE \ --url https://cloud.syminet.com/api/v1/symbalancers/SYMBALANCER_ID/servers/remove/SLICE_ID \ --header "authorization:bearer $API_TOKEN" **Response:** :green:`202 OK` Set Server States ----------------- There are three endpoints for setting server state: Set State READY +++++++++++++++ **Type:** :guilabel:`GET` .. py:function:: https://cloud.syminet.com/api/v1/symbalancers/{SYMBALANCER_ID}/servers/setstate/ready/{SLICE_ID} On symBalancer ``SYMBALANCER_ID``, set backend server state for ``SLICE_ID`` to READY. **Required URL Parameters:** SYMBALANCER_ID symBalancer ID SLICE_ID Slice ID to set state READY. .. code-block:: shell :caption: Curl curl --request GET \ --url https://cloud.syminet.com/api/v1/symbalancers/SYMBALANCER_ID/servers/setstate/ready/SLICE_ID \ --header "authorization:bearer $API_TOKEN" **Response:** :green:`202 OK` Set state DRAIN +++++++++++++++ **Type:** :guilabel:`GET` .. py:function:: https://cloud.syminet.com/api/v1/symbalancers/{SYMBALANCER_ID}/servers/setstate/drain/{SLICE_ID} On symBalancer ``SYMBALANCER_ID``, set backend server state for ``SLICE_ID`` to DRAIN. **Required URL Parameters:** SYMBALANCER_ID symBalancer ID SLICE_ID Slice ID to set state DRAIN. .. code-block:: shell :caption: Curl curl --request GET \ --url https://cloud.syminet.com/api/v1/symbalancers/SYMBALANCER_ID/servers/setstate/drain/SLICE_ID \ --header "authorization:bearer $API_TOKEN" **Response:** :green:`202 OK` Set state MAINT +++++++++++++++ **Type:** :guilabel:`GET` .. py:function:: https://cloud.syminet.com/api/v1/symbalancers/{SYMBALANCER_ID}/servers/setstate/maintenance/{SLICE_ID} On symBalancer ``SYMBALANCER_ID``, set backend server state for ``SLICE_ID`` to MAINT. (maintenance) **Required URL Parameters:** SYMBALANCER_ID symBalancer ID SLICE_ID Slice ID to set state MAINT. .. code-block:: shell :caption: Curl curl --request GET \ --url https://cloud.syminet.com/api/v1/symbalancers/SYMBALANCER_ID/servers/setstate/maintenance/SLICE_ID \ --header "authorization:bearer $API_TOKEN" **Response:** :green:`202 OK`