Integration Network¶
Manage integration networks in the account.
listNetwork¶
Retrieves a list of all networks from the account with pagination support. Use this to retrieve and manage networks in your application.
See: Network Integration
Parameters:
Optional queryObj: NetworkQueryQuery parameters to filter the results.Default queryObj:¶queryObj = { "page": 1, "fields": ["id", "name"], "filter": {}, "amount": 20, "orderBy": ["name", "asc"] }Returns:
List[NetworkInfo]# If receive an error "Authorization Denied", check policy "Integration Network" / "Access" in Access Management. from tagoio_sdk import Resources resources = Resources() networks = resources.integration.networks.listNetwork({ "page": 1, "fields": ["id", "name"], "amount": 20, "orderBy": ["name", "asc"] }) print(networks) # [{'id': 'network-id-123', 'name': 'My Network', ...}]
info¶
Retrieves detailed information about a specific network.
See: Network Integration
Parameters:
networkID: GenericIDNetwork IDOptional fields: List[str]Fields to retrieve (default: [“id”, “name”])Returns:
# If receive an error "Authorization Denied", check policy "Integration Network" / "Access" in Access Management. from tagoio_sdk import Resources resources = Resources() network_info = resources.integration.networks.info("network-id-123") print(network_info) # {'id': '...', 'name': 'My Network', ...}
create¶
Creates a new integration network in the account.
See: Creating a Network Integration
Parameters:
networkObj: NetworkCreateInfoNetwork informationReturns:
Dict[str, str]# If receive an error "Authorization Denied", check policy "Integration Network" / "Create" in Access Management. from tagoio_sdk import Resources resources = Resources() new_network = resources.integration.networks.create({ "name": "My Custom Network", "description": "Custom integration network", "middleware_endpoint": "https://my-middleware.com/endpoint", "public": False }) print(new_network) # {'network': 'network-id-123'}
edit¶
Modifies any property of an existing network.
Parameters:
networkID: GenericIDNetwork IDnetworkObj: NetworkCreateInfoNetwork information to updateReturns:
str# If receive an error "Authorization Denied", check policy "Integration Network" / "Edit" in Access Management. from tagoio_sdk import Resources resources = Resources() result = resources.integration.networks.edit("network-id-123", { "name": "Updated Network Name", "description": "Updated description", "public": True }) print(result) # Successfully Updated
delete¶
Permanently deletes a network from the account.
Parameters:
networkID: GenericIDNetwork IDReturns:
str# If receive an error "Authorization Denied", check policy "Integration Network" / "Delete" in Access Management. from tagoio_sdk import Resources resources = Resources() result = resources.integration.networks.delete("network-id-123") print(result) # Successfully Removed
tokenList¶
Retrieves a list of all authentication tokens for a network with optional filtering.
See: Tokens and Getting Devices
Parameters:
networkID: GenericIDNetwork IDOptional queryObj: ListTokenQueryQuery parameters to filter the results.Default queryObj:¶queryObj = { "page": 1, "fields": ["name", "token", "permission"], "filter": {}, "amount": 20, "orderBy": ["created_at", "desc"] }Returns:
List[NetworkTokenInfo]# If receive an error "Authorization Denied", check policy "Integration Network" / "Access" in Access Management. from tagoio_sdk import Resources resources = Resources() tokens = resources.integration.networks.tokenList("network-id-123", { "page": 1, "amount": 20, "fields": ["name", "token", "permission"], "orderBy": ["created_at", "desc"] }) print(tokens) # [{'name': 'Default Token', 'token': '...', 'permission': 'full', ...}]
tokenCreate¶
Generates and retrieves a new authentication token for a network.
See: Tokens and Getting Devices
Parameters:
Returns:
# If receive an error "Authorization Denied", check policy "Integration Network" / "Create Token" in Access Management. from tagoio_sdk import Resources resources = Resources() result = resources.integration.networks.tokenCreate("network-id-123", { "name": "Production Token", "permission": "write", "expire_time": "never" }) print(result) # {'token': 'new-token-value', 'expire_date': None}
tokenDelete¶
Permanently deletes an authentication token.
See: Tokens and Getting Devices
Parameters:
token: GenericTokenToken to deleteReturns:
str# If receive an error "Authorization Denied", check policy "Integration Network" / "Delete Token" in Access Management. from tagoio_sdk import Resources resources = Resources() result = resources.integration.networks.tokenDelete("token-to-delete") print(result) # Successfully Removed