# flyte.remote

Remote Entities that are accessible from the Union Server once deployed or created.
## Directory

### Classes

| Class | Description |
|-|-|
| [`Action`](https://www.union.ai/docs/v2/byoc/api-reference/flyte-sdk/packages/flyte.remote/action/page.md) | A class representing an action. |
| [`ActionDetails`](https://www.union.ai/docs/v2/byoc/api-reference/flyte-sdk/packages/flyte.remote/actiondetails/page.md) | A class representing an action. |
| [`ActionInputs`](https://www.union.ai/docs/v2/byoc/api-reference/flyte-sdk/packages/flyte.remote/actioninputs/page.md) | A class representing the inputs of an action. |
| [`ActionOutputs`](https://www.union.ai/docs/v2/byoc/api-reference/flyte-sdk/packages/flyte.remote/actionoutputs/page.md) | A class representing the outputs of an action. |
| [`App`](https://www.union.ai/docs/v2/byoc/api-reference/flyte-sdk/packages/flyte.remote/app/page.md) |  |
| [`Project`](https://www.union.ai/docs/v2/byoc/api-reference/flyte-sdk/packages/flyte.remote/project/page.md) | A class representing a project in the Union API. |
| [`Run`](https://www.union.ai/docs/v2/byoc/api-reference/flyte-sdk/packages/flyte.remote/run/page.md) | A class representing a run of a task. |
| [`RunDetails`](https://www.union.ai/docs/v2/byoc/api-reference/flyte-sdk/packages/flyte.remote/rundetails/page.md) | A class representing a run of a task. |
| [`Secret`](https://www.union.ai/docs/v2/byoc/api-reference/flyte-sdk/packages/flyte.remote/secret/page.md) |  |
| [`Task`](https://www.union.ai/docs/v2/byoc/api-reference/flyte-sdk/packages/flyte.remote/task/page.md) |  |
| [`TaskDetails`](https://www.union.ai/docs/v2/byoc/api-reference/flyte-sdk/packages/flyte.remote/taskdetails/page.md) |  |
| [`TimeFilter`](https://www.union.ai/docs/v2/byoc/api-reference/flyte-sdk/packages/flyte.remote/timefilter/page.md) | Filter for time-based fields (e. |
| [`Trigger`](https://www.union.ai/docs/v2/byoc/api-reference/flyte-sdk/packages/flyte.remote/trigger/page.md) | Represents a trigger in the Flyte platform. |
| [`User`](https://www.union.ai/docs/v2/byoc/api-reference/flyte-sdk/packages/flyte.remote/user/page.md) | Represents a user in the Flyte platform. |

### Methods

| Method | Description |
|-|-|
| [`auth_metadata()`](#auth_metadata) | This context manager allows you to pass contextualized auth metadata downstream to the Flyte authentication system. |
| [`create_channel()`](#create_channel) | Creates a new gRPC channel with appropriate authentication interceptors. |
| [`upload_dir()`](#upload_dir) | Uploads a directory to a remote location and returns the remote URI. |
| [`upload_file()`](#upload_file) | Uploads a file to a remote location and returns the remote URI. |

## Methods

#### auth_metadata()

```python
def auth_metadata(
    kv: typing.Tuple[str, str],
)
```
This context manager allows you to pass contextualized auth metadata downstream to the Flyte authentication system.

This is only useful if flyte.init_passthrough() has been called.

```python

flyte.init_passthrough("my-endpoint")

...

with auth_metadata((key1, value1), (key2, value2)):
    ...
```

| Parameter | Type | Description |
|-|-|-|
| `kv` | `typing.Tuple[str, str]` | |

#### create_channel()

```python
def create_channel(
    endpoint: str | None,
    api_key: str | None,
    insecure: typing.Optional[bool],
    insecure_skip_verify: typing.Optional[bool],
    ca_cert_file_path: typing.Optional[str],
    ssl_credentials: typing.Optional[ssl_channel_credentials],
    grpc_options: typing.Optional[typing.Sequence[typing.Tuple[str, typing.Any]]],
    compression: typing.Optional[grpc.Compression],
    http_session: httpx.AsyncClient | None,
    proxy_command: typing.Optional[typing.List[str]],
    rpc_retries: typing.Optional[int],
    kwargs,
) -> grpc.aio._base_channel.Channel
```
Creates a new gRPC channel with appropriate authentication interceptors.

This function creates either a secure or insecure gRPC channel based on the provided parameters,
and adds authentication interceptors to the channel. If SSL credentials are not provided,
they are created based on the insecure_skip_verify and ca_cert_file_path parameters.

The function is async because it may need to read certificate files asynchronously
and create authentication interceptors that perform async operations.

| Parameter | Type | Description |
|-|-|-|
| `endpoint` | `str \| None` | The endpoint URL for the gRPC channel |
| `api_key` | `str \| None` | API key for authentication; if provided, it will be used to detect the endpoint and credentials. |
| `insecure` | `typing.Optional[bool]` | Whether to use an insecure channel (no SSL) |
| `insecure_skip_verify` | `typing.Optional[bool]` | Whether to skip SSL certificate verification |
| `ca_cert_file_path` | `typing.Optional[str]` | Path to CA certificate file for SSL verification |
| `ssl_credentials` | `typing.Optional[ssl_channel_credentials]` | Pre-configured SSL credentials for the channel |
| `grpc_options` | `typing.Optional[typing.Sequence[typing.Tuple[str, typing.Any]]]` | Additional gRPC channel options |
| `compression` | `typing.Optional[grpc.Compression]` | Compression method for the channel |
| `http_session` | `httpx.AsyncClient \| None` | Pre-configured HTTP session to use for requests |
| `proxy_command` | `typing.Optional[typing.List[str]]` | List of strings for proxy command configuration |
| `rpc_retries` | `typing.Optional[int]` | Number of times to retry gRPC calls (flyte.init defaults to 3). None means do not install the interceptor at all. |
| `kwargs` | `**kwargs` | Additional arguments passed to various functions - For grpc.aio.insecure_channel/secure_channel: - root_certificates: Root certificates for SSL credentials - private_key: Private key for SSL credentials - certificate_chain: Certificate chain for SSL credentials - options: gRPC channel options - compression: gRPC compression method - For proxy configuration: - proxy_env: Dict of environment variables for proxy - proxy_timeout: Timeout for proxy connection - For authentication interceptors (passed to create_auth_interceptors and create_proxy_auth_interceptors): - auth_type: The authentication type to use ("Pkce", "ClientSecret", "ExternalCommand", "DeviceFlow") - command: Command to execute for ExternalCommand authentication - client_id: Client ID for ClientSecret authentication - client_secret: Client secret for ClientSecret authentication - client_credentials_secret: Client secret for ClientSecret authentication (alias) - scopes: List of scopes to request during authentication - audience: Audience for the token - http_proxy_url: HTTP proxy URL - verify: Whether to verify SSL certificates - ca_cert_path: Optional path to CA certificate file - header_key: Header key to use for authentication - redirect_uri: OAuth2 redirect URI for PKCE authentication - add_request_auth_code_params_to_request_access_token_params: Whether to add auth code params to token request - request_auth_code_params: Parameters to add to login URI opened in browser - request_access_token_params: Parameters to add when exchanging auth code for access token - refresh_access_token_params: Parameters to add when refreshing access token |

**Returns:** grpc.aio.Channel with authentication interceptors configured

#### upload_dir()

> [!NOTE] 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 upload_dir.aio()`.
```python
def upload_dir(
    dir_path: pathlib.Path,
    verify: bool,
    prefix: str | None,
) -> str
```
Uploads a directory to a remote location and returns the remote URI.

| Parameter | Type | Description |
|-|-|-|
| `dir_path` | `pathlib.Path` | The directory path to upload. |
| `verify` | `bool` | Whether to verify the certificate for HTTPS requests. |
| `prefix` | `str \| None` | |

**Returns:** The remote URI of the uploaded directory.

#### upload_file()

> [!NOTE] 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 upload_file.aio()`.
```python
def upload_file(
    fp: pathlib.Path,
    verify: bool,
    fname: str | None,
) -> typing.Tuple[str, str]
```
Uploads a file to a remote location and returns the remote URI.

| Parameter | Type | Description |
|-|-|-|
| `fp` | `pathlib.Path` | The file path to upload. |
| `verify` | `bool` | Whether to verify the certificate for HTTPS requests. |
| `fname` | `str \| None` | Optional file name for the remote path. |

**Returns:** Tuple of (MD5 digest hex string, remote native URL).

## Subpages

- [Action](https://www.union.ai/docs/v2/byoc/api-reference/flyte-sdk/packages/flyte.remote/action/page.md)
  - Parameters
  - Properties
  - Methods
  - abort()
  - details()
  - done()
  - get()
  - get_logs()
  - listall()
  - show_logs()
  - sync()
  - to_dict()
  - to_json()
  - wait()
  - watch()
- [ActionDetails](https://www.union.ai/docs/v2/byoc/api-reference/flyte-sdk/packages/flyte.remote/actiondetails/page.md)
  - Parameters
  - Properties
  - Methods
  - done()
  - get()
  - get_details()
  - get_phase_transitions()
  - inputs()
  - logs_available()
  - outputs()
  - to_dict()
  - to_json()
  - watch()
  - watch_updates()
- [ActionInputs](https://www.union.ai/docs/v2/byoc/api-reference/flyte-sdk/packages/flyte.remote/actioninputs/page.md)
  - Parameters
  - Methods
  - clear()
  - copy()
  - fromkeys()
  - get()
  - items()
  - keys()
  - pop()
  - popitem()
  - setdefault()
  - to_dict()
  - to_json()
  - update()
  - values()
- [ActionOutputs](https://www.union.ai/docs/v2/byoc/api-reference/flyte-sdk/packages/flyte.remote/actionoutputs/page.md)
  - Parameters
  - Properties
  - Methods
  - to_dict()
  - to_json()
- [App](https://www.union.ai/docs/v2/byoc/api-reference/flyte-sdk/packages/flyte.remote/app/page.md)
  - Parameters
  - Properties
  - Methods
  - activate()
  - create()
  - deactivate()
  - delete()
  - ephemeral_ctx()
  - ephemeral_ctx_sync()
  - get()
  - is_active()
  - is_deactivated()
  - listall()
  - replace()
  - to_dict()
  - to_json()
  - update()
  - watch()
- [Project](https://www.union.ai/docs/v2/byoc/api-reference/flyte-sdk/packages/flyte.remote/project/page.md)
  - Parameters
  - Methods
  - archive()
  - create()
  - get()
  - listall()
  - to_dict()
  - to_json()
  - unarchive()
  - update()
- [Run](https://www.union.ai/docs/v2/byoc/api-reference/flyte-sdk/packages/flyte.remote/run/page.md)
  - Parameters
  - Properties
  - Methods
  - abort()
  - details()
  - done()
  - get()
  - get_debug_url()
  - get_logs()
  - inputs()
  - listall()
  - outputs()
  - show_logs()
  - sync()
  - to_dict()
  - to_json()
  - wait()
  - watch()
- [RunDetails](https://www.union.ai/docs/v2/byoc/api-reference/flyte-sdk/packages/flyte.remote/rundetails/page.md)
  - Parameters
  - Properties
  - Methods
  - done()
  - get()
  - get_details()
  - inputs()
  - outputs()
  - to_dict()
  - to_json()
- [Secret](https://www.union.ai/docs/v2/byoc/api-reference/flyte-sdk/packages/flyte.remote/secret/page.md)
  - Parameters
  - Properties
  - Methods
  - create()
  - delete()
  - get()
  - listall()
  - to_dict()
  - to_json()
- [Task](https://www.union.ai/docs/v2/byoc/api-reference/flyte-sdk/packages/flyte.remote/task/page.md)
  - Parameters
  - Properties
  - Methods
  - get()
  - listall()
  - to_dict()
  - to_json()
- [TaskDetails](https://www.union.ai/docs/v2/byoc/api-reference/flyte-sdk/packages/flyte.remote/taskdetails/page.md)
  - Parameters
  - Properties
  - Methods
  - fetch()
  - get()
  - override()
  - to_dict()
  - to_json()
- [TimeFilter](https://www.union.ai/docs/v2/byoc/api-reference/flyte-sdk/packages/flyte.remote/timefilter/page.md)
  - Parameters
- [Trigger](https://www.union.ai/docs/v2/byoc/api-reference/flyte-sdk/packages/flyte.remote/trigger/page.md)
  - Parameters
  - Properties
  - Methods
  - create()
  - delete()
  - get()
  - get_details()
  - listall()
  - to_dict()
  - to_json()
  - update()
- [User](https://www.union.ai/docs/v2/byoc/api-reference/flyte-sdk/packages/flyte.remote/user/page.md)
  - Parameters
  - Methods
  - get()
  - name()
  - subject()
  - to_dict()
  - to_json()

---
**Source**: https://github.com/unionai/unionai-docs/blob/main/content/api-reference/flyte-sdk/packages/flyte.remote/_index.md
**HTML**: https://www.union.ai/docs/v2/byoc/api-reference/flyte-sdk/packages/flyte.remote/
