Policy
Package: flyteplugins.union.remote
Represents a Union RBAC Policy.
class Policy(
pb2: PolicyPb2,
)| Parameter | Type | Description |
|---|---|---|
pb2 |
PolicyPb2 |
Properties
| Property | Type | Description |
|---|---|---|
bindings |
None |
|
description |
None |
|
name |
None |
|
organization |
None |
Methods
| Method | Description |
|---|---|
create() |
Create a new policy. |
delete() |
Delete a policy. |
get() |
Get a policy by name. |
listall() |
List all policies in the organization. |
to_dict() |
Convert the object to a JSON-serializable dictionary. |
to_json() |
Convert the object to a JSON string. |
update() |
Update a policy by diffing bindings and applying add/remove operations. |
create()
Default invocation is sync and will block.
To call it asynchronously, use the function .aio() on the method name itself, e.g.,:
result = await Policy.create.aio().
def create(
cls,
name: str,
description: str,
bindings: list[dict] | None,
) -> PolicyCreate a new policy.
| Parameter | Type | Description |
|---|---|---|
cls |
||
name |
str |
|
description |
str |
|
bindings |
list[dict] | None |
delete()
Default invocation is sync and will block.
To call it asynchronously, use the function .aio() on the method name itself, e.g.,:
result = await Policy.delete.aio().
def delete(
cls,
name: str,
)Delete a policy.
| Parameter | Type | Description |
|---|---|---|
cls |
||
name |
str |
get()
Default invocation is sync and will block.
To call it asynchronously, use the function .aio() on the method name itself, e.g.,:
result = await Policy.get.aio().
def get(
cls,
name: str,
) -> PolicyGet a policy by name.
| Parameter | Type | Description |
|---|---|---|
cls |
||
name |
str |
listall()
Default invocation is sync and will block.
To call it asynchronously, use the function .aio() on the method name itself, e.g.,:
result = await Policy.listall.aio().
def listall(
cls,
limit: int,
) -> AsyncIterator[Policy]List all policies in the organization.
| Parameter | Type | Description |
|---|---|---|
cls |
||
limit |
int |
to_dict()
def to_dict()Convert the object to a JSON-serializable dictionary.
Returns: dict: A dictionary representation of the object.
to_json()
def to_json()Convert the object to a JSON string.
Returns: str: A JSON string representation of the object.
update()
Default invocation is sync and will block.
To call it asynchronously, use the function .aio() on the method name itself, e.g.,:
result = await Policy.update.aio().
def update(
cls,
name: str,
old_bindings: list[dict],
new_bindings: list[dict],
) -> PolicyUpdate a policy by diffing bindings and applying add/remove operations.
| Parameter | Type | Description |
|---|---|---|
cls |
||
name |
str |
|
old_bindings |
list[dict] |
|
new_bindings |
list[dict] |