Skip to content

masterofmonkeys/foreman-java-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Foreman Java SDK v1.0

Maven Artifact

Add the dependency to your maven project.

	<dependency>
		<groupId>net.munichconsulting.thirdparty</groupId>
		<artifactId>foreman</artifactId>
		<version>1.0.0-SNAPSHOT</version>
	</dependency>

Usage

Get a ForemanClient instance - by providing your API's URL, username and password, and then you can invoke any Foreman command, like GetDashboad, list all hostgroup defined...

   ForemanClient client = new ForemanClient(FOREMAN_API_URL, "username", "password");
   Dashboard dashboard = client.execute(new GetDashboard());
   
   HostGroupWrapper[] groups = client.execute(new ListHostGroups());
   for (int i = 0; i < groups.length; i++) {
       System.out.println(groups[i].getHostGroup().getLabel());
       System.out.println(groups[i].getHostGroup().getParameters());	
   }   

About

Foreman's Java SDK

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages