https://pulumi.com logo
#python
Title
g

green-school-95910

08/28/2020, 8:34 PM
Copy code
environments = gitlab_repo.id.apply(lambda repo_id:
      <http://requests.post|requests.post>(f"<https://gitlab.com/api/v4/projects/{repo_id}/environments>",
        data={
          "name": "dev",
          "state": "available"
        },
        headers={
          "PRIVATE-TOKEN": "xxxxx"
        }
      ).json() # <= This will get the json response as a dictionary
    )