-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add Json documentation Signed-off-by: Olblak <me@olblak.com> * remove swp file Signed-off-by: Olblak <me@olblak.com> * Fix json example Signed-off-by: Olblak <me@olblak.com> Signed-off-by: Olblak <me@olblak.com>
- Loading branch information
Showing
2 changed files
with
111 additions
and
0 deletions.
There are no files selected for viewing
52 changes: 52 additions & 0 deletions
52
assets/code_example/docs/plugins/resources/json/updatecli.d/default.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: Basic Json Example | ||
|
||
scms: | ||
default: | ||
kind: git | ||
spec: | ||
url: https://github.com/updatecli/updatecli.git | ||
|
||
sources: | ||
local: | ||
name: Get value from json | ||
kind: json | ||
scmid: default | ||
spec: | ||
file: pkg/plugins/resources/json/testdata/data.json | ||
key: firstName | ||
http: | ||
name: Get value from json | ||
kind: json | ||
spec: | ||
file: https://www.updatecli.io/schema/latest/config.json | ||
key: $id | ||
|
||
conditions: | ||
local: | ||
name: Test value from json | ||
kind: json | ||
sourceid: local | ||
scmid: default | ||
spec: | ||
file: pkg/plugins/resources/json/testdata/data.json | ||
key: firstName | ||
http: | ||
name: Test value from json | ||
kind: json | ||
disablesourceinput: true | ||
spec: | ||
file: https://www.updatecli.io/schema/latest/config.json | ||
key: $schema | ||
value: http://json-schema.org/draft-04/schema | ||
|
||
targets: | ||
local: | ||
name: Test value from json | ||
kind: json | ||
sourceid: local | ||
scmid: default | ||
spec: | ||
file: pkg/plugins/resources/json/testdata/data.json | ||
key: firstName | ||
value: John | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
--- | ||
title: "JSON" | ||
description: "Manipulate Json information" | ||
lead: "kind: json" | ||
date: 2021-09-24T19:19:01+02:00 | ||
draft: false | ||
images: [] | ||
menu: | ||
docs: | ||
parent: "plugin-resource" | ||
toc: true | ||
plugins: | ||
- source | ||
- condition | ||
- target | ||
--- | ||
// <!-- Required for asciidoctor --> | ||
:toc: | ||
// Set toclevels to be at least your hugo [markup.tableOfContents.endLevel] config key | ||
:toclevels: 4 | ||
|
||
[cols="1^,1^,1^",options=header] | ||
|=== | ||
| source | condition | target | ||
| ✔ | ✔ | ✔ | ||
|=== | ||
|
||
== Description | ||
|
||
**source** | ||
|
||
The JSON "source" retrieves an information from a JSON file. | ||
|
||
**condition** | ||
|
||
The JSON "condition" tests that an information exist in a JSON file. | ||
|
||
**target** | ||
|
||
The JSON "target" ensures that a JSON file content a specific value at specific location. | ||
|
||
== Parameters | ||
|
||
{{< resourceparameters "sources" "json" >}} | ||
|
||
=== Xpath | ||
|
||
Under construction, some help would be need to document common jsonpath query that work with Updatecli | ||
https://www.w3.org/TR/1999/REC-xpath-19991116/ | ||
|
||
== Example | ||
|
||
[source,yaml] | ||
---- | ||
# updatecli.yaml | ||
{{<include "assets/code_example/docs/plugins/resources/json/updatecli.d/default.yaml">}} | ||
---- | ||
|
||
|