0.2.1

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()

This method can be called both synchronously or asynchronously.

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,
) -> Policy

Create a new policy.

Parameter Type Description
cls
name str
description str
bindings list[dict] | None

delete()

This method can be called both synchronously or asynchronously.

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()

This method can be called both synchronously or asynchronously.

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,
) -> Policy

Get a policy by name.

Parameter Type Description
cls
name str

listall()

This method can be called both synchronously or asynchronously.

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()

This method can be called both synchronously or asynchronously.

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],
) -> Policy

Update a policy by diffing bindings and applying add/remove operations.

Parameter Type Description
cls
name str
old_bindings list[dict]
new_bindings list[dict]