|
1 | 1 | **Integration Network** |
2 | 2 | ======================= |
3 | 3 |
|
4 | | -Manage integration network in the account |
| 4 | +Manage integration networks in the account. |
5 | 5 |
|
6 | 6 | ============ |
7 | 7 | listNetwork |
8 | 8 | ============ |
9 | | -Get list of networks |
| 9 | + |
| 10 | +Retrieves a list of all networks from the account with pagination support. |
| 11 | +Use this to retrieve and manage networks in your application. |
| 12 | + |
| 13 | +See: `Network Integration <https://docs.tago.io/docs/tagoio/integrations/general/creating-a-network-integration>`_ |
10 | 14 |
|
11 | 15 | **Parameters:** |
12 | 16 |
|
13 | | - | **queryObj**: :ref:`Query` |
14 | | - | Network Query |
| 17 | + | *Optional* **queryObj**: :ref:`NetworkQuery` |
| 18 | + | Query parameters to filter the results. |
| 19 | +
|
| 20 | + .. code-block:: |
| 21 | + :caption: **Default queryObj:** |
| 22 | +
|
| 23 | + queryObj = { |
| 24 | + "page": 1, |
| 25 | + "fields": ["id", "name"], |
| 26 | + "filter": {}, |
| 27 | + "amount": 20, |
| 28 | + "orderBy": ["name", "asc"] |
| 29 | + } |
| 30 | +
|
| 31 | + **Returns:** |
| 32 | + |
| 33 | + | List[:ref:`NetworkInfo`] |
| 34 | +
|
| 35 | + .. code-block:: python |
| 36 | +
|
| 37 | + # If receive an error "Authorization Denied", check policy "Integration Network" / "Access" in Access Management. |
| 38 | + from tagoio_sdk import Resources |
| 39 | +
|
| 40 | + resources = Resources() |
| 41 | + networks = resources.integration.networks.listNetwork({ |
| 42 | + "page": 1, |
| 43 | + "fields": ["id", "name"], |
| 44 | + "amount": 20, |
| 45 | + "orderBy": ["name", "asc"] |
| 46 | + }) |
| 47 | + print(networks) # [{'id': 'network-id-123', 'name': 'My Network', ...}] |
15 | 48 |
|
16 | 49 |
|
17 | 50 | ====== |
18 | 51 | info |
19 | 52 | ====== |
20 | 53 |
|
21 | | -Gets information about the network |
| 54 | +Retrieves detailed information about a specific network. |
| 55 | + |
| 56 | +See: `Network Integration <https://docs.tago.io/docs/tagoio/integrations/general/creating-a-network-integration>`_ |
| 57 | + |
| 58 | + **Parameters:** |
| 59 | + |
| 60 | + | **networkID**: :ref:`GenericID` |
| 61 | + | Network ID |
| 62 | +
|
| 63 | + | *Optional* **fields**: List[str] |
| 64 | + | Fields to retrieve (default: ["id", "name"]) |
| 65 | +
|
| 66 | + **Returns:** |
| 67 | + |
| 68 | + | :ref:`NetworkInfo` |
| 69 | +
|
| 70 | + .. code-block:: python |
| 71 | +
|
| 72 | + # If receive an error "Authorization Denied", check policy "Integration Network" / "Access" in Access Management. |
| 73 | + from tagoio_sdk import Resources |
| 74 | +
|
| 75 | + resources = Resources() |
| 76 | + network_info = resources.integration.networks.info("network-id-123") |
| 77 | + print(network_info) # {'id': '...', 'name': 'My Network', ...} |
| 78 | +
|
| 79 | +
|
| 80 | +====== |
| 81 | +create |
| 82 | +====== |
| 83 | + |
| 84 | +Creates a new integration network in the account. |
| 85 | + |
| 86 | +See: `Creating a Network Integration <https://docs.tago.io/docs/tagoio/integrations/general/creating-a-network-integration#create-a-new-integration>`_ |
| 87 | + |
| 88 | + **Parameters:** |
| 89 | + |
| 90 | + | **networkObj**: :ref:`NetworkCreateInfo` |
| 91 | + | Network information |
| 92 | +
|
| 93 | + **Returns:** |
| 94 | + |
| 95 | + | Dict[str, str] |
| 96 | +
|
| 97 | + .. code-block:: python |
| 98 | +
|
| 99 | + # If receive an error "Authorization Denied", check policy "Integration Network" / "Create" in Access Management. |
| 100 | + from tagoio_sdk import Resources |
| 101 | +
|
| 102 | + resources = Resources() |
| 103 | + new_network = resources.integration.networks.create({ |
| 104 | + "name": "My Custom Network", |
| 105 | + "description": "Custom integration network", |
| 106 | + "middleware_endpoint": "https://my-middleware.com/endpoint", |
| 107 | + "public": False |
| 108 | + }) |
| 109 | + print(new_network) # {'network': 'network-id-123'} |
| 110 | +
|
| 111 | +
|
| 112 | +====== |
| 113 | +edit |
| 114 | +====== |
| 115 | + |
| 116 | +Modifies any property of an existing network. |
| 117 | + |
| 118 | + **Parameters:** |
| 119 | + |
| 120 | + | **networkID**: :ref:`GenericID` |
| 121 | + | Network ID |
| 122 | +
|
| 123 | + | **networkObj**: :ref:`NetworkCreateInfo` |
| 124 | + | Network information to update |
| 125 | +
|
| 126 | + **Returns:** |
| 127 | + |
| 128 | + | str |
| 129 | +
|
| 130 | + .. code-block:: python |
| 131 | +
|
| 132 | + # If receive an error "Authorization Denied", check policy "Integration Network" / "Edit" in Access Management. |
| 133 | + from tagoio_sdk import Resources |
| 134 | +
|
| 135 | + resources = Resources() |
| 136 | + result = resources.integration.networks.edit("network-id-123", { |
| 137 | + "name": "Updated Network Name", |
| 138 | + "description": "Updated description", |
| 139 | + "public": True |
| 140 | + }) |
| 141 | + print(result) # Successfully Updated |
| 142 | +
|
| 143 | +
|
| 144 | +====== |
| 145 | +delete |
| 146 | +====== |
| 147 | + |
| 148 | +Permanently deletes a network from the account. |
22 | 149 |
|
23 | 150 | **Parameters:** |
24 | 151 |
|
25 | | - | **networkID**: GenericID: str |
26 | | - | Network identification |
| 152 | + | **networkID**: :ref:`GenericID` |
| 153 | + | Network ID |
| 154 | +
|
| 155 | + **Returns:** |
| 156 | + |
| 157 | + | str |
| 158 | +
|
| 159 | + .. code-block:: python |
| 160 | +
|
| 161 | + # If receive an error "Authorization Denied", check policy "Integration Network" / "Delete" in Access Management. |
| 162 | + from tagoio_sdk import Resources |
| 163 | +
|
| 164 | + resources = Resources() |
| 165 | + result = resources.integration.networks.delete("network-id-123") |
| 166 | + print(result) # Successfully Removed |
| 167 | +
|
| 168 | +
|
| 169 | +========== |
| 170 | +tokenList |
| 171 | +========== |
| 172 | + |
| 173 | +Retrieves a list of all authentication tokens for a network with optional filtering. |
| 174 | + |
| 175 | +See: `Tokens and Getting Devices <https://docs.tago.io/docs/tagoio/integrations/general/creating-a-network-integration#tokens-and-getting-devices>`_ |
| 176 | + |
| 177 | + **Parameters:** |
| 178 | + |
| 179 | + | **networkID**: :ref:`GenericID` |
| 180 | + | Network ID |
| 181 | +
|
| 182 | + | *Optional* **queryObj**: :ref:`ListTokenQuery` |
| 183 | + | Query parameters to filter the results. |
| 184 | +
|
| 185 | + .. code-block:: |
| 186 | + :caption: **Default queryObj:** |
| 187 | +
|
| 188 | + queryObj = { |
| 189 | + "page": 1, |
| 190 | + "fields": ["name", "token", "permission"], |
| 191 | + "filter": {}, |
| 192 | + "amount": 20, |
| 193 | + "orderBy": ["created_at", "desc"] |
| 194 | + } |
| 195 | +
|
| 196 | + **Returns:** |
| 197 | + |
| 198 | + | List[:ref:`NetworkTokenInfo`] |
| 199 | +
|
| 200 | + .. code-block:: python |
| 201 | +
|
| 202 | + # If receive an error "Authorization Denied", check policy "Integration Network" / "Access" in Access Management. |
| 203 | + from tagoio_sdk import Resources |
| 204 | +
|
| 205 | + resources = Resources() |
| 206 | + tokens = resources.integration.networks.tokenList("network-id-123", { |
| 207 | + "page": 1, |
| 208 | + "amount": 20, |
| 209 | + "fields": ["name", "token", "permission"], |
| 210 | + "orderBy": ["created_at", "desc"] |
| 211 | + }) |
| 212 | + print(tokens) # [{'name': 'Default Token', 'token': '...', 'permission': 'full', ...}] |
| 213 | +
|
| 214 | +
|
| 215 | +=========== |
| 216 | +tokenCreate |
| 217 | +=========== |
| 218 | + |
| 219 | +Generates and retrieves a new authentication token for a network. |
| 220 | + |
| 221 | +See: `Tokens and Getting Devices <https://docs.tago.io/docs/tagoio/integrations/general/creating-a-network-integration#tokens-and-getting-devices>`_ |
| 222 | + |
| 223 | + **Parameters:** |
| 224 | + |
| 225 | + | **networkID**: :ref:`GenericID` |
| 226 | + | Network ID |
| 227 | +
|
| 228 | + | **tokenParams**: :ref:`IntegrationTokenData` |
| 229 | + | Parameters for the new token |
| 230 | +
|
| 231 | + **Returns:** |
| 232 | + |
| 233 | + | :ref:`TokenCreateResponse` |
| 234 | +
|
| 235 | + .. code-block:: python |
| 236 | +
|
| 237 | + # If receive an error "Authorization Denied", check policy "Integration Network" / "Create Token" in Access Management. |
| 238 | + from tagoio_sdk import Resources |
| 239 | +
|
| 240 | + resources = Resources() |
| 241 | + result = resources.integration.networks.tokenCreate("network-id-123", { |
| 242 | + "name": "Production Token", |
| 243 | + "permission": "write", |
| 244 | + "expire_time": "never" |
| 245 | + }) |
| 246 | + print(result) # {'token': 'new-token-value', 'expire_date': None} |
| 247 | +
|
| 248 | +
|
| 249 | +=========== |
| 250 | +tokenDelete |
| 251 | +=========== |
| 252 | + |
| 253 | +Permanently deletes an authentication token. |
| 254 | + |
| 255 | +See: `Tokens and Getting Devices <https://docs.tago.io/docs/tagoio/integrations/general/creating-a-network-integration#tokens-and-getting-devices>`_ |
| 256 | + |
| 257 | + **Parameters:** |
| 258 | + |
| 259 | + | **token**: :ref:`GenericToken` |
| 260 | + | Token to delete |
| 261 | +
|
| 262 | + **Returns:** |
| 263 | + |
| 264 | + | str |
| 265 | +
|
| 266 | + .. code-block:: python |
| 267 | +
|
| 268 | + # If receive an error "Authorization Denied", check policy "Integration Network" / "Delete Token" in Access Management. |
| 269 | + from tagoio_sdk import Resources |
| 270 | +
|
| 271 | + resources = Resources() |
| 272 | + result = resources.integration.networks.tokenDelete("token-to-delete") |
| 273 | + print(result) # Successfully Removed |
| 274 | +
|
27 | 275 |
|
28 | 276 | .. toctree:: |
29 | 277 |
|
|
0 commit comments