Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Protected Environments Group Level #3168

Open
@xakepnz

Description

@xakepnz

Protected Environments at the Group level

Feature Request to create the group level protected environments list on the Group class.

The ability exists over API to query this:

curl --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/groups/:id/protected_environments"
[
  {
    "name": "development",
    "deploy_access_levels": [
      {
        "id": 1234567,
        "access_level": 40,
        "access_level_description": "Maintainers",
        "user_id": null,
        "group_id": null,
        "group_inheritance_type": 0
      }
    ],
    "required_approval_count": 0,
    "approval_rules": []
  }
]
...

e.g.

>>> group = gl.groups.get('56')
>>> pe = group.protected_environments.list(get_all=False)
>>> from pprint import pprint
>>> for e in pe):
>>> pprint(e)
{
  "name": "development",
  "deploy_access_levels": [
    {
      "id": 1234567,
      "access_level": 40,
      "access_level_description": "Maintainers",
      "user_id": null,
      "group_id": null,
      "group_inheritance_type": 0
    }
  ],
  "required_approval_count": 0,
  "approval_rules": []
}
...

ref: https://gitlab.com/gitlab-security-oss/cis/gitlabcis/-/issues/125

Specifications

  • python-gitlab version: 5.6.0
  • Gitlab server version (or gitlab.com): GitLab Enterprise Edition 17.11.0-pre 76ac92593a5

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions