Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F92304048
ConduitAPI_daemon_setstatus_Method.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Tue, Nov 19, 06:06
Size
1 KB
Mime Type
text/x-php
Expires
Thu, Nov 21, 06:06 (1 d, 21 h)
Engine
blob
Format
Raw Data
Handle
22411245
Attached To
rPH Phabricator
ConduitAPI_daemon_setstatus_Method.php
View Options
<?php
/**
* @group conduit
*/
final
class
ConduitAPI_daemon_setstatus_Method
extends
ConduitAPIMethod
{
public
function
shouldRequireAuthentication
()
{
// TODO: Lock this down once we build phantoms.
return
false
;
}
public
function
shouldAllowUnguardedWrites
()
{
return
true
;
}
public
function
getMethodDescription
()
{
return
"Used by daemons to update their status."
;
}
public
function
defineParamTypes
()
{
return
array
(
'daemonLogID'
=>
'required string'
,
'status'
=>
'required enum<unknown, run, timeout, dead, exit>'
,
);
}
public
function
defineReturnType
()
{
return
'void'
;
}
public
function
defineErrorTypes
()
{
return
array
(
'ERR-INVALID-ID'
=>
'An invalid daemonLogID was provided.'
,
);
}
protected
function
execute
(
ConduitAPIRequest
$request
)
{
$daemon_log
=
id
(
new
PhabricatorDaemonLog
())
->
load
(
$request
->
getValue
(
'daemonLogID'
));
if
(!
$daemon_log
)
{
throw
new
ConduitException
(
'ERR-INVALID-ID'
);
}
$daemon_log
->
setStatus
(
$request
->
getValue
(
'status'
));
$daemon_log
->
save
();
}
}
Event Timeline
Log In to Comment