PNC Groovy Client

A client for the PNC REST API

Лицензия

Лицензия

Категории

Категории

Groovy Языки программирования CLI Взаимодействие с пользователем
Группа

Группа

ca.szc.groovy.pnc
Идентификатор

Идентификатор

pnc-groovy-client
Последняя версия

Последняя версия

1.2.2
Дата

Дата

Тип

Тип

jar
Описание

Описание

PNC Groovy Client
A client for the PNC REST API

Скачать pnc-groovy-client

Как подключить последнюю версию

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

Зависимости

compile (4)

Идентификатор библиотеки Тип Версия
org.codehaus.groovy : groovy jar 2.5.2
org.codehaus.groovy : groovy-json jar 2.5.2
org.codehaus.groovy : groovy-xml jar 2.5.2
io.github.http-builder-ng : http-builder-ng-apache jar 1.0.3

test (2)

Идентификатор библиотеки Тип Версия
org.spockframework : spock-core jar 1.2-RC3-groovy-2.5
org.slf4j : slf4j-nop jar 1.7.25

Модули Проекта

Данный проект не имеет модулей.

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

Версии библиотеки

Версия
1.2.2
1.2.1
1.2.0
1.1.2
1.1.1
1.1.0
1.0.0