https://github.com/ow2-proactive/catalog
https://github.com/ow2-proactive/catalog
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/ow2-proactive/catalog
- Owner: ow2-proactive
- License: agpl-3.0
- Created: 2017-01-13T09:47:24.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2025-04-25T15:22:45.000Z (9 months ago)
- Last Synced: 2025-05-13T11:15:00.143Z (8 months ago)
- Language: Java
- Size: 19.9 MB
- Stars: 3
- Watchers: 17
- Forks: 24
- Open Issues: 18
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# ProActive Catalog
[](http://jenkins.activeeon.com/job/generic-catalog/)
[](https://coveralls.io/github/ow2-proactive/catalog?branch=origin%2Fmaster)
The goal of the catalog is to store ProActive objects. It is the catalog for general purpose.
The stored objects in the catalog could be:
- rule for PCW service
- workflows
- selection script
- Proactive pre/post task
- objects for authentication service
- any kind of other objects
Catalog contains a set of objects organized into buckets with versioning capabilities.
A single Bucket can store multiple kinds of objects
## Building and deploying
You can build a WAR file as follows:
```
$ ./gradlew clean build war
```
Then, you can directly deploy the service with embedded Tomcat:
```
$ java -jar build/libs/catalog-X.Y.Z-SNAPSHOT.war
```
The WAR file produced by Gradle can also be deployed in the embedded Jetty container started by an instance of [ProActive Server](https://github.com/ow2-proactive/scheduling).
## Samples with REST API
Available resources can be listed and tested with Swagger.
A complete documentation of the Catalog REST API is available by default on:
[http://localhost:8080/catalog/swagger-ui.html](http://localhost:8080/catalog/swagger-ui.html)
Below are some REST invocations using [HTTPie](https://github.com/jkbrzt/httpie).
### Bucket resource
Creating a new bucket named _test_:
```
$ http -f POST http://localhost:8080/buckets name=test-bucket
```
Getting information about bucket by name as identifier:
```
$ http http://localhost:8080/buckets/test-bucket
```
Listing available buckets:
```
$ http http://localhost:8080/buckets
```
### Object resource
**REST actions related to existing objects apply to the latest revision of the identified object.**
Adding a new object in bucket with name test-bucket:
```
$ http -f POST http://localhost:8080/buckets/test-bucket/objects file@/path/to/object.xml
```
Getting object metadata for object with name objectName in bucket test-bucket:
```
$ http http://localhost:8080/buckets/test-bucket/objects/objectName
```
Fetching the raw content of a last revision for object with identifier objectName:
```
$ http http://localhost:8080/buckets/{bucketName}/resources/{objectName}/raw
```
Listing objects managed by bucket with name test-bucket:
```
$ http http://localhost:8080/buckets/test-bucket/objects
```
### Object revision resource
Adding a new object revision for object with name objectName in bucket with name test-bucket:
```
$ http -f POST http://localhost:8080/buckets/test-bucket/objects/objectName/revisions file@/path/to/object.xml
```
Getting object metadata for object with identifier objectName in bucket test-bucket for revision identified by commitTime:
```
$ http http://localhost:8080/buckets/test-bucket/objects/objectName/revisions/commitTime
```
Fetching raw object's content for object with identifier objectName and specific revision by commitTime:
```
$ http http://localhost:8080/buckets/{bucketName}/resources/{objectName}/revisions/{commitTime}/raw
```
Listing all revisions for object with name test-bucket:
```
$ http http://localhost:8080/buckets/test-bucket/objects/objectName/revisions
```
## GraphQL usage
GraphQL is the standardized query language, which provides opportunity to search and retrieve the Objects by specified criterion from the Catalog.
NOTE: Please follow the graphiql endpoint: http://localhost:8080/catalog/graphiql in order to query for the specific Object.
In GraphQL the user can filter Objects by specific parameters. The user will retrieve only the fields of Object that are required.
### Example of GraphQL query
The next example will fetch all Objects that has name like `Clear%` from `cloud-automation` bucket.
The response will return all fields, that are in the query.
```
{
allCatalogObjects(where: {AND: [{nameArg: {like: "Clear%"}}, {bucketNameArg: {eq: "cloud-automation"}}]}) {
edges {
bucketName
name
kind
contentType
metadata {
key
value
label
}
commitMessage
commitDateTime
link
}
page
size
totalPage
totalCount
hasNext
hasPrevious
}
}
```
More complex examples are available inside GraphqlServiceIntegrationTest class implementation.
For more information about existing search filters and model of Catalog Object, please check Documentation explorer in graphiql GUI.