Entornos y despliegues
Los entornos de un proyecto (crear, leer, actualizar, parar y borrar), los registros de despliegue hechos en ellos (listar, leer, crear, actualizar, borrar, los merge requests que entregó un despliegue y aprobar o rechazar un despliegue que espera en una puerta manual) y los periodos de congelación que bloquean los despliegues según un calendario. Los entornos protegidos, que limitan quién puede desplegar en un entorno, son las acciones que se sirven a partir de Premium.
Parar un entorno ejecuta sus jobs de parada, y force se los salta; parar y borrar son destructivas.
Preguntas de ejemplo
Sección titulada «Preguntas de ejemplo»- “Lista los entornos del proyecto 42”
- “¿Qué está desplegado ahora mismo en production?”
- “Añade una congelación de despliegues durante las vacaciones de fin de año”
- “Aprueba el despliegue que espera en production”
Cómo llamarlo
Sección titulada «Cómo llamarlo»- Dinámica, la superficie predeterminada: llama a
gitlab_execute_actionconactionigual al ID de la acción, comoenvironment.create, y sus parámetros enparams.gitlab_find_actionencuentra un ID a partir de una descripción de la tarea. - Meta (
GITLAB_MCP_TOOL_SURFACE=meta): llama agitlab_environmentconactionigual al nombre de la acción, comocreate, y sus parámetros enparams. - Individual (
GITLAB_MCP_TOOL_SURFACE=individual): llama a la herramienta propia de la acción, comogitlab_environment_create, pasándole directamente sus parámetros.
Disponibilidad
Sección titulada «Disponibilidad»Cuántas de estas acciones sirve una instancia en cada nivel, de un total de 24:
- Free: 19
- Premium: 24
- Ultimate: 24
Acciones de solo lectura: 9 de 24, las que conserva un despliegue en modo de solo lectura. A un token con read_api y sin api se le sirven 9 de las 24.
Acciones
Sección titulada «Acciones»La descripción de cada acción, y la de cada uno de sus parámetros, es el texto que sirve el servidor para ella en la superficie predeterminada, citado tal cual; por eso está en inglés. Las líneas de token dicen lo que exige GitLab 19.6.1 a un token para las peticiones que envía cada acción; en una instancia con Admin Mode activado, una acción que solo puede ejecutar un administrador necesita además admin_mode. Una acción destructiva solo se ejecuta una vez confirmada, salvo que GITLAB_MCP_YOLO_MODE (o AUTOPILOT) se salte ese paso: la superficie dinámica necesita confirm: true en gitlab_execute_action, y las otras dos aceptan un parámetro confirm o la pregunta del cliente (Acciones destructivas).
| Acción | Nivel | Individual |
|---|---|---|
environment.create |
Free | gitlab_environment_create |
environment.delete |
Free | gitlab_environment_delete |
environment.deployment_approve_or_reject |
Free | gitlab_deployment_approve_or_reject |
environment.deployment_create |
Free | gitlab_deployment_create |
environment.deployment_delete |
Free | gitlab_deployment_delete |
environment.deployment_get |
Free | gitlab_deployment_get |
environment.deployment_list |
Free | gitlab_deployment_list |
environment.deployment_merge_requests |
Free | gitlab_list_deployment_merge_requests |
environment.deployment_update |
Free | gitlab_deployment_update |
environment.freeze_create |
Free | gitlab_create_freeze_period |
environment.freeze_delete |
Free | gitlab_delete_freeze_period |
environment.freeze_get |
Free | gitlab_get_freeze_period |
environment.freeze_list |
Free | gitlab_list_freeze_periods |
environment.freeze_update |
Free | gitlab_update_freeze_period |
environment.get |
Free | gitlab_environment_get |
environment.list |
Free | gitlab_environment_list |
environment.protected_get |
Premium | gitlab_protected_environment_get |
environment.protected_list |
Premium | gitlab_protected_environment_list |
environment.protected_protect |
Premium | gitlab_protected_environment_protect |
environment.protected_unprotect |
Premium | gitlab_protected_environment_unprotect |
environment.protected_update |
Premium | gitlab_protected_environment_update |
environment.stop |
Free | gitlab_environment_stop |
environment.stop_stale |
Free | gitlab_environment_stop_stale |
environment.update |
Free | gitlab_environment_update |
environment.create
Sección titulada «environment.create»Create an environment in a project. Use when introducing new runtime targets such as review, staging, or production environments.
- Meta-herramienta:
gitlab_environment, accióncreate - Herramienta individual:
gitlab_environment_create - Nivel: Free
- Token clásico u OAuth:
api - Token de grano fino: Environment: Create en proyecto (página de permisos)
- Comportamiento: escribe, no idempotente
| Parámetro | Tipo | Requerido | Descripción |
|---|---|---|---|
name |
string |
sí | Environment name (e.g. production, staging) |
project_id |
string/integer |
sí | Project ID or URL-encoded path |
auto_stop_setting |
string (always, with_action) |
no | Auto-stop behavior: always or with_action |
cluster_agent_id |
integer |
no | ID of the cluster agent to associate with this environment |
description |
string |
no | Description of the environment |
external_url |
string |
no | URL of the environment’s external deployment |
flux_resource_path |
string |
no | Flux resource path used to track the environment’s deployment status |
kubernetes_namespace |
string |
no | Kubernetes namespace for the cluster agent |
tier |
string (production, staging, testing, development, other) |
no | Deployment tier: production, staging, testing, development, other |
environment.delete
Sección titulada «environment.delete»Delete a stopped environment from a project. Returns: a success confirmation naming the deleted environment. See also:
environment.stop,environment.list,environment.get.
- Meta-herramienta:
gitlab_environment, accióndelete - Herramienta individual:
gitlab_environment_delete - Nivel: Free
- Token clásico u OAuth:
api - Token de grano fino: Environment: Delete en proyecto (página de permisos)
- Comportamiento: escribe, destructiva (necesita confirmación), idempotente
| Parámetro | Tipo | Requerido | Descripción |
|---|---|---|---|
environment_id |
integer |
sí | Environment ID |
project_id |
string/integer |
sí | Project ID or URL-encoded path |
environment.deployment_approve_or_reject
Sección titulada «environment.deployment_approve_or_reject»Approve or reject a blocked deployment awaiting protected-environment approval, optionally with a comment and an approval rule to represent. Returns: a confirmation message naming the deployment and the applied status. See also:
environment.deployment_get,environment.deployment_update.
- Meta-herramienta:
gitlab_environment, accióndeployment_approve_or_reject - Herramienta individual:
gitlab_deployment_approve_or_reject - Nivel: Free
- Token clásico u OAuth:
api - Token de grano fino: Deployment: Approve en proyecto (página de permisos)
- Comportamiento: escribe, idempotente
| Parámetro | Tipo | Requerido | Descripción |
|---|---|---|---|
deployment_id |
integer |
sí | Deployment ID |
project_id |
string/integer |
sí | Project ID or URL-encoded path |
status |
string (approved, rejected) |
sí | Approval status: approved or rejected |
comment |
string |
no | Optional comment for the approval or rejection |
represented_as |
string |
no | Name of the approval rule to act as, when the user belongs to multiple approval rules |
environment.deployment_create
Sección titulada «environment.deployment_create»Create a deployment record for an environment at a given ref and sha with an initial status. Returns: the created deployment with id, iid, ref, sha, status, and nested user, environment, and deployable objects. See also:
environment.get,environment.deployment_list,environment.deployment_update.
- Meta-herramienta:
gitlab_environment, accióndeployment_create - Herramienta individual:
gitlab_deployment_create - Nivel: Free
- Token clásico u OAuth:
api - Token de grano fino: Deployment: Create en proyecto (página de permisos)
- Comportamiento: escribe, no idempotente
| Parámetro | Tipo | Requerido | Descripción |
|---|---|---|---|
environment |
string |
sí | Name of the environment to deploy to |
project_id |
string/integer |
sí | Project ID or URL-encoded path |
ref |
string |
sí | Git branch or tag to deploy |
sha |
string |
sí | Git SHA to deploy |
status |
string (running, success, failed, canceled) |
sí | Initial deployment status: running or success or failed or canceled. GitLab 19 rejects created when creating a deployment |
tag |
boolean |
sí | Whether the ref is a tag: false for a branch ref, true for a tag ref |
environment.deployment_delete
Sección titulada «environment.deployment_delete»Delete a deployment record by deployment_id within a project. Returns: a confirmation that the deployment was deleted. See also:
environment.deployment_get,environment.deployment_list.
- Meta-herramienta:
gitlab_environment, accióndeployment_delete - Herramienta individual:
gitlab_deployment_delete - Nivel: Free
- Token clásico u OAuth:
api - Token de grano fino: Deployment: Delete en proyecto (página de permisos)
- Comportamiento: escribe, destructiva (necesita confirmación), idempotente
| Parámetro | Tipo | Requerido | Descripción |
|---|---|---|---|
deployment_id |
integer |
sí | Deployment ID |
project_id |
string/integer |
sí | Project ID or URL-encoded path |
environment.deployment_get
Sección titulada «environment.deployment_get»Get one deployment by deployment_id for a project. Use when investigating a specific deployment state, environment, or actor metadata.
- Meta-herramienta:
gitlab_environment, accióndeployment_get - Herramienta individual:
gitlab_deployment_get - Nivel: Free
- Token clásico u OAuth:
read_api(oapi) - Token de grano fino: Deployment: Read en proyecto (página de permisos)
- Comportamiento: solo lectura, idempotente
| Parámetro | Tipo | Requerido | Descripción |
|---|---|---|---|
deployment_id |
integer |
sí | Deployment ID |
project_id |
string/integer |
sí | Project ID or URL-encoded path |
environment.deployment_list
Sección titulada «environment.deployment_list»List deployments in a project with environment, status, and date filters plus offset pagination. Returns: matching deployments with ref, sha, status, user, environment, and deployable (CI job) objects, and pagination metadata. See also:
environment.deployment_get,environment.list,pipeline.get.
- Meta-herramienta:
gitlab_environment, accióndeployment_list - Herramienta individual:
gitlab_deployment_list - Nivel: Free
- Token clásico u OAuth:
read_api(oapi) - Token de grano fino: Deployment: Read en proyecto (página de permisos)
- Comportamiento: solo lectura, idempotente
| Parámetro | Tipo | Requerido | Descripción |
|---|---|---|---|
project_id |
string/integer |
sí | Project ID or URL-encoded path |
environment |
string |
no | Filter by environment name |
finished_after |
string |
no | Return deployments finished after this RFC3339 timestamp (GitLab 14+ only) |
finished_before |
string |
no | Return deployments finished before this RFC3339 timestamp (GitLab 14+ only) |
order_by |
string (id, iid, created_at, updated_at, finished_at, ref) |
no | Order by id or iid or created_at or updated_at or finished_at or ref (default: id) |
page |
integer |
no | Page number to fetch, 1-based. Defaults to 1. Use the next_page field from the previous response to paginate forward. |
per_page |
integer |
no | Items per page. Defaults to 20, minimum 1, maximum 100. Use 100 to minimize round trips when the result set is large. |
sort |
string (asc, desc) |
no | Sort order: asc or desc (default: asc) |
status |
string (created, running, success, failed, canceled, blocked) |
no | Filter by status: created or running or success or failed or canceled |
updated_after |
string |
no | Return deployments updated after this RFC3339 timestamp (GitLab < 14 only) |
updated_before |
string |
no | Return deployments updated before this RFC3339 timestamp (GitLab < 14 only) |
environment.deployment_merge_requests
Sección titulada «environment.deployment_merge_requests»List the merge requests associated with a deployment, with merge-request filtering (state, approval, author, assignee, draft, created date) and offset pagination. Returns: matching merge requests with full metadata (author, assignees, reviewers, labels, milestone, pipelines, time stats, timestamps) and pagination metadata. See also:
merge_request.get,merge_request.list,environment.deployment_list.
- Meta-herramienta:
gitlab_environment, accióndeployment_merge_requests - Herramienta individual:
gitlab_list_deployment_merge_requests - Nivel: Free
- Token clásico u OAuth:
read_api(oapi) - Token de grano fino: Deployment: Read, Merge Request: Read en proyecto (página de permisos)
- Comportamiento: solo lectura, idempotente
| Parámetro | Tipo | Requerido | Descripción |
|---|---|---|---|
deployment_id |
integer |
sí | Deployment ID |
project_id |
string/integer |
sí | Project ID or URL-encoded path |
approved_by_ids |
integer/string[] |
no | Filter by MRs approved by all listed user IDs. Accepts user IDs, or exactly one of “Any” (approved by someone) or “None” (unapproved) |
approved_by_usernames |
string[] |
no | Filter by MRs approved by all listed usernames |
approver_ids |
integer/string[] |
no | Filter by MRs with all listed users as eligible approvers. Accepts user IDs, or exactly one of “Any” (has approvers) or “None” (has none) |
assignee_id |
string/integer |
no | Filter by assignee: a user ID, None for merge requests nobody is assigned, or Any for those somebody is |
assignee_username |
string[] |
no | Filter by assignee usernames: MRs assigned to all of them. GitLab takes one unless the license carries multiple assignees (Premium or Ultimate). Cannot be combined with assignee_id |
author_id |
integer |
no | Filter by author user ID |
author_username |
string |
no | Filter by author username |
created_after |
string |
no | Return MRs created after date (ISO 8601, e.g. 2025-01-01T00:00:00Z) |
created_before |
string |
no | Return MRs created before date (ISO 8601, e.g. 2025-12-31T23:59:59Z) |
deployed_after |
string |
no | Return MRs deployed after date (ISO 8601) |
deployed_before |
string |
no | Return MRs deployed before date (ISO 8601) |
draft |
boolean |
no | Filter by draft status (true=only drafts, false=only non-drafts) |
environment |
string |
no | Filter by MRs deployed to this environment name |
in |
string |
no | Fields the search parameter matches. Accepts title, description, or both joined with a comma. Default is title,description |
labels |
string[] |
no | Label names to filter by |
merge_user_id |
integer |
no | Filter by the user ID of who merged the MR. Cannot be combined with merge_user_username |
merge_user_username |
string |
no | Filter by the username of who merged the MR. Cannot be combined with merge_user_id |
merged_after |
string |
no | Return MRs merged on or after this time (ISO 8601, e.g. 2025-01-01T00:00:00Z) |
merged_before |
string |
no | Return MRs merged on or before this time (ISO 8601, e.g. 2025-12-31T23:59:59Z) |
milestone |
string |
no | Milestone title to filter by |
my_reaction_emoji |
string |
no | Filter by MRs the caller reacted to with this emoji (e.g. thumbsup) |
non_archived |
boolean |
no | Return merge requests from non-archived projects only. Default is true |
not_assignee_id |
integer |
no | Exclude MRs assigned to this user ID |
not_assignee_username |
string[] |
no | Exclude MRs assigned to these usernames. GitLab takes one unless the license carries multiple assignees (Premium or Ultimate) |
not_author_id |
integer |
no | Exclude MRs authored by this user ID |
not_author_username |
string |
no | Exclude MRs authored by this username |
not_labels |
string[] |
no | Label names to exclude |
not_milestone |
string |
no | Exclude MRs in this milestone (its title) |
not_my_reaction_emoji |
string |
no | Exclude MRs the caller reacted to with this emoji (e.g. thumbsup) |
not_reviewer_id |
integer |
no | Exclude MRs with this user ID as a reviewer |
not_reviewer_username |
string |
no | Exclude MRs with this username as a reviewer |
order_by |
string (created_at, updated_at, merged_at, label_priority, priority, milestone_due, popularity, title) |
no | Order by: created_at, updated_at, merged_at, label_priority, priority, milestone_due, popularity, or title (default created_at) |
page |
integer |
no | Page number to fetch, 1-based. Defaults to 1. Use the next_page field from the previous response to paginate forward. |
per_page |
integer |
no | Items per page. Defaults to 20, minimum 1, maximum 100. Use 100 to minimize round trips when the result set is large. |
reviewer_id |
string/integer |
no | Filter by reviewer: a user ID, None for merge requests with no reviewer, or Any for those with one |
reviewer_username |
string |
no | Filter by reviewer username |
scope |
string (created_by_me, assigned_to_me, reviews_for_me, all) |
no | Filter by scope: created_by_me, assigned_to_me, reviews_for_me, or all |
search |
string |
no | Search in title and description |
sort |
string (asc, desc) |
no | Sort order: asc or desc |
source_branch |
string |
no | Filter by source branch name |
state |
string (opened, closed, locked, merged, all) |
no | Filter by state: opened, closed, locked, merged, or all (default all) |
target_branch |
string |
no | Filter by target branch name |
updated_after |
string |
no | Return MRs updated after date (ISO 8601, e.g. 2025-01-01T00:00:00Z) |
updated_before |
string |
no | Return MRs updated before date (ISO 8601, e.g. 2025-12-31T23:59:59Z) |
wip |
string |
no | Filter by draft/WIP status: ‘yes’ for draft MRs, ‘no’ for non-draft |
environment.deployment_update
Sección titulada «environment.deployment_update»Update a deployment’s status by deployment_id within a project. Returns: the updated deployment with id, iid, ref, sha, status, and nested user, environment, and deployable objects. See also:
environment.deployment_get,environment.deployment_list,environment.deployment_approve_or_reject.
- Meta-herramienta:
gitlab_environment, accióndeployment_update - Herramienta individual:
gitlab_deployment_update - Nivel: Free
- Token clásico u OAuth:
api - Token de grano fino: Deployment: Update en proyecto (página de permisos)
- Comportamiento: escribe, idempotente
| Parámetro | Tipo | Requerido | Descripción |
|---|---|---|---|
deployment_id |
integer |
sí | Deployment ID |
project_id |
string/integer |
sí | Project ID or URL-encoded path |
status |
string (running, success, failed, canceled) |
sí | New deployment status: running or success or failed or canceled |
environment.freeze_create
Sección titulada «environment.freeze_create»Create a deploy freeze period for a project. Returns: the created freeze period with id, freeze_start/freeze_end cron expressions, and cron_timezone.
- Meta-herramienta:
gitlab_environment, acciónfreeze_create - Herramienta individual:
gitlab_create_freeze_period - Nivel: Free
- Token clásico u OAuth:
api - Token de grano fino: Freeze Period: Create en proyecto (página de permisos)
- Comportamiento: escribe, no idempotente
| Parámetro | Tipo | Requerido | Descripción |
|---|---|---|---|
freeze_end |
string |
sí | Cron expression for freeze end (e.g. 0 7 * * 1) |
freeze_start |
string |
sí | Cron expression for freeze start (e.g. 0 23 * * 5) |
project_id |
string/integer |
sí | Project ID or URL-encoded path |
cron_timezone |
string |
no | Timezone for cron expressions (e.g. America/New_York) |
environment.freeze_delete
Sección titulada «environment.freeze_delete»Delete a deploy freeze period. Returns: no content on success (HTTP 204).
- Meta-herramienta:
gitlab_environment, acciónfreeze_delete - Herramienta individual:
gitlab_delete_freeze_period - Nivel: Free
- Token clásico u OAuth:
api - Token de grano fino: Freeze Period: Delete en proyecto (página de permisos)
- Comportamiento: escribe, destructiva (necesita confirmación), idempotente
| Parámetro | Tipo | Requerido | Descripción |
|---|---|---|---|
freeze_period_id |
integer |
sí | Freeze period ID |
project_id |
string/integer |
sí | Project ID or URL-encoded path |
environment.freeze_get
Sección titulada «environment.freeze_get»Get a specific deploy freeze period. Returns: the freeze period’s id, freeze_start/freeze_end cron expressions, cron_timezone, and created/updated timestamps.
- Meta-herramienta:
gitlab_environment, acciónfreeze_get - Herramienta individual:
gitlab_get_freeze_period - Nivel: Free
- Token clásico u OAuth:
read_api(oapi) - Token de grano fino: Freeze Period: Read en proyecto (página de permisos)
- Comportamiento: solo lectura, idempotente
| Parámetro | Tipo | Requerido | Descripción |
|---|---|---|---|
freeze_period_id |
integer |
sí | Freeze period ID |
project_id |
string/integer |
sí | Project ID or URL-encoded path |
environment.freeze_list
Sección titulada «environment.freeze_list»List deploy freeze periods for a project. Returns: each freeze period’s id, freeze_start/freeze_end cron expressions, cron_timezone, and created/updated timestamps.
- Meta-herramienta:
gitlab_environment, acciónfreeze_list - Herramienta individual:
gitlab_list_freeze_periods - Nivel: Free
- Token clásico u OAuth:
read_api(oapi) - Token de grano fino: Freeze Period: Read en proyecto (página de permisos)
- Comportamiento: solo lectura, idempotente
| Parámetro | Tipo | Requerido | Descripción |
|---|---|---|---|
project_id |
string/integer |
sí | Project ID or URL-encoded path |
order_by |
string |
no | Column to order results by |
page |
integer |
no | Page number to fetch, 1-based. Defaults to 1. Use the next_page field from the previous response to paginate forward. |
per_page |
integer |
no | Items per page. Defaults to 20, minimum 1, maximum 100. Use 100 to minimize round trips when the result set is large. |
sort |
string (asc, desc) |
no | Sort direction (asc, desc) |
environment.freeze_update
Sección titulada «environment.freeze_update»Update an existing deploy freeze period. Returns: the updated freeze period with id, freeze_start/freeze_end cron expressions, and cron_timezone.
- Meta-herramienta:
gitlab_environment, acciónfreeze_update - Herramienta individual:
gitlab_update_freeze_period - Nivel: Free
- Token clásico u OAuth:
api - Token de grano fino: Freeze Period: Update en proyecto (página de permisos)
- Comportamiento: escribe, idempotente
| Parámetro | Tipo | Requerido | Descripción |
|---|---|---|---|
freeze_period_id |
integer |
sí | Freeze period ID |
project_id |
string/integer |
sí | Project ID or URL-encoded path |
cron_timezone |
string |
no | Timezone for cron expressions |
freeze_end |
string |
no | Cron expression for freeze end |
freeze_start |
string |
no | Cron expression for freeze start |
environment.get
Sección titulada «environment.get»Get one environment by environment_id. Use when inspecting state, tier, external URL, and stop behavior of a specific environment.
- Meta-herramienta:
gitlab_environment, acciónget - Herramienta individual:
gitlab_environment_get - Nivel: Free
- Token clásico u OAuth:
read_api(oapi) - Token de grano fino: Environment: Read en proyecto (página de permisos)
- Comportamiento: solo lectura, idempotente
| Parámetro | Tipo | Requerido | Descripción |
|---|---|---|---|
environment_id |
integer |
sí | Environment ID |
project_id |
string/integer |
sí | Project ID or URL-encoded path |
environment.list
Sección titulada «environment.list»List environments in one project with filters and pagination. Use this to discover environment IDs before get/update/stop/delete operations.
- Meta-herramienta:
gitlab_environment, acciónlist - Herramienta individual:
gitlab_environment_list - Nivel: Free
- Token clásico u OAuth:
read_api(oapi) - Token de grano fino: Environment: Read en proyecto (página de permisos)
- Comportamiento: solo lectura, idempotente
| Parámetro | Tipo | Requerido | Descripción |
|---|---|---|---|
project_id |
string/integer |
sí | Project ID or URL-encoded path |
name |
string |
no | Filter by exact environment name |
order_by |
string |
no | Column to order results by (e.g. id, name) |
page |
integer |
no | Page number to fetch, 1-based. Defaults to 1. Use the next_page field from the previous response to paginate forward. |
per_page |
integer |
no | Items per page. Defaults to 20, minimum 1, maximum 100. Use 100 to minimize round trips when the result set is large. |
search |
string |
no | Search environments by name (fuzzy) |
sort |
string (asc, desc) |
no | Sort order: asc or desc |
states |
string (available, stopping, stopped) |
no | Filter by state: available, stopping, stopped |
environment.protected_get
Sección titulada «environment.protected_get»Get a single protected (or wildcard) environment by name. Returns: the environment with its deploy access levels (id, access level, user/group, group inheritance) and approval rules. See also:
environment.protected_list,environment.protected_update,environment.protected_unprotect.
- Meta-herramienta:
gitlab_environment, acciónprotected_get - Herramienta individual:
gitlab_protected_environment_get - Nivel: Premium
- Token clásico u OAuth:
read_api(oapi) - Token de grano fino: Protected Environment: Read en proyecto (página de permisos)
- Comportamiento: solo lectura, idempotente
| Parámetro | Tipo | Requerido | Descripción |
|---|---|---|---|
environment |
string |
sí | Environment name |
project_id |
string/integer |
sí | Project ID or URL-encoded path |
environment.protected_list
Sección titulada «environment.protected_list»List protected environments in a project with order_by/sort and offset pagination. Returns: protected environments with their deploy access levels, required approval count, approval rules, and pagination metadata. See also:
environment.protected_get,environment.protected_protect,environment.list.
- Meta-herramienta:
gitlab_environment, acciónprotected_list - Herramienta individual:
gitlab_protected_environment_list - Nivel: Premium
- Token clásico u OAuth:
read_api(oapi) - Token de grano fino: Protected Environment: Read en proyecto (página de permisos)
- Comportamiento: solo lectura, idempotente
| Parámetro | Tipo | Requerido | Descripción |
|---|---|---|---|
project_id |
string/integer |
sí | Project ID or URL-encoded path |
order_by |
string |
no | Column to order results by |
page |
integer |
no | Page number to fetch, 1-based. Defaults to 1. Use the next_page field from the previous response to paginate forward. |
per_page |
integer |
no | Items per page. Defaults to 20, minimum 1, maximum 100. Use 100 to minimize round trips when the result set is large. |
sort |
string (asc, desc) |
no | Sort direction (asc, desc) |
environment.protected_protect
Sección titulada «environment.protected_protect»Protect a single environment or wildcard with deploy access levels, each naming exactly one of access_level, user_id or group_id, and approval rules, each naming at least one. Returns: the newly protected environment with its deploy access levels, required approval count, and approval rules. See also:
environment.protected_get,environment.protected_update,environment.protected_unprotect.
- Meta-herramienta:
gitlab_environment, acciónprotected_protect - Herramienta individual:
gitlab_protected_environment_protect - Nivel: Premium
- Token clásico u OAuth:
api - Token de grano fino: Protected Environment: Create en proyecto (página de permisos)
- Comportamiento: escribe, no idempotente
| Parámetro | Tipo | Requerido | Descripción |
|---|---|---|---|
deploy_access_levels |
object[] |
sí | Who may deploy: at least one entry, each naming exactly one of access_level, user_id or group_id |
name |
string |
sí | Environment name to protect |
project_id |
string/integer |
sí | Project ID or URL-encoded path |
approval_rules |
object[] |
no | Who must approve a deployment: each rule names at least one of access_level, user_id or group_id |
required_approval_count |
integer |
no | Deprecated: GitLab refuses any value but 0. Require approvals with required_approvals on approval_rules instead. |
environment.protected_unprotect
Sección titulada «environment.protected_unprotect»Unprotect a single environment or wildcard, removing its deployment gates. Returns: a success confirmation naming the unprotected environment. See also:
environment.protected_list,environment.protected_protect.
- Meta-herramienta:
gitlab_environment, acciónprotected_unprotect - Herramienta individual:
gitlab_protected_environment_unprotect - Nivel: Premium
- Token clásico u OAuth:
api - Token de grano fino: Protected Environment: Delete en proyecto (página de permisos)
- Comportamiento: escribe, destructiva (necesita confirmación), idempotente
| Parámetro | Tipo | Requerido | Descripción |
|---|---|---|---|
environment |
string |
sí | Environment name to unprotect |
project_id |
string/integer |
sí | Project ID or URL-encoded path |
environment.protected_update
Sección titulada «environment.protected_update»Update a protected environment’s deploy access levels and approval rules. An entry with the id of an existing one changes it, or removes it with _destroy true, and an entry without an id adds one: a new deploy access level names exactly one of access_level, user_id or group_id, and every approval rule but a removal names at least one. Returns: the updated environment with its deploy access levels, required approval count, and approval rules. See also:
environment.protected_get,environment.protected_protect,environment.protected_unprotect.
- Meta-herramienta:
gitlab_environment, acciónprotected_update - Herramienta individual:
gitlab_protected_environment_update - Nivel: Premium
- Token clásico u OAuth:
api - Token de grano fino: Protected Environment: Update en proyecto (página de permisos)
- Comportamiento: escribe, idempotente
| Parámetro | Tipo | Requerido | Descripción |
|---|---|---|---|
environment |
string |
sí | Environment name |
project_id |
string/integer |
sí | Project ID or URL-encoded path |
approval_rules |
object[] |
no | Approval rules to add, change or remove: a rule with the id of an existing one changes it, or removes it with _destroy true, and a rule without an id adds one. A rule that is not removed names at least one of access_level, user_id or group_id, and may name more than one |
deploy_access_levels |
object[] |
no | Deploy access levels to add, change or remove: an entry with the id of an existing one changes it, or removes it with _destroy true, and an entry without an id adds one. An entry names at most one of access_level, user_id or group_id, and one of them when it has no id |
name |
string |
no | New environment name |
required_approval_count |
integer |
no | Deprecated: GitLab refuses any value but 0. Require approvals with required_approvals on approval_rules instead. |
environment.stop
Sección titulada «environment.stop»Stop an active environment. This is modeled as a delete-style action but intentionally marked non-destructive because it changes runtime state without deleting the environment resource.
- Meta-herramienta:
gitlab_environment, acciónstop - Herramienta individual:
gitlab_environment_stop - Nivel: Free
- Token clásico u OAuth:
api - Token de grano fino: Environment: Stop en proyecto (página de permisos)
- Comportamiento: escribe, destructiva (necesita confirmación), idempotente
| Parámetro | Tipo | Requerido | Descripción |
|---|---|---|---|
environment_id |
integer |
sí | Environment ID |
project_id |
string/integer |
sí | Project ID or URL-encoded path |
force |
boolean |
no | Force stop even if environment has active deployments |
environment.stop_stale
Sección titulada «environment.stop_stale»Stop every environment of a project last modified or deployed to before a time, protected environments excepted, and the stops run in the background. Returns: the request’s status and GitLab’s message. See also:
environment.list,environment.stop,environment.delete.
- Meta-herramienta:
gitlab_environment, acciónstop_stale - Herramienta individual:
gitlab_environment_stop_stale - Nivel: Free
- Token clásico u OAuth:
api - Token de grano fino: Environment: Stop en proyecto (página de permisos)
- Comportamiento: escribe, destructiva (necesita confirmación), idempotente
| Parámetro | Tipo | Requerido | Descripción |
|---|---|---|---|
before |
string |
sí | Stop the environments last modified or deployed to before this time (ISO 8601 format). GitLab takes a time between 10 years ago and 1 week ago |
project_id |
string/integer |
sí | Project ID or URL-encoded path |
environment.update
Sección titulada «environment.update»Update an existing environment in a project. Returns: the updated environment with state, tier, external URL, cluster agent, Kubernetes namespace, Flux resource path, and auto-stop settings. See also:
environment.get,environment.list,environment.stop.
- Meta-herramienta:
gitlab_environment, acciónupdate - Herramienta individual:
gitlab_environment_update - Nivel: Free
- Token clásico u OAuth:
api - Token de grano fino: Environment: Update en proyecto. Algunas llamadas también necesitan: Environment: Read en proyecto (página de permisos)
- Comportamiento: escribe, idempotente
| Parámetro | Tipo | Requerido | Descripción |
|---|---|---|---|
environment_id |
integer |
sí | Environment ID |
project_id |
string/integer |
sí | Project ID or URL-encoded path |
auto_stop_setting |
string (always, with_action) |
no | Auto-stop behavior: always or with_action |
cluster_agent_id |
integer |
no | ID of the cluster agent to associate with this environment |
description |
string |
no | Updated description. Pass an empty string to remove it. Omit the field to leave it untouched |
external_url |
string |
no | Updated external URL. Pass an empty string to remove it. Omit the field to leave it untouched |
flux_resource_path |
string |
no | Flux resource path used to track the environment’s deployment status. Pass an empty string to remove it. Omit the field to leave it untouched |
kubernetes_namespace |
string |
no | Kubernetes namespace for the cluster agent. Pass an empty string to remove it, together with flux_resource_path as an empty string when the environment has a Flux path, since GitLab keeps no Flux path without a namespace. Omit the field to leave it untouched |
name |
string |
no | New environment name |
tier |
string (production, staging, testing, development, other) |
no | Updated tier: production, staging, testing, development, other |