docs: note BrowseChildren in gateway overview and client READMEs
This commit is contained in:
@@ -196,6 +196,28 @@ dotnet run --project clients/dotnet/ZB.MOM.WW.MxGateway.Client.Cli -- galaxy-las
|
|||||||
dotnet run --project clients/dotnet/ZB.MOM.WW.MxGateway.Client.Cli -- galaxy-discover --endpoint http://localhost:5000 --api-key-env MXGATEWAY_API_KEY
|
dotnet run --project clients/dotnet/ZB.MOM.WW.MxGateway.Client.Cli -- galaxy-discover --endpoint http://localhost:5000 --api-key-env MXGATEWAY_API_KEY
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Browsing lazily
|
||||||
|
|
||||||
|
For UI trees or OPC UA bridges, use `BrowseChildrenAsync` to walk one level at a
|
||||||
|
time instead of paging the full hierarchy. Pass an empty request for root objects;
|
||||||
|
subsequent calls supply `ParentGobjectId`, `ParentTagName`, or
|
||||||
|
`ParentContainedPath`. Each child's `ChildHasChildren[i]` tells you whether to
|
||||||
|
draw an expand triangle. Filter fields match `DiscoverHierarchy`. See
|
||||||
|
[Galaxy Repository](../../docs/GalaxyRepository.md#browsechildren) for full
|
||||||
|
request and filter semantics.
|
||||||
|
|
||||||
|
```csharp
|
||||||
|
BrowseChildrenReply roots = await repository.BrowseChildrenAsync(
|
||||||
|
new BrowseChildrenRequest());
|
||||||
|
|
||||||
|
for (int i = 0; i < roots.Children.Count; i++)
|
||||||
|
{
|
||||||
|
GalaxyObject child = roots.Children[i];
|
||||||
|
bool hasChildren = roots.ChildHasChildren[i];
|
||||||
|
Console.WriteLine($"{child.TagName} expand={hasChildren}");
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
### Watching deploy events
|
### Watching deploy events
|
||||||
|
|
||||||
`WatchDeployEventsAsync` opens the `WatchDeployEvents` server-streaming RPC. The
|
`WatchDeployEventsAsync` opens the `WatchDeployEvents` server-streaming RPC. The
|
||||||
|
|||||||
@@ -121,6 +121,28 @@ reports `present=false` (no deploy recorded). `DiscoverHierarchy` returns
|
|||||||
the generated `*GalaxyObject` slice with each object's dynamic attributes
|
the generated `*GalaxyObject` slice with each object's dynamic attributes
|
||||||
populated for direct contract access.
|
populated for direct contract access.
|
||||||
|
|
||||||
|
### Browsing lazily
|
||||||
|
|
||||||
|
For UI trees or OPC UA bridges, use `BrowseChildren` to walk one level at a
|
||||||
|
time instead of loading the full hierarchy. Pass an empty request for root
|
||||||
|
objects; subsequent calls set `ParentGobjectId`, `ParentTagName`, or
|
||||||
|
`ParentContainedPath`. Filter fields match `DiscoverHierarchy`. Each response
|
||||||
|
pairs `Children` with `ChildHasChildren` so you know which nodes to expand. See
|
||||||
|
[Galaxy Repository](../../docs/GalaxyRepository.md#browsechildren) for full
|
||||||
|
request and filter semantics.
|
||||||
|
|
||||||
|
```go
|
||||||
|
import pb "gitea.dohertylan.com/dohertj2/mxaccessgw/clients/go/internal/generated/galaxy_repository/v1"
|
||||||
|
|
||||||
|
reply, err := galaxy.BrowseChildren(ctx, &pb.BrowseChildrenRequest{})
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
for i, child := range reply.GetChildren() {
|
||||||
|
fmt.Printf("%s expand=%v\n", child.GetTagName(), reply.GetChildHasChildren()[i])
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
### Watching deploy events
|
### Watching deploy events
|
||||||
|
|
||||||
`WatchDeployEvents` opens a server-streaming subscription. The server emits a
|
`WatchDeployEvents` opens a server-streaming subscription. The server emits a
|
||||||
|
|||||||
@@ -116,6 +116,29 @@ gradle :zb-mom-ww-mxgateway-cli:run --args="galaxy-deploy-time --endpoint localh
|
|||||||
gradle :zb-mom-ww-mxgateway-cli:run --args="galaxy-discover --endpoint localhost:5000 --api-key-env MXGATEWAY_API_KEY --plaintext --json"
|
gradle :zb-mom-ww-mxgateway-cli:run --args="galaxy-discover --endpoint localhost:5000 --api-key-env MXGATEWAY_API_KEY --plaintext --json"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Browsing lazily
|
||||||
|
|
||||||
|
For UI trees or OPC UA bridges, use `browseChildren` to walk one level at a
|
||||||
|
time instead of loading the full hierarchy with `discoverHierarchy`. Pass a
|
||||||
|
default request for root objects; subsequent calls set `parentGobjectId`,
|
||||||
|
`parentTagName`, or `parentContainedPath`. Filter fields match
|
||||||
|
`DiscoverHierarchy`. Each response pairs `getChildrenList()` with
|
||||||
|
`getChildHasChildrenList()` so you know which nodes to expand. See
|
||||||
|
[Galaxy Repository](../../docs/GalaxyRepository.md#browsechildren) for full
|
||||||
|
request and filter semantics. This snippet documents the API as it appears once
|
||||||
|
the Java client is regenerated on the Windows host.
|
||||||
|
|
||||||
|
```java
|
||||||
|
BrowseChildrenReply reply = galaxy.browseChildren(
|
||||||
|
BrowseChildrenRequest.newBuilder().build());
|
||||||
|
|
||||||
|
List<GalaxyObject> children = reply.getChildrenList();
|
||||||
|
List<Boolean> hasChildren = reply.getChildHasChildrenList();
|
||||||
|
for (int i = 0; i < children.size(); i++) {
|
||||||
|
System.out.printf("%s expand=%b%n", children.get(i).getTagName(), hasChildren.get(i));
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
### Watching deploy events
|
### Watching deploy events
|
||||||
|
|
||||||
`GalaxyRepository.WatchDeployEvents` is a server-streaming RPC: the gateway
|
`GalaxyRepository.WatchDeployEvents` is a server-streaming RPC: the gateway
|
||||||
|
|||||||
@@ -138,6 +138,25 @@ The methods return native Python types (`bool`, `datetime | None`, and a
|
|||||||
into the hierarchy without learning the underlying stub class. The
|
into the hierarchy without learning the underlying stub class. The
|
||||||
service requires the `metadata:read` scope on the API key.
|
service requires the `metadata:read` scope on the API key.
|
||||||
|
|
||||||
|
### Browsing lazily
|
||||||
|
|
||||||
|
For UI trees or OPC UA bridges, use `browse_children` to walk one level at a
|
||||||
|
time instead of loading the full hierarchy with `discover_hierarchy`. Pass an
|
||||||
|
empty request for root objects; subsequent calls set `parent_gobject_id`,
|
||||||
|
`parent_tag_name`, or `parent_contained_path`. Filter fields match
|
||||||
|
`DiscoverHierarchy`. Each response pairs `children` with `child_has_children` so
|
||||||
|
you know which nodes to expand. See
|
||||||
|
[Galaxy Repository](../../docs/GalaxyRepository.md#browsechildren) for full
|
||||||
|
request and filter semantics.
|
||||||
|
|
||||||
|
```python
|
||||||
|
from zb_mom_ww_mxgateway.generated import galaxy_repository_pb2 as galaxy_pb2
|
||||||
|
|
||||||
|
reply = await galaxy.browse_children(galaxy_pb2.BrowseChildrenRequest())
|
||||||
|
for child, has_children in zip(reply.children, reply.child_has_children):
|
||||||
|
print(child.tag_name, "expand=" + str(has_children))
|
||||||
|
```
|
||||||
|
|
||||||
### Watching deploy events
|
### Watching deploy events
|
||||||
|
|
||||||
`GalaxyRepositoryClient.watch_deploy_events` opens a server-streaming
|
`GalaxyRepositoryClient.watch_deploy_events` opens a server-streaming
|
||||||
|
|||||||
@@ -138,6 +138,25 @@ cargo run -p mxgw-cli -- galaxy last-deploy-time --endpoint http://localhost:500
|
|||||||
cargo run -p mxgw-cli -- galaxy discover-hierarchy --endpoint http://localhost:5000 --api-key-env MXGATEWAY_API_KEY --json
|
cargo run -p mxgw-cli -- galaxy discover-hierarchy --endpoint http://localhost:5000 --api-key-env MXGATEWAY_API_KEY --json
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Browsing lazily
|
||||||
|
|
||||||
|
For UI trees or OPC UA bridges, use `browse_children` to walk one level at a
|
||||||
|
time instead of paging the full hierarchy. Pass a default request for root
|
||||||
|
objects; subsequent calls set `parent_gobject_id`, `parent_tag_name`, or
|
||||||
|
`parent_contained_path`. Filter fields match `discover_hierarchy`. Each response
|
||||||
|
pairs `children` with `child_has_children` so you know which nodes to expand. See
|
||||||
|
[Galaxy Repository](../../docs/GalaxyRepository.md#browsechildren) for full
|
||||||
|
request and filter semantics.
|
||||||
|
|
||||||
|
```rust
|
||||||
|
use zb_mom_ww_mxgateway_client::generated::galaxy_repository::v1::BrowseChildrenRequest;
|
||||||
|
|
||||||
|
let reply = galaxy.browse_children(BrowseChildrenRequest::default()).await?.into_inner();
|
||||||
|
for (child, has_children) in reply.children.iter().zip(reply.child_has_children.iter()) {
|
||||||
|
println!("{} expand={}", child.tag_name, has_children);
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
### Watching deploy events
|
### Watching deploy events
|
||||||
|
|
||||||
`watch_deploy_events` opens the `WatchDeployEvents` server stream. The
|
`watch_deploy_events` opens the `WatchDeployEvents` server stream. The
|
||||||
|
|||||||
@@ -65,6 +65,9 @@ Detailed follow-up docs:
|
|||||||
- `docs/GalaxyRepository.md` covers the read-only Galaxy Repository browse
|
- `docs/GalaxyRepository.md` covers the read-only Galaxy Repository browse
|
||||||
RPCs that let clients enumerate the deployed object hierarchy and dynamic
|
RPCs that let clients enumerate the deployed object hierarchy and dynamic
|
||||||
attributes before subscribing via the MXAccess gateway service.
|
attributes before subscribing via the MXAccess gateway service.
|
||||||
|
`DiscoverHierarchy` returns paged flat results; `BrowseChildren` returns
|
||||||
|
the direct children of one parent for OPC UA-style lazy tree walks — see
|
||||||
|
[Galaxy Repository](docs/GalaxyRepository.md#browsechildren).
|
||||||
|
|
||||||
Implementation style guides:
|
Implementation style guides:
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user