parameters: (self, name, input_type, default_output,
                               slo_micros)
docstring: Register a new application with Clipper.
  
          An application in Clipper corresponds to a named REST endpoint that can be used to request
          predictions. This command will attempt to create a new endpoint with the provided name.
          Application names must be unique. This command will fail if an application with the provided
          name already exists.
  
          Parameters
          ----------
          name : str
              The unique name of the application.
          input_type : str
              The type of the request data this endpoint can process. Input type can be
              one of "integers", "floats", "doubles", "bytes", or "strings".
          default_output : str
              The default output for the application. The default output will be returned whenever
              an application is unable to receive a response from a model within the specified
              query latency SLO (service level objective). The reason the default output was returned
              is always provided as part of the prediction response object.
          slo_micros : int
              The query latency objective for the application in microseconds.
              This is the processing latency between Clipper receiving a request
              and sending a response. It does not account for network latencies
              before a request is received or after a response is sent.
              If Clipper cannot process a query within the latency objective,
              the default output is returned. Therefore, it is recommended that
              the SLO not be set aggressively low unless absolutely necessary.
              100000 (100ms) is a good starting value, but the optimal latency objective
              will vary depending on the application.
  
          Raises
          ------
          :py:exc:`clipper.UnconnectedException`
          :py:exc:`clipper.ClipperException`
docstring_summary: Register a new application with Clipper.
docstring_tokens: Register a new application with Clipper .
function: def register_application(self, name, input_type, default_output,
                               slo_micros):
          # TODO(crankshaw): Add links to user guide section on input types once user guide is
          # written:
          # "See the `User Guide <http://clipper.ai/user_guide/#input-types>`_ for more details
          # on picking the right input type for your application."
          """Register a new application with Clipper.
  
          An application in Clipper corresponds to a named REST endpoint that can be used to request
          predictions. This command will attempt to create a new endpoint with the provided name.
          Application names must be unique. This command will fail if an application with the provided
          name already exists.
  
          Parameters
          ----------
          name : str
              The unique name of the application.
          input_type : str
              The type of the request data this endpoint can process. Input type can be
              one of "integers", "floats", "doubles", "bytes", or "strings".
          default_output : str
              The default output for the application. The default output will be returned whenever
              an application is unable to receive a response from a model within the specified
              query latency SLO (service level objective). The reason the default output was returned
              is always provided as part of the prediction response object.
          slo_micros : int
              The query latency objective for the application in microseconds.
              This is the processing latency between Clipper receiving a request
              and sending a response. It does not account for network latencies
              before a request is received or after a response is sent.
              If Clipper cannot process a query within the latency objective,
              the default output is returned. Therefore, it is recommended that
              the SLO not be set aggressively low unless absolutely necessary.
              100000 (100ms) is a good starting value, but the optimal latency objective
              will vary depending on the application.
  
          Raises
          ------
          :py:exc:`clipper.UnconnectedException`
          :py:exc:`clipper.ClipperException`
          """
          if not self.connected:
              raise UnconnectedException()
          url = "http://{host}/admin/add_app".format(
              host=self.cm.get_admin_addr())
          req_json = json.dumps({
              "name": name,
              "input_type": input_type,
              "default_output": default_output,
              "latency_slo_micros": slo_micros
          })
          headers = {'Content-type': 'application/json'}
          r = requests.post(url, headers=headers, data=req_json)
          self.logger.debug(r.text)
          if r.status_code != requests.codes.ok:
              msg = "Received error status code: {code} and message: {msg}".format(
                  code=r.status_code, msg=r.text)
              self.logger.error(msg)
              raise ClipperException(msg)
          else:
              self.logger.info(
                  "Application {app} was successfully registered".format(
                      app=name))
function_tokens: def register_application ( self , name , input_type , default_output , slo_micros ) : # TODO(crankshaw): Add links to user guide section on input types once user guide is # written: # "See the `User Guide <http://clipper.ai/user_guide/#input-types>`_ for more details # on picking the right input type for your application." if not self . connected : raise UnconnectedException ( ) url = "http://{host}/admin/add_app" . format ( host = self . cm . get_admin_addr ( ) ) req_json = json . dumps ( { "name" : name , "input_type" : input_type , "default_output" : default_output , "latency_slo_micros" : slo_micros } ) headers = { 'Content-type' : 'application/json' } r = requests . post ( url , headers = headers , data = req_json ) self . logger . debug ( r . text ) if r . status_code != requests . codes . ok : msg = "Received error status code: {code} and message: {msg}" . format ( code = r . status_code , msg = r . text ) self . logger . error ( msg ) raise ClipperException ( msg ) else : self . logger . info ( "Application {app} was successfully registered" . format ( app = name ) )