Get Hubs
You can consider this task as your “Hello World” tutorial. It lets you send a request to the Manufacturing Data Model server, and receive a response in a few steps.
Key learnings
By the end of this task, you will be able to:
Queries used in this task
You will use the following queries in this task:
Type | Operation | Description |
---|---|---|
Query | hubs | Retrieves all hubs accessible to you. |
Step 1 - Request a list of Hubs
The hubs query returns a Hubs object which contains an array of Hubs objects.
While the Hub object has many fields, for this exercise, we will be requesting the id
and the name
fields only.
- In Manufacturing Data Model Explorer, enter the following query in the Query Pane:
Query
query GetHubs {
hubs {
results {
id
name
}
}
}
Show More
- Click Play. A list of hubs that you have access to is displayed in the response section. It should be similar to the following code-block:
Response
{
"data": {
"hubs": {
"results": [
{
"id": "a.YnVzaW5lc3M6YXV0b2Rlc2s2MTA0",
"name": "L2-Forge-Data-Team"
},
{
"id": "a.YnVzaW5lc3M6YXV0b2Rlc2s0NTA5",
"name": "Michelangelo’s Playground"
}
]
}
}
}
Show More
- Note down the ID of the hubs that you wish to use. You will need this ID for the remaining tasks. For illustration, in this tutorial we have used the ID of the hub named
L2-Forge-Data-Team
.
After working through the steps mentioned above, you should see a screen similar to the following image.
