ExDoppler.Configs (ExDoppler v1.0.0)

View Source

Module for interacting with ExDoppler.Config

๐Ÿ“– Resources

Summary

Functions

Same as clone_config/3 but won't wrap a successful response in {:ok, response}

Same as create_config/3 but won't wrap a successful response in {:ok, response}

Same as delete_config/2 but won't wrap a successful response in {:ok, response}

Same as get_config/2 but won't wrap a successful response in {:ok, response}

Same as list_configs/2 but won't wrap a successful response in {:ok, response}

Locks a ExDoppler.Config (no modifications allowed)

Same as lock_config/2 but won't wrap a successful response in {:ok, response}

Same as rename_config/3 but won't wrap a successful response in {:ok, response}

Same as set_config_inheritable/3 but won't wrap a successful response in {:ok, response}

Same as unlock_config/2 but won't wrap a successful response in {:ok, response}

Functions

clone_config(project_name, source_config, new_config_name)

Clones a ExDoppler.Config to a new Config

๐Ÿท๏ธ Params

  • project_name: The relevant project name (e.g "example-project")
  • source_config: The config to clone (e.g "prd_aws")
  • new_config_name: The config name to clone (e.g "prd_aws2")

โคต๏ธ Returns

โœ… On Success

  {:ok, %ExDoppler.Config{...}}

โŒ On Failure

  {:err, err}

๐Ÿ’ป Examples

iex> alias ExDoppler.Configs
iex> _ = Configs.delete_config!("example-project", "dev_doc")
iex> _ = Configs.delete_config!("example-project", "dev_doc2")
iex> {:ok, _config} = Configs.create_config("example-project", "dev", "dev_doc")
iex> {:ok, _config} = Configs.clone_config("example-project", "dev_doc", "dev_doc2")
iex> :ok = Configs.delete_config!("example-project", "dev_doc")
iex> :ok = Configs.delete_config!("example-project", "dev_doc2")

๐Ÿ“– Resources

clone_config!(project_name, source_config, new_config_name)

Same as clone_config/3 but won't wrap a successful response in {:ok, response}

create_config(project_name, environment_id, config_name)

Creates a new ExDoppler.Config

๐Ÿท๏ธ Params

  • project_name: The relevant project name (e.g "example-project")
  • environment_id: The relevant environment id (e.g "prd")
  • config_name: The config name to make (e.g "prd_aws")

โคต๏ธ Returns

โœ… On Success

  {:ok, %ExDoppler.Config{...}}

โŒ On Failure

  {:err, err}

๐Ÿ’ป Examples

iex> alias ExDoppler.Configs
iex> _ = Configs.delete_config!("example-project", "dev_doc")
iex> {:ok, _config} = Configs.create_config("example-project", "dev", "dev_doc")
iex> {:ok, _config} = Configs.get_config("example-project", "dev_doc")
iex> {:ok, _} = Configs.delete_config("example-project", "dev_doc")

๐Ÿ“– Resources

create_config!(project_name, environment_id, config_name)

Same as create_config/3 but won't wrap a successful response in {:ok, response}

delete_config(project_name, config_name)

Deletes a ExDoppler.Config

๐Ÿท๏ธ Params

  • project_name: The relevant project name (e.g "example-project")
  • config_name: The config to delete (e.g "prd_aws")

โคต๏ธ Returns

โœ… On Success

  {:ok, {:success, true}}

โŒ On Failure

  {:err, err}

๐Ÿ’ป Examples

iex> alias ExDoppler.Configs
iex> alias ExDoppler.Config
iex> _ = Configs.delete_config!("example-project", "dev_doc")
iex> {:ok, _config} = Configs.create_config("example-project", "dev", "dev_doc")
iex> {:ok, {:success, true}} = Configs.delete_config("example-project", "dev_doc")

๐Ÿ“– Resources

delete_config!(project_name, config_name)

Same as delete_config/2 but won't wrap a successful response in {:ok, response}

get_config(project_name, config_name)

Retrieves a ExDoppler.Config

๐Ÿท๏ธ Params

  • project_name: The relevant project name (e.g "example-project")
  • config_name: The config name to get (e.g "dev_personal")

โคต๏ธ Returns

โœ… On Success

  {:ok, %ExDoppler.Config{...}}

โŒ On Failure

  {:err, err}

๐Ÿ’ป Examples

iex> alias ExDoppler.Configs
iex> {:ok, _config} = Configs.get_config("example-project", "dev")

๐Ÿ“– Resources

get_config!(project_name, config_name)

Same as get_config/2 but won't wrap a successful response in {:ok, response}

list_configs(project, opts \\ [])

Lists ExDoppler.Config using pagination.

๐Ÿท๏ธ Params

  • project: The ExDoppler.Project for which you want the configs (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.Config to return for this page (e.g per_page: 50). Default: 20

โคต๏ธ Returns

โœ… On Success

  {:ok, [%ExDoppler.Config{...}]}

โŒ On Failure

  {:err, err}

๐Ÿ’ป Examples

iex> alias ExDoppler.Configs
iex> alias ExDoppler.Projects
iex> [project | _] = Projects.list_projects!()
iex> {:ok, _configs} = Configs.list_configs(project, page: 1, per_page: 20)

๐Ÿ“– Resources

list_configs!(project, opts \\ [])

Same as list_configs/2 but won't wrap a successful response in {:ok, response}

list_trusted_ips(project_name, config_name)

lock_config(project_name, config_name)

Locks a ExDoppler.Config (no modifications allowed)

๐Ÿท๏ธ Params

  • project_name: The relevant project name (e.g "example-project")
  • config_name: The config to lock (e.g "prd_aws")

โคต๏ธ Returns

โœ… On Success

  {:ok, %ExDoppler.Config{...}}

โŒ On Failure

  {:err, err}

๐Ÿ’ป Examples

iex> alias ExDoppler.Configs
iex> alias ExDoppler.Config
iex> _ = Configs.delete_config!("example-project", "dev_doc")
iex> {:ok, _config} = Configs.create_config("example-project", "dev", "dev_doc")
iex> {:ok, %Config{locked: true}} = Configs.lock_config("example-project", "dev_doc")
iex> {:ok, %Config{locked: false}} = Configs.unlock_config("example-project", "dev_doc")
iex> :ok = Configs.delete_config!("example-project", "dev_doc")

๐Ÿ“– Resources

lock_config!(project_name, config_name)

Same as lock_config/2 but won't wrap a successful response in {:ok, response}

rename_config(project_name, current_config_name, new_config_name)

Renames a ExDoppler.Config

๐Ÿท๏ธ Params

  • project_name: The relevant project name (e.g "example-project")
  • current_config_name: The relevant environment id (e.g "prd_aws")
  • new_config_name: The new config name (e.g "prd_gcp")

โคต๏ธ Returns

โœ… On Success

  {:ok, %ExDoppler.Config{...}}

โŒ On Failure

  {:err, err}

๐Ÿ’ป Examples

iex> alias ExDoppler.Configs
iex> _ = Configs.delete_config!("example-project", "dev_doc")
iex> _ = Configs.delete_config!("example-project", "dev_doc2")
iex> {:ok, _config} = Configs.create_config("example-project", "dev", "dev_doc")
iex> {:ok, _config} = Configs.rename_config("example-project", "dev_doc", "dev_doc2")
iex> {:ok, _} = Configs.delete_config("example-project", "dev_doc2")

๐Ÿ“– Resources

rename_config!(project_name, current_config_name, new_config_name)

Same as rename_config/3 but won't wrap a successful response in {:ok, response}

set_config_inheritable(project_name, config_name, is_inheritable)

set_config_inheritable!(project_name, config_name, is_inheritable)

Same as set_config_inheritable/3 but won't wrap a successful response in {:ok, response}

unlock_config(project_name, config_name)

Unlocks a ExDoppler.Config (modifications allowed)

๐Ÿท๏ธ Params

  • project_name: The relevant project name (e.g "example-project")
  • config_name: The config to unlock (e.g "prd_aws")

โคต๏ธ Returns

โœ… On Success

  {:ok, %ExDoppler.Config{...}}

โŒ On Failure

  {:err, err}

๐Ÿ’ป Examples

iex> alias ExDoppler.Configs
iex> alias ExDoppler.Config
iex> _ = Configs.delete_config!("example-project", "dev_doc")
iex> {:ok, _config} = Configs.create_config("example-project", "dev", "dev_doc")
iex> {:ok, %Config{locked: true}} = Configs.lock_config("example-project", "dev_doc")
iex> {:ok, %Config{locked: false}} = Configs.unlock_config("example-project", "dev_doc")
iex> :ok = Configs.delete_config!("example-project", "dev_doc")

๐Ÿ“– Resources

unlock_config!(project_name, config_name)

Same as unlock_config/2 but won't wrap a successful response in {:ok, response}