{"id":18698283,"url":"https://github.com/ihor/supervisorxmlrpc","last_synced_at":"2025-04-12T07:32:52.412Z","repository":{"id":36258156,"uuid":"40562578","full_name":"ihor/SupervisorXMLRPC","owner":"ihor","description":"Simple Supervisor XML RPC Client in PHP","archived":false,"fork":false,"pushed_at":"2019-05-03T09:46:08.000Z","size":36,"stargazers_count":30,"open_issues_count":0,"forks_count":10,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-12T19:08:25.089Z","etag":null,"topics":["php","supervisor"],"latest_commit_sha":null,"homepage":"http://supervisorxmlrpc.readthedocs.org/","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ihor.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-08-11T20:04:48.000Z","updated_at":"2024-01-13T19:51:50.000Z","dependencies_parsed_at":"2022-09-09T11:51:50.731Z","dependency_job_id":null,"html_url":"https://github.com/ihor/SupervisorXMLRPC","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ihor%2FSupervisorXMLRPC","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ihor%2FSupervisorXMLRPC/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ihor%2FSupervisorXMLRPC/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ihor%2FSupervisorXMLRPC/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ihor","download_url":"https://codeload.github.com/ihor/SupervisorXMLRPC/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223505019,"owners_count":17156447,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["php","supervisor"],"created_at":"2024-11-07T11:27:39.955Z","updated_at":"2024-11-07T11:27:40.590Z","avatar_url":"https://github.com/ihor.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"Supervisor\n==========\n\nPHP XML RPC Client for [Supervisor](http://supervisord.org)\n\nInstallation\n------------\nDefine the following requirement in your composer.json file:\n```\n\"require\": {\n    \"ihor/supervisor-xml-rpc\": \"~0.2\"\n}\n```\n\nIt also requires [PHP XML-RPC extension](http://php.net/manual/en/book.xmlrpc.php). The version is marked as dev because I haven't heard any feedback from other users.\n\nUsage\n-----\n\n```php\n// Create Supervisor API instance\n$api = new \\Supervisor\\Api('127.0.0.1', 9001 /* username, password */);\n\n// Call Supervisor API\n$api-\u003egetApiVersion();\n\n// That's all!\n```\n\nReference\n---------\n\n##### getApiVersion()\n\nReturns the version of the RPC API used by supervisord\n\nThis API is versioned separately from Supervisor itself. The API version returned by getAPIVersion only changes when the API changes. Its purpose is to help the client identify with which version of the Supervisor API it is communicating.\n\nWhen writing software that communicates with this API, it is highly recommended that you first test the API version for compatibility before making method calls.\n\n[getAPIVersion](http://supervisord.org/api.html#supervisor.rpcinterface.SupervisorNamespaceRPCInterface.getAPIVersion)\n\n\n##### getSupervisorVersion()\n\nReturns the version of the supervisor package in use by supervisord\n\nhttp://supervisord.org/api.html#supervisor.rpcinterface.SupervisorNamespaceRPCInterface.getSupervisorVersion\n\n\n##### getIdentification()\n\nReturns identifying string of supervisord\n\nThis method allows the client to identify with which Supervisor instance it is communicating in the case of environments where multiple Supervisors may be running.\n\nThe identification is a string that must be set in Supervisor’s configuration file. This method simply returns that value back to the client.\n\nhttp://supervisord.org/api.html#supervisor.rpcinterface.SupervisorNamespaceRPCInterface.getIdentification\n\n\n##### getState()\n\nReturns current state of supervisord as a struct\n\nThis is an internal value maintained by Supervisor that determines what Supervisor believes to be its current operational state.\n\nSome method calls can alter the current state of the Supervisor. For example, calling the method supervisor.shutdown() while the station is in the RUNNING state places the Supervisor in the SHUTDOWN state while it is shutting down.\n\nThe supervisor.getState() method provides a means for the client to check Supervisor’s state, both for informational purposes and to ensure that the methods it intends to call will be permitted.\n\nThe return value is a struct:\n\nThe possible return values are:\n\nCode | Name       | Description\n-----|------------|-----------------------------------------------\n 2   | FATAL      | Supervisor has experienced a serious error.\n 1   | RUNNING    | Supervisor is working normally.\n 0   | RESTARTING | Supervisor is in the process of restarting.\n -1  | SHUTDOWN   | Supervisor is in the process of shutting down.\n\nThe FATAL state reports unrecoverable errors, such as internal errors inside Supervisor or system runaway conditions. Once set to FATAL, the Supervisor can never return to any other state without being restarted.\n\nIn the FATAL state, all future methods except supervisor.shutdown() and supervisor.restart() will automatically fail without being called and the fault FATAL_STATE will be raised.\n\nIn the SHUTDOWN or RESTARTING states, all method calls are ignored and their possible return values are undefined.\n\nhttp://supervisord.org/api.html#supervisor.rpcinterface.SupervisorNamespaceRPCInterface.getState\n\n\n##### getPid()\n\nReturns the PID of supervisord\n\nhttp://supervisord.org/api.html#supervisor.rpcinterface.SupervisorNamespaceRPCInterface.getPID\n\n\n##### readLog($offset, $length)\n\nReads length bytes from the main log starting at offset\n\nIt can either return the entire log, a number of characters from the tail of the log, or a slice of the log specified by the offset and length parameters:\n\nOffset           | Length    |  Behavior of readProcessLog\n-----------------|-----------|-----------------------------------------------------------------\nNegative         | Not Zero  |  Bad arguments. This will raise the fault BAD_ARGUMENTS.\nNegative         | Zero      |  This will return the tail of the log, or offset number of characters from the end of the log. For example, if offset = -4 and length = 0, then the last four characters will be returned from the end of the log.\nZero or Positive | Negative  |  Bad arguments. This will raise the fault BAD_ARGUMENTS.\nZero or Positive | Zero      |  All characters will be returned from the offset specified.\nZero or Positive | Positive  |  A number of characters length will be returned from the offset.\n\nIf the log is empty and the entire log is requested, an empty string is returned.\nIf either offset or length is out of range, the fault BAD_ARGUMENTS will be returned.\nIf the log cannot be read, this method will raise either the NO_FILE error if the file does not exist or the FAILED error if any other problem was encountered.\n\nhttp://supervisord.org/api.html#supervisor.rpcinterface.SupervisorNamespaceRPCInterface.readLog\n\n\n##### clearLog()\n\nClears the main log\n\nIf the log cannot be cleared because the log file does not exist, the fault NO_FILE will be raised. If the log cannot be cleared for any other reason, the fault FAILED will be raised.\n\nhttp://supervisord.org/api.html#supervisor.rpcinterface.SupervisorNamespaceRPCInterface.clearLog\n\n\n##### shutdown()\n\nShuts down the supervisor process\n\nThis method shuts down the Supervisor daemon. If any processes are running, they are automatically killed without warning.\nUnlike most other methods, if Supervisor is in the FATAL state, this method will still function.\n\nhttp://supervisord.org/api.html#supervisor.rpcinterface.SupervisorNamespaceRPCInterface.shutdown\n\n\n##### restart()\n\nRestarts the supervisor process\n\nThis method soft restarts the Supervisor daemon. If any processes are running, they are automatically killed without warning. Note that the actual UNIX process for Supervisor cannot restart; only Supervisor’s main program loop. This has the effect of resetting the internal states of Supervisor.\n\nUnlike most other methods, if Supervisor is in the FATAL state, this method will still function.\n\nhttp://supervisord.org/api.html#supervisor.rpcinterface.SupervisorNamespaceRPCInterface.restart\n\n\n##### getProcessInfo($name)\n\nReturns info about a process named name\n\nThe return value is a struct:\n```\n{'name':           'process name',\n 'group':          'group name',\n 'description':    'pid 18806, uptime 0:03:12'\n 'start':          1200361776,\n 'stop':           0,\n 'now':            1200361812,\n 'state':          1,\n 'statename':      'RUNNING',\n 'spawnerr':       '',\n 'exitstatus':     0,\n 'logfile':        '/path/to/stdout-log', # deprecated, b/c only\n 'stdout_logfile': '/path/to/stdout-log',\n 'stderr_logfile': '/path/to/stderr-log',\n 'pid':            1}\n```\n\nhttp://supervisord.org/api.html#supervisor.rpcinterface.SupervisorNamespaceRPCInterface.getProcessInfo\n\n\n##### getAllProcessInfo()\n\nReturns info about all processes\n\nEach element contains a struct, and this struct contains the exact same elements as the struct returned by getProcess. If the process table is empty, an empty array is returned.\n\nhttp://supervisord.org/api.html#supervisor.rpcinterface.SupervisorNamespaceRPCInterface.getAllProcessInfo\n\n\n##### startProcess($name, $wait = true)\n\nStarts a process\n\nhttp://supervisord.org/api.html#supervisor.rpcinterface.SupervisorNamespaceRPCInterface.startProcess\n\n\n##### stopProcess($name, $wait = true)\n\nStops a process named by name\n\nhttp://supervisord.org/api.html#supervisor.rpcinterface.SupervisorNamespaceRPCInterface.stopProcess\n\n\n##### startProcessGroup($name, $wait = true)\n\nStarts all processes in the group named by name\n\nhttp://supervisord.org/api.html#supervisor.rpcinterface.SupervisorNamespaceRPCInterface.startProcessGroup\n\n\n##### stopProcessGroup($name, $wait = true)\n\nStops all processes in the process group named by name\n\nhttp://supervisord.org/api.html#supervisor.rpcinterface.SupervisorNamespaceRPCInterface.stopProcessGroup\n\n\n##### startAllProcesses($wait = true)\n\nStarts all processes listed in the configuration file\n\nhttp://supervisord.org/api.html#supervisor.rpcinterface.SupervisorNamespaceRPCInterface.startAllProcesses\n\n\n##### stopAllProcesses($wait = true)\n\nStops all processes in the process list\n\nhttp://supervisord.org/api.html#supervisor.rpcinterface.SupervisorNamespaceRPCInterface.stopAllProcesses\n\n\n##### sendProcessStdin($name, $chars)\n\nSends a string of chars to the stdin of the process name.\n\nIf non-7-bit data is sent (unicode), it is encoded to utf-8 before being sent to the process’ stdin. If chars i not a string or is not unicode, raise INCORRECT_PARAMETERS. If the process is not running, raise NOT_RUNNING. If the process’ stdin cannot accept input (e.g. it was closed by the child process), raise NO_FILE.\n\nhttp://supervisord.org/api.html#supervisor.rpcinterface.SupervisorNamespaceRPCInterface.sendProcessStdin\n\n\n##### sendRemoteCommEvent($type, $data)\n\nSends an event that will be received by event listener subprocesses subscribing to the RemoteCommunicationEvent.\n\nhttp://supervisord.org/api.html#supervisor.rpcinterface.SupervisorNamespaceRPCInterface.sendRemoteCommEvent\n\n\n##### addProcessGroup($name)\n\nUpdates the config for a running process from config file.\n\nhttp://supervisord.org/api.html#supervisor.rpcinterface.SupervisorNamespaceRPCInterface.addProcessGroup\n\n\n##### removeProcessGroup($name)\n\nRemoves a stopped process from the active configuration\n\nhttp://supervisord.org/api.html#supervisor.rpcinterface.SupervisorNamespaceRPCInterface.removeProcessGroup\n\n\n##### readProcessStdoutLog($name, $offset, $length)\n\nReads length bytes from name’s stdout log starting at offset\n\nhttp://supervisord.org/api.html#supervisor.rpcinterface.SupervisorNamespaceRPCInterface.readProcessStdoutLog\n\n\n##### readProcessStderrLog($name, $offset, $length)\n\nRead length bytes from name’s stderr log starting at offset\n\nhttp://supervisord.org/api.html#supervisor.rpcinterface.SupervisorNamespaceRPCInterface.tailProcessStderrLog\n\n\n##### tailProcessStdoutLog($name, $offset, $length)\n\nProvides a more efficient way to tail the (stdout) log than readProcessStdoutLog(). Use readProcessStdoutLog() to read chunks and tailProcessStdoutLog() to tail.\n\nRequests (length) bytes from the (name)’s log, starting at (offset). If the total log size is greater than (offset + length), the overflow flag is set and the (offset) is automatically increased to position the buffer at the end of the log. If less than (length) bytes are available, the maximum number of available bytes will be returned. (offset) returned is always the last offset in the log +1.\n\nhttp://supervisord.org/api.html#supervisor.rpcinterface.SupervisorNamespaceRPCInterface.tailProcessStdoutLog\n\n\n##### tailProcessStderrLog($name, $offset, $length)\n\nProvides a more efficient way to tail the (stderr) log than readProcessStderrLog(). Use readProcessStderrLog() to read chunks and tailProcessStderrLog() to tail.\n\nRequests (length) bytes from the (name)’s log, starting at (offset). If the total log size is greater than (offset + length), the overflow flag is set and the (offset) is automatically increased to position the buffer at the end of the log. If less than (length) bytes are available, the maximum number of available bytes will be returned. (offset) returned is always the last offset in the log +1.\n\nhttp://supervisord.org/api.html#supervisor.rpcinterface.SupervisorNamespaceRPCInterface.tailProcessStderrLog\n\n\n##### clearProcessLogs($name)\n\nClears the stdout and stderr logs for the named process and reopen them\n\nhttp://supervisord.org/api.html#supervisor.rpcinterface.SupervisorNamespaceRPCInterface.clearProcessLogs\n\n\n##### clearAllProcessLogs()\n\nClears all process log files\n\nhttp://supervisord.org/api.html#supervisor.rpcinterface.SupervisorNamespaceRPCInterface.clearAllProcessLogs\n\n\n##### listMethods()\n\nReturns an array listing the available method names\n\nhttp://supervisord.org/api.html#supervisor.xmlrpc.SystemNamespaceRPCInterface.listMethods\n\n\n##### methodHelp($name)\n\nReturns a string showing the method’s documentation\n\nhttp://supervisord.org/api.html#supervisor.xmlrpc.SystemNamespaceRPCInterface.methodHelp\n\n\n##### methodSignature($name)\n\nReturns an array describing the method signature in the form [rtype, ptype, ptype...] where rtype is the return data type of the method, and ptypes are the parameter data types that the method accepts in method argument order.\n\nhttp://supervisord.org/api.html#supervisor.xmlrpc.SystemNamespaceRPCInterface.methodSignature\n\n\n##### multicall(array $calls)\n\nProcesses an array of calls, and return an array of results. Calls should be structs of the form. Each result will either be a single-item array containg the result value, or a struct of the form . This is useful when you need to make lots of small calls without lots of round trips.\n\nhttp://supervisord.org/api.html#supervisor.xmlrpc.SystemNamespaceRPCInterface.multicall\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fihor%2Fsupervisorxmlrpc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fihor%2Fsupervisorxmlrpc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fihor%2Fsupervisorxmlrpc/lists"}