Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/Api/DeployKeys.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@

class DeployKeys extends AbstractApi
{
/**
* List all deploy keys across all projects of the GitLab instance.
*
* @see https://docs.gitlab.com/api/deploy_keys/#list-all-deploy-keys
*/
public function all(array $parameters = []): mixed
{
$resolver = $this->createOptionsResolver();
Expand Down
13 changes: 13 additions & 0 deletions src/Api/Deployments.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
class Deployments extends AbstractApi
{
/**
* List all deployments of a project.
*
* @see https://docs.gitlab.com/api/deployments/#list-all-project-deployments
*
* @param array $parameters {
*
* @var string $order_by Return deployments ordered by id, iid, created_at, updated_at, finished_at, or ref fields (default is id)
Expand Down Expand Up @@ -74,12 +78,21 @@ public function all(int|string $project_id, array $parameters = []): mixed
return $this->get($this->getProjectPath($project_id, 'deployments'), $resolver->resolve($parameters));
}

/**
* Get a specific deployment of a project.
*
* @see https://docs.gitlab.com/api/deployments/#retrieve-a-deployment
*/
public function show(int|string $project_id, int $deployment_id): mixed
{
return $this->get($this->getProjectPath($project_id, 'deployments/'.$deployment_id));
}

/**
* List the merge requests associated with a deployment.
*
* @see https://docs.gitlab.com/api/deployments/#list-all-merge-requests-associated-with-a-deployment
*
* @param array $parameters {
*
* @var string $state return all merge requests or just those that are opened, closed, locked, or merged
Expand Down
28 changes: 28 additions & 0 deletions src/Api/Environments.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@

class Environments extends AbstractApi
{
/**
* List all environments of a project.
*
* @see https://docs.gitlab.com/api/environments/#list-all-environments
*/
public function all(int|string $project_id, array $parameters = []): mixed
{
$resolver = $this->createOptionsResolver();
Expand All @@ -34,6 +39,10 @@ public function all(int|string $project_id, array $parameters = []): mixed
}

/**
* Create a new environment.
*
* @see https://docs.gitlab.com/api/environments/#create-an-environment
*
* @param array $parameters {
*
* @var string $name The name of the environment
Expand All @@ -55,17 +64,31 @@ public function create(int|string $project_id, array $parameters = []): mixed
return $this->post($this->getProjectPath($project_id, 'environments'), $resolver->resolve($parameters));
}

/**
* Delete an environment.
*
* @see https://docs.gitlab.com/api/environments/#delete-an-environment
*/
public function remove(int|string $project_id, int $environment_id): mixed
{
return $this->delete($this->getProjectPath($project_id, 'environments/'.$environment_id));
}

/**
* Stop an environment.
*
* @see https://docs.gitlab.com/api/environments/#stop-an-environment
*/
public function stop(int|string $project_id, int $environment_id): mixed
{
return $this->post($this->getProjectPath($project_id, 'environments/'.self::encodePath($environment_id).'/stop'));
}

/**
* Stop multiple stale environments.
*
* @see https://docs.gitlab.com/api/environments/#stop-stale-environments
*
* @param array $parameters {
*
* @var \DateTimeInterface $before Stop environments that have been modified or deployed to before the specified date.
Expand All @@ -86,6 +109,11 @@ public function stopStale(int|string $project_id, array $parameters = []): mixed
return $this->post($this->getProjectPath($project_id, 'environments/stop_stale'), $resolver->resolve($parameters));
}

/**
* Get a specific environment.
*
* @see https://docs.gitlab.com/api/environments/#retrieve-an-environment
*/
public function show(int|string $project_id, int $environment_id): mixed
{
return $this->get($this->getProjectPath($project_id, 'environments/'.self::encodePath($environment_id)));
Expand Down
4 changes: 4 additions & 0 deletions src/Api/Events.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
class Events extends AbstractApi
{
/**
* List currently authenticated user's events.
*
* @see https://docs.gitlab.com/api/events/#list-all-events
*
* @param array $parameters {
*
* @var string $action include only events of a particular action type
Expand Down
Loading