com.oneops:oneops-client

Common build configuration for OneOps projects.

License

License

Categories

Categories

CLI User Interface
GroupId

GroupId

com.oneops
ArtifactId

ArtifactId

oneops-client
Last Version

Last Version

5.0.25
Release Date

Release Date

Type

Type

jar
Description

Description

Common build configuration for OneOps projects.
Project Organization

Project Organization

Walmart, Inc.
Source Code Management

Source Code Management

https://github.com/oneops/OneOpsAPIClient

Download oneops-client

How to add to project

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

Dependencies

compile (7)

Group / Artifact Type Version
com.jayway.restassured : rest-assured jar 2.9.0
org.json : json jar 20151123
com.google.guava : guava jar 20.0
com.fasterxml.jackson.core : jackson-core jar 2.7.3
com.fasterxml.jackson.core : jackson-databind jar 2.7.3
org.apache.commons : commons-io jar 1.3.2
org.slf4j : slf4j-api jar 1.7.21

test (1)

Group / Artifact Type Version
junit : junit jar 3.8.1

Project Modules

There are no modules declared in this project.

OneOpsAPIClient

This library provides java client for OneOps APIs across all types of resources. Each of the resources client java class provides contextual APIs. The resources for which API client is available are:

  • Account
  • Assembly
  • Cloud
  • Design
  • Transition
  • Monitor
  • Operation

Example code for sample routines are present in test package

Routine for App life cycle is added in PackLifeCycleTests.java with steps involving

  • create assembly
  • create platform with or without yaml
  • create environment
  • start deployment
  • execute actions across all component instances after successful deployment
  • delete resources
  • delete environment
  • delete platforms
  • delete assembly

Example code to commit and deploy

OOInstance instance = new OOInstance();
instance.setAuthtoken("myToken");
instance.setOrgname("myOrg");
instance.setEndpoint("https://localhost:9090/");

Transition transition = new Transition(instance , assembly);
Release latestRelease = transition.getLatestRelease(environment);
String releaseState = latestRelease.getReleaseState();
//commit if an open release id found
if("open".equals(releaseState)) {
	Deployment latestDeployment = transition.getLatestDeployment(environment);
	Long deploymentId = latestDeployment.getDeploymentId();
	waitForActiveDeployment(instance, assembly, environment, deploymentId);
	transition.commitEnvironment(environment, null, "test deployment");
} else {
	CiResource env = transition.getEnvironment(environment);
	String envState = env.getCiState();
	while("locked".equals(envState)) {
		Uninterruptibles.sleepUninterruptibly(20, TimeUnit.SECONDS);
		env = transition.getEnvironment(environment);
		envState = env.getCiState();
	}
}

//deploy
Deployment deploy = transition.deploy(environment, "test deploy");
Long deploymentId = deploy.getString("deploymentId");

transition.getDeploymentStatus(environment, deploymentId);
waitForActiveDeployment(instance, assembly, environment, deploymentId);

Example code to poll deployment state until it reaches end state

OOInstance instance = new OOInstance();
instance.setAuthtoken("myToken");
instance.setOrgname("myOrg");
instance.setEndpoint("https://localhost:9090/");

Transition transition = new Transition(instance , assembly);
Deployment deploymentStatus = transition.getDeploymentStatus(env, deploymentId);
String deploymentState = deploymentStatus.getDeploymentState();
while("active".equals(deploymentState)) {
	Uninterruptibles.sleepUninterruptibly(20, TimeUnit.SECONDS);
	deploymentStatus = transition.getDeploymentStatus(env, deploymentId);
	deploymentState = deploymentStatus.getDeploymentState();
	System.out.println(deploymentState);
} 

Example code to update variable value in Transition

OOInstance instance = new OOInstance();
instance.setAuthtoken("myToken");
instance.setOrgname("myOrg");
instance.setEndpoint("https://localhost:9090/");

Transition transition = new Transition(instance , assembly);

transition.updatePlatformVariable(environment, platform, "appVersion", "2.59", false);
transition.updateGlobalVariable(environment, "version", "2.59", false);
com.oneops

OneOps

Application Lifecycle Management of Cloud Based Workloads

Versions

Version
5.0.25
5.0.24
5.0.23
5.0.22
5.0.21
5.0.20
5.0.19
5.0.18
5.0.17
5.0.16
5.0.15
5.0.14
5.0.13
5.0.12
5.0.11
5.0.10
5.0.9
5.0.8
5.0.7
5.0.6
5.0.5
5.0.4
5.0.3
5.0.2