FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [View Raw Code]   [Original HTTPS Page]

python-gitlab/docs/gl_objects/environments.rst at v8.1.0 · python-gitlab/python-gitlab · GitHub

Repository navigation

Latest commit

 

History

History
46 lines (28 loc) · 988 Bytes

File metadata and controls

46 lines (28 loc) · 988 Bytes

Environments

Reference

  • v4 API:
    • :class:`gitlab.v4.objects.ProjectEnvironment`
    • :class:`gitlab.v4.objects.ProjectEnvironmentManager`
    • :attr:`gitlab.v4.objects.Project.environments`
  • GitLab API: https://docs.gitlab.com/api/environments

Examples

List environments for a project:

environments = project.environments.list(get_all=True)

Create an environment for a project:

environment = project.environments.create({'name': 'production'})

Retrieve a specific environment for a project:

environment = project.environments.get(112)

Update an environment for a project:

environment.external_url = 'http://foo.bar.com'
environment.save()

Delete an environment for a project:

environment = project.environments.delete(environment_id)
# or
environment.delete()

Stop an environment:

environment.stop()

To manage protected environments, see :doc:`/gl_objects/protected_environments`.


Back | FazBrowse Home | New Git URL