ExDoppler.Environments (ExDoppler v1.0.1)
View SourceModule for interacting with ExDoppler.Environment
๐ Resources
- ๐ Doppler docs
- ๐ Doppler API docs
- ๐ฌ Contact the maintainer (he's happy to help!)
Summary
Functions
Creates a new ExDoppler.Environment
Same as create_environment/4
but won't wrap a successful response in {:ok, response}
Same as delete_environment/1
but won't wrap a successful response in {:ok, response}
Same as get_environment/2
but won't wrap a successful response in {:ok, response}
Lists ExDoppler.Environment
using pagination.
Same as list_environments/2
but won't wrap a successful response in {:ok, response}
Updates an ExDoppler.Environment
, given a project name, a env slug and options detailing modifications
Same as update_environment/2
but won't wrap a successful response in {:ok, response}
Functions
Creates a new ExDoppler.Environment
๐ท๏ธ Params
- project_name: The relevant project name (e.g
"example-project"
) - env_name: A new environment's name (e.g
"prd"
) - env_slug: A new environment's slug (e.g
"prd"
) - enable_personal_config: Optional setting if this environment has personal configs (default:
false
)
โคต๏ธ Returns
โ On Success
{:ok, %ExDoppler.Environment{...}}
โ On Failure
{:error, err}
๐ป Examples
iex> alias ExDoppler.Environments
iex> alias ExDoppler.Environment
iex> alias ExDoppler.Projects
iex> [project | _] = Projects.list_projects!()
iex> _ = Environments.delete_environment(%Environment{project: project.name, slug: "envdoc"})
iex> {:ok, env} = Environments.create_environment(project, "envdoc", "envdoc")
iex> :ok = Environments.delete_environment!(env)
๐ Resources
- ๐ Doppler API docs
- ๐ฌ Contact the maintainer (he's happy to help!)
Same as create_environment/4
but won't wrap a successful response in {:ok, response}
Deletes a ExDoppler.Environment
๐ท๏ธ Params
- environment: The relevant environment (e.g
%Environment{project: "example-project", slug: "dev" ...}
)
โคต๏ธ Returns
โ On Success
{:ok, {:success, true}}
โ On Failure
{:error, err}
๐ป Examples
iex> alias ExDoppler.Environments
iex> alias ExDoppler.Environment
iex> alias ExDoppler.Projects
iex> [project | _] = Projects.list_projects!()
iex> _ = Environments.delete_environment(%Environment{project: project.name, slug: "envdoc"})
iex> {:ok, env} = Environments.create_environment(project, "envdoc", "envdoc")
iex> {:ok, {:success, true}} = Environments.delete_environment(env)
๐ Resources
- ๐ Doppler API docs
- ๐ฌ Contact the maintainer (he's happy to help!)
Same as delete_environment/1
but won't wrap a successful response in {:ok, response}
Retrieves a ExDoppler.Environment
๐ท๏ธ Params
- project_name: The relevant project name (e.g
"example-project"
) - config_name: The environment to get (e.g
"dev"
)
โคต๏ธ Returns
โ On Success
{:ok, %ExDoppler.Environment{...}}
โ On Failure
{:error, err}
๐ป Examples
iex> alias ExDoppler.Environments
iex> alias ExDoppler.Projects
iex> [project | _] = Projects.list_projects!()
iex> {:ok, _env} = Environments.get_environment(project, "dev")
๐ Resources
- ๐ Doppler API docs
- ๐ฌ Contact the maintainer (he's happy to help!)
Same as get_environment/2
but won't wrap a successful response in {:ok, response}
Lists ExDoppler.Environment
using pagination.
๐ท๏ธ Params
- project: The
ExDoppler.Project
for which you want the environments (e.g%Project{name: "example-project"}
) - opts: Optional modifications to the list call
- page - which page to list (starts at 1) (e.g
page: 2
). Default:1
- per_page - the number of
ExDoppler.Environment
to return for this page (e.gper_page: 50
). Default:20
- page - which page to list (starts at 1) (e.g
โคต๏ธ Returns
โ On Success
{:ok, [%ExDoppler.Environment{...}]}
โ On Failure
{:error, err}
๐ป Examples
iex> alias ExDoppler.Environments
iex> alias ExDoppler.Projects
iex> [project | _] = Projects.list_projects!()
iex> {:ok, _envs} = Environments.list_environments(project, page: 1, per_page: 20)
๐ Resources
- ๐ Doppler API docs
- ๐ฌ Contact the maintainer (he's happy to help!)
Same as list_environments/2
but won't wrap a successful response in {:ok, response}
Updates an ExDoppler.Environment
, given a project name, a env slug and options detailing modifications
๐ท๏ธ Params
- environment: The relevant environment (e.g
%Environment{project: "example-project", slug: "dev" ...}
) - opts: Optional modifications
- name - New name for this environment
- slug - New slug for this environment
- personal_configs - If set true, will enable personal configs
โคต๏ธ Returns
โ On Success
{:ok, %ExDoppler.Environment{...}}
โ On Failure
{:error, err}
๐ป Examples
iex> alias ExDoppler.Environments
iex> alias ExDoppler.Environment
iex> alias ExDoppler.Projects
iex> [project | _] = Projects.list_projects!()
iex> _ = Environments.delete_environment(%Environment{project: project.name, slug: "envdoc"})
iex> _ = Environments.delete_environment(%Environment{project: project.name, slug: "envdoc2"})
iex> {:ok, env} = Environments.create_environment(project, "envdoc", "envdoc")
iex> {:ok, updated} = Environments.update_environment(env, name: "envdoc2", personal_configs: true)
iex> :ok = Environments.delete_environment!(updated)
๐ Resources
- ๐ Doppler API docs
- ๐ฌ Contact the maintainer (he's happy to help!)
Same as update_environment/2
but won't wrap a successful response in {:ok, response}