top
(README.md)
ddknife
=======

A command line utility to manage resources such as servers in the Dimension Data cloud. ddknife currently supports the starting and stopping of servers. At [EmergeAdapt](http://www.emergeadapt.com) we use ddknife in conjunction with [cron](http://en.wikipedia.org/wiki/Cron) to schedule the running time of temporary environments such as our test environments.

# Download binaries

Rather than building ddknife from source code you can download binaries for the following operation systems:

* [ddknife for Windows 64-bit](https://github.com/EmergeAdapt/ddknife/releases/download/v0.2/ddknife.exe)
* [ddknife for Mac OS X 64-bit](https://github.com/EmergeAdapt/ddknife/releases/download/v0.2/ddknife)

# Starting Servers

To start a bunch of servers, e.g. at EmergeAdapt all staging servers are prefixed with "STG":

	ddknife serversStart -NameRgx="STG.*" -ApiEndpoint=https://api-eu.dimensiondata.com/oec/0.9 -Username=john_doe -Password=s3cr3t -OrgId=428cbc1d-88cd-4d42-8b1f-180373fb68df -NetworkId=7da3300a-84fe-11e3-878b-2be333cc2931

To see an explanation of the parameters type:

	ddknife help serversStart

You can avoid having to type in the parameters by creating a .ddknife config file in your $HOME folder. See below.

# Stopping Servers

To start a bunch of servers, e.g. at EmergeAdapt all staging servers are prefixed with "STG":

	ddknife serversStop  -NameRgx="STG.*" -ApiEndpoint=https://api-eu.dimensiondata.com/oec/0.9 -Username=john_doe -Password=s3cr3t -OrgId=428cbc1d-88cd-4d42-8b1f-180373fb68df -NetworkId=7da3300a-84fe-11e3-878b-2be333cc2931

To see an explanation of the parameters type:

	ddknife help serversStop

You can avoid having to type in the parameters by creating a .ddknife config file in your $HOME folder. See below.

# Configuration File

Most of the parameters in a 'ddknife serversStart' call hardly ever change, so why bother typing them in. You can create a default settings file in your home folder.

	vim $HOME/.ddknife

Specify as many defaults as are necessary, the remainder will need to be specified on the command line. Here's a sample config file:

	Username=john_doe
	Password=s3cr3t
	OrgId=428cbc1d-88cd-4d42-8b1f-180373fb68df
	NetworkId=7da3300a-84fe-11e3-878b-2be333cc2931
	NameRgx=STG.*

You can always override the defaults from the .ddknife file by specifying a new value on the command line:

	ddknife serversStart NameRgx=PROD.*

# Dependencies

To compile, test and run from source you'll need to install the following dependencies:

	go get -t github.com/smartystreets/goconvey
	go get github.com/codegangsta/cli

# Tests

You can run the tests by installing goconvey, running 'goconvey' on the command line from the root folder of this project, and visiting http://localhost:8080.

# License

The MIT License (MIT)

Copyright (c) 2014 EmergeAdapt

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Test imports 1 package(s) ΒΆ

  1. github.com/smartystreets/goconvey/convey