cfscalerservice

package module
v0.0.0-...-4ee4f08 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 19, 2016 License: Apache-2.0 Imports: 4 Imported by: 0

README

cf-scaler-service

This Cloudfoundry helper service is to allow the remote scaling of application instances without having to access the console of CLI.

The service works by interacting with the Cloudfoundry REST API to effect changes to the instances assigned to an application. A possible use case would be a monitoring event triggering a call to increase capacity.

Prerequisites
  1. Golang 1.5.3+
  2. Godep
  3. cloudcontroller-client
Build from Source
git clone git@github.com:comcast/cf-scaler-service.git
go get github.com/tools/godep
go get github.com/codegangsta/negroni
go get github.com/unrolled/render
go get github.com/xchapter7x/cloudcontroller-client
godep go build server/main.go

The binary will be in the repository directory. Ensure the PORT environment variable is set before starting.

Usage

Post a request with the below JSON structure, credentials for the Cloudfoundry foundation are passed through as Basic Auth in the header.

{
	"loginurl": "https://login.mycfplatform.comcast.net",
	"apiurl": "https://mycfplatform.comcast.net/v2",
	"org": "MY-ORG",
	"space": "my-space",
    "appname": "my-application-generic#1.0.0.81-f4e05e",
	"scalefactor": 0.5
}

loginurl - authentication endpoint for Cloudfoundry foundation.
apiurl - api endpoint for the Cloudfoundry foundation.
org - name of the target organization.
space - name of the target space.
appname - name of the application to be scaled.
scalefactor - float multiplier, >1 grows the number of instances, <1 shrinks.

Todo
  1. Improve test coverage and fakes for cloudcontroller-client.
  2. Finish implementing Concourse.ci pipeline.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StartNegroni

func StartNegroni() (n *negroni.Negroni)

StartNegroni - spins up a negroni instance, ready to be Run

Types

This section is empty.

Directories

Path Synopsis
Godeps
_workspace/src/github.com/codegangsta/negroni
Package negroni is an idiomatic approach to web middleware in Go.
Package negroni is an idiomatic approach to web middleware in Go.
_workspace/src/github.com/onsi/ginkgo
Ginkgo is a BDD-style testing framework for Golang The godoc documentation describes Ginkgo's API.
Ginkgo is a BDD-style testing framework for Golang The godoc documentation describes Ginkgo's API.
_workspace/src/github.com/onsi/ginkgo/config
Ginkgo accepts a number of configuration options.
Ginkgo accepts a number of configuration options.
_workspace/src/github.com/onsi/ginkgo/ginkgo
The Ginkgo CLI The Ginkgo CLI is fully documented [here](http://onsi.github.io/ginkgo/#the_ginkgo_cli) You can also learn more by running: ginkgo help Here are some of the more commonly used commands: To install: go install github.com/onsi/ginkgo/ginkgo To run tests: ginkgo To run tests in all subdirectories: ginkgo -r To run tests in particular packages: ginkgo <flags> /path/to/package /path/to/another/package To pass arguments/flags to your tests: ginkgo <flags> <packages> -- <pass-throughs> To run tests in parallel ginkgo -p this will automatically detect the optimal number of nodes to use.
The Ginkgo CLI The Ginkgo CLI is fully documented [here](http://onsi.github.io/ginkgo/#the_ginkgo_cli) You can also learn more by running: ginkgo help Here are some of the more commonly used commands: To install: go install github.com/onsi/ginkgo/ginkgo To run tests: ginkgo To run tests in all subdirectories: ginkgo -r To run tests in particular packages: ginkgo <flags> /path/to/package /path/to/another/package To pass arguments/flags to your tests: ginkgo <flags> <packages> -- <pass-throughs> To run tests in parallel ginkgo -p this will automatically detect the optimal number of nodes to use.
_workspace/src/github.com/onsi/ginkgo/internal/remote
Aggregator is a reporter used by the Ginkgo CLI to aggregate and present parallel test output coherently as tests complete.
Aggregator is a reporter used by the Ginkgo CLI to aggregate and present parallel test output coherently as tests complete.
_workspace/src/github.com/onsi/ginkgo/reporters
Ginkgo's Default Reporter A number of command line flags are available to tweak Ginkgo's default output.
Ginkgo's Default Reporter A number of command line flags are available to tweak Ginkgo's default output.
_workspace/src/github.com/onsi/gomega
Gomega is the Ginkgo BDD-style testing framework's preferred matcher library.
Gomega is the Ginkgo BDD-style testing framework's preferred matcher library.
_workspace/src/github.com/onsi/gomega/format
Gomega's format package pretty-prints objects.
Gomega's format package pretty-prints objects.
_workspace/src/github.com/onsi/gomega/gbytes
Package gbytes provides a buffer that supports incrementally detecting input.
Package gbytes provides a buffer that supports incrementally detecting input.
_workspace/src/github.com/onsi/gomega/gexec
Package gexec provides support for testing external processes.
Package gexec provides support for testing external processes.
_workspace/src/github.com/onsi/gomega/ghttp
Package ghttp supports testing HTTP clients by providing a test server (simply a thin wrapper around httptest's server) that supports registering multiple handlers.
Package ghttp supports testing HTTP clients by providing a test server (simply a thin wrapper around httptest's server) that supports registering multiple handlers.
_workspace/src/github.com/onsi/gomega/matchers
Gomega matchers This package implements the Gomega matchers and does not typically need to be imported.
Gomega matchers This package implements the Gomega matchers and does not typically need to be imported.
_workspace/src/github.com/unrolled/render
Package render is a package that provides functionality for easily rendering JSON, XML, binary data, and HTML templates.
Package render is a package that provides functionality for easily rendering JSON, XML, binary data, and HTML templates.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL