Last active
May 23, 2020 03:48
-
-
Save skizzerz/85a0a2d4a6176ffa67004cd22c507799 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package Cpanel::API::VCDeployStatus; | |
use strict; | |
use warnings; | |
our $VERSION = '1.0.0'; | |
# Because VersionControlDeployment::retrieve sucks and doesn't let us filter on a given id | |
use Cpanel::VersionControl::Deployment::DB (); | |
our %API = ( | |
_needs_feature => 'version_control' | |
); | |
sub retrieve { | |
my ($args, $result) = @_; | |
my $deploy_id = $args->get_length_required('deploy_id'); | |
my $db = Cpanel::VersionControl::Deployment::DB->new(); | |
my $deploy = $db->retrieve($deploy_id); | |
if (!defined($deploy)) { | |
$result->error('“[_1]” is not a valid “[_2]”.', $deploy_id, 'deploy_id'); | |
return; | |
} | |
$result->data($deploy); | |
return 1; | |
} | |
1; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment