Help us learn about your current experience with the documentation. Take the survey.

计划限制 API

  • 版本:Free, Premium, Ultimate
  • 提供:GitLab 自托管

使用此 API 与您现有订阅计划的应用限制进行交互。

现有计划取决于 GitLab 版本。在社区版中,只有 default 计划可用。在企业版中,还有其他可用计划。

先决条件:

  • 您必须拥有实例的管理员权限。

获取当前计划限制

列出 GitLab 实例上某个计划的当前限制。

GET /application/plan_limits
属性 类型 必需 描述
plan_name string 要获取限制的计划名称。默认值:default
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/application/plan_limits"

示例响应:

{
  "ci_instance_level_variables": 25,
  "ci_pipeline_size": 0,
  "ci_active_jobs": 0,
  "ci_project_subscriptions": 2,
  "ci_pipeline_schedules": 10,
  "ci_needs_size_limit": 50,
  "ci_registered_group_runners": 1000,
  "ci_registered_project_runners": 1000,
  "dotenv_size": 5120,
  "dotenv_variables": 20,
  "conan_max_file_size": 3221225472,
  "enforcement_limit": 10000,
  "generic_packages_max_file_size": 5368709120,
  "helm_max_file_size": 5242880,
  "notification_limit": 10000,
  "maven_max_file_size": 3221225472,
  "npm_max_file_size": 524288000,
  "nuget_max_file_size": 524288000,
  "pipeline_hierarchy_size": 1000,
  "pypi_max_file_size": 3221225472,
  "terraform_module_max_file_size": 1073741824,
  "storage_size_limit": 15000
}

修改计划限制

修改 GitLab 实例上某个计划的限制。

PUT /application/plan_limits
属性 类型 必需 描述
plan_name string 要更新的计划名称。
ci_instance_level_variables integer 可以定义的实例级 CI/CD 变量的最大数量。
ci_pipeline_size integer 单个管道中的作业最大数量。在 GitLab 15.0 中引入
ci_active_jobs integer 当前活动管道中的作业总数。在 GitLab 15.0 中引入
ci_project_subscriptions integer 项目间管道订阅的最大数量。在 GitLab 15.0 中引入
ci_pipeline_schedules integer 管道计划的最大数量。在 GitLab 15.0 中引入
ci_needs_size_limit integer 作业可以拥有的 needs 依赖项的最大数量。在 GitLab 15.0 中引入
ci_registered_group_runners integer 过去七天内组中创建或处于活动状态的 runner 最大数量。在 GitLab 15.0 中引入
ci_registered_project_runners integer 过去七天内项目中创建或处于活动状态的 runner 最大数量。在 GitLab 15.0 中引入
dotenv_size integer dotenv 工件的最大大小(字节)。在 GitLab 17.1 中引入
dotenv_variables integer dotenv 工件中的变量最大数量。在 GitLab 17.1 中引入
conan_max_file_size integer Conan 包文件的最大大小(字节)。
enforcement_limit integer 根命名空间限制执行的存储大小上限(MiB)。
generic_packages_max_file_size integer 通用包文件的最大大小(字节)。
helm_max_file_size integer Helm 图表文件的最大大小(字节)。
maven_max_file_size integer Maven 包文件的最大大小(字节)。
notification_limit integer 根命名空间限制通知的存储大小上限(MiB)。
npm_max_file_size integer NPM 包文件的最大大小(字节)。
nuget_max_file_size integer NuGet 包文件的最大大小(字节)。
pipeline_hierarchy_size integer 管道层次结构树中下游管道的最大数量。默认值:1000。大于 1000 的值不推荐
pypi_max_file_size integer PyPI 包文件的最大大小(字节)。
terraform_module_max_file_size integer Terraform 模块包文件的最大大小(字节)。
storage_size_limit integer 根命名空间的存储大小上限(MiB)。
curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/application/plan_limits?plan_name=default&conan_max_file_size=3221225472"

示例响应:

{
  "ci_instance_level_variables": 25,
  "ci_pipeline_size": 0,
  "ci_active_jobs": 0,
  "ci_project_subscriptions": 2,
  "ci_pipeline_schedules": 10,
  "ci_needs_size_limit": 50,
  "ci_registered_group_runners": 1000,
  "ci_registered_project_runners": 1000,
  "conan_max_file_size": 3221225472,
  "dotenv_variables": 20,
  "dotenv_size": 5120,
  "generic_packages_max_file_size": 5368709120,
  "helm_max_file_size": 5242880,
  "maven_max_file_size": 3221225472,
  "npm_max_file_size": 524288000,
  "nuget_max_file_size": 524288000,
  "pipeline_hierarchy_size": 1000,
  "pypi_max_file_size": 3221225472,
  "terraform_module_max_file_size": 1073741824
}