OVH SDK For Java

DESC.

License

License

Categories

Categories

IDE Development Tools Java Languages Net
GroupId

GroupId

net.minidev
ArtifactId

ArtifactId

ovh-java-sdk
Last Version

Last Version

1.0.17
Release Date

Release Date

Type

Type

jar
Description

Description

OVH SDK For Java
DESC.
Project URL

Project URL

https://github.com/UrielCh/ovh-java-sdk

Download ovh-java-sdk

How to add to project

<!-- https://jarcasting.com/artifacts/net.minidev/ovh-java-sdk/ -->
<dependency>
    <groupId>net.minidev</groupId>
    <artifactId>ovh-java-sdk</artifactId>
    <version>1.0.17</version>
</dependency>
// https://jarcasting.com/artifacts/net.minidev/ovh-java-sdk/
implementation 'net.minidev:ovh-java-sdk:1.0.17'
// https://jarcasting.com/artifacts/net.minidev/ovh-java-sdk/
implementation ("net.minidev:ovh-java-sdk:1.0.17")
'net.minidev:ovh-java-sdk:jar:1.0.17'
<dependency org="net.minidev" name="ovh-java-sdk" rev="1.0.17">
  <artifact name="ovh-java-sdk" type="jar" />
</dependency>
@Grapes(
@Grab(group='net.minidev', module='ovh-java-sdk', version='1.0.17')
)
libraryDependencies += "net.minidev" % "ovh-java-sdk" % "1.0.17"
[net.minidev/ovh-java-sdk "1.0.17"]

Dependencies

compile (75)

Group / Artifact Type Version
net.minidev : ovh-java-sdk-allDom Optional jar 1.0.17
net.minidev : ovh-java-sdk-core Optional jar 1.0.17
net.minidev : ovh-java-sdk-caascontainers Optional jar 1.0.17
net.minidev : ovh-java-sdk-caasregistry Optional jar 1.0.17
net.minidev : ovh-java-sdk-cdndedicated Optional jar 1.0.17
net.minidev : ovh-java-sdk-cdnwebsite Optional jar 1.0.17
net.minidev : ovh-java-sdk-cdnwebstorage Optional jar 1.0.17
net.minidev : ovh-java-sdk-cloud Optional jar 1.0.17
net.minidev : ovh-java-sdk-clusterhadoop Optional jar 1.0.17
net.minidev : ovh-java-sdk-connectivity Optional jar 1.0.17
net.minidev : ovh-java-sdk-contact Optional jar 1.0.17
net.minidev : ovh-java-sdk-dbaaslogs Optional jar 1.0.17
net.minidev : ovh-java-sdk-dbaasqueue Optional jar 1.0.17
net.minidev : ovh-java-sdk-dbaastimeseries Optional jar 1.0.17
net.minidev : ovh-java-sdk-dedicatedceph Optional jar 1.0.17
net.minidev : ovh-java-sdk-dedicatedhousing Optional jar 1.0.17
net.minidev : ovh-java-sdk-dedicatedinstallationTemplate Optional jar 1.0.17
net.minidev : ovh-java-sdk-dedicatednas Optional jar 1.0.17
net.minidev : ovh-java-sdk-dedicatednasha Optional jar 1.0.17
net.minidev : ovh-java-sdk-dedicatedserver Optional jar 1.0.17
net.minidev : ovh-java-sdk-dedicatedCloud Optional jar 1.0.17
net.minidev : ovh-java-sdk-deskaas Optional jar 1.0.17
net.minidev : ovh-java-sdk-distributionimage Optional jar 1.0.17
net.minidev : ovh-java-sdk-domain Optional jar 1.0.17
net.minidev : ovh-java-sdk-emaildomain Optional jar 1.0.17
net.minidev : ovh-java-sdk-emailexchange Optional jar 1.0.17
net.minidev : ovh-java-sdk-emailpro Optional jar 1.0.17
net.minidev : ovh-java-sdk-freefax Optional jar 1.0.17
net.minidev : ovh-java-sdk-horizonView Optional jar 1.0.17
net.minidev : ovh-java-sdk-hostingprivateDatabase Optional jar 1.0.17
net.minidev : ovh-java-sdk-hostingreseller Optional jar 1.0.17
net.minidev : ovh-java-sdk-hostingweb Optional jar 1.0.17
net.minidev : ovh-java-sdk-hpcspot Optional jar 1.0.17
net.minidev : ovh-java-sdk-ip Optional jar 1.0.17
net.minidev : ovh-java-sdk-ipLoadbalancing Optional jar 1.0.17
net.minidev : ovh-java-sdk-kube Optional jar 1.0.17
net.minidev : ovh-java-sdk-licensecloudLinux Optional jar 1.0.17
net.minidev : ovh-java-sdk-licensecpanel Optional jar 1.0.17
net.minidev : ovh-java-sdk-licensedirectadmin Optional jar 1.0.17
net.minidev : ovh-java-sdk-licenseoffice Optional jar 1.0.17
net.minidev : ovh-java-sdk-licenseplesk Optional jar 1.0.17
net.minidev : ovh-java-sdk-licensesqlserver Optional jar 1.0.17
net.minidev : ovh-java-sdk-licensevirtuozzo Optional jar 1.0.17
net.minidev : ovh-java-sdk-licensewindows Optional jar 1.0.17
net.minidev : ovh-java-sdk-licenseworklight Optional jar 1.0.17
net.minidev : ovh-java-sdk-me Optional jar 1.0.17
net.minidev : ovh-java-sdk-metrics Optional jar 1.0.17
net.minidev : ovh-java-sdk-msServices Optional jar 1.0.17
net.minidev : ovh-java-sdk-newAccount Optional jar 1.0.17
net.minidev : ovh-java-sdk-order Optional jar 1.0.17
net.minidev : ovh-java-sdk-overTheBox Optional jar 1.0.17
net.minidev : ovh-java-sdk-paastimeseries Optional jar 1.0.17
net.minidev : ovh-java-sdk-packsiptrunk Optional jar 1.0.17
net.minidev : ovh-java-sdk-packxdsl Optional jar 1.0.17
net.minidev : ovh-java-sdk-partners Optional jar 1.0.17
net.minidev : ovh-java-sdk-price Optional jar 1.0.17
net.minidev : ovh-java-sdk-router Optional jar 1.0.17
net.minidev : ovh-java-sdk-saascsp2 Optional jar 1.0.17
net.minidev : ovh-java-sdk-secret Optional jar 1.0.17
net.minidev : ovh-java-sdk-service Optional jar 1.0.17
net.minidev : ovh-java-sdk-sms Optional jar 1.0.17
net.minidev : ovh-java-sdk-ssl Optional jar 1.0.17
net.minidev : ovh-java-sdk-sslGateway Optional jar 1.0.17
net.minidev : ovh-java-sdk-stackmis Optional jar 1.0.17
net.minidev : ovh-java-sdk-status Optional jar 1.0.17
net.minidev : ovh-java-sdk-store Optional jar 1.0.17
net.minidev : ovh-java-sdk-supplymondialRelay Optional jar 1.0.17
net.minidev : ovh-java-sdk-support Optional jar 1.0.17
net.minidev : ovh-java-sdk-telephony Optional jar 1.0.17
net.minidev : ovh-java-sdk-veeamveeamEnterprise Optional jar 1.0.17
net.minidev : ovh-java-sdk-veeamCloudConnect Optional jar 1.0.17
net.minidev : ovh-java-sdk-vip Optional jar 1.0.17
net.minidev : ovh-java-sdk-vps Optional jar 1.0.17
net.minidev : ovh-java-sdk-vrack Optional jar 1.0.17
net.minidev : ovh-java-sdk-xdsl Optional jar 1.0.17

Project Modules

There are no modules declared in this project.

OVH logo

Ovh-java-sdk

Build Status Maven Central

Project on-hold

Since every change from OVH API can break any existing code using this api, I prefert to give up this java wrapper. I have switch to typescript I'm converting all my existing code to use api-ovh-node

A lot's of sample code are available here

With this new api far is way more easy to read.


usage

The complete java SDK for OVH services.

Each service had his own java SDK. you can use each service independently:

<dependency>
	<groupId>net.minidev</groupId>
	<artifactId>ovh-java-sdk-domain</artifactId>
	<version>1.0.17</version>
</dependency>
<dependency>
	<groupId>net.minidev</groupId>
	<artifactId>ovh-java-sdk-order</artifactId>
	<version>1.0.17</version>
</dependency>

Or you can load them all with a single dependency:

<dependency>
	<groupId>net.minidev</groupId>
	<artifactId>ovh-java-sdk</artifactId>
	<version>1.0.17</version>
</dependency>

But it's not recomended, excepted if you use them all.

Usage sample

Using the all in one SDK:

List all your domain with their expiration dates.

ApiOvh api = ApiOvh.getInstance(nic, password);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
for (String serviceName : api.domain.GET(null)) {
    OvhService service = api.domain.serviceName_serviceInfos_GET(serviceName);
    System.out.printf("%s status:%s expire on:%s\n", serviceName,
    service.status.toString(), sdf.format(service.expiration));
}

by default you will get the following error:

[main] ERROR net.minidev.ovh.core.ApiOvhConfigBasic - No cert directory, can not save consumer_key! please set `consumer_key_storage` variable to a valid directory in your ./ovh.conf, ~/.ovh/config, ~/ovh.conf or /etc/ovh.conf, or in your environ variale OVH_CONSUMER_KEY_STORAGE
[main] ERROR net.minidev.ovh.core.ApiOvhConfigBasic - no applicationKey, using the defaut one create a key, and set `application_key` and `application_secret` variable in your ./ovh.conf, ~/.ovh/config, ~/ovh.conf or /etc/ovh.conf, or in your environ variales OVH_APPLICATION_KEY and OVH_APPLICATION_SECRET

because you need to configure your ovh access, but it will work.

Using ApiOvhDomain:

List all your domains with their expiration dates, only using ovh-java-sdk-domain dependence.

ApiOvhCore core = ApiOvhCore.getInstance(nic, password);
ApiOvhDomain api = new ApiOvhDomain(core);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
for (String serviceName : api.GET(null)) {
    OvhService service = api.serviceName_serviceInfos_GET(serviceName);
    System.out.printf("%s status:%s expire on:%s\n", serviceName,
    service.status.toString(), sdf.format(service.expiration));
}

you get the same results.

Configuration file

The configuration is loaded from the following files in this order:

  1. ovh.conf in the current directory
  2. ~/.ovh/config
  3. ~/ovh.conf
  4. /etc/ovh.conf

the configuration file can contain those values:

  • endpoint entry point if you use a single endpoint
  • application_key your application key
  • application_secret your application secret
  • consumer_key your consumer key (CK) if you are using a single account
  • redirection the redirection linked to your application_key
  • consumer_key_storage a directory to store your CK in multi account mode.

Function naming

Java method has the same name that their REST URL, just replace special chars by _ and postfix the result by the uppercased http method example:

POST /telephony/{billingAccount}/conference/{serviceName}/participants/{id}/mute
GET  /telephony/{billingAccount}/abbreviatedNumber/{abbreviatedNumber}

will be named:

billingAccount_conference_serviceName_participants_id_mute_POST(billingAccount, serviceName, id, ...)
billingAccount_abbreviatedNumber_abbreviatedNumber_GET(billingAccount, abbreviatedNumber)

so that you can easily guest all the function names.

  • the namespace are removed form the method name.
  • using the main ApiOvh fron ovh-java-sdk this called is available through apiOvh.telephony.billingAccount_abbreviatedNumber_abbreviatedNumber_GET

Services:

All services are present excepted ovh-java-sdk-auth, that one is embedded in the main ovh-java-sdk-core artefact.

Authentication

You can use:

  • a user/password: in this case the API generates ConsumerKey on demand for TTL_IN_SEC, and renew them if needed. ApiOvhCore.getInstance("nic", "password", TTL_IN_SEC)
  • a ConsumerKey: provided by your code. ApiOvhCore.getInstance("My__consumer___key") (available in version 0.9.1)
  • a ConsumerKey: provided in your configuration, in this case you can only use a single account. ApiOvhCore.getInstance() (available in version 0.9.1)

About the API:

  • This api is the public version of the Api used to manage the biggest OVH customer resources.
  • The first version of our API had never been released for the sake of ovh. (We outaged OVH a couple of times with the previous version)
  • This api had been built to use multiple accounts in the same time.

Supported APIs

Try the official API api Ovh europe.

License

3-Clause BSD

Versions

Version
1.0.17
0.9.15
0.9.14
0.9.13
0.9.12
0.9.11
0.9.10
0.9.9
0.9.8
0.9.6
0.9.4
0.9.3
0.9.2
0.9.1
0.9