module Gitlab::Client::Environments

def create_environment(project, env_name, options = {})

Returns:
  • (Gitlab::ObjectifiedHash) - The updated environment.

Options Hash: (**options)
  • :external_url (String) -- Optional URL for viewing the deployed project in this environment

Parameters:
  • env_name (String) -- Name for the environment
  • project (Integer, String) -- The ID or name of a project.
def create_environment(project, env_name, options = {})
  body = { name: env_name }.merge(options)
  post("/projects/#{url_encode project}/environments", body: body)
end

def delete_environment(project, id)

Returns:
  • (Gitlab::ObjectifiedHash) - Information about the deleted environment.

Parameters:
  • id (Integer) -- The ID of an environment.
  • project (Integer, String) -- The ID or name of a project.
def delete_environment(project, id)
  delete("/projects/#{url_encode project}/environments/#{id}")
end

def edit_environment(project, id, options = {})

Returns:
  • (Gitlab::ObjectifiedHash) - The updated environment.

Options Hash: (**options)
  • external_url (String) -- Optional URL for viewing the deployed project in this environment
  • env_name (String) -- Name for the environment

Parameters:
  • options (Hash) -- A hash of the attribute keys & values to update.
  • id (Integer) -- The ID of an environment.
  • project (Integer, String) -- The ID or name of a project.
def edit_environment(project, id, options = {})
  put("/projects/#{url_encode project}/environments/#{id}", body: options)
end

def environment(project, id)

Returns:
  • (Gitlab::ObjectifiedHash) -

Parameters:
  • id (Integer) -- The ID of an environment.
  • project (Integer, String) -- The ID or name of a project.
def environment(project, id)
  get("/projects/#{url_encode project}/environments/#{id}")
end

def environments(project, options = {})

Returns:
  • (Array) -

Options Hash: (**options)
  • :per_page (Integer) -- The number of results per page.
  • :page (Integer) -- The page number.

Parameters:
  • options (Hash) -- A customizable set of options.
  • project (Integer, String) -- The ID or name of a project.
def environments(project, options = {})
  get("/projects/#{url_encode project}/environments", query: options)
end

def stop_environment(project, id)

Returns:
  • (Array) - The stopped environment.

Parameters:
  • id (Integer) -- The ID of an environment.
  • project (Integer, String) -- The ID or name of a project.
def stop_environment(project, id)
  post("/projects/#{url_encode project}/environments/#{id}/stop")
end