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
This is a small wrapper for the OVH API in Java. It aims to provide tools to handle the most off-putting part of using this API.
3
+
This is a small wrapper for the OVH API in Java. It aims to provide tools to handle the most off-putting part of using this API.
4
+
5
+
## Installation
6
+
7
+
If you have a Maven installation, navigate to the folder in which you cloned the repo, and type :
8
+
9
+
```bash
10
+
mvn package
11
+
```
12
+
13
+
to compile and package the sources into a JAR file (usual output directory is 'target'). To install the packages inside your local Maven repository, type :
14
+
15
+
```bash
16
+
mvn install
17
+
```
18
+
19
+
## Sample usage
20
+
21
+
Include the Jar file as a dependency, then import the classes :
22
+
23
+
```java
24
+
importfr.rabian.ovhApi.core.beans.*;
25
+
```
26
+
27
+
You can then create an application and its manager, and get your first consumer :
28
+
29
+
```java
30
+
Application a =newApplication(AK, AS, Endpoint.ovh_eu);
31
+
AppManager am = a.getAppManager();
32
+
Consumer c;
33
+
34
+
ScopeElement g =newScopeElement("GET", "/*");
35
+
List<ScopeElement> scope =newArrayList<>();
36
+
scope.add(g);
37
+
38
+
try {
39
+
c = am.getConsumer(scope, "");
40
+
System.out.println(nc.getConsumerKey());
41
+
Scanner in =newScanner(System.in);
42
+
String wait = in.nextLine();
43
+
System.out.println(am.sendGetReq("/me", c));
44
+
} catch (NOKResponseException e) {
45
+
e.printStackTrace();
46
+
}
47
+
```
48
+
49
+
## License
50
+
51
+
This software is licensed under GNU GPL v3 license. Check the license file for details.
0 commit comments