Skip to content

souenzzo/gcp-api

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gcp-api

gcp-api is a Clojure library which provides programmatic access to GCP services from your Clojure program.

Rationale

See aws-api's rationale here.

Approach

Much the same as aws-api's approach, this library publishes descriptor files that specify the operations, inputs, and outputs. These descriptor files are created from the GCP discovery documents.

The generated descriptor files are published in a separate repository located here.

Usage

Using gcp-api requires you to add gcp-api and the service(s) of your choosing. In the below example we add the GCP Compute Engine API gcp-api/compute. Note that you must replace part of the :deps/root path with the API version you want to use.

gcp-api {:git/url "https://github.com/ComputeSoftware/gcp-api.git"
         :sha     "<most recent sha>"}
gcp-api/compute {:git/url   "[email protected]:ComputeSoftware/gcp-api-descriptors.git"
                 :sha       "<most recent sha>"
                 :deps/root "compute/<version>"}
(require '[compute.gcp.api :as gcp-api])

(def client
  (gcp-api/client {:api     :compute
                   :version "v1"}))

(gcp-api/invoke
  client
  {:op      "compute.instances.list"
   :request {:project "my-project"
             :zone    "us-central1-c"}})

Prior Art

License

Copyright © 2020 Compute Software

Distributed under the Eclipse Public License either version 2.0 or (at your option) any later version.

About

GCP, data driven

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Clojure 97.2%
  • Shell 2.8%