You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: cradle-admin-tool-http/README.md
+11-2
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
# cradle-admin-tool-http (1.7.2)
1
+
# cradle-admin-tool-http (1.8.0)
2
2
Service which allows user to manage books/pages via RestAPI requests.
3
3
- The first page in a book can be created only if start time is more than current time.
4
4
- After the first page all new pages must have start time more than current time + `bookRefreshIntervalMillis` * 2
@@ -12,7 +12,10 @@ Service which allows user to manage books/pages via RestAPI requests.
12
12
-**ip** - host where http cradle admin instance will be instanciated. Default value: `0.0.0.0`
13
13
-**port** - port on which http server will listen user requests. Default value: `8080`
14
14
-**page-recheck-interval** - interval in seconds which `PageManager` service checks if new page is required to create or not based on duration values presented in `auto-pages`. Default value: 60 seconds
15
-
-**auto-pages** - defines rule for automatic pages creation for multiple books. If empty no pages will be created automatically. Default value: `empty_map`.
15
+
-**auto-book** - if `true` than cradle-admin-tool creates books with first page for each value from `auto-pages` option when target book doesn't exist in cradle.
16
+
Creation book time is calculate by the `current time - 1 day` formula to cover events and messages published a bit earlier than cradle-admin-tool started. Default value: `true`.
17
+
Please note you can create your own book via REST API later.
18
+
-**auto-pages** - defines rule for automatic pages creation for multiple books. If empty no pages will be created automatically.
16
19
-**page-duration** - defines duration of the page for the book. Value uses the Java Duration format. You can read more about it [here](https://docs.oracle.com/javase/8/docsT/api/java/time/Duration.html#parse-java.lang.CharSequence-).
17
20
-**page-start-time** - baseline date and time for every new page created by `PageManager` for this book.
thrownewIllegalStateException("Storage doesn't contain the '" + bookName + "' book. Create book manually or enable auto-book functionality in configuration");
170
+
}
171
+
172
+
BookToAddbookToAdd = newBookToAdd(
173
+
bookName,
174
+
Instant.now().minus(1, ChronoUnit.DAYS)
175
+
);
176
+
bookToAdd.setFullName(bookName);
177
+
bookToAdd.setDesc(AUTO_BOOK_DESCRIPTION);
178
+
179
+
BookInfobookInfo = storage.addBook(bookToAdd);
180
+
181
+
LOGGER.info("Created '{}' book, time: {}, full name: {}, description: {}",
0 commit comments