Product Documentation

Creating a Service Class

Apr 27, 2015

To add a service class on the CloudBridge appliance, you must use the "service_class" object.

  1. Add a new service class named SC1.
    • Request:

      HTTP Method
      POST
      URL
      https://<cb_ip>/cb/nitro/v1/config/service_class
      Request Header
      Authorization: Basic <base64 encoded(username:password)> 
      Content-Type: application/vnd.com.citrix.cloudbridge.service_class+json
      Request Payload
      { 
          "service_class": 
          { 
              "classname":"SC1", 
              "accelerationpolicy":"disk", 
              "qospolicy":"Very High Priority Traffic", 
              "enabled":"true", 
              "filterrules": 
              [ 
                  { 
                      "applications": 
                      [ 
                          { 
                              "appname":"UDP" 
                          }, 
                          { 
                              "appname":"TCP" 
                          } 
                      ] 
                  } 
              ] 
          } 
      }
    • Response:

      HTTP Status Code on Success
      201 Created
      HTTP Status Code on Failure
      4xx <string> or 5xx <string>. The response provides details of the error. See Error Handling.
      Response Header
      Content-Type: application/vnd.com.citrix.cloudbridge.service_class+json
      Response Payload
      { 
          "service_class": 
          { 
              ... 
              ... 
          } 
      }
  2. Modify the newly created service class SC1 by specifying the required changes. This example shows the modification of accelerationpolicy to memory, qospolicy to Very Low Priority, and add some filter rules.
    • Request:

      HTTP Method
      PUT
      URL
      https://<cb_ip>/cb/nitro/v1/config/service_class/SC1
      Request Header
      Authorization: Basic <base64 encoded(username:password)> 
      Content-Type: application/vnd.com.citrix.cloudbridge.service_class+json
      Request Payload
      { 
          "service_class": 
          { 
              "accelerationpolicy":"memory", 
              "qospolicy":"Very Low Priority Traffic", 
              "filterrules": 
              [ 
                  { 
                      "srcipaddresses": 
                      [ 
                          { 
                              "srcipaddress": 
                              { 
                                  "ipaddressmask":"172.16.1.0/24", 
                                  "rangetype":"ipmask" 
                              } 
                          }, 
                          { 
                              "srcipaddress": 
                              { 
                                  "left":"172.16.1.10", 
                                  "right":"172.16.1.20", 
                                  "rangetype":"hyphen seperated" 
                              }, 
                              "excluded":"true" 
                          } 
                      ] 
                  } 
              ] 
          } 
      }
    • Response:

      HTTP Status Code on Success
      200 OK
      HTTP Status Code on Failure
      4xx <string> or 5xx <string>. The response provides details of the error. See Error Handling.
      Response Header
      Content-Type: application/vnd.com.citrix.cloudbridge.service_class+json
      Response Payload
      { 
          "service_class": 
          { 
              ... 
              ... 
          } 
      }