Skip to content

Commit 81ad354

Browse files
committed
more details on the request and response.
1 parent dac2d1d commit 81ad354

File tree

1 file changed

+85
-11
lines changed

1 file changed

+85
-11
lines changed

articles/ai-foundry/foundry-local/reference/reference-catalog-api.md

Lines changed: 85 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,26 +15,100 @@ author: maanavd
1515

1616
This document provides a detailed reference for catalog implementers that want to create their own catalog implementations to be integrated with Foundry Local.
1717

18-
## Catalog Host
18+
The catalog API is a RESTful API that allows you to query and manage your model catalog. The API supports the following operations:
1919

20-
### URI format
20+
- **Search**: Search for models in the catalog based on various criteria.
21+
- **List**: List all models in the catalog.
2122

22-
The catalog host URI is the base URL for your catalog API. It should be in the following format:
23+
## Request
2324

24-
```
25-
https://<catalog provider URI>/<provider subpath>
26-
```
25+
THe catalog API is a POST endpoint that accepts a JSON request body. The request must be anonymous and does not require authentication.
26+
27+
The request format for the catalog API is as follows:
28+
29+
- **Method**: `POST`
30+
- **Content-Type**: `application/json`
31+
- **User-Agent**: `AzureAiStudio`
2732

28-
### Authorization
33+
The request body must be a JSON object that contains the following fields:
2934

30-
All endpoints must support:
35+
- `resourceIds`: An array of resource IDs that specify the resources to be queried.
36+
- `indexEntitiesRequest`: An object that contains the search parameters.
37+
- `filters`: An array of filter objects that specify the criteria for filtering the search results.
38+
- `pageSize`: The maximum number of results to return (for pagination).
39+
- `skip`: The number of results to skip (for pagination).
40+
- `continuationToken`: A token for pagination to continue from a previous request.
3141

32-
- Anonymous access (no authentication required)
42+
### Example request
3343

44+
```bash
45+
curl POST <your-catalog-api-endpoint> \
46+
-H "Content-Type: application/json" \
47+
-H "User-Agent: AzureAiStudio" \
48+
-d '{
49+
"resourceIds": [
50+
{
51+
"resourceId": "azureml",
52+
"entityContainerType": "Registry"
53+
}
54+
],
55+
"indexEntitiesRequest": {
56+
"filters": [
57+
{
58+
"field": "type",
59+
"operator": "eq",
60+
"values": [
61+
"models"
62+
]
63+
},
64+
{
65+
"field": "kind",
66+
"operator": "eq",
67+
"values": [
68+
"Versioned"
69+
]
70+
},
71+
{
72+
"field": "labels",
73+
"operator": "eq",
74+
"values": [
75+
"latest"
76+
]
77+
},
78+
{
79+
"field": "annotations/tags/foundryLocal",
80+
"operator": "eq",
81+
"values": [
82+
""
83+
]
84+
},
85+
{
86+
"field": "properties/variantInfo/variantMetadata/device",
87+
"operator": "eq",
88+
"values": [
89+
"cpu",
90+
"gpu"
91+
]
92+
},
93+
{
94+
"field": "properties/variantInfo/variantMetadata/executionProvider",
95+
"operator": "eq",
96+
"values": [
97+
"cpuexecutionprovider",
98+
"webgpuexecutionprovider"
99+
]
100+
}
101+
],
102+
"pageSize": 10,
103+
"skip": null,
104+
"continuationToken": null
105+
}
106+
}'
107+
```
34108

35-
## JSON response format
109+
## Reponse
36110

37-
Your endpoint must return a JSON response. The response schema is as follows:
111+
The response from the catalog API is a JSON object that contains the search results. The response schema is as follows:
38112

39113
```json
40114
{

0 commit comments

Comments
 (0)