https://github.com/tombuildsstuff/swift-puppetdb
A Swift Library to connect to PuppetDB
https://github.com/tombuildsstuff/swift-puppetdb
Last synced: over 1 year ago
JSON representation
A Swift Library to connect to PuppetDB
- Host: GitHub
- URL: https://github.com/tombuildsstuff/swift-puppetdb
- Owner: tombuildsstuff
- License: mit
- Created: 2016-09-19T06:31:18.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2016-09-19T06:32:23.000Z (almost 10 years ago)
- Last Synced: 2025-02-07T14:45:35.389Z (over 1 year ago)
- Language: Swift
- Homepage:
- Size: 4.88 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Swift-PuppetDB
Connect to PuppetDB from Swift
## Usage
```swift
let puppetDB = PuppetDB(configuration: Configuration(host: "puppetdb.my-domain.com", port: 8080))
```
### Get All Nodes
```swift
puppetDB.getAllNodes(done: { (nodes: AllNodesResponse) in
let nodeNames = nodes.nodes.map {
(metaData: NodeMetaData) -> String in
return metaData.certname
}
print(nodeNames)
}, error: {
(err: Error) -> () in
print(err)
})
```
### Get All Fact Names
```swift
puppetDB.getAllFactNames(done: {
(facts: [String]) in
print(facts)
}, error: {
(err: Error) -> () in
print(err)
})
```
### Licence
MIT