Gateways
get_gateway(gateway, *, df=True)
Retrieves the details of a gateway by its ID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
gateway
|
str
|
The name or ID of the gateway to retrieve. |
required |
df
|
Optional[bool]
|
If True or not provided, returns a DataFrame with flattened keys. If False, returns a list of dictionaries. |
True
|
Returns:
| Type | Description |
|---|---|
Union[DataFrame, Dict[str, Any], None]
|
The gateway details if found, otherwise None. |
Examples:
get_gateway('123e4567-e89b-12d3-a456-426614174000')
get_gateway('my-gateway')
Source code in src/pyfabricops/core/gateways.py
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 | |
get_gateway_id(gateway_name)
Retrieves the ID of a gateway by its name.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
gateway_name
|
str
|
The name of the gateway. |
required |
Returns:
| Type | Description |
|---|---|
Union[str, None]
|
str | None: The ID of the gateway if found, otherwise None. |
Source code in src/pyfabricops/core/gateways.py
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | |
get_gateway_public_key(gateway)
Extracts the public key of a gateway by its ID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
gateway
|
str
|
The ID of the gateway to retrieve the public key from. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict | None
|
The public key details if found, otherwise None. |
Examples:
get_gateway_public_key('123e4567-e89b-12d3-a456-426614174000')
Source code in src/pyfabricops/core/gateways.py
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 | |
list_gateways(df=True)
Lists all available gateways.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
df
|
Optional[bool]
|
If True or not provided, returns a DataFrame with flattened keys. If False, returns a list of dictionaries. |
True
|
Returns:
| Type | Description |
|---|---|
Union[DataFrame, List[Dict[str, Any]], None]
|
The list of gateways. |
Examples:
list_gateways()
Source code in src/pyfabricops/core/gateways.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | |
resolve_gateway(gateway)
Resolves a gateway name to its ID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
gateway
|
str
|
The name of the gateway. |
required |
Returns:
| Type | Description |
|---|---|
Union[str, None]
|
str | None: The ID of the gateway if found, otherwise None. |
Source code in src/pyfabricops/core/gateways.py
53 54 55 56 57 58 59 60 61 62 63 64 65 66 | |