Skip to content

Commit 8250a90

Browse files
author
Cristi
committed
update documentation for 1.1.0 version
1 parent 9ae7be7 commit 8250a90

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

README.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ To use the client add the project declaration to your `pom.xml`:
2626
<dependency>
2727
<groupId>com.coscale.sdk-java</groupId>
2828
<artifactId>coscale-sdk-java</artifactId>
29-
<version>1.0.1</version>
29+
<version>1.1.0</version>
3030
</dependency>
3131
```
3232

@@ -38,6 +38,7 @@ Resources this API supports:
3838
- [Data](#data)
3939
- [Servers](#servers)
4040
- [Events](#events)
41+
- [Requests](#requests)
4142

4243

4344
## Authentication
@@ -129,6 +130,12 @@ Server server = apiFactory.getServersApi().insert(serverInsert);
129130
// To get a server by the name we can add a filter.
130131
Options filter = new Builder().selectBy("name", "Ubuntu Server").build();
131132
apiFactory.getServersApi().all(filter);
133+
134+
// Get the server attributes.
135+
Options options = new Options.Builder().expand("attributes").build();
136+
Server server = serversApi.getServer(server.id, options);
137+
// or
138+
List<Server> servers = serversApi.all(options);
132139
```
133140

134141
### Events
@@ -154,6 +161,20 @@ EventData eventData = eventsApi.getData(event.id, eventData.id);
154161
Msg msg = eventsApi.deleteData(event.id, eventData.id);
155162
```
156163

164+
### Requests
165+
166+
```java
167+
// Get a request by id.
168+
Request request = requestsApi.get(request.id);
169+
170+
// Get all Requests.
171+
List<Request> requests = requestsApi.all();
172+
173+
// Get all Requests and filter by attributes.
174+
Options options = new Options.Builder().selectBy("name", "example.coscale.com").build();
175+
List<Request> requests = requestsApi.all(options);
176+
```
177+
157178
## Subject
158179

159180
A metric or a event is defined on either a "SERVER" or "APPLICATION".

0 commit comments

Comments
 (0)