pglift.roles exposes the following API to manipulate
- pglift.roles.apply(instance: PostgreSQLInstance, role: Role) ApplyResult #
Apply state described by specified interface model as a PostgreSQL role.
In case it’s not possible to inspect changed role, possibly due to the super-user password being modified, change_state attribute within the returned object is set to interface.ApplyResult.changed with a warning logged.
The instance should be running and not a standby.
DependencyError – if the role cannot be dropped due some database dependency.
- pglift.roles.exists(instance: PostgreSQLInstance, name: str) bool #
Return True if named role exists in ‘instance’.
The instance should be running.
- pglift.roles.get(instance: PostgreSQLInstance, name: str, *, password: bool = True) Role #
Return the role object with specified name.
RoleNotFound – if no role with specified ‘name’ exists.
- pglift.roles.drop(instance: PostgreSQLInstance, role: RoleDropped) None #
Drop a role from instance.