PNC Groovy Client Parent

A client for the PNC REST API

License

License

Categories

Categories

Groovy Languages
GroupId

GroupId

ca.szc.groovy.pnc
ArtifactId

ArtifactId

pnc-groovy-parent
Last Version

Last Version

1.2.2
Release Date

Release Date

Type

Type

pom
Description

Description

PNC Groovy Client Parent
A client for the PNC REST API
Project URL

Project URL

https://github.com/ASzc/pnc-groovy-client
Source Code Management

Source Code Management

https://github.com/ASzc/pnc-groovy-client

Download pnc-groovy-parent

How to add to project

<!-- https://jarcasting.com/artifacts/ca.szc.groovy.pnc/pnc-groovy-parent/ -->
<dependency>
    <groupId>ca.szc.groovy.pnc</groupId>
    <artifactId>pnc-groovy-parent</artifactId>
    <version>1.2.2</version>
    <type>pom</type>
</dependency>
// https://jarcasting.com/artifacts/ca.szc.groovy.pnc/pnc-groovy-parent/
implementation 'ca.szc.groovy.pnc:pnc-groovy-parent:1.2.2'
// https://jarcasting.com/artifacts/ca.szc.groovy.pnc/pnc-groovy-parent/
implementation ("ca.szc.groovy.pnc:pnc-groovy-parent:1.2.2")
'ca.szc.groovy.pnc:pnc-groovy-parent:pom:1.2.2'
<dependency org="ca.szc.groovy.pnc" name="pnc-groovy-parent" rev="1.2.2">
  <artifact name="pnc-groovy-parent" type="pom" />
</dependency>
@Grapes(
@Grab(group='ca.szc.groovy.pnc', module='pnc-groovy-parent', version='1.2.2')
)
libraryDependencies += "ca.szc.groovy.pnc" % "pnc-groovy-parent" % "1.2.2"
[ca.szc.groovy.pnc/pnc-groovy-parent "1.2.2"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

  • client
  • cli

PNC Groovy Client

A minimal Newcastle REST API Client written in Groovy.

Overview

Features

  • Always has the latest operations (swagger API data processed at runtime)
  • Read-only queries do not require authentication
  • Transparent pagination (pages are detected, fetched, and unpacked for you)
  • Authentication
  • Optional CLI
    • RPM available with pre-written config file
    • debugging
    • shell scripts
    • discovering new API operations
    • allows multiple PNC instances to be accessed from one config file (using --config-prefix)
    • generally conforms to POSIX CLI conventions

TODO

  • Body parameters (used for some non-idempotent operations)
    • Model mapping
    • Construction arguments
  • First release to maven central

Usage

CLI

alias pgc='java -jar cli/target/pnc-groovy-cli-1.0.0-SNAPSHOT-executable.jar'
echo 'pnc.url=http://orch.example.com/pnc-rest/rest/swagger.json' > $HOME/.config/pgc.properties
pgc -h
pgc list -h
pgc call -h
pnc_version="$(pgc call build-records get-specific -a id=7113 | jq -r '.executionRootVersion')"

API

def pnc = new PncClient('http://orch.example.com/pnc-rest/rest/swagger.json')
Map buildInfo = pnc.exec(
    'buildRecords', 'getSpecific',
    id: 7113,
)
String pncVersion = buildInfo['executionRootVersion']

Development

Compile

mvn clean package

Unit Tests

Unit tests are executed by default during compilation

Integration Tests

mvn clean package -Dintegration.pnc.host=pnc-orch-master-nightly.cloud.pnc.devel.example.com

Versions

Version
1.2.2
1.2.1
1.2.0
1.1.2
1.1.1
1.1.0
1.0.0