We have detected an error in your notification set-up
(Event-ID dab39dc24f564ec7bd4628d1305fd03c).
Currently, we cannot inform you about inspection progress.
Please check that the user
557058:bca11929-8c2d-43f2-8a82-c5416880d395
still has access to your repository or
update the API account.
1 | <?php |
||
22 | class Pipelines extends Api |
||
23 | { |
||
24 | /** |
||
25 | * Get the information associated with a repository's pipelines |
||
26 | * |
||
27 | * @access public |
||
28 | * @param string $account The team or individual account owning the repository. |
||
29 | * @param string $repo The repository identifier. |
||
30 | * @return MessageInterface |
||
31 | */ |
||
32 | 1 | public function all($account, $repo) |
|
33 | { |
||
34 | 1 | return $this->getClient()->setApiVersion('2.0')->get( |
|
35 | 1 | sprintf('repositories/%s/%s/pipelines/', $account, $repo) |
|
36 | ); |
||
37 | } |
||
38 | |||
39 | /** |
||
40 | * Creates a pipeline for the specified repository. |
||
41 | * |
||
42 | * @access public |
||
43 | * @param string $account The team or individual account owning the repository. |
||
44 | * @param string $repo The repository identifier. |
||
45 | * @param array|string $params Additional parameters as array or JSON string |
||
46 | * @return MessageInterface |
||
47 | */ |
||
48 | 2 | public function create($account, $repo, $params = array()) |
|
49 | { |
||
50 | // allow developer to directly specify params as json if (s)he wants. |
||
51 | 2 | if ('array' !== gettype($params)) { |
|
52 | 1 | if (empty($params)) { |
|
53 | throw new \InvalidArgumentException('Invalid JSON provided.'); |
||
54 | } |
||
55 | |||
56 | 1 | $params = $this->decodeJSON($params); |
|
57 | } |
||
58 | |||
59 | 2 | return $this->getClient()->setApiVersion('2.0')->post( |
|
60 | 2 | sprintf('repositories/%s/%s/pipelines/', $account, $repo), |
|
61 | 2 | json_encode($params), |
|
62 | 2 | array('Content-Type' => 'application/json') |
|
63 | ); |
||
64 | } |
||
65 | |||
66 | /** |
||
67 | * Get a specific pipeline |
||
68 | * |
||
69 | * @access public |
||
70 | * @param string $account The team or individual account owning the repository. |
||
71 | * @param string $repo The repository identifier. |
||
72 | * @param string $uuid The pipeline's identifier. |
||
73 | * @return MessageInterface |
||
74 | */ |
||
75 | 1 | public function get($account, $repo, $uuid) |
|
76 | { |
||
77 | 1 | return $this->getClient()->setApiVersion('2.0')->get( |
|
78 | 1 | sprintf('repositories/%s/%s/pipelines/%s', $account, $repo, $uuid) |
|
79 | ); |
||
80 | } |
||
81 | |||
82 | /** |
||
83 | * Stop a specific pipeline |
||
84 | * |
||
85 | * @access public |
||
86 | * @param string $account The team or individual account owning the repository. |
||
87 | * @param string $repo The repository identifier. |
||
88 | * @param string $uuid The pipeline's identifier. |
||
89 | * @return MessageInterface |
||
90 | */ |
||
91 | 1 | public function stopPipeline($account, $repo, $uuid) |
|
92 | { |
||
93 | 1 | return $this->getClient()->setApiVersion('2.0')->post( |
|
94 | 1 | sprintf('repositories/%s/%s/pipelines/%s/stopPipeline', $account, $repo, $uuid) |
|
95 | ); |
||
96 | } |
||
97 | |||
98 | /** |
||
99 | * Get steps |
||
100 | * |
||
101 | * @access public |
||
102 | * @return Pipelines\Steps |
||
103 | * |
||
104 | * @throws \InvalidArgumentException |
||
105 | * @codeCoverageIgnore |
||
106 | */ |
||
107 | public function steps() |
||
111 | } |
||
112 |