Coder Social home page Coder Social logo

r2z's Introduction

WARNING: THIS REPOSITORY IS MARKED AS 'DEPRECATED' AND WON'T BE MAINTAINED. CONSIDER SWITCHING TO ZOWE CLIENT KOTLIN SDK WITH THE SIMILAR APPROACH TO WORK WITH Z/OSMF REST API (link)

zOSMF Retrofit Library

This library covert zOSMF Rest API with kotlin object oriented code using Retrofit. r2z will allow you to send http requests to your zOSMF.

Installation

To install this library in your project use one of build tools like Maven, Gradle or Ant. Use the link below to get necessary artifacts. https://mvnrepository.com/artifact/eu.ibagroup/r2z

<dependency>
  <groupId>eu.ibagroup</groupId>
  <artifactId>r2z</artifactId>
  <version>{version}</version>
</dependency>

Guide

In r2z you can find ...API classes. They can be used to send requests to zOSMF. Besides API classes there located data classes like Dataset. Their purpose is to wrap a response from the server or a request into it using an object model. let's look at an example.

// Create stub for DataAPI interface using Retrofit. Here baseUrl is url of your zOSMF service.
val dataAPI = Retrofit.Builder()
  .baseUrl(baseUrl)
  .addConverterFactory(GsonConverterFactory.create())
  .client(client)
  .build()
  .create(DataAPI::class.java)

// You can use basic authentication to access zOSMF.
val basicCreds = Credentials.basic(zosmfUser, zosmfPassword) ?: ""

// Call method you need and get Request object.
val request = dataAPI.listDatasetMembers(
  authorizationToken = basicCreds,
  datasetName = "EXAMPLE.DATASET"
)

// Execute request to get Response object.
val response = request.execute()

// If the request went well you can get result from response body.
if (response.isSuccessful){
  val members = response.body();
}

Please note that in order to create API stub, you have to specify that the response should be converted by gson. And that's how you can easily use r2z.

Documentation with Dokka

To build Dokka documentattion, run:

./gradlew dokkaHtml

Docs will be added to build/dokka/html

How to run tests

Unit tests

To run unit tests:

./gradlew test -x signArchives

Integration tests

NOTE: integration tests use a specific environment. To test their correctness, you need either create the compliant one, or change the tests

Before running integration tests, you need three variables to be set up:

  • ZOSMF_TEST_URL - URL of the real mainframe with z/OSMF API to run the tests
  • ZOSMF_TEST_USERNAME - username with appropriate permissions to run the tests
  • ZOSMF_TEST_PASSWORD - user password to run the tests

To run integration tests:

./gradlew intTest

r2z's People

Contributors

atsikhamirau avatar belobockii avatar hhaliuk avatar hunts396 avatar kbranavitski avatar kugdev avatar legimonas avatar studenich avatar vkrus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

pinpan

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.