/clj-heroku-api

An always-up-to-date Heroku API client for Clojure

Primary LanguageClojureApache License 2.0Apache-2.0

clj-heroku-api

An always-up-to-date Heroku API client for Clojure.

The Heroku platform API provides a JSON-schema describing the resources exposed through the API and any commands which can be performed against those resources. The clj-heroku-api library downloads and caches this schema when creating a client connection and uses the schema to construct REST resource paths and request bodies.

NOTE: This library is still in early development, and subject to change at any time. I intend to follow SemVer/BreakVer versioning semantics, so prior to v1.0.0, watch out for breaking changes!

Usage

(def client (create-client "heroku-api-auth-token"))

(api-action client "apps" "create"
  []
  {"name"   "test-app"
   "region" "us"
   "stack"  "cedar"})

(api-action client "dyno" "create"
  ["test-app"]
  {"size" "2X"})

Todo

  • Parameter/property validation based on API schema
  • Macros to auto-generate API namespaces/functions for each resource/command
  • Cleaner support for header-based features

Thanks

Development and release of clj-heroku-api was generously supported by Revcaster

License

Copyright © 2014 Dylan Paris

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.