Skip to content

Commit

Permalink
Add octoprint,tailscale,nextdns
Browse files Browse the repository at this point in the history
  • Loading branch information
kylechase committed Jan 25, 2023
1 parent ef9d1c4 commit 7ea37a7
Show file tree
Hide file tree
Showing 6 changed files with 152 additions and 0 deletions.
1 change: 1 addition & 0 deletions nextdns/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# NextDNS API Config
41 changes: 41 additions & 0 deletions nextdns/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
version: 1

api:
name: NextDNS
description: Interfaces with NextDNS to provide tags regarding your account
version: 1.0.0
author:
name: Kyle Chase
email: kyle@kyvislabs.com
url: https://github.com/KyvisLabs/API-YAML/nextdns

variables:
baseUrl:
required: true
default: https://api.nextdns.io
accountId:
required: true
apiKey:
required: true

authType:
type: none

functions:
account:
url: "{{var::baseUrl}}/profiles/{{var::accountId}}"
method: get
responseType: json
schedule:
type: timer
duration: 30
unit: seconds
actions:
- action: tag
path: "{{var::apiName}}/account"
type: jsonExpand
headers:
- key: X-Api-Key
value: "{{var::apiKey}}"
- key: Accept
value: "*/*"
1 change: 1 addition & 0 deletions octoprint/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Octoprint API Config
64 changes: 64 additions & 0 deletions octoprint/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
version: 1

api:
name: Octoprint
description: Interfaces with Octoprint for printer information
version: 1.0.0
author:
name: Kyle Chase
email: kyle@kyvislabs.com
url: https://github.com/KyvisLabs/API-YAML/octoprint

variables:
baseUrl:
required: true
apikey:
hidden: false
sensitive: false

functions:
printer:
url: "{{var::baseUrl}}/api/printer"
method: get
responseType: json
schedule:
type: timer
duration: 5
unit: seconds
actions:
- action: tag
path: "{{var::apiName}}/printer"
type: jsonExpand
headers:
- key: X-Api-Key
value: "{{var::apikey}}"
server:
url: "{{var::baseUrl}}/api/version"
method: get
responseType: json
schedule:
type: timer
duration: 5
unit: seconds
actions:
- action: tag
path: "{{var::apiName}}/version"
type: jsonExpand
headers:
- key: X-Api-Key
value: "{{var::apikey}}"
connection:
url: "{{var::baseUrl}}/api/connection"
method: get
responseType: json
schedule:
type: timer
duration: 5
unit: seconds
actions:
- action: tag
path: "{{var::apiName}}/connection"
type: jsonExpand
headers:
- key: X-Api-Key
value: "{{var::apikey}}"
1 change: 1 addition & 0 deletions tailscale/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Tailscale API Config
44 changes: 44 additions & 0 deletions tailscale/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
version: 1

api:
name: Tailscale
description: Interfaces with Tailscale to provide tags regarding your tailnet
version: 1.0.0
author:
name: Kyle Chase
email: kyle@kyvislabs.com
url: https://github.com/KyvisLabs/API-YAML/tailscale

variables:
baseUrl:
required: true
default: https://api.tailscale.com
tailnet:
required: true
fields:
default: all
required: true

authType:
type: basic

functions:
devices:
url: "{{var::baseUrl}}/api/v2/tailnet/{{var::tailnet}}/devices"
method: get
responseType: json
schedule:
type: timer
duration: 30
unit: seconds
actions:
- action: tag
path: "{{var::apiName}}/devices"
type: jsonExpand
filter: "{{jsonPath::$.devices}}"
rename:
- items: "{{jsonPath::$.[*]}}"
name: "{{jsonPath::item::$.hostname}}"
params:
- name: fields
value: "{{var::fields}}"

0 comments on commit 7ea37a7

Please sign in to comment.