|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/** |
|
4
|
|
|
* This file is part of the bitbucket-api package. |
|
5
|
|
|
* |
|
6
|
|
|
* (c) Alexandru G. <[email protected]> |
|
7
|
|
|
* |
|
8
|
|
|
* For the full copyright and license information, please view the LICENSE |
|
9
|
|
|
* file that was distributed with this source code. |
|
10
|
|
|
*/ |
|
11
|
|
|
|
|
12
|
|
|
namespace Bitbucket\API\Repositories\Pipelines; |
|
13
|
|
|
|
|
14
|
|
|
use Bitbucket\API; |
|
15
|
|
|
use Buzz\Message\MessageInterface; |
|
16
|
|
|
|
|
17
|
|
|
/** |
|
18
|
|
|
* Manage the steps of a pipeline. |
|
19
|
|
|
* |
|
20
|
|
|
* @author Marco Veenendaal <[email protected]> |
|
21
|
|
|
*/ |
|
22
|
|
|
class Steps extends API\Api |
|
23
|
|
|
{ |
|
24
|
|
|
/** |
|
25
|
|
|
* Get a list of all pipeline steps |
|
26
|
|
|
* |
|
27
|
|
|
* @access public |
|
28
|
|
|
* @param string $account The team or individual account owning the repository. |
|
29
|
|
|
* @param string $repo The repository identifier. |
|
30
|
|
|
* @param string $pipelineUuid UUID of the pipeline. |
|
31
|
|
|
* @return MessageInterface |
|
32
|
|
|
*/ |
|
33
|
|
|
public function all($account, $repo, $pipelineUuid) |
|
34
|
|
|
{ |
|
35
|
|
|
return $this->getClient()->setApiVersion('2.0')->get( |
|
36
|
|
|
sprintf('repositories/%s/%s/pipelines/%s/steps/', $account, $repo, $pipelineUuid) |
|
37
|
|
|
); |
|
38
|
|
|
} |
|
39
|
|
|
|
|
40
|
|
|
/** |
|
41
|
|
|
* Get an individual pipeline step |
|
42
|
|
|
* |
|
43
|
|
|
* @access public |
|
44
|
|
|
* @param string $account The team or individual account owning the repository. |
|
45
|
|
|
* @param string $repo The repository identifier. |
|
46
|
|
|
* @param string $pipelineUuid UUID of the pipeline. |
|
47
|
|
|
* @param string $stepUuid UUID of the step. |
|
48
|
|
|
* @return MessageInterface |
|
49
|
|
|
*/ |
|
50
|
|
|
public function get($account, $repo, $pipelineUuid, $stepUuid) |
|
51
|
|
|
{ |
|
52
|
|
|
return $this->getClient()->setApiVersion('2.0')->get( |
|
53
|
|
|
sprintf('repositories/%s/%s/pipelines/%s/steps/%s', $account, $repo, $pipelineUuid, $stepUuid) |
|
54
|
|
|
); |
|
55
|
|
|
} |
|
56
|
|
|
|
|
57
|
|
|
/** |
|
58
|
|
|
* Get the log of an individual pipeline step |
|
59
|
|
|
* |
|
60
|
|
|
* @access public |
|
61
|
|
|
* @param string $account The team or individual account owning the repository. |
|
62
|
|
|
* @param string $repo The repository identifier. |
|
63
|
|
|
* @param string $pipelineUuid UUID of the pipeline. |
|
64
|
|
|
* @param string $stepUuid UUID of the step. |
|
65
|
|
|
* @return MessageInterface |
|
66
|
|
|
*/ |
|
67
|
|
|
public function log($account, $repo, $pipelineUuid, $stepUuid) |
|
68
|
|
|
{ |
|
69
|
|
|
return $this->getClient()->setApiVersion('2.0')->get( |
|
70
|
|
|
sprintf('repositories/%s/%s/pipelines/%s/steps/%s/log', $account, $repo, $pipelineUuid, $stepUuid) |
|
71
|
|
|
); |
|
72
|
|
|
} |
|
73
|
|
|
} |
|
74
|
|
|
|