Module eetcd_auth

Function Index

auth_disable/1AuthDisable disables auth of an etcd cluster.
auth_enable/1AuthEnable enables auth of an etcd cluster.
new/1Create context for request.
role_add/2RoleAdd adds a new role to an etcd cluster.
role_delete/2RoleDelete deletes a role.
role_get/2RoleGet gets a detailed information of a role.
role_grant_permission/5RoleGrantPermission grants a permission to a role.
role_list/1RoleList gets a list of all roles.
role_revoke_permission/4RoleRevokePermission revokes a permission from a role.
user_add/2UserAdd adds a new user without password to an etcd cluster.
user_add/3UserAdd adds a new user with password to an etcd cluster.
user_change_password/3UserChangePassword changes a password of a user.
user_delete/2UserDelete deletes a user from an etcd cluster.
user_get/2UserGet gets a detailed information of a user.
user_grant_role/3UserGrantRole grants a role to a user.
user_list/1UserList gets a list of all users.
user_revoke_role/3UserRevokeRole revokes a role of a user.
with_timeout/2Timeout is an integer greater than zero which specifies how many milliseconds to wait for a reply, or the atom infinity to wait indefinitely.

Function Details

auth_disable/1

auth_disable(Context::name() | context()) -> {ok, router_pb:'Etcd.AuthDisableResponse'()} | {error, eetcd_error()}

AuthDisable disables auth of an etcd cluster.

1.base
eetcd_auth:auth_disable(ConnName)
2.elixir
   :eetcd_auth.new(connName)
   |> :eetcd_auth.with_timeout(6000)
   |> :eetcd_auth.auth_disable()
eetcd_auth:with_timeout/2 eetcd_auth:new/1

auth_enable/1

auth_enable(Context::name() | context()) -> {ok, router_pb:'Etcd.AuthEnableResponse'()} | {error, eetcd_error()}

AuthEnable enables auth of an etcd cluster.

1.base
eetcd_auth:auth_enable(ConnName)
2.elixir
   :eetcd_auth.new(connName)
   |> :eetcd_auth.with_timeout(6000)
   |> :eetcd_auth.auth_enable()
eetcd_auth:with_timeout/2 eetcd_auth:new/1

new/1

new(Context::atom() | reference()) -> context()

Create context for request.

role_add/2

role_add(Context::name() | context(), Name::iodata()) -> {ok, router_pb:'Etcd.AuthRoleAddResponse'()} | {error, eetcd_error()}

RoleAdd adds a new role to an etcd cluster.

1.base
eetcd_auth:role_add(ConnName, Name)
2.elixir
   :eetcd_auth.new(connName)
   |> :eetcd_auth.with_timeout(6000)
   |> :eetcd_auth.role_add(name)
eetcd_auth:with_timeout/2 eetcd_auth:new/1

role_delete/2

role_delete(Context::name() | context(), Role::iodata()) -> {ok, router_pb:'Etcd.AuthRoleDeleteResponse'()} | {error, eetcd_error()}

RoleDelete deletes a role.

1.base
eetcd_auth:role_delete(ConnName, Role)
2.elixir
   :eetcd_auth.new(connName)
   |> :eetcd_auth.with_timeout(6000)
   |> :eetcd_auth.role_delete(role)
eetcd_auth:with_timeout/2 eetcd_auth:new/1

role_get/2

role_get(Context::name() | context(), Role::iodata()) -> {ok, router_pb:'Etcd.AuthRoleGetResponse'()} | {error, eetcd_error()}

RoleGet gets a detailed information of a role.

1.base
eetcd_auth:role_get(ConnName, Role)
2.elixir
   :eetcd_auth.new(connName)
   |> :eetcd_auth.with_timeout(6000)
   |> :eetcd_auth.role_get(role)
eetcd_auth:with_timeout/2 eetcd_auth:new/1

role_grant_permission/5

role_grant_permission(Context::name() | context(), Name::iodata(), Key::iodata(), RangeEnd::iodata(), PermType::'READ' | 'WRITE' | 'READWRITE') -> {ok, router_pb:'Etcd.AuthRoleGrantPermissionResponse'()} | {error, eetcd_error()}

RoleGrantPermission grants a permission to a role. PermType: 'READ' | 'WRITE' | 'READWRITE'

1.base
eetcd_auth:role_grant_permission(ConnName, Name, Key, RangeEnd,READ')'
2.elixir
   :eetcd_auth.new(connName)
   |> :eetcd_auth.with_timeout(6000)
   |> :eetcd_auth.user_add(name, key, rangeEnd, :'WRITE')
eetcd_auth:with_timeout/2 eetcd_auth:new/1

role_list/1

role_list(Context::name() | context()) -> {ok, router_pb:'Etcd.AuthRoleListResponse'()} | {error, eetcd_error()}

RoleList gets a list of all roles.

1.base
eetcd_auth:role_list(ConnName)
2.elixir
   :eetcd_auth.new(connName)
   |> :eetcd_auth.with_timeout(6000)
   |> :eetcd_auth.role_list()
eetcd_auth:with_timeout/2 eetcd_auth:new/1

role_revoke_permission/4

role_revoke_permission(Context::name() | context(), Role::iodata(), Key::iodata(), RangeEnd::iodata()) -> {ok, router_pb:'Etcd.AuthRoleRevokePermissionResponse'()} | {error, eetcd_error()}

RoleRevokePermission revokes a permission from a role.

1.base
eetcd_auth:role_revoke_permission(ConnName, Role, Key, RangeEnd)
2.elixir
   :eetcd_auth.new(connName)
   |> :eetcd_auth.with_timeout(6000)
   |> :eetcd_auth.role_revoke_permission(role, key, rangeEnd)
eetcd_auth:with_timeout/2 eetcd_auth:new/1

user_add/2

user_add(Context::name() | context(), Name::iodata()) -> {ok, router_pb:'Etcd.AuthUserAddResponse'()} | {error, eetcd_error()}

UserAdd adds a new user without password to an etcd cluster.

1.base
eetcd_auth:user_add(ConnName, Name)
2.elixir
   :eetcd_auth.new(connName)
   |> :eetcd_auth.with_timeout(6000)
   |> :eetcd_auth.user_add(name)
eetcd_auth:with_timeout/2 eetcd_auth:new/1

user_add/3

user_add(Context::name() | context(), Name::iodata(), Password::iodata()) -> {ok, router_pb:'Etcd.AuthUserAddResponse'()} | {error, eetcd_error()}

UserAdd adds a new user with password to an etcd cluster.

1.base
eetcd_auth:user_add(ConnName, Name, Password)
2.elixir
   :eetcd_auth.new(connName)
   |> :eetcd_auth.with_timeout(6000)
   |> :eetcd_auth.user_add(name, password)
eetcd_auth:with_timeout/2 eetcd_auth:new/1

user_change_password/3

user_change_password(Context::name() | context(), Name::iodata(), Password::iodata()) -> {ok, router_pb:'Etcd.AuthUserChangePasswordResponse'()} | {error, eetcd_error()}

UserChangePassword changes a password of a user.

1.base
eetcd_auth:user_change_password(ConnName, Name, Password)
2.elixir
   :eetcd_auth.new(connName)
   |> :eetcd_auth.with_timeout(6000)
   |> :eetcd_auth.user_change_password(name, password)
eetcd_auth:with_timeout/2 eetcd_auth:new/1

user_delete/2

user_delete(Context::name() | context(), Name::iodata()) -> {ok, router_pb:'Etcd.AuthUserDeleteResponse'()} | {error, eetcd_error()}

UserDelete deletes a user from an etcd cluster.

1.base
eetcd_auth:user_delete(ConnName, Name)
2.elixir
   :eetcd_auth.new(connName)
   |> :eetcd_auth.with_timeout(6000)
   |> :eetcd_auth.user_delete(name)
eetcd_auth:with_timeout/2 eetcd_auth:new/1

user_get/2

user_get(Context::name() | context(), Name::iodata()) -> {ok, router_pb:'Etcd.AuthUserGetResponse'()} | {error, eetcd_error()}

UserGet gets a detailed information of a user.

1.base
eetcd_auth:user_get(ConnName, Name)
2.elixir
   :eetcd_auth.new(connName)
   |> :eetcd_auth.with_timeout(6000)
   |> :eetcd_auth.user_get(name)
eetcd_auth:with_timeout/2 eetcd_auth:new/1

user_grant_role/3

user_grant_role(Context::name() | context(), User::iodata(), Role::iodata()) -> {ok, router_pb:'Etcd.AuthUserGrantRoleResponse'()} | {error, eetcd_error()}

UserGrantRole grants a role to a user.

1.base
eetcd_auth:user_grant_role(ConnName, User, Role)
2.elixir
   :eetcd_auth.new(connName)
   |> :eetcd_auth.with_timeout(6000)
   |> :eetcd_auth.user_grant_role(user, role)
eetcd_auth:with_timeout/2 eetcd_auth:new/1

user_list/1

user_list(Context::name() | context()) -> {ok, router_pb:'Etcd.AuthUserListResponse'()} | {error, eetcd_error()}

UserList gets a list of all users.

1.base
eetcd_auth:user_list(ConnName)
2.elixir
   :eetcd_auth.new(connName)
   |> :eetcd_auth.with_timeout(6000)
   |> eetcd_auth:user_list()
eetcd_auth:with_timeout/2 eetcd_auth:new/1

user_revoke_role/3

user_revoke_role(Context::name() | context(), Name::iodata(), Role::iodata()) -> {ok, router_pb:'Etcd.AuthUserRevokeRoleResponse'()} | {error, eetcd_error()}

UserRevokeRole revokes a role of a user.

1.base
eetcd_auth:user_revoke_role(ConnName, Name, Role)
2.elixir
   :eetcd_auth.new(connName)
   |> :eetcd_auth.with_timeout(6000)
   |> :eetcd_auth.user_revoke_role(name, role)
eetcd_auth:with_timeout/2 eetcd_auth:new/1

with_timeout/2

with_timeout(Context::context(), Timeout::pos_integer() | infinity) -> context()

Timeout is an integer greater than zero which specifies how many milliseconds to wait for a reply, or the atom infinity to wait indefinitely. Default value is 5000. If no reply is received within the specified time, the function call fails with {error, timeout}.


Generated by EDoc