# Go Go BOSH - BOSH client API for golang applications

This project is a golang library for applications wanting to talk to a BOSH/MicroBOSH or bosh-lite.

<a href=''><img src='' ></a>

## API

The following client functions are available, as a subset of the full BOSH Director API.

* repo.GetInfo()
* repo.GetStemcells()
* repo.DeleteStemcell("bosh-stemcell", "993")
* repo.GetReleases()
* repo.DeleteReleases("cf")
* repo.DeleteRelease("cf", "144")
* repo.GetDeployments()
* repo.ListDeploymentVMs("cf-warden")
* repo.FetchVMsStatus("cf-warden")
* repo.GetTaskStatus(123)

### API compatibility

Note: Development is currently being done against bosh-lite v147.

The BOSH Core team nor its Product Managers do not claim that a BOSH director has a public API; and they want to make changes to the API in the future. It will may be tricky for golang apps to support different BOSH APIs. We'll figure this out as we go.

The best way to describe the API support in this library is to document what version of bosh-lite is being tested against, the date that it was published. Hopefully bosh-lite is always approximately parallel (via rebasing) in its API with the main BOSH project; and the same timestamps can map to the continuously delivered releases of BOSH & its RubyGems.

Trying to write a client library for an API without any versioning strategy could get messy for client applications. Please write your own integration tests that work against running BOSHes that you'll use in production.

If you are using this library, or the Ruby library within the `bosh_cli` rubygem, or talking directly with the BOSH director API - please announce yourself on the bosh-users google group and/or to the PM of BOSH. This way they can be aware of who many be affected by API changes.

## Install

go get

### Use

There is an extensive [example application]( showing usage of many of the read-only functions.

As a short getting started guide:

``` golang
package main

import (

func main() {
	gogobosh.Logger = gogobosh.NewLogger()

	target := flag.String("target", "", "BOSH director host")
	username := flag.String("username", "admin", "Login with username")
	password := flag.String("password", "admin", "Login with password")

  director := gogobosh.NewDirector(*target, *username, *password)
  repo := gogobosh.NewBoshDirectorRepository(&director, gogobosh.NewDirectorGateway())

  info, apiResponse := repo.GetInfo()
  if apiResponse.IsNotSuccessful() {
    fmt.Println("Could not fetch BOSH info")

  fmt.Printf("  Name       %s\n", info.Name)
  fmt.Printf("  URL        %s\n", info.URL)
  fmt.Printf("  Version    %s\n", info.Version)
  fmt.Printf("  User       %s\n", info.User)
  fmt.Printf("  UUID       %s\n", info.UUID)
  fmt.Printf("  CPI        %s\n", info.CPI)

## Tests

Tests are all local currently; and do not test against a running bosh or bosh-lite. I'd like to at least do integration tests against a bosh-lite in future.

Imports 1 package(s)


Test imports 2 package(s)