unlink_clusters
Applicable Products
Product |
Supported (Yes/No) |
|---|---|
No |
|
Yes |
|
Yes |
|
No |
|
No |
|
No |
Note: For the
Function Description
Disconnects a link.
Prototype
1 | unlink_clusters(clusters: Union[List[LLMClusterInfo], Tuple[LLMClusterInfo]], timeout=3000, force=False) |
Parameters
Parameter |
Data Type |
Value Description |
|---|---|---|
clusters |
Union[List[LLMClusterInfo], Tuple[LLMClusterInfo]] |
Cluster list. |
timeout |
int |
Timeout interval, in milliseconds. The default timeout interval is 3000 ms. |
force |
bool |
Whether to forcibly disconnect the link. The default value is False. True indicates forcible disconnection.
|
Example
1 2 3 4 5 6 7 8 9 10 11 12 13 | from llm_datadist import LLMDataDist, LLMRole, LLMStatusCode, LLMClusterInfo llm_datadist = LLMDataDist(LLMRole.DECODER, 0) cluster = LLMClusterInfo() cluster.remote_cluster_id = 1 cluster.append_local_ip_info("1.1.1.1", 26000) cluster.append_remote_ip_info("1.1.1.1", 26000) ret, rets = llm_datadist.unlink_clusters([cluster], 5000) if ret != LLMStatusCode.LLM_SUCCESS: raise Exception("unlink failed.") for cluster_i in range(len(rets)): unlink_ret = rets[cluster_i] if unlink_ret != LLMStatusCode.LLM_SUCCESS: print(f"{cluster_i} unlink failed.") |
Returns
In normal cases, a tuple of two values is returned. The first value is the return value of the API, and the type is LLMStatusCode. The second value is the list of link setup results of each cluster, and the type is LLMStatusCode.
If a parameter is incorrect, a TypeError or ValueError may be thrown.
Constraints
None