-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge of development for release (#83)
New features/functionality: * [#60] Webhook functionality added to the CLI. * [#76] Project changed to use semantic versioning. See http://semver.org/ for further details. * Added a get baremetal capabilities command. * Added a version command to return build version, build date and git commit hash, os and Go version * Changed the integration tests to use 'go test' instead of a seperate executable. The tests utilise the new subtest functionality in go 1.7. * API file generation now has been separated out into a different command line. Bug fixes: * [#55] Remove premium storage type as its deprecated. The --storage-type command line option has been removed completely for server create, server import. * [#64] Listing cross DC policies didn't filter as expected. * [#67] Getting server details doesn't return IsManaged or IsManagdBackup * [#69] Updating the server disks fails. * [#70] Integration tests where failing due to multiple issues. * [#75] Creating bare metal servers shouldn't require CPU, MemoryGB or template. Additionally the configuration-id and os-type parameters should indicate how to get the allowed values. Resolves #55, #60, #64, #67, #69, #70, #75, #76 Signed-off-by: Richard Case <[email protected]>
- Loading branch information
1 parent
f83d789
commit 399b738
Showing
42 changed files
with
707 additions
and
376 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ out/* | |
*.swp | ||
.DS_Store | ||
release/* | ||
.vscode/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package base | ||
|
||
var BuildVersion = "built-from-source" | ||
var BuildGitCommit = "No git commit provided" | ||
var BuildDate = "No build date supplied" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package main | ||
|
||
import ( | ||
"flag" | ||
"os" | ||
|
||
integration "github.com/centurylinkcloud/clc-go-cli/integration_tests" | ||
) | ||
|
||
func main() { | ||
logger := integration.NewLogger() | ||
|
||
var apiPath = flag.String("api-path", "", "The path to the API file") | ||
flag.Parse() | ||
|
||
if *apiPath == "" { | ||
logger.Logf("ERROR: The api-path command line argument must be specified.") | ||
os.Exit(-1) | ||
} | ||
|
||
parser := integration.NewParser(logger) | ||
|
||
apiDef, err := parser.ParseApi() | ||
if err != nil { | ||
logger.Logf("Error while parsing API definition: %v", err) | ||
os.Exit(-2) | ||
} | ||
|
||
err = integration.StoreApi(apiDef, *apiPath) | ||
if err != nil { | ||
logger.Logf("Error while storing API definition: %v", err) | ||
os.Exit(-3) | ||
} | ||
|
||
os.Exit(0) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package commands | ||
|
||
import ( | ||
"fmt" | ||
"runtime" | ||
|
||
"github.com/centurylinkcloud/clc-go-cli/base" | ||
) | ||
|
||
var banner = ` | ||
------------------------------------------------------------- | ||
_____ __ __ _ __ | ||
/ ___/___ ___ / /_ __ __ ____ __ __ / / (_)___ / /__ | ||
/ /__ / -_)/ _ \/ __// // // __// // // /__ / // _ \ / '_/ | ||
\___/ \__//_//_/\__/ \_,_//_/ \_, //____//_//_//_//_/\_\ | ||
/___/ | ||
------------------------------------------------------------- | ||
` | ||
|
||
type Version struct { | ||
CommandBase | ||
} | ||
|
||
func NewVersion(info CommandExcInfo) *Version { | ||
v := Version{} | ||
v.ExcInfo = info | ||
return &v | ||
} | ||
|
||
func (v *Version) IsOffline() bool { | ||
return true | ||
} | ||
|
||
func (v *Version) ExecuteOffline() (string, error) { | ||
fmt.Printf("%s", banner) | ||
fmt.Printf("CenturyLink Cloud CLI (Version %s)\n", base.BuildVersion) | ||
fmt.Printf("%s\n", base.PROJ_URL) | ||
fmt.Printf("\n") | ||
fmt.Printf("Go Version: %s %s/%s\n", runtime.Version(), runtime.GOOS, runtime.GOARCH) | ||
fmt.Printf("Built on: %s\n", base.BuildDate) | ||
fmt.Printf("Git Commit: %s\n", base.BuildGitCommit) | ||
fmt.Printf("\n") | ||
fmt.Printf("For more information on CenturyLink Cloud visit: %s\n", base.CTL_URL) | ||
|
||
return "", nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.