You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by sv...@apache.org on 2016/04/05 16:16:03 UTC
[1/4] brooklyn-client git commit: remove brooklyn-client Godep from
repo - @geomacy can you have a look at this,
leaving this in results in mvn building from the old Godep. I can build via
`mvn`, `godep install`
Repository: brooklyn-client
Updated Branches:
refs/heads/master 5194b683b -> 7066a4d69
http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/bdb83934/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/sensor.go
----------------------------------------------------------------------
diff --git a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/sensor.go b/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/sensor.go
deleted file mode 100644
index d4fb78d..0000000
--- a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/sensor.go
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package commands
-
-import (
- "fmt"
- "github.com/apache/brooklyn-client/api/entity_sensors"
- "github.com/apache/brooklyn-client/command_metadata"
- "github.com/apache/brooklyn-client/error_handler"
- "github.com/apache/brooklyn-client/models"
- "github.com/apache/brooklyn-client/net"
- "github.com/apache/brooklyn-client/scope"
- "github.com/apache/brooklyn-client/terminal"
- "github.com/codegangsta/cli"
- "sort"
-)
-
-type Sensor struct {
- network *net.Network
-}
-
-type sensorList []models.SensorSummary
-
-// Len is the number of elements in the collection.
-func (sensors sensorList) Len() int {
- return len(sensors)
-}
-
-// Less reports whether the element with
-// index i should sort before the element with index j.
-func (sensors sensorList) Less(i, j int) bool {
- return sensors[i].Name < sensors[j].Name
-}
-
-// Swap swaps the elements with indexes i and j.
-func (sensors sensorList) Swap(i, j int) {
- temp := sensors[i]
- sensors[i] = sensors[j]
- sensors[j] = temp
-}
-
-func NewSensor(network *net.Network) (cmd *Sensor) {
- cmd = new(Sensor)
- cmd.network = network
- return
-}
-
-func (cmd *Sensor) Metadata() command_metadata.CommandMetadata {
- return command_metadata.CommandMetadata{
- Name: "sensor",
- Description: "Show values of all sensors or named sensor for an application or entity",
- Usage: "BROOKLYN_NAME SCOPE sensor [ SENSOR_NAME ]",
- Flags: []cli.Flag{},
- }
-}
-
-func (cmd *Sensor) Run(scope scope.Scope, c *cli.Context) {
- if err := net.VerifyLoginURL(cmd.network); err != nil {
- error_handler.ErrorExit(err)
- }
- if c.Args().Present() {
- cmd.show(scope.Application, scope.Entity, c.Args().First())
- } else {
- cmd.list(scope.Application, scope.Entity)
- }
-}
-
-func (cmd *Sensor) show(application, entity, sensor string) {
- sensorValue, err := entity_sensors.SensorValue(cmd.network, application, entity, sensor)
- if nil != err {
- error_handler.ErrorExit(err)
- }
- displayValue, err := stringRepresentation(sensorValue)
- if nil != err {
- error_handler.ErrorExit(err)
- }
- fmt.Println(displayValue)
-}
-
-func (cmd *Sensor) list(application, entity string) {
- sensors, err := entity_sensors.SensorList(cmd.network, application, entity)
- if nil != err {
- error_handler.ErrorExit(err)
- }
- var theSensors sensorList = sensors
- table := terminal.NewTable([]string{"Name", "Description", "Value"})
-
- sort.Sort(theSensors)
-
- for _, sensor := range theSensors {
- value, err := entity_sensors.SensorValue(cmd.network, application, entity, sensor.Name)
- if nil != err {
- error_handler.ErrorExit(err)
- }
- displayValue, err := stringRepresentation(value)
- if nil != err {
- error_handler.ErrorExit(err)
- }
- table.Add(sensor.Name, sensor.Description, displayValue)
- }
- table.Print()
-}
http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/bdb83934/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/set.go
----------------------------------------------------------------------
diff --git a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/set.go b/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/set.go
deleted file mode 100644
index 5342e4d..0000000
--- a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/set.go
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package commands
-
-import (
- "fmt"
- "github.com/apache/brooklyn-client/api/entity_config"
- "github.com/apache/brooklyn-client/command_metadata"
- "github.com/apache/brooklyn-client/error_handler"
- "github.com/apache/brooklyn-client/net"
- "github.com/apache/brooklyn-client/scope"
- "github.com/codegangsta/cli"
-)
-
-type SetConfig struct {
- network *net.Network
-}
-
-func NewSetConfig(network *net.Network) (cmd *SetConfig) {
- cmd = new(SetConfig)
- cmd.network = network
- return
-}
-
-func (cmd *SetConfig) Metadata() command_metadata.CommandMetadata {
- return command_metadata.CommandMetadata{
- Name: "set",
- Description: "Set config for an entity",
- Usage: "BROOKLYN_NAME CONFIG-SCOPE set VALUE",
- Flags: []cli.Flag{},
- }
-}
-
-func (cmd *SetConfig) Run(scope scope.Scope, c *cli.Context) {
- if err := net.VerifyLoginURL(cmd.network); err != nil {
- error_handler.ErrorExit(err)
- }
- response, err := entity_config.SetConfig(cmd.network, scope.Application, scope.Entity, scope.Config, c.Args().First())
- if nil != err {
- error_handler.ErrorExit(err)
- }
- fmt.Println(response)
-}
http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/bdb83934/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/spec.go
----------------------------------------------------------------------
diff --git a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/spec.go b/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/spec.go
deleted file mode 100644
index 64d0a8c..0000000
--- a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/spec.go
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package commands
-
-import (
- "fmt"
- "github.com/apache/brooklyn-client/api/entities"
- "github.com/apache/brooklyn-client/command_metadata"
- "github.com/apache/brooklyn-client/error_handler"
- "github.com/apache/brooklyn-client/net"
- "github.com/apache/brooklyn-client/scope"
- "github.com/codegangsta/cli"
-)
-
-type Spec struct {
- network *net.Network
-}
-
-func NewSpec(network *net.Network) (cmd *Spec) {
- cmd = new(Spec)
- cmd.network = network
- return
-}
-
-func (cmd *Spec) Metadata() command_metadata.CommandMetadata {
- return command_metadata.CommandMetadata{
- Name: "spec",
- Description: "Get the YAML spec used to create the entity, if available",
- Usage: "BROOKLYN_NAME SCOPE spec",
- Flags: []cli.Flag{},
- }
-}
-
-func (cmd *Spec) Run(scope scope.Scope, c *cli.Context) {
- if err := net.VerifyLoginURL(cmd.network); err != nil {
- error_handler.ErrorExit(err)
- }
- spec, err := entities.Spec(cmd.network, scope.Application, scope.Entity)
- if nil != err {
- error_handler.ErrorExit(err)
- }
- fmt.Println(spec)
-}
http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/bdb83934/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/start-policy.go
----------------------------------------------------------------------
diff --git a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/start-policy.go b/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/start-policy.go
deleted file mode 100644
index 46c3823..0000000
--- a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/start-policy.go
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package commands
-
-import (
- "fmt"
- "github.com/apache/brooklyn-client/api/entity_policies"
- "github.com/apache/brooklyn-client/command_metadata"
- "github.com/apache/brooklyn-client/error_handler"
- "github.com/apache/brooklyn-client/net"
- "github.com/apache/brooklyn-client/scope"
- "github.com/codegangsta/cli"
-)
-
-type StartPolicy struct {
- network *net.Network
-}
-
-func NewStartPolicy(network *net.Network) (cmd *StartPolicy) {
- cmd = new(StartPolicy)
- cmd.network = network
- return
-}
-
-func (cmd *StartPolicy) Metadata() command_metadata.CommandMetadata {
- return command_metadata.CommandMetadata{
- Name: "start-policy",
- Description: "Start or resume a policy",
- Usage: "BROOKLYN_NAME SCOPE start-policy POLICY",
- Flags: []cli.Flag{},
- }
-}
-
-func (cmd *StartPolicy) Run(scope scope.Scope, c *cli.Context) {
- if err := net.VerifyLoginURL(cmd.network); err != nil {
- error_handler.ErrorExit(err)
- }
- spec, err := entity_policies.StartPolicy(cmd.network, scope.Application, scope.Entity, c.Args().First())
- if nil != err {
- error_handler.ErrorExit(err)
- }
- fmt.Println(spec)
-}
http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/bdb83934/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/stop-policy.go
----------------------------------------------------------------------
diff --git a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/stop-policy.go b/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/stop-policy.go
deleted file mode 100644
index da67bea..0000000
--- a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/stop-policy.go
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package commands
-
-import (
- "fmt"
- "github.com/apache/brooklyn-client/api/entity_policies"
- "github.com/apache/brooklyn-client/command_metadata"
- "github.com/apache/brooklyn-client/error_handler"
- "github.com/apache/brooklyn-client/net"
- "github.com/apache/brooklyn-client/scope"
- "github.com/codegangsta/cli"
-)
-
-type StopPolicy struct {
- network *net.Network
-}
-
-func NewStopPolicy(network *net.Network) (cmd *StopPolicy) {
- cmd = new(StopPolicy)
- cmd.network = network
- return
-}
-
-func (cmd *StopPolicy) Metadata() command_metadata.CommandMetadata {
- return command_metadata.CommandMetadata{
- Name: "stop-policy",
- Description: "Suspends a policy",
- Usage: "BROOKLYN_NAME SCOPE stop-policy POLICY",
- Flags: []cli.Flag{},
- }
-}
-
-func (cmd *StopPolicy) Run(scope scope.Scope, c *cli.Context) {
- if err := net.VerifyLoginURL(cmd.network); err != nil {
- error_handler.ErrorExit(err)
- }
- spec, err := entity_policies.StopPolicy(cmd.network, scope.Application, scope.Entity, c.Args().First())
- if nil != err {
- error_handler.ErrorExit(err)
- }
- fmt.Println(spec)
-}
http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/bdb83934/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/tree.go
----------------------------------------------------------------------
diff --git a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/tree.go b/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/tree.go
deleted file mode 100644
index 96e19d6..0000000
--- a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/tree.go
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package commands
-
-import (
- "fmt"
- "github.com/apache/brooklyn-client/api/application"
- "github.com/apache/brooklyn-client/command_metadata"
- "github.com/apache/brooklyn-client/error_handler"
- "github.com/apache/brooklyn-client/models"
- "github.com/apache/brooklyn-client/net"
- "github.com/apache/brooklyn-client/scope"
- "github.com/codegangsta/cli"
-)
-
-type Tree struct {
- network *net.Network
-}
-
-func NewTree(network *net.Network) (cmd *Tree) {
- cmd = new(Tree)
- cmd.network = network
- return
-}
-
-func (cmd *Tree) Metadata() command_metadata.CommandMetadata {
- return command_metadata.CommandMetadata{
- Name: "tree",
- Description: "* Show the tree of all applications",
- Usage: "BROOKLYN_NAME tree",
- Flags: []cli.Flag{},
- }
-}
-
-func (cmd *Tree) Run(scope scope.Scope, c *cli.Context) {
- if err := net.VerifyLoginURL(cmd.network); err != nil {
- error_handler.ErrorExit(err)
- }
- trees, err := application.Tree(cmd.network)
- if nil != err {
- error_handler.ErrorExit(err)
- }
- cmd.printTrees(trees, "")
-}
-
-func (cmd *Tree) printTrees(trees []models.Tree, indent string) {
- for i, app := range trees {
- cmd.printTree(app, indent, i == len(trees)-1)
- }
-}
-
-func (cmd *Tree) printTree(tree models.Tree, indent string, last bool) {
- fmt.Println(indent+"|-", tree.Name)
- fmt.Println(indent+"+-", tree.Type)
-
- if last {
- indent = indent + " "
- } else {
- indent = indent + "| "
- }
- cmd.printTrees(tree.Children, indent)
-}
http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/bdb83934/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/utils.go
----------------------------------------------------------------------
diff --git a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/utils.go b/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/utils.go
deleted file mode 100644
index a4533b1..0000000
--- a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/utils.go
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package commands
-
-import (
- "encoding/json"
-)
-
-func stringRepresentation(value interface{}) (string, error) {
- var result string
- switch value.(type) {
- case string:
- result = value.(string) // use string value as-is
- default:
- json, err := json.Marshal(value)
- if err != nil {
- return "", err
- }
- result = string(json) // return JSON text representation of value object
- }
- return result, nil
-}
http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/bdb83934/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/version.go
----------------------------------------------------------------------
diff --git a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/version.go b/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/version.go
deleted file mode 100644
index a378e1e..0000000
--- a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/version.go
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package commands
-
-import (
- "fmt"
- "github.com/apache/brooklyn-client/api/version"
- "github.com/apache/brooklyn-client/command_metadata"
- "github.com/apache/brooklyn-client/error_handler"
- "github.com/apache/brooklyn-client/net"
- "github.com/apache/brooklyn-client/scope"
- "github.com/codegangsta/cli"
-)
-
-type Version struct {
- network *net.Network
-}
-
-func NewVersion(network *net.Network) (cmd *Version) {
- cmd = new(Version)
- cmd.network = network
- return
-}
-
-func (cmd *Version) Metadata() command_metadata.CommandMetadata {
- return command_metadata.CommandMetadata{
- Name: "version",
- Description: "Display the version of the connected Brooklyn",
- Usage: "BROOKLYN_NAME version",
- Flags: []cli.Flag{},
- }
-}
-
-func (cmd *Version) Run(scope scope.Scope, c *cli.Context) {
- if err := net.VerifyLoginURL(cmd.network); err != nil {
- error_handler.ErrorExit(err)
- }
- version, err := version.Version(cmd.network)
- if nil != err {
- error_handler.ErrorExit(err)
- }
- fmt.Println(version.Version)
-}
http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/bdb83934/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/error_handler/error.go
----------------------------------------------------------------------
diff --git a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/error_handler/error.go b/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/error_handler/error.go
deleted file mode 100644
index 8238c2b..0000000
--- a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/error_handler/error.go
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package error_handler
-
-import (
- "fmt"
- "os"
-)
-
-const CLIUsageErrorExitCode int = 1
-const CliGenericErrorExitCode int = 2
-const CLITrapErrorCode int = 3
-
-func ErrorExit(errorvalue interface{}, errorcode ...int) {
- switch errorvalue.(type) {
- case error:
- fmt.Fprintln(os.Stderr, errorvalue)
- case string:
- fmt.Fprintln(os.Stderr, errorvalue)
- case nil:
- fmt.Fprintln(os.Stderr, "No error message provided")
- default:
- fmt.Fprintln(os.Stderr, "Unknown Error Type: ", errorvalue)
- }
- if len(errorcode) > 0 {
- os.Exit(errorcode[0])
- } else {
- os.Exit(CliGenericErrorExitCode)
- }
-}
http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/bdb83934/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/io/config.go
----------------------------------------------------------------------
diff --git a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/io/config.go b/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/io/config.go
deleted file mode 100644
index 4ba80ab..0000000
--- a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/io/config.go
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package io
-
-import (
- "encoding/json"
- "github.com/apache/brooklyn-client/error_handler"
- "os"
- "path/filepath"
-)
-
-type Config struct {
- FilePath string
- Map map[string]interface{}
-}
-
-func GetConfig() (config *Config) {
- // check to see if $BRCLI_HOME/.brooklyn_cli or $HOME/.brooklyn_cli exists
- // Then parse it to get user credentials
- config = new(Config)
- if os.Getenv("BRCLI_HOME") != "" {
- config.FilePath = filepath.Join(os.Getenv("BRCLI_HOME"), ".brooklyn_cli")
- } else {
- config.FilePath = filepath.Join(os.Getenv("HOME"), ".brooklyn_cli")
- }
- if _, err := os.Stat(config.FilePath); os.IsNotExist(err) {
- config.Map = make(map[string]interface{})
- config.Write()
- }
- config.Read()
- return
-}
-
-func (config *Config) Write() {
-
- // Create file as read/write by user (but does not change perms of existing file)
- fileToWrite, err := os.OpenFile(config.FilePath, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0600)
- if err != nil {
- error_handler.ErrorExit(err)
- }
-
- enc := json.NewEncoder(fileToWrite)
- enc.Encode(config.Map)
-}
-
-func (config *Config) Read() {
- fileToRead, err := os.Open(config.FilePath)
- if err != nil {
- error_handler.ErrorExit(err)
- }
- dec := json.NewDecoder(fileToRead)
- dec.Decode(&config.Map)
-}
http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/bdb83934/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/models/access.go
----------------------------------------------------------------------
diff --git a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/models/access.go b/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/models/access.go
deleted file mode 100644
index 7fbdcbf..0000000
--- a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/models/access.go
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package models
-
-type AccessSummary struct {
- Links map[string]URI `json:"links"`
- LocationProvisioningAllowed bool `json:"locationProvisioningAllowed"`
-}
http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/bdb83934/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/models/applications.go
----------------------------------------------------------------------
diff --git a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/models/applications.go b/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/models/applications.go
deleted file mode 100644
index aa44b8d..0000000
--- a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/models/applications.go
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package models
-
-type Tree struct {
- Id string `json:"id"`
- ParentId string `json:"parentId"`
- Name string `json:"name"`
- Type string `json:"type"`
- CatalogItemId string `json:"catalogItemId"`
- Children []Tree `json:"children"`
- GroupIds []string `json:"groupIds"`
- Members []string `json:"members"`
-}
-
-type TaskSummary struct {
- SubmitTimeUtc int64 `json:"submitTimeUtc"`
- EndTimeUtc int64 `json:"endTimeUtc"`
- IsCancelled bool `json:"isCancelled"`
- CurrentStatus string `json:"currentStatus"`
- BlockingTask LinkTaskWithMetadata `json:"blockingTask"`
- DisplayName string `json:"displayName"`
- Streams map[string]LinkStreamsWithMetadata `json:"streams"`
- Description string `json:"description"`
- EntityId string `json:"entityId"`
- EntityDisplayName string `json:"entityDisplayName"`
- Error bool `json:"error"`
- SubmittedByTask LinkTaskWithMetadata `json:"submittedByTask"`
- Result interface{} `json:"result"`
- IsError bool `json:"isError"`
- DetailedStatus string `json:"detailedStatus"`
- Children []LinkTaskWithMetadata `json:"children"`
- BlockingDetails string `json:"blockingDetails"`
- Cancelled bool `json:"cancelled"`
- Links map[string]URI `json:"links"`
- Id string `json:"id"`
- StartTimeUtc int64 `json:"startTimeUtc"`
-}
-
-type ApplicationSummary struct {
- Links map[string]URI `json:"links"`
- Id string `json:"id"`
- Spec ApplicationSpec `json:"spec"`
- Status Status `json:"status"`
-}
-
-type ApplicationSpec struct {
- Name string `json:"name"`
- Type string `json:"type"`
- Locations []string `json:"locations"`
-}
-
-type Status string
-
-type LinkWithMetadata struct {
-}
-
-type LinkStreamsWithMetadata struct {
- Link string `json:"link"`
- Metadata LinkStreamMetadata `json:"metadata"`
-}
-
-type LinkStreamMetadata struct {
- Name string `json:"name"`
- Size int64 `json:"size"`
- SizeText string `json:"sizeText"`
-}
-
-type LinkTaskWithMetadata struct {
- Link string `json:"link"`
- Metadata LinkTaskMetadata `json:"metadata"`
-}
-
-type LinkTaskMetadata struct {
- Id string `json:"id"`
- TaskName string `json:"taskName"`
- EntityId string `json:"entityId"`
- EntityDisplayName string `json:"entityDisplayName"`
-}
-
-type URI string
http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/bdb83934/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/models/catalog.go
----------------------------------------------------------------------
diff --git a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/models/catalog.go b/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/models/catalog.go
deleted file mode 100644
index ef6dabf..0000000
--- a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/models/catalog.go
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package models
-
-type CatalogItemSummary struct {
- Name string `json:"name"`
- JavaType string `json:"javaType"`
- SymbolicName string `json:"symbolicName"`
- Version string `json:"version"`
- PlanYaml string `json:"planYaml"`
- Description string `json:"description"`
- Deprecated bool `json:"deprecated"`
- Links map[string]interface{} `json:"links"`
- Id string `json:"id"`
- Type string `json:"type"`
-}
-
-type CatalogPolicySummary struct {
- symbolicName string `json:"symbolicName"`
- version string `json:"version"`
- displayName string `json:"name"`
- javaType string `json:"javaType"`
- planYaml string `json:"planYaml"`
- description string `json:"description"`
- iconUrl string `json:"iconUrl"`
- deprecated bool `json:"deprecated"`
- links map[string]URI `json:"links"`
-}
-
-type CatalogLocationSummary struct {
-}
-
-type CatalogEntitySummary struct {
- symbolicName string `json:"symbolicName"`
- version string `json:"version"`
- displayName string `json:"name"`
- javaType string `json:"javaType"`
- planYaml string `json:"planYaml"`
- description string `json:"description"`
- Config []ConfigSummary `json:"config"`
- Effectors []EffectorSummary `json:"effectors"`
- Sensors []SensorSummary `json:"sensors"`
- Deprecated bool `json:"deprecated"`
- Links map[string]interface{} `json:"links"`
- Id string `json:"id"`
- Type string `json:"type"`
-}
http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/bdb83934/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/models/config.go
----------------------------------------------------------------------
diff --git a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/models/config.go b/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/models/config.go
deleted file mode 100644
index bc97650..0000000
--- a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/models/config.go
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package models
-
-type ConfigSummary struct {
- Reconfigurable bool `json:"reconfigurable"`
- PossibleValues []map[string]string `json:"possibleValues"`
- DefaultValue interface{} `json:"defaultValue"`
- Name string `json:"name"`
- Description string `json:"description"`
- Links map[string]URI `json:"links"`
- Label string `json:"label"`
- Priority float64 `json:"priority"`
- Type string `json:"type"`
-}
http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/bdb83934/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/models/effectors.go
----------------------------------------------------------------------
diff --git a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/models/effectors.go b/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/models/effectors.go
deleted file mode 100644
index 1b846b7..0000000
--- a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/models/effectors.go
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package models
-
-type EffectorSummary struct {
- Name string `json:"name"`
- Description string `json:"description"`
- Links map[string]URI `json:"links"`
- Parameters []ParameterSummary `json:"parameters"`
- ReturnType string `json:"returnType"`
-}
-
-type ParameterSummary struct {
- Name string `json:"name"`
- Type string `json:"type"`
- Description string `json:"description"`
- DefaultValue interface{} `json:"defaultValue"`
-}
http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/bdb83934/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/models/entities.go
----------------------------------------------------------------------
diff --git a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/models/entities.go b/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/models/entities.go
deleted file mode 100644
index fdb85dc..0000000
--- a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/models/entities.go
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package models
-
-type EntitySummary struct {
- CatalogItemId string `json:"catalogItemId"`
- Name string `json:"name"`
- Links map[string]URI `json:"links"`
- Id string `json:"id"`
- Type string `json:"type"`
-}
http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/bdb83934/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/models/locations.go
----------------------------------------------------------------------
diff --git a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/models/locations.go b/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/models/locations.go
deleted file mode 100644
index 2505eae..0000000
--- a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/models/locations.go
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package models
-
-type LocationSummary struct {
- Id string `json:"id"`
- Name string `json:"name"`
- Spec string `json:"spec"`
- Type string `json:"type"`
- Config map[string]interface{} `json:"config"`
- Links map[string]URI `json:"links"`
-}
http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/bdb83934/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/models/policies.go
----------------------------------------------------------------------
diff --git a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/models/policies.go b/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/models/policies.go
deleted file mode 100644
index fca9298..0000000
--- a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/models/policies.go
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package models
-
-type PolicySummary struct {
- CatalogItemId string `json:"catalogItemId"`
- Name string `json:"name"`
- Links map[string]URI `json:"links"`
- Id string `json:"id"`
- State Status `json:"state"`
-}
-
-type PolicyConfigList struct {
- Name string `json:"name"`
- Type string `json:"type"`
- DefaultValue interface{} `json:"defaultValue`
- Description string `json:"description"`
- Reconfigurable bool `json:"reconfigurable"`
- Label string `json:"label"`
- Priority int64 `json:"priority"`
- PossibleValues []interface{} `json:"possibleValues"`
- Links map[string]URI `json:"links"`
-}
http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/bdb83934/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/models/sensors.go
----------------------------------------------------------------------
diff --git a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/models/sensors.go b/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/models/sensors.go
deleted file mode 100644
index 67b3b4f..0000000
--- a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/models/sensors.go
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package models
-
-type SensorSummary struct {
- Name string `json:"name"`
- Description string `json:"description"`
- Links map[string]URI `json:"links"`
- Type string `json:"type"`
-}
http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/bdb83934/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/models/version.go
----------------------------------------------------------------------
diff --git a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/models/version.go b/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/models/version.go
deleted file mode 100644
index 8f12a67..0000000
--- a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/models/version.go
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package models
-
-type VersionSummary struct {
- Version string `json:"version"`
- BuildSha1 string `json:"buildSha1"`
- BuildBranch string `json:"buildBranch"`
- Features []BrooklynFeatureSummary `json:"features"`
-}
-
-type BrooklynFeatureSummary struct {
- Name string `json:"name"`
- SymbolicName string `json:"symbolicName"`
- Version string `json:"version"`
- LastModified string `json:"lastModified"`
- AdditionalData map[string]string `json:"additionalData"`
-}
http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/bdb83934/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/net/net.go
----------------------------------------------------------------------
diff --git a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/net/net.go b/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/net/net.go
deleted file mode 100644
index f910a17..0000000
--- a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/net/net.go
+++ /dev/null
@@ -1,174 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package net
-
-import (
- "bytes"
- "encoding/json"
- "errors"
- "io"
- "io/ioutil"
- "net/http"
- "net/url"
- "os"
- "path/filepath"
- "strconv"
- "strings"
-)
-
-type Network struct {
- BrooklynUrl string
- BrooklynUser string
- BrooklynPass string
-}
-
-func NewNetwork(brooklynUrl, brooklynUser, brooklynPass string) (net *Network) {
- net = new(Network)
- net.BrooklynUrl = brooklynUrl
- net.BrooklynUser = brooklynUser
- net.BrooklynPass = brooklynPass
- return
-}
-
-func (net *Network) NewRequest(method, path string, body io.Reader) *http.Request {
- req, _ := http.NewRequest(method, net.BrooklynUrl+path, body)
- req.SetBasicAuth(net.BrooklynUser, net.BrooklynPass)
- return req
-}
-
-func (net *Network) NewGetRequest(url string) *http.Request {
- return net.NewRequest("GET", url, nil)
-}
-
-func (net *Network) NewPostRequest(url string, body io.Reader) *http.Request {
- return net.NewRequest("POST", url, body)
-}
-
-func (net *Network) NewDeleteRequest(url string) *http.Request {
- return net.NewRequest("DELETE", url, nil)
-}
-
-type HttpError struct {
- Code int
- Status string
- Headers http.Header
- Body string
-}
-
-func (err HttpError) Error() string {
- return err.Status
-}
-
-func makeError(resp *http.Response, code int, body []byte) error {
- theError := HttpError{
- Code: code,
- Status: resp.Status,
- Headers: resp.Header,
- }
- details := make(map[string]string)
- if err := json.Unmarshal(body, &details); nil == err {
- if message, ok := details["message"]; ok {
- theError.Body = message
- return theError
- }
- }
- theError.Body = string(body)
- return theError
-}
-
-func (net *Network) SendRequest(req *http.Request) ([]byte, error) {
- client := &http.Client{}
- resp, err := client.Do(req)
- if err != nil {
- return nil, err
- }
- defer resp.Body.Close()
- body, err := ioutil.ReadAll(resp.Body)
- if code, failed := unsuccessful(resp.Status); failed {
- return nil, makeError(resp, code, body)
- }
- return body, err
-}
-
-const httpSuccessSeriesFrom = 200
-const httpSuccessSeriesTo = 300
-
-func unsuccessful(status string) (int, bool) {
- tokens := strings.Split(status, " ")
- if 0 == len(tokens) {
- return -1, false
- }
- code, err := strconv.Atoi(tokens[0])
- if nil != err {
- return -1, false
- }
- return code, code < httpSuccessSeriesFrom || httpSuccessSeriesTo <= code
-}
-
-func (net *Network) SendGetRequest(url string) ([]byte, error) {
- req := net.NewGetRequest(url)
- req.Header.Set("Accept", "application/json, text/plain")
- body, err := net.SendRequest(req)
- return body, err
-}
-
-func (net *Network) SendDeleteRequest(url string) ([]byte, error) {
- req := net.NewDeleteRequest(url)
- body, err := net.SendRequest(req)
- return body, err
-}
-
-func (net *Network) SendEmptyPostRequest(url string) ([]byte, error) {
- req := net.NewPostRequest(url, nil)
- body, err := net.SendRequest(req)
- return body, err
-}
-
-func (net *Network) SendPostRequest(urlStr string, data []byte) ([]byte, error) {
- req := net.NewPostRequest(urlStr, bytes.NewBuffer(data))
- req.Header.Set("Content-Type", "application/json")
- body, err := net.SendRequest(req)
- return body, err
-}
-
-func (net *Network) SendPostFileRequest(url, filePath string, contentType string) ([]byte, error) {
- file, err := os.Open(filepath.Clean(filePath))
- if err != nil {
- return nil, err
- }
- defer file.Close()
- req := net.NewPostRequest(url, file)
- req.Header.Set("Content-Type", contentType)
- body, err := net.SendRequest(req)
- return body, err
-}
-
-func VerifyLoginURL(network *Network) error {
- url, err := url.Parse(network.BrooklynUrl)
- if err != nil {
- return err
- }
- if url.Scheme != "http" && url.Scheme != "https" {
- return errors.New("Use login command to set Brooklyn URL with a scheme of \"http\" or \"https\"")
- }
- if url.Host == "" {
- return errors.New("Use login command to set Brooklyn URL with a valid host[:port]")
- }
- return nil
-}
http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/bdb83934/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/scope/scope.go
----------------------------------------------------------------------
diff --git a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/scope/scope.go b/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/scope/scope.go
deleted file mode 100644
index 9332c4a..0000000
--- a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/scope/scope.go
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package scope
-
-import (
- "strings"
-)
-
-type Scope struct {
- Application string
- Entity string
- Effector string
- Config string
- Activity string
-}
-
-func (scope Scope) String() string {
- return strings.Join([]string{
- "{Application: ", scope.Application,
- ", Entity: ", scope.Entity,
- ", Effector: ", scope.Effector,
- ", Config: ", scope.Config,
- ", Activity: ", scope.Activity,
- "}",
- }, "")
-}
-
-func application(scope *Scope, id string) {
- scope.Application = id
-}
-
-func entity(scope *Scope, id string) {
- scope.Entity = id
-}
-
-func effector(scope *Scope, id string) {
- scope.Effector = id
-}
-
-func config(scope *Scope, id string) {
- scope.Config = id
-}
-
-func activity(scope *Scope, id string) {
- scope.Activity = id
-}
-
-var scopeSpecifier = map[string]func(scope *Scope, id string){
- "application": application,
- "app": application,
- "a": application,
- "entity": entity,
- "ent": entity,
- "e": entity,
- "effector": effector,
- "eff": effector,
- "f": effector,
- "config": config,
- "conf": config,
- "con": config,
- "c": config,
- "activity": activity,
- "act": activity,
- "v": activity,
-}
-
-// Scopes the arguments.
-// Assumes the arguments are a copy of the program args, including the first member that defines the program name.
-// Removes the scope arguments from the array and applies them to a scope object.
-// Returns the remaining arguments with the program name restored to first argument.
-// For example with input
-// br application 1 entity 2 doSomething
-// the function will return ([]string{"br", "doSomething"}, Scope{Application:1, Entity:2})
-func ScopeArguments(args []string) ([]string, Scope) {
- scope := Scope{}
-
- if len(args) < 2 {
- return args, scope
- }
-
- command := args[0]
- args = args[1:]
-
- args = defineScope(args, &scope)
-
- args = prepend(command, args)
-
- return args, scope
-}
-
-func defineScope(args []string, scope *Scope) []string {
-
- allScopesFound := false
- for !allScopesFound && len(args) > 2 && args[1][0] != '-' {
- if setAppropriateScope, nameOfAScope := scopeSpecifier[args[0]]; nameOfAScope {
- setAppropriateScope(scope, args[1])
- args = args[2:]
- } else {
- allScopesFound = true
- }
- }
-
- setDefaultEntityIfRequired(scope)
-
- return args
-}
-
-func setDefaultEntityIfRequired(scope *Scope) {
- if "" == scope.Entity {
- scope.Entity = scope.Application
- }
-}
-
-func prepend(v string, args []string) []string {
- result := make([]string, len(args)+1)
- result[0] = v
- for i, a := range args {
- result[i+1] = a
- }
- return result
-}
http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/bdb83934/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/terminal/table.go
----------------------------------------------------------------------
diff --git a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/terminal/table.go b/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/terminal/table.go
deleted file mode 100644
index c163318..0000000
--- a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/terminal/table.go
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package terminal
-
-import (
- "fmt"
- "strings"
- "unicode/utf8"
-)
-
-type Table interface {
- Add(row ...string)
- Print()
-}
-
-type PrintableTable struct {
- headers []string
- headerPrinted bool
- maxSizes []int
- rows [][]string
-}
-
-func NewTable(headers []string) Table {
- return &PrintableTable{
- headers: headers,
- maxSizes: make([]int, len(headers)),
- }
-}
-
-func (t *PrintableTable) Add(row ...string) {
- t.rows = append(t.rows, row)
-}
-
-func (t *PrintableTable) Print() {
- for _, row := range append(t.rows, t.headers) {
- t.calculateMaxSize(row)
- }
-
- if t.headerPrinted == false {
- t.printHeader()
- t.headerPrinted = true
- }
-
- for _, line := range t.rows {
- t.printRow(line)
- }
-
- t.rows = [][]string{}
-}
-
-func (t *PrintableTable) calculateMaxSize(row []string) {
- for index, value := range row {
- cellLength := utf8.RuneCountInString(value)
- if t.maxSizes[index] < cellLength {
- t.maxSizes[index] = cellLength
- }
- }
-}
-
-func (t *PrintableTable) printHeader() {
- output := ""
- for col, value := range t.headers {
- output = output + t.cellValue(col, value)
- }
- fmt.Println(output)
-}
-
-func (t *PrintableTable) printRow(row []string) {
- output := ""
- for columnIndex, value := range row {
- if columnIndex == 0 {
- value = value
- }
-
- output = output + t.cellValue(columnIndex, value)
- }
- fmt.Printf("%s\n", output)
-}
-
-func (t *PrintableTable) cellValue(col int, value string) string {
- padding := ""
- if col < len(t.headers)-1 {
- padding = strings.Repeat(" ", t.maxSizes[col]-utf8.RuneCountInString(value))
- }
- return fmt.Sprintf("%s%s ", value, padding)
-}
[3/4] brooklyn-client git commit: remove brooklyn-client Godep from
repo - @geomacy can you have a look at this,
leaving this in results in mvn building from the old Godep. I can build via
`mvn`, `godep install`
Posted by sv...@apache.org.
remove brooklyn-client Godep from repo
- @geomacy can you have a look at this, leaving this in results in mvn building from the old Godep. I can build via `mvn`, `godep install`
Project: http://git-wip-us.apache.org/repos/asf/brooklyn-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-client/commit/bdb83934
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-client/tree/bdb83934
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-client/diff/bdb83934
Branch: refs/heads/master
Commit: bdb8393472267fb2ae73d044f110ed4da3560068
Parents: 285013a
Author: John McCabe <jo...@johnmccabe.net>
Authored: Tue Mar 22 10:52:28 2016 +0000
Committer: John McCabe <jo...@johnmccabe.net>
Committed: Tue Mar 22 10:52:28 2016 +0000
----------------------------------------------------------------------
.gitignore | 1 +
.../github.com/apache/brooklyn-client/LICENSE | 201 ----------------
.../api/access_control/access_control.go | 48 ----
.../api/activities/activities.go | 59 -----
.../api/application/applications.go | 141 -----------
.../brooklyn-client/api/catalog/catalog.go | 233 -------------------
.../brooklyn-client/api/entities/entities.go | 183 ---------------
.../brooklyn-client/api/entity_config/config.go | 94 --------
.../api/entity_effectors/effectors.go | 62 -----
.../api/entity_policies/policies.go | 104 ---------
.../api/entity_policy_config/config.go | 65 ------
.../api/entity_sensors/sensors.go | 98 --------
.../brooklyn-client/api/locations/locations.go | 77 ------
.../brooklyn-client/api/version/version.go | 36 ---
.../apache/brooklyn-client/app/app.go | 163 -------------
.../apache/brooklyn-client/command/command.go | 30 ---
.../brooklyn-client/command/supercommand.go | 30 ---
.../brooklyn-client/command_factory/factory.go | 141 -----------
.../command_metadata/command_metadata.go | 33 ---
.../brooklyn-client/command_runner/runner.go | 61 -----
.../apache/brooklyn-client/commands/access.go | 59 -----
.../brooklyn-client/commands/activity-stream.go | 149 ------------
.../apache/brooklyn-client/commands/activity.go | 162 -------------
.../brooklyn-client/commands/add-catalog.go | 59 -----
.../brooklyn-client/commands/add-children.go | 63 -----
.../brooklyn-client/commands/add-location.go | 33 ---
.../brooklyn-client/commands/add-policy.go | 50 ----
.../brooklyn-client/commands/application.go | 111 ---------
.../commands/catalog-applications.go | 33 ---
.../commands/catalog-entities.go | 33 ---
.../brooklyn-client/commands/catalog-entity.go | 33 ---
.../commands/catalog-location.go | 33 ---
.../commands/catalog-locations.go | 33 ---
.../commands/catalog-policies.go | 33 ---
.../brooklyn-client/commands/catalog-policy.go | 33 ---
.../apache/brooklyn-client/commands/catalog.go | 63 -----
.../apache/brooklyn-client/commands/config.go | 78 -------
.../commands/delete-catalog-application.go | 33 ---
.../commands/delete-catalog-entity.go | 33 ---
.../commands/delete-catalog-policy.go | 33 ---
.../apache/brooklyn-client/commands/delete.go | 59 -----
.../apache/brooklyn-client/commands/deploy.go | 85 -------
.../brooklyn-client/commands/destroy-policy.go | 59 -----
.../apache/brooklyn-client/commands/effector.go | 70 ------
.../apache/brooklyn-client/commands/entity.go | 127 ----------
.../apache/brooklyn-client/commands/invoke.go | 202 ----------------
.../apache/brooklyn-client/commands/list.go | 90 -------
.../brooklyn-client/commands/locations.go | 63 -----
.../apache/brooklyn-client/commands/login.go | 111 ---------
.../apache/brooklyn-client/commands/policy.go | 114 ---------
.../apache/brooklyn-client/commands/rename.go | 59 -----
.../brooklyn-client/commands/reset-catalog.go | 33 ---
.../apache/brooklyn-client/commands/sensor.go | 118 ----------
.../apache/brooklyn-client/commands/set.go | 59 -----
.../apache/brooklyn-client/commands/spec.go | 59 -----
.../brooklyn-client/commands/start-policy.go | 59 -----
.../brooklyn-client/commands/stop-policy.go | 59 -----
.../apache/brooklyn-client/commands/tree.go | 78 -------
.../apache/brooklyn-client/commands/utils.go | 38 ---
.../apache/brooklyn-client/commands/version.go | 59 -----
.../brooklyn-client/error_handler/error.go | 46 ----
.../apache/brooklyn-client/io/config.go | 69 ------
.../apache/brooklyn-client/models/access.go | 24 --
.../brooklyn-client/models/applications.go | 97 --------
.../apache/brooklyn-client/models/catalog.go | 63 -----
.../apache/brooklyn-client/models/config.go | 31 ---
.../apache/brooklyn-client/models/effectors.go | 34 ---
.../apache/brooklyn-client/models/entities.go | 27 ---
.../apache/brooklyn-client/models/locations.go | 28 ---
.../apache/brooklyn-client/models/policies.go | 39 ----
.../apache/brooklyn-client/models/sensors.go | 26 ---
.../apache/brooklyn-client/models/version.go | 34 ---
.../apache/brooklyn-client/net/net.go | 174 --------------
.../apache/brooklyn-client/scope/scope.go | 137 -----------
.../apache/brooklyn-client/terminal/table.go | 102 --------
75 files changed, 1 insertion(+), 5548 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/bdb83934/.gitignore
----------------------------------------------------------------------
diff --git a/.gitignore b/.gitignore
index b2365f9..43a069d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,6 +4,7 @@ brooklyn-cli
temp_test
target
+br/Godeps/_workspace/src/github.com/apache/brooklyn-client
.project
.classpath
http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/bdb83934/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/LICENSE
----------------------------------------------------------------------
diff --git a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/LICENSE b/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/LICENSE
deleted file mode 100644
index 5c304d1..0000000
--- a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/LICENSE
+++ /dev/null
@@ -1,201 +0,0 @@
-Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "{}"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright {yyyy} {name of copyright owner}
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/bdb83934/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/api/access_control/access_control.go
----------------------------------------------------------------------
diff --git a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/api/access_control/access_control.go b/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/api/access_control/access_control.go
deleted file mode 100644
index c68eecf..0000000
--- a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/api/access_control/access_control.go
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package access_control
-
-import (
- "encoding/json"
- "fmt"
- "github.com/apache/brooklyn-client/models"
- "github.com/apache/brooklyn-client/net"
-)
-
-func Access(network *net.Network) (models.AccessSummary, error) {
- url := fmt.Sprintf("/v1/access")
- var access models.AccessSummary
-
- body, err := network.SendGetRequest(url)
- if err != nil {
- return access, err
- }
-
- err = json.Unmarshal(body, &access)
- return access, err
-}
-
-// WIP
-//func LocationProvisioningAllowed(network *net.Network, allowed bool) {
-// url := fmt.Sprintf("/v1/access/locationProvisioningAllowed")
-// body, err := network.SendPostRequest(url)
-// if err != nil {
-// error_handler.ErrorExit(err)
-// }
-//}
http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/bdb83934/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/api/activities/activities.go
----------------------------------------------------------------------
diff --git a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/api/activities/activities.go b/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/api/activities/activities.go
deleted file mode 100644
index 0364dcb..0000000
--- a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/api/activities/activities.go
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package activities
-
-import (
- "encoding/json"
- "fmt"
- "github.com/apache/brooklyn-client/models"
- "github.com/apache/brooklyn-client/net"
-)
-
-func Activity(network *net.Network, activity string) (models.TaskSummary, error) {
- url := fmt.Sprintf("/v1/activities/%s", activity)
- var task models.TaskSummary
- body, err := network.SendGetRequest(url)
- if err != nil {
- return task, err
- }
-
- err = json.Unmarshal(body, &task)
- return task, err
-}
-
-func ActivityChildren(network *net.Network, activity string) ([]models.TaskSummary, error) {
- url := fmt.Sprintf("/v1/activities/%s/children", activity)
- var tasks []models.TaskSummary
- body, err := network.SendGetRequest(url)
- if err != nil {
- return tasks, err
- }
-
- err = json.Unmarshal(body, &tasks)
- return tasks, err
-}
-
-func ActivityStream(network *net.Network, activity, streamId string) (string, error) {
- url := fmt.Sprintf("/v1/activities/%s/stream/%s", activity, streamId)
- body, err := network.SendGetRequest(url)
- if nil != err {
- return "", err
- }
- return string(body), nil
-}
http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/bdb83934/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/api/application/applications.go
----------------------------------------------------------------------
diff --git a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/api/application/applications.go b/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/api/application/applications.go
deleted file mode 100644
index 7f44ce0..0000000
--- a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/api/application/applications.go
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package application
-
-import (
- "encoding/json"
- "fmt"
- "github.com/apache/brooklyn-client/models"
- "github.com/apache/brooklyn-client/net"
-)
-
-//WIP
-func Fetch(network *net.Network) (string, error) {
- url := "/v1/applications/fetch"
- body, err := network.SendGetRequest(url)
- if err != nil {
- return "", err
- }
- // TODO return model
- return string(body), nil
-}
-
-func Applications(network *net.Network) ([]models.ApplicationSummary, error) {
- url := fmt.Sprintf("/v1/applications")
- var appSummary []models.ApplicationSummary
- body, err := network.SendGetRequest(url)
- if err != nil {
- return appSummary, err
- }
-
- err = json.Unmarshal(body, &appSummary)
- return appSummary, err
-}
-
-func Create(network *net.Network, filePath string) (models.TaskSummary, error) {
- url := "/v1/applications"
- var response models.TaskSummary
- body, err := network.SendPostFileRequest(url, filePath, "application/json")
- if err != nil {
- return response, err
- }
- err = json.Unmarshal(body, &response)
- return response, err
-}
-
-func CreateFromBytes(network *net.Network, blueprint []byte) (models.TaskSummary, error) {
- url := "/v1/applications"
- var response models.TaskSummary
- body, err := network.SendPostRequest(url, blueprint)
- if err != nil {
- return response, err
- }
- err = json.Unmarshal(body, &response)
- return response, err
-}
-
-// WIP
-func Descendants(network *net.Network, app string) (string, error) {
- url := fmt.Sprintf("/v1/applications/%s/descendants", app)
-
- body, err := network.SendGetRequest(url)
- // TODO return model
- if nil != err {
- return "", err
- }
- return string(body), nil
-}
-
-// WIP
-func DescendantsSensor(network *net.Network, app, sensor string) (string, error) {
- url := fmt.Sprintf("/v1/applications/%s/descendants/sensor/%s", app, sensor)
-
- body, err := network.SendGetRequest(url)
- // TODO return model
- if nil != err {
- return "", err
- }
- return string(body), nil
-}
-
-func Tree(network *net.Network) ([]models.Tree, error) {
- url := "/v1/applications/fetch"
- var tree []models.Tree
- body, err := network.SendGetRequest(url)
- if err != nil {
- return tree, err
- }
-
- err = json.Unmarshal(body, &tree)
- return tree, err
-}
-
-func Application(network *net.Network, app string) (models.ApplicationSummary, error) {
- url := fmt.Sprintf("/v1/applications/%s", app)
- var appSummary models.ApplicationSummary
- body, err := network.SendGetRequest(url)
- if err != nil {
- return appSummary, err
- }
-
- err = json.Unmarshal(body, &appSummary)
- return appSummary, err
-}
-
-func Delete(network *net.Network, application string) (models.TaskSummary, error) {
- url := fmt.Sprintf("/v1/applications/%s", application)
- var response models.TaskSummary
- body, err := network.SendDeleteRequest(url)
- if err != nil {
- return response, err
- }
- err = json.Unmarshal(body, &response)
- return response, err
-}
-
-// WIP
-func CreateLegacy(network *net.Network) (string, error) {
- url := fmt.Sprintf("/v1/applications/createLegacy")
- body, err := network.SendEmptyPostRequest(url)
- if err != nil {
- return "", err
- }
- // TODO return model
- return string(body), nil
-}
http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/bdb83934/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/api/catalog/catalog.go
----------------------------------------------------------------------
diff --git a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/api/catalog/catalog.go b/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/api/catalog/catalog.go
deleted file mode 100644
index b087530..0000000
--- a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/api/catalog/catalog.go
+++ /dev/null
@@ -1,233 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package catalog
-
-import (
- "encoding/json"
- "fmt"
- "github.com/apache/brooklyn-client/models"
- "github.com/apache/brooklyn-client/net"
-)
-
-func Icon(network *net.Network, itemId string) ([]byte, error) {
- url := fmt.Sprintf("/v1/catalog/icon/%s", itemId)
- body, err := network.SendGetRequest(url)
- return body, err
-}
-
-func IconWithVersion(network *net.Network, itemId, version string) ([]byte, error) {
- url := fmt.Sprintf("/v1/catalog/icon/%s/%s", itemId, version)
- body, err := network.SendGetRequest(url)
- return body, err
-}
-
-func GetEntityWithVersion(network *net.Network, entityId, version string) (models.CatalogEntitySummary, error) {
- url := fmt.Sprintf("/v1/catalog/entities/%s/%s", entityId, version)
- var catalogEntity models.CatalogEntitySummary
- body, err := network.SendGetRequest(url)
- if err != nil {
- return catalogEntity, err
- }
- err = json.Unmarshal(body, &catalogEntity)
- return catalogEntity, err
-}
-
-func DeleteEntityWithVersion(network *net.Network, entityId, version string) (string, error) {
- url := fmt.Sprintf("/v1/catalog/entities/%s/%s", entityId, version)
- body, err := network.SendDeleteRequest(url)
- if err != nil {
- return "", err
- }
- return string(body), nil
-}
-
-func GetEntity(network *net.Network, entityId string) (models.CatalogEntitySummary, error) {
- url := fmt.Sprintf("/v1/catalog/entities/%s", entityId)
- var catalogEntity models.CatalogEntitySummary
- body, err := network.SendGetRequest(url)
- if err != nil {
- return catalogEntity, err
- }
- err = json.Unmarshal(body, &catalogEntity)
- return catalogEntity, err
-}
-
-func DeleteEntity(network *net.Network, entityId string) (string, error) {
- url := fmt.Sprintf("/v1/catalog/entities/%s", entityId)
- body, err := network.SendDeleteRequest(url)
- if err != nil {
- return "", err
- }
- return string(body), nil
-}
-
-func GetPolicy(network *net.Network, policyId string) (models.CatalogItemSummary, error) {
- url := fmt.Sprintf("/v1/catalog/policies/%s", policyId)
- var catalogItem models.CatalogItemSummary
- body, err := network.SendGetRequest(url)
- if err != nil {
- return catalogItem, err
- }
- err = json.Unmarshal(body, &catalogItem)
- return catalogItem, err
-}
-
-func GetPolicyWithVersion(network *net.Network, policyId, version string) (models.CatalogItemSummary, error) {
- url := fmt.Sprintf("/v1/catalog/policies/%s/%s", policyId)
- var catalogItem models.CatalogItemSummary
- body, err := network.SendGetRequest(url)
- if err != nil {
- return catalogItem, err
- }
- err = json.Unmarshal(body, &catalogItem)
- return catalogItem, err
-}
-
-func DeletePolicyWithVersion(network *net.Network, policyId, version string) (string, error) {
- url := fmt.Sprintf("/v1/catalog/policies/%s/%s", policyId)
- body, err := network.SendDeleteRequest(url)
- if err != nil {
- return "", err
- }
- return string(body), nil
-}
-
-func GetApplication(network *net.Network, applicationId string) (models.CatalogEntitySummary, error) {
- url := fmt.Sprintf("/v1/catalog/applications/%s", applicationId)
- var catalogEntity models.CatalogEntitySummary
- body, err := network.SendGetRequest(url)
- if err != nil {
- return catalogEntity, err
- }
- err = json.Unmarshal(body, &catalogEntity)
- return catalogEntity, err
-}
-
-func GetApplicationWithVersion(network *net.Network, applicationId, version string) (models.CatalogEntitySummary, error) {
- url := fmt.Sprintf("/v1/catalog/applications/%s/%s", applicationId, version)
- var catalogEntity models.CatalogEntitySummary
- body, err := network.SendGetRequest(url)
- if err != nil {
- return catalogEntity, err
- }
- err = json.Unmarshal(body, &catalogEntity)
- return catalogEntity, err
-}
-
-func DeleteApplicationWithVersion(network *net.Network, applicationId, version string) (string, error) {
- url := fmt.Sprintf("/v1/catalog/applications/%s/%s", applicationId, version)
- body, err := network.SendDeleteRequest(url)
- if err != nil {
- return "", err
- }
- return string(body), nil
-}
-
-func Policies(network *net.Network) ([]models.CatalogPolicySummary, error) {
- url := "/v1/catalog/policies"
- var policies []models.CatalogPolicySummary
- body, err := network.SendGetRequest(url)
- if err != nil {
- return policies, err
- }
- err = json.Unmarshal(body, &policies)
- return policies, err
-}
-
-func Locations(network *net.Network) (models.CatalogLocationSummary, error) {
- url := "/v1/catalog/locations"
- var catalogLocation models.CatalogLocationSummary
- body, err := network.SendGetRequest(url)
- if err != nil {
- return catalogLocation, err
- }
- err = json.Unmarshal(body, &catalogLocation)
- return catalogLocation, err
-}
-
-func AddCatalog(network *net.Network, filePath string) (string, error) {
- url := "/v1/catalog"
- body, err := network.SendPostFileRequest(url, filePath, "application/json")
- if err != nil {
- return "", err
- }
- return string(body), nil
-}
-
-func Reset(network *net.Network) (string, error) {
- url := "/v1/catalog/reset"
- body, err := network.SendEmptyPostRequest(url)
- if err != nil {
- return "", err
- }
- return string(body), nil
-}
-
-func GetLocationWithVersion(network *net.Network, locationId, version string) (models.CatalogLocationSummary, error) {
- url := fmt.Sprintf("/v1/catalog/locations/%s/%s", locationId, version)
- var catalogLocation models.CatalogLocationSummary
- body, err := network.SendGetRequest(url)
- if err != nil {
- return catalogLocation, err
- }
- err = json.Unmarshal(body, &catalogLocation)
- return catalogLocation, err
-}
-
-func PostLocationWithVersion(network *net.Network, locationId, version string) (string, error) {
- url := fmt.Sprintf("/v1/catalog/locations/%s/%s", locationId, version)
- body, err := network.SendEmptyPostRequest(url)
- if err != nil {
- return "", err
- }
- return string(body), nil
-}
-
-func Entities(network *net.Network) ([]models.CatalogItemSummary, error) {
- url := "/v1/catalog/entities"
- var entities []models.CatalogItemSummary
- body, err := network.SendGetRequest(url)
- if err != nil {
- return entities, err
- }
- err = json.Unmarshal(body, &entities)
- return entities, err
-}
-
-func Catalog(network *net.Network) ([]models.CatalogItemSummary, error) {
- url := "/v1/catalog/applications"
- var applications []models.CatalogItemSummary
- body, err := network.SendGetRequest(url)
- if err != nil {
- return applications, err
- }
- err = json.Unmarshal(body, &applications)
- return applications, err
-}
-
-func GetLocation(network *net.Network, locationId string) (models.CatalogLocationSummary, error) {
- url := fmt.Sprintf("/v1/catalog/locations/%s", locationId)
- var catalogLocation models.CatalogLocationSummary
- body, err := network.SendGetRequest(url)
- if err != nil {
- return catalogLocation, err
- }
- err = json.Unmarshal(body, &catalogLocation)
- return catalogLocation, err
-}
http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/bdb83934/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/api/entities/entities.go
----------------------------------------------------------------------
diff --git a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/api/entities/entities.go b/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/api/entities/entities.go
deleted file mode 100644
index f132827..0000000
--- a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/api/entities/entities.go
+++ /dev/null
@@ -1,183 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package entities
-
-import (
- "encoding/json"
- "fmt"
- "github.com/apache/brooklyn-client/models"
- "github.com/apache/brooklyn-client/net"
- "net/url"
-)
-
-//WIP
-func GetTask(network *net.Network, application, entity, task string) (string, error) {
- url := fmt.Sprintf("/v1/applications/%s/entities/%s/activities/%s", application, entity, task)
- body, err := network.SendGetRequest(url)
- // TODO return model
- if nil != err {
- return "", err
- }
- return string(body), nil
-}
-
-//WIP
-func GetIcon(network *net.Network, application, entity string) (string, error) {
- url := fmt.Sprintf("/v1/applications/%s/entities/%s/icon", application, entity)
- body, err := network.SendGetRequest(url)
- // TODO return model
- if nil != err {
- return "", err
- }
- return string(body), nil
-}
-
-func Children(network *net.Network, application, entity string) ([]models.EntitySummary, error) {
- urlStr := fmt.Sprintf("/v1/applications/%s/entities/%s/children", application, entity)
- var entityList []models.EntitySummary
- body, err := network.SendGetRequest(urlStr)
- if err != nil {
- return entityList, err
- }
-
- err = json.Unmarshal(body, &entityList)
- return entityList, err
-}
-
-func AddChildren(network *net.Network, application, entity, filePath string) (models.TaskSummary, error) {
- urlStr := fmt.Sprintf("/v1/applications/%s/entities/%s/children", application, entity)
- var response models.TaskSummary
- body, err := network.SendPostFileRequest(urlStr, filePath, "application/json")
- if err != nil {
- return response, err
- }
-
- err = json.Unmarshal(body, &response)
- return response, err
-}
-
-//WIP
-func GetLocations(network *net.Network, application, entity string) (string, error) {
- url := fmt.Sprintf("/v1/applications/%s/entities/%s/locations", application, entity)
- body, err := network.SendGetRequest(url)
- // TODO return model
- if nil != err {
- return "", err
- }
- return string(body), nil
-}
-
-func Spec(network *net.Network, application, entity string) (string, error) {
- urlStr := fmt.Sprintf("/v1/applications/%s/entities/%s/spec", application, entity)
- body, err := network.SendGetRequest(urlStr)
- if nil != err {
- return "", err
- }
- return string(body), nil
-}
-
-//WIP
-func GetDescendants(network *net.Network, application, entity string) (string, error) {
- url := fmt.Sprintf("/v1/applications/%s/entities/%s/descendants", application, entity)
- body, err := network.SendGetRequest(url)
- // TODO return model
- if nil != err {
- return "", err
- }
- return string(body), nil
-}
-
-//WIP
-func GetDescendantsSensor(network *net.Network, application, entity, sensor string) (string, error) {
- url := fmt.Sprintf("/v1/applications/%s/entities/%s/descendants/sensor/%s", application, entity, sensor)
- body, err := network.SendGetRequest(url)
- // TODO return model
- if nil != err {
- return "", err
- }
- return string(body), nil
-}
-
-func GetActivities(network *net.Network, application, entity string) ([]models.TaskSummary, error) {
- url := fmt.Sprintf("/v1/applications/%s/entities/%s/activities", application, entity)
- var activityList []models.TaskSummary
- body, err := network.SendGetRequest(url)
- if err != nil {
- return activityList, err
- }
-
- err = json.Unmarshal(body, &activityList)
- return activityList, err
-}
-
-//WIP
-func GetTags(network *net.Network, application, entity string) (string, error) {
- url := fmt.Sprintf("/v1/applications/%s/entities/%s/tags", application, entity)
- body, err := network.SendGetRequest(url)
- // TODO return model
- if nil != err {
- return "", err
- }
- return string(body), nil
-}
-
-//WIP
-func Expunge(network *net.Network, application, entity string) (string, error) {
- url := fmt.Sprintf("/v1/applications/%s/entities/%s/expunge", application, entity)
- body, err := network.SendEmptyPostRequest(url)
- // TODO return model
- if nil != err {
- return "", err
- }
- return string(body), nil
-}
-
-//WIP
-func GetEntity(network *net.Network, application, entity string) (models.EntitySummary, error) {
- url := fmt.Sprintf("/v1/applications/%s/entities/%s", application, entity)
- summary := models.EntitySummary{}
- body, err := network.SendGetRequest(url)
- if err != nil {
- return summary, err
- }
-
- err = json.Unmarshal(body, &summary)
- return summary, err
-}
-
-func EntityList(network *net.Network, application string) ([]models.EntitySummary, error) {
- urlStr := fmt.Sprintf("/v1/applications/%s/entities", application)
- var entityList []models.EntitySummary
- body, err := network.SendGetRequest(urlStr)
- if err != nil {
- return entityList, err
- }
-
- err = json.Unmarshal(body, &entityList)
- return entityList, err
-}
-
-func Rename(network *net.Network, application, entity, newName string) (string, error) {
- urlStr := fmt.Sprintf("/v1/applications/%s/entities/%s/name?name=%s", application, entity, url.QueryEscape(newName))
- body, err := network.SendEmptyPostRequest(urlStr)
- if nil != err {
- return "", err
- }
- return string(body), nil
-}
http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/bdb83934/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/api/entity_config/config.go
----------------------------------------------------------------------
diff --git a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/api/entity_config/config.go b/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/api/entity_config/config.go
deleted file mode 100644
index 66cd1d5..0000000
--- a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/api/entity_config/config.go
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package entity_config
-
-import (
- "encoding/json"
- "fmt"
- "github.com/apache/brooklyn-client/models"
- "github.com/apache/brooklyn-client/net"
-)
-
-func ConfigValue(network *net.Network, application, entity, config string) (interface{}, error) {
- bytes, err := ConfigValueAsBytes(network, application, entity, config)
- if nil != err || 0 == len(bytes) {
- return nil, err
- }
-
- var value interface{}
- err = json.Unmarshal(bytes, &value)
- if nil != err {
- return nil, err
- }
-
- return value, nil
-}
-
-func ConfigValueAsBytes(network *net.Network, application, entity, config string) ([]byte, error) {
- url := fmt.Sprintf("/v1/applications/%s/entities/%s/config/%s", application, entity, config)
- body, err := network.SendGetRequest(url)
- if err != nil {
- return []byte{}, err
- }
-
- return body, nil
-}
-
-func SetConfig(network *net.Network, application, entity, config, value string) (string, error) {
- url := fmt.Sprintf("/v1/applications/%s/entities/%s/config/%s", application, entity, config)
- val := []byte(value)
- body, err := network.SendPostRequest(url, val)
- if nil != err {
- return "", err
- }
- return string(body), nil
-}
-
-func ConfigList(network *net.Network, application, entity string) ([]models.ConfigSummary, error) {
- url := fmt.Sprintf("/v1/applications/%s/entities/%s/config", application, entity)
- var configList []models.ConfigSummary
- body, err := network.SendGetRequest(url)
- if err != nil {
- return configList, err
- }
-
- err = json.Unmarshal(body, &configList)
- return configList, err
-}
-
-func PostConfig(network *net.Network, application, entity, config, value string) (string, error) {
- url := fmt.Sprintf("/v1/applications/%s/entities/%s/config", application, entity)
- val := []byte(value)
- body, err := network.SendPostRequest(url, val)
- if nil != err {
- return "", err
- }
- return string(body), nil
-}
-
-func ConfigCurrentState(network *net.Network, application, entity string) (map[string]interface{}, error) {
- url := fmt.Sprintf("/v1/applications/%s/entities/%s/config/current-state", application, entity)
- var currentState map[string]interface{}
- body, err := network.SendGetRequest(url)
- if err != nil {
- return currentState, err
- }
- err = json.Unmarshal(body, ¤tState)
- return currentState, err
-}
http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/bdb83934/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/api/entity_effectors/effectors.go
----------------------------------------------------------------------
diff --git a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/api/entity_effectors/effectors.go b/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/api/entity_effectors/effectors.go
deleted file mode 100644
index 488a5b1..0000000
--- a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/api/entity_effectors/effectors.go
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package entity_effectors
-
-import (
- "bytes"
- "encoding/json"
- "errors"
- "fmt"
- "github.com/apache/brooklyn-client/models"
- "github.com/apache/brooklyn-client/net"
- "net/url"
- "strconv"
- "strings"
-)
-
-func EffectorList(network *net.Network, application, entity string) ([]models.EffectorSummary, error) {
- path := fmt.Sprintf("/v1/applications/%s/entities/%s/effectors", application, entity)
- var effectorList []models.EffectorSummary
- body, err := network.SendGetRequest(path)
- if err != nil {
- return effectorList, err
- }
-
- err = json.Unmarshal(body, &effectorList)
- return effectorList, err
-}
-
-func TriggerEffector(network *net.Network, application, entity, effector string, params []string, args []string) (string, error) {
- if len(params) != len(args) {
- return "", errors.New(strings.Join([]string{"Parameters not supplied:", strings.Join(params, ", ")}, " "))
- }
- path := fmt.Sprintf("/v1/applications/%s/entities/%s/effectors/%s", application, entity, effector)
- data := url.Values{}
- for i := range params {
- data.Set(params[i], args[i])
- }
- req := network.NewPostRequest(path, bytes.NewBufferString(data.Encode()))
- req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
- req.Header.Add("Content-Length", strconv.Itoa(len(data.Encode())))
- body, err := network.SendRequest(req)
- if err != nil {
- return "", err
- }
- return string(body), nil
-}
http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/bdb83934/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/api/entity_policies/policies.go
----------------------------------------------------------------------
diff --git a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/api/entity_policies/policies.go b/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/api/entity_policies/policies.go
deleted file mode 100644
index d776a05..0000000
--- a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/api/entity_policies/policies.go
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package entity_policies
-
-import (
- "bytes"
- "encoding/json"
- "fmt"
- "github.com/apache/brooklyn-client/models"
- "github.com/apache/brooklyn-client/net"
- "net/url"
- "strconv"
-)
-
-// WIP
-func AddPolicy(network *net.Network, application, entity, policy string, config map[string]string) (models.PolicySummary, error) {
- path := fmt.Sprintf("/v1/applications/%s/entities/%s/policies", application, entity)
- data := url.Values{}
- data.Set("policyType", policy)
- //data.Add("config", config)
- req := network.NewPostRequest(path, bytes.NewBufferString(data.Encode()))
- req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
- req.Header.Add("Content-Length", strconv.Itoa(len(data.Encode())))
- var policySummary models.PolicySummary
- body, err := network.SendRequest(req)
- if err != nil {
- return policySummary, err
- }
- err = json.Unmarshal(body, &policySummary)
- return policySummary, err
-}
-
-func PolicyList(network *net.Network, application, entity string) ([]models.PolicySummary, error) {
- url := fmt.Sprintf("/v1/applications/%s/entities/%s/policies", application, entity)
- var policyList []models.PolicySummary
- body, err := network.SendGetRequest(url)
- if err != nil {
- return policyList, err
- }
-
- err = json.Unmarshal(body, &policyList)
- return policyList, err
-}
-
-func PolicyStatus(network *net.Network, application, entity, policy string) (string, error) {
- url := fmt.Sprintf("/v1/applications/%s/entities/%s/policies/%s", application, entity, policy)
- body, err := network.SendGetRequest(url)
- if nil != err {
- return "", err
- }
- return string(body), nil
-}
-
-func CurrentState(network *net.Network, application, entity string) (string, error) {
- url := fmt.Sprintf("/v1/applications/%s/entities/%s/policies/current-state", application, entity)
- body, err := network.SendGetRequest(url)
- if nil != err {
- return "", err
- }
- return string(body), nil
-}
-
-func StartPolicy(network *net.Network, application, entity, policy string) (string, error) {
- url := fmt.Sprintf("/v1/applications/%s/entities/%s/policies/%s/start", application, entity, policy)
- body, err := network.SendEmptyPostRequest(url)
- if nil != err {
- return "", err
- }
- return string(body), nil
-}
-
-func StopPolicy(network *net.Network, application, entity, policy string) (string, error) {
- url := fmt.Sprintf("/v1/applications/%s/entities/%s/policies/%s/stop", application, entity, policy)
- body, err := network.SendEmptyPostRequest(url)
- if nil != err {
- return "", err
- }
- return string(body), nil
-}
-
-func DestroyPolicy(network *net.Network, application, entity, policy string) (string, error) {
- url := fmt.Sprintf("/v1/applications/%s/entities/%s/policies/%s/destroy", application, entity, policy)
- body, err := network.SendEmptyPostRequest(url)
- if nil != err {
- return "", err
- }
- return string(body), nil
-}
http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/bdb83934/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/api/entity_policy_config/config.go
----------------------------------------------------------------------
diff --git a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/api/entity_policy_config/config.go b/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/api/entity_policy_config/config.go
deleted file mode 100644
index 0cf40fe..0000000
--- a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/api/entity_policy_config/config.go
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package entity_policy_config
-
-import (
- "encoding/json"
- "fmt"
- "github.com/apache/brooklyn-client/models"
- "github.com/apache/brooklyn-client/net"
-)
-
-func CurrentState(network *net.Network, application, entity, policy string) (string, error) {
- url := fmt.Sprintf("/v1/applications/%s/entities/%s/policies/%s/config/current-state", application, entity, policy)
- body, err := network.SendGetRequest(url)
- if nil != err {
- return "", err
- }
- return string(body), nil
-}
-
-func GetConfigValue(network *net.Network, application, entity, policy, config string) (string, error) {
- url := fmt.Sprintf("/v1/applications/%s/entities/%s/policies/%s/config/%s", application, entity, policy, config)
- body, err := network.SendGetRequest(url)
- if nil != err {
- return "", err
- }
- return string(body), nil
-}
-
-// WIP
-func SetConfigValue(network *net.Network, application, entity, policy, config string) (string, error) {
- url := fmt.Sprintf("/v1/applications/%s/entities/%s/policies/%s/config/%s", application, entity, policy, config)
- body, err := network.SendEmptyPostRequest(url)
- if nil != err {
- return "", err
- }
- return string(body), nil
-}
-
-func GetAllConfigValues(network *net.Network, application, entity, policy string) ([]models.PolicyConfigList, error) {
- url := fmt.Sprintf("/v1/applications/%s/entities/%s/policies/%s/config", application, entity, policy)
- var policyConfigList []models.PolicyConfigList
- body, err := network.SendGetRequest(url)
- if nil != err {
- return policyConfigList, err
- }
- err = json.Unmarshal(body, &policyConfigList)
- return policyConfigList, err
-}
http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/bdb83934/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/api/entity_sensors/sensors.go
----------------------------------------------------------------------
diff --git a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/api/entity_sensors/sensors.go b/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/api/entity_sensors/sensors.go
deleted file mode 100644
index ddb0d5b..0000000
--- a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/api/entity_sensors/sensors.go
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package entity_sensors
-
-import (
- "encoding/json"
- "fmt"
- "github.com/apache/brooklyn-client/models"
- "github.com/apache/brooklyn-client/net"
-)
-
-func SensorValue(network *net.Network, application, entity, sensor string) (interface{}, error) {
- url := fmt.Sprintf("/v1/applications/%s/entities/%s/sensors/%s", application, entity, sensor)
- body, err := network.SendGetRequest(url)
- if nil != err || 0 == len(body) {
- return nil, err
- }
-
- var value interface{}
- err = json.Unmarshal(body, &value)
- if nil != err {
- return nil, err
- }
-
- return value, nil
-}
-
-// WIP
-func DeleteSensor(network *net.Network, application, entity, sensor string) (string, error) {
- url := fmt.Sprintf("/v1/applications/%s/entities/%s/sensors/%s", application, entity, sensor)
- body, err := network.SendDeleteRequest(url)
- if nil != err {
- return "", err
- }
- return string(body), nil
-}
-
-// WIP
-//func SetSensor(network *net.Network, application, entity, sensor string) string {
-// url := fmt.Sprintf("/v1/applications/%s/entities/%s/sensors/%s", application, entity, sensor)
-// body, err := network.SendPostRequest(url)
-// if err != nil {
-// error_handler.ErrorExit(err)
-// }
-
-// return string(body)
-//}
-
-// WIP
-//func SetSensors(network *net.Network, application, entity, sensor string) string {
-// url := fmt.Sprintf("/v1/applications/%s/entities/%s/sensors", application, entity, sensor)
-// body, err := network.SendPostRequest(url)
-// if err != nil {
-// error_handler.ErrorExit(err)
-// }
-
-// return string(body)
-//}
-
-func SensorList(network *net.Network, application, entity string) ([]models.SensorSummary, error) {
- url := fmt.Sprintf("/v1/applications/%s/entities/%s/sensors", application, entity)
- body, err := network.SendGetRequest(url)
- var sensorList []models.SensorSummary
- if err != nil {
- return sensorList, err
- }
-
- err = json.Unmarshal(body, &sensorList)
- return sensorList, err
-}
-
-func CurrentState(network *net.Network, application, entity string) (map[string]interface{}, error) {
- url := fmt.Sprintf("/v1/applications/%s/entities/%s/sensors/current-state", application, entity)
- var currentState map[string]interface{}
- body, err := network.SendGetRequest(url)
- if err != nil {
- return currentState, err
- }
-
- err = json.Unmarshal(body, ¤tState)
- return currentState, err
-}
http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/bdb83934/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/api/locations/locations.go
----------------------------------------------------------------------
diff --git a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/api/locations/locations.go b/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/api/locations/locations.go
deleted file mode 100644
index 9bbb9b3..0000000
--- a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/api/locations/locations.go
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package locations
-
-import (
- "encoding/json"
- "fmt"
- "github.com/apache/brooklyn-client/models"
- "github.com/apache/brooklyn-client/net"
-)
-
-func LocatedLocations(network *net.Network) (string, error) {
- url := "/v1/locations/usage/LocatedLocations"
- body, err := network.SendGetRequest(url)
- if err != nil {
- return "", err
- }
- return string(body), nil
-}
-
-func GetLocation(network *net.Network, locationId string) (models.LocationSummary, error) {
- url := fmt.Sprintf("/v1/locations/%s", locationId)
- var locationDetail models.LocationSummary
- body, err := network.SendGetRequest(url)
- if err != nil {
- return locationDetail, err
- }
- err = json.Unmarshal(body, &locationDetail)
- return locationDetail, err
-}
-
-func DeleteLocation(network *net.Network, locationId string) (string, error) {
- url := fmt.Sprintf("/v1/locations/%s", locationId)
- body, err := network.SendDeleteRequest(url)
- if err != nil {
- return "", err
- }
- return string(body), nil
-}
-
-// WIP
-func CreateLocation(network *net.Network, locationId string) (string, error) {
- url := fmt.Sprintf("/v1/locations", locationId)
- body, err := network.SendEmptyPostRequest(url)
- if err != nil {
- return "", err
- }
- return string(body), nil
-}
-
-func LocationList(network *net.Network) ([]models.LocationSummary, error) {
- url := "/v1/locations"
- var locationList []models.LocationSummary
- body, err := network.SendGetRequest(url)
- if err != nil {
- return locationList, err
- }
-
- err = json.Unmarshal(body, &locationList)
- return locationList, err
-}
http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/bdb83934/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/api/version/version.go
----------------------------------------------------------------------
diff --git a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/api/version/version.go b/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/api/version/version.go
deleted file mode 100644
index c3f1c70..0000000
--- a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/api/version/version.go
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package version
-
-import (
- "encoding/json"
- "github.com/apache/brooklyn-client/models"
- "github.com/apache/brooklyn-client/net"
-)
-
-func Version(network *net.Network) (models.VersionSummary, error) {
- url := "/v1/server/version"
- var versionSummary models.VersionSummary
- body, err := network.SendGetRequest(url)
- if err != nil {
- return versionSummary, err
- }
- err = json.Unmarshal(body, &versionSummary)
- return versionSummary, err
-}
http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/bdb83934/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/app/app.go
----------------------------------------------------------------------
diff --git a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/app/app.go b/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/app/app.go
deleted file mode 100644
index 55557bf..0000000
--- a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/app/app.go
+++ /dev/null
@@ -1,163 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package app
-
-import (
- "fmt"
- "github.com/apache/brooklyn-client/command_metadata"
- "github.com/apache/brooklyn-client/command_runner"
- "github.com/apache/brooklyn-client/error_handler"
- "github.com/codegangsta/cli"
- "os"
- "strings"
-)
-
-type configDefaults struct {
- Name string
- HelpName string
- Usage string
- Version string
-}
-
-var appConfig = configDefaults{
- Name: os.Args[0],
- HelpName: os.Args[0],
- Usage: "A Brooklyn command line client application",
- Version: "0.9.0",
-}
-
-func NewApp(baseName string, cmdRunner command_runner.Runner, metadatas ...command_metadata.CommandMetadata) (app *cli.App) {
-
- cli.AppHelpTemplate = appHelpTemplate()
- cli.CommandHelpTemplate = commandHelpTemplate()
- app = cli.NewApp()
- app.Name = appConfig.Name
- app.HelpName = appConfig.HelpName
- app.Usage = appConfig.Usage
- app.Version = appConfig.Version
-
- app.Commands = []cli.Command{}
-
- for _, metadata := range metadatas {
- primaryCommand := getCommand(baseName, metadata, cmdRunner)
- app.Commands = append(app.Commands, primaryCommand)
- }
- return
-}
-
-func getCommand(baseName string, metadata command_metadata.CommandMetadata, runner command_runner.Runner) cli.Command {
- command := cli.Command{
- Name: metadata.Name,
- Aliases: metadata.Aliases,
- ShortName: metadata.ShortName,
- Description: metadata.Description,
- Usage: strings.Replace(metadata.Usage, "BROOKLYN_NAME", baseName, -1),
- Action: func(context *cli.Context) {
- err := runner.RunCmdByName(metadata.Name, context)
- if err != nil {
- error_handler.ErrorExit(err)
- }
- },
- Flags: metadata.Flags,
- SkipFlagParsing: metadata.SkipFlagParsing,
- }
-
- if nil != metadata.Operands {
- command.Subcommands = make([]cli.Command, 0)
- for _, operand := range metadata.Operands {
- command.Subcommands = append(command.Subcommands, cli.Command{
- Name: operand.Name,
- Aliases: operand.Aliases,
- ShortName: operand.ShortName,
- Description: operand.Description,
- Usage: operand.Usage,
- Flags: operand.Flags,
- SkipFlagParsing: operand.SkipFlagParsing,
- Action: subCommandAction(command.Name, operand.Name, runner),
- })
- command.Usage = strings.Join([]string{
- command.Usage, "\n... ", operand.Usage, "\t", operand.Description,
- }, "")
- }
- }
-
- return command
-}
-
-func subCommandAction(command string, operand string, runner command_runner.Runner) func(context *cli.Context) {
- return func(context *cli.Context) {
- err := runner.RunSubCmdByName(command, operand, context)
- if err != nil {
- fmt.Fprintln(os.Stderr, err)
- }
- }
-}
-
-func appHelpTemplate() string {
- return `NAME:
- {{.Name}} - {{.Usage}}
-USAGE:
- {{.Name}} {{if .Flags}}[global options] {{end}}command{{if .Flags}} [command options]{{end}} [arguments...]
-
-VERSION:
- {{.Version}}{{if or .Author .Email}}
-
-AUTHOR:{{if .Author}}
- {{.Author}}{{if .Email}} - <{{.Email}}>{{end}}{{else}}
- {{.Email}}{{end}}{{end}}
-
-
-SCOPES:
- Many commands require a "scope" expression to indicate the target on which they operate. The scope expressions are
- as follows (values in brackets are aliases for the scope):
- - application APP-ID (app, a) Selects and application, e.g. "br app myapp"
- - entity ENT-ID (ent, e) Selects an entity within an application scope, e.g. "br app myapp ent myserver"
- - effector EFF-ID (eff, f) Selects an effector of an entity or application, e.g. "br a myapp e myserver eff xyz"
- - config CONF-KEY (conf, con, c) Selects a configuration key of an entity e.g. "br a myapp e myserver config jmx.agent.mode"
- - activity ACT-ID (act, v) Selects an activity of an entity e.g. "br a myapp e myserver act iHG7sq1"
-
-
-COMMANDS:
-
- Commands whose description begins with a "*" character are particularly experimental and likely to change in upcoming
- releases. If not otherwise specified, "SCOPE" below means application or entity scope. If an entity scope is not
- specified, the application entity is used as a default.
-
- {{range .Commands}}{{.Name}}{{with .ShortName}}, {{.}}{{end}}{{ "\t" }}{{.Description}}
- {{end}}{{if .Flags}}
-GLOBAL OPTIONS:
- {{range .Flags}}{{.}}
- {{end}}{{end}}
-`
-}
-
-func commandHelpTemplate() string {
- return `NAME:
- {{.Name}} - {{.Description}}
-{{with .ShortName}}
-ALIAS:
- {{.}}
-{{end}}
-USAGE:
- {{.Usage}}{{with .Flags}}
-OPTIONS:
-{{range .}} {{.}}
-{{end}}{{else}}
-{{end}}`
-}
http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/bdb83934/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/command/command.go
----------------------------------------------------------------------
diff --git a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/command/command.go b/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/command/command.go
deleted file mode 100644
index 14c03a5..0000000
--- a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/command/command.go
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package command
-
-import (
- "github.com/apache/brooklyn-client/command_metadata"
- "github.com/apache/brooklyn-client/scope"
- "github.com/codegangsta/cli"
-)
-
-type Command interface {
- Metadata() command_metadata.CommandMetadata
- Run(scope scope.Scope, context *cli.Context)
-}
http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/bdb83934/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/command/supercommand.go
----------------------------------------------------------------------
diff --git a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/command/supercommand.go b/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/command/supercommand.go
deleted file mode 100644
index 82a5856..0000000
--- a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/command/supercommand.go
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package command
-
-// A command with further (sub) commands, like 'git remote', with its 'git remote add' etc.
-type SuperCommand interface {
- Command
-
- // Get the sub command wih the given name
- SubCommand(name string) Command
-
- // Get the names of all subcommands
- SubCommandNames() []string
-}
http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/bdb83934/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/command_factory/factory.go
----------------------------------------------------------------------
diff --git a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/command_factory/factory.go b/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/command_factory/factory.go
deleted file mode 100644
index 7a46eb9..0000000
--- a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/command_factory/factory.go
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package command_factory
-
-import (
- "errors"
- "github.com/apache/brooklyn-client/command"
- "github.com/apache/brooklyn-client/command_metadata"
- "github.com/apache/brooklyn-client/commands"
- "github.com/apache/brooklyn-client/io"
- "github.com/apache/brooklyn-client/net"
- "sort"
- "strings"
-)
-
-type Factory interface {
- GetByCmdName(cmdName string) (cmd command.Command, err error)
- GetBySubCmdName(cmdName string, subCmdName string) (cmd command.Command, err error)
- CommandMetadatas() []command_metadata.CommandMetadata
-}
-
-type concreteFactory struct {
- cmdsByName map[string]command.Command
- subCommands map[string]map[string]command.Command
-}
-
-func NewFactory(network *net.Network, config *io.Config) (factory concreteFactory) {
- factory.cmdsByName = make(map[string]command.Command)
- factory.subCommands = make(map[string]map[string]command.Command)
-
- factory.simpleCommand(commands.NewAccess(network))
- //factory.command(commands.NewActivities(network))
- factory.simpleCommand(commands.NewActivity(network))
- factory.simpleCommand(commands.NewActivityStreamEnv(network))
- factory.simpleCommand(commands.NewActivityStreamStderr(network))
- factory.simpleCommand(commands.NewActivityStreamStdin(network))
- factory.simpleCommand(commands.NewActivityStreamStdout(network))
- factory.simpleCommand(commands.NewAddCatalog(network))
- factory.simpleCommand(commands.NewAddChildren(network))
- factory.simpleCommand(commands.NewApplication(network))
- //factory.simpleCommand(commands.NewApplications(network))
- factory.simpleCommand(commands.NewCatalog(network))
- factory.simpleCommand(commands.NewConfig(network))
- factory.simpleCommand(commands.NewDeploy(network))
- factory.simpleCommand(commands.NewDelete(network))
- factory.simpleCommand(commands.NewDestroyPolicy(network))
- factory.simpleCommand(commands.NewEffector(network))
- factory.simpleCommand(commands.NewEntity(network))
- factory.simpleCommand(commands.NewInvoke(network))
- factory.simpleCommand(commands.NewInvokeRestart(network))
- factory.simpleCommand(commands.NewInvokeStart(network))
- factory.simpleCommand(commands.NewInvokeStop(network))
- // NewList below is not used but we retain the code as an example of how to do a super command.
- // factory.superCommand(commands.NewList(network))
- factory.simpleCommand(commands.NewLocations(network))
- factory.simpleCommand(commands.NewLogin(network, config))
- factory.simpleCommand(commands.NewPolicy(network))
- factory.simpleCommand(commands.NewRename(network))
- factory.simpleCommand(commands.NewSensor(network))
- factory.simpleCommand(commands.NewSetConfig(network))
- factory.simpleCommand(commands.NewSpec(network))
- factory.simpleCommand(commands.NewStartPolicy(network))
- factory.simpleCommand(commands.NewStopPolicy(network))
- factory.simpleCommand(commands.NewTree(network))
- factory.simpleCommand(commands.NewVersion(network))
-
- return factory
-}
-
-func (factory *concreteFactory) simpleCommand(cmd command.Command) {
- factory.cmdsByName[cmd.Metadata().Name] = cmd
-}
-
-func (factory *concreteFactory) superCommand(cmd command.SuperCommand) {
-
- factory.simpleCommand(cmd)
-
- if nil == factory.subCommands[cmd.Metadata().Name] {
- factory.subCommands[cmd.Metadata().Name] = make(map[string]command.Command)
- }
-
- for _, sub := range cmd.SubCommandNames() {
- factory.subCommands[cmd.Metadata().Name][sub] = cmd.SubCommand(sub)
- }
-}
-
-func (f concreteFactory) GetByCmdName(cmdName string) (cmd command.Command, err error) {
- cmd, found := f.cmdsByName[cmdName]
- if !found {
- for _, c := range f.cmdsByName {
- if c.Metadata().ShortName == cmdName {
- return c, nil
- }
- }
-
- err = errors.New(strings.Join([]string{"Command not found:", cmdName}, " "))
- }
- return
-}
-
-func (f concreteFactory) GetBySubCmdName(cmdName string, subCmdName string) (cmd command.Command, err error) {
-
- _, hasPrimary := f.subCommands[cmdName]
- if hasPrimary {
- cmd, found := f.subCommands[cmdName][subCmdName]
- if found {
- return cmd, nil
- }
- }
- return cmd, errors.New(strings.Join([]string{"Command not found:", cmdName, subCmdName}, " "))
-}
-
-func (factory concreteFactory) CommandMetadatas() (commands []command_metadata.CommandMetadata) {
- keys := make([]string, 0, len(factory.cmdsByName))
- for key := range factory.cmdsByName {
- keys = append(keys, key)
- }
- sort.Strings(keys)
-
- for _, key := range keys {
- command := factory.cmdsByName[key]
- commands = append(commands, command.Metadata())
- }
- return
-}
http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/bdb83934/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/command_metadata/command_metadata.go
----------------------------------------------------------------------
diff --git a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/command_metadata/command_metadata.go b/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/command_metadata/command_metadata.go
deleted file mode 100644
index 7f5c1b9..0000000
--- a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/command_metadata/command_metadata.go
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package command_metadata
-
-import "github.com/codegangsta/cli"
-
-type CommandMetadata struct {
- Name string
- Aliases []string
- ShortName string
- Usage string
- Description string
- Flags []cli.Flag
- SkipFlagParsing bool
- TotalArgs int //Optional: number of required arguments to skip for flag verification
- Operands []CommandMetadata
-}
http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/bdb83934/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/command_runner/runner.go
----------------------------------------------------------------------
diff --git a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/command_runner/runner.go b/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/command_runner/runner.go
deleted file mode 100644
index 5fc86e5..0000000
--- a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/command_runner/runner.go
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package command_runner
-
-import (
- "github.com/apache/brooklyn-client/command_factory"
- "github.com/apache/brooklyn-client/scope"
- "github.com/codegangsta/cli"
-)
-
-type Runner interface {
- RunCmdByName(cmdName string, c *cli.Context) (err error)
- RunSubCmdByName(cmdName string, subCommand string, c *cli.Context) (err error)
-}
-
-type ConcreteRunner struct {
- cmdFactory command_factory.Factory
- scope scope.Scope
-}
-
-func NewRunner(scope scope.Scope, cmdFactory command_factory.Factory) (runner ConcreteRunner) {
- runner.cmdFactory = cmdFactory
- runner.scope = scope
- return
-}
-
-func (runner ConcreteRunner) RunCmdByName(cmdName string, c *cli.Context) error {
- cmd, err := runner.cmdFactory.GetByCmdName(cmdName)
- if nil != err {
- return err
- }
-
- cmd.Run(runner.scope, c)
- return nil
-}
-
-func (runner ConcreteRunner) RunSubCmdByName(cmdName string, subCommand string, c *cli.Context) error {
- cmd, err := runner.cmdFactory.GetBySubCmdName(cmdName, subCommand)
- if nil != err {
- return err
- }
-
- cmd.Run(runner.scope, c)
- return nil
-}
http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/bdb83934/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/access.go
----------------------------------------------------------------------
diff --git a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/access.go b/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/access.go
deleted file mode 100644
index 1ddef76..0000000
--- a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/access.go
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package commands
-
-import (
- "fmt"
- "github.com/apache/brooklyn-client/api/access_control"
- "github.com/apache/brooklyn-client/command_metadata"
- "github.com/apache/brooklyn-client/error_handler"
- "github.com/apache/brooklyn-client/net"
- "github.com/apache/brooklyn-client/scope"
- "github.com/codegangsta/cli"
-)
-
-type Access struct {
- network *net.Network
-}
-
-func NewAccess(network *net.Network) (cmd *Access) {
- cmd = new(Access)
- cmd.network = network
- return
-}
-
-func (cmd *Access) Metadata() command_metadata.CommandMetadata {
- return command_metadata.CommandMetadata{
- Name: "access",
- Description: "Show access control",
- Usage: "BROOKLYN_NAME access",
- Flags: []cli.Flag{},
- }
-}
-
-func (cmd *Access) Run(scope scope.Scope, c *cli.Context) {
- if err := net.VerifyLoginURL(cmd.network); err != nil {
- error_handler.ErrorExit(err)
- }
- access, err := access_control.Access(cmd.network)
- if nil != err {
- error_handler.ErrorExit(err)
- }
- fmt.Println("Location Provisioning Allowed:", access.LocationProvisioningAllowed)
-}
[4/4] brooklyn-client git commit: Closes #11
Posted by sv...@apache.org.
Closes #11
remove brooklyn-client Godep from repo
@geomacy can you have a look at this, leaving this in results in mvn building from the old Godep. I can build via `mvn`, `godep install`
Project: http://git-wip-us.apache.org/repos/asf/brooklyn-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-client/commit/7066a4d6
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-client/tree/7066a4d6
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-client/diff/7066a4d6
Branch: refs/heads/master
Commit: 7066a4d69989711655fb58716ff32117e5791441
Parents: 5194b68 bdb8393
Author: Svetoslav Neykov <sv...@cloudsoftcorp.com>
Authored: Tue Apr 5 17:15:49 2016 +0300
Committer: Svetoslav Neykov <sv...@cloudsoftcorp.com>
Committed: Tue Apr 5 17:15:49 2016 +0300
----------------------------------------------------------------------
.gitignore | 1 +
.../github.com/apache/brooklyn-client/LICENSE | 201 ----------------
.../api/access_control/access_control.go | 48 ----
.../api/activities/activities.go | 59 -----
.../api/application/applications.go | 141 -----------
.../brooklyn-client/api/catalog/catalog.go | 233 -------------------
.../brooklyn-client/api/entities/entities.go | 183 ---------------
.../brooklyn-client/api/entity_config/config.go | 94 --------
.../api/entity_effectors/effectors.go | 62 -----
.../api/entity_policies/policies.go | 104 ---------
.../api/entity_policy_config/config.go | 65 ------
.../api/entity_sensors/sensors.go | 98 --------
.../brooklyn-client/api/locations/locations.go | 77 ------
.../brooklyn-client/api/version/version.go | 36 ---
.../apache/brooklyn-client/app/app.go | 163 -------------
.../apache/brooklyn-client/command/command.go | 30 ---
.../brooklyn-client/command/supercommand.go | 30 ---
.../brooklyn-client/command_factory/factory.go | 141 -----------
.../command_metadata/command_metadata.go | 33 ---
.../brooklyn-client/command_runner/runner.go | 61 -----
.../apache/brooklyn-client/commands/access.go | 59 -----
.../brooklyn-client/commands/activity-stream.go | 149 ------------
.../apache/brooklyn-client/commands/activity.go | 162 -------------
.../brooklyn-client/commands/add-catalog.go | 59 -----
.../brooklyn-client/commands/add-children.go | 63 -----
.../brooklyn-client/commands/add-location.go | 33 ---
.../brooklyn-client/commands/add-policy.go | 50 ----
.../brooklyn-client/commands/application.go | 111 ---------
.../commands/catalog-applications.go | 33 ---
.../commands/catalog-entities.go | 33 ---
.../brooklyn-client/commands/catalog-entity.go | 33 ---
.../commands/catalog-location.go | 33 ---
.../commands/catalog-locations.go | 33 ---
.../commands/catalog-policies.go | 33 ---
.../brooklyn-client/commands/catalog-policy.go | 33 ---
.../apache/brooklyn-client/commands/catalog.go | 63 -----
.../apache/brooklyn-client/commands/config.go | 78 -------
.../commands/delete-catalog-application.go | 33 ---
.../commands/delete-catalog-entity.go | 33 ---
.../commands/delete-catalog-policy.go | 33 ---
.../apache/brooklyn-client/commands/delete.go | 59 -----
.../apache/brooklyn-client/commands/deploy.go | 85 -------
.../brooklyn-client/commands/destroy-policy.go | 59 -----
.../apache/brooklyn-client/commands/effector.go | 70 ------
.../apache/brooklyn-client/commands/entity.go | 127 ----------
.../apache/brooklyn-client/commands/invoke.go | 202 ----------------
.../apache/brooklyn-client/commands/list.go | 90 -------
.../brooklyn-client/commands/locations.go | 63 -----
.../apache/brooklyn-client/commands/login.go | 111 ---------
.../apache/brooklyn-client/commands/policy.go | 114 ---------
.../apache/brooklyn-client/commands/rename.go | 59 -----
.../brooklyn-client/commands/reset-catalog.go | 33 ---
.../apache/brooklyn-client/commands/sensor.go | 118 ----------
.../apache/brooklyn-client/commands/set.go | 59 -----
.../apache/brooklyn-client/commands/spec.go | 59 -----
.../brooklyn-client/commands/start-policy.go | 59 -----
.../brooklyn-client/commands/stop-policy.go | 59 -----
.../apache/brooklyn-client/commands/tree.go | 78 -------
.../apache/brooklyn-client/commands/utils.go | 38 ---
.../apache/brooklyn-client/commands/version.go | 59 -----
.../brooklyn-client/error_handler/error.go | 46 ----
.../apache/brooklyn-client/io/config.go | 69 ------
.../apache/brooklyn-client/models/access.go | 24 --
.../brooklyn-client/models/applications.go | 97 --------
.../apache/brooklyn-client/models/catalog.go | 63 -----
.../apache/brooklyn-client/models/config.go | 31 ---
.../apache/brooklyn-client/models/effectors.go | 34 ---
.../apache/brooklyn-client/models/entities.go | 27 ---
.../apache/brooklyn-client/models/locations.go | 28 ---
.../apache/brooklyn-client/models/policies.go | 39 ----
.../apache/brooklyn-client/models/sensors.go | 26 ---
.../apache/brooklyn-client/models/version.go | 34 ---
.../apache/brooklyn-client/net/net.go | 174 --------------
.../apache/brooklyn-client/scope/scope.go | 137 -----------
.../apache/brooklyn-client/terminal/table.go | 102 --------
75 files changed, 1 insertion(+), 5548 deletions(-)
----------------------------------------------------------------------
[2/4] brooklyn-client git commit: remove brooklyn-client Godep from
repo - @geomacy can you have a look at this,
leaving this in results in mvn building from the old Godep. I can build via
`mvn`, `godep install`
Posted by sv...@apache.org.
http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/bdb83934/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/activity-stream.go
----------------------------------------------------------------------
diff --git a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/activity-stream.go b/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/activity-stream.go
deleted file mode 100644
index 38cec20..0000000
--- a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/activity-stream.go
+++ /dev/null
@@ -1,149 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package commands
-
-import (
- "fmt"
- "github.com/apache/brooklyn-client/api/activities"
- "github.com/apache/brooklyn-client/command_metadata"
- "github.com/apache/brooklyn-client/error_handler"
- "github.com/apache/brooklyn-client/net"
- "github.com/apache/brooklyn-client/scope"
- "github.com/codegangsta/cli"
-)
-
-type ActivityStreamEnv struct {
- network *net.Network
-}
-
-type ActivityStreamStderr struct {
- network *net.Network
-}
-
-type ActivityStreamStdin struct {
- network *net.Network
-}
-
-type ActivityStreamStdout struct {
- network *net.Network
-}
-
-func NewActivityStreamEnv(network *net.Network) (cmd *ActivityStreamEnv) {
- cmd = new(ActivityStreamEnv)
- cmd.network = network
- return
-}
-
-func NewActivityStreamStderr(network *net.Network) (cmd *ActivityStreamStderr) {
- cmd = new(ActivityStreamStderr)
- cmd.network = network
- return
-}
-
-func NewActivityStreamStdin(network *net.Network) (cmd *ActivityStreamStdin) {
- cmd = new(ActivityStreamStdin)
- cmd.network = network
- return
-}
-
-func NewActivityStreamStdout(network *net.Network) (cmd *ActivityStreamStdout) {
- cmd = new(ActivityStreamStdout)
- cmd.network = network
- return
-}
-
-func (cmd *ActivityStreamEnv) Metadata() command_metadata.CommandMetadata {
- return command_metadata.CommandMetadata{
- Name: "env",
- Description: "Show the ENV stream for a given activity",
- Usage: "BROOKLYN_NAME ACTIVITY-SCOPE env",
- Flags: []cli.Flag{},
- }
-}
-
-func (cmd *ActivityStreamStderr) Metadata() command_metadata.CommandMetadata {
- return command_metadata.CommandMetadata{
- Name: "stderr",
- Description: "Show the STDERR stream for a given activity",
- Usage: "BROOKLYN_NAME ACTIVITY-SCOPE stderr",
- Flags: []cli.Flag{},
- }
-}
-
-func (cmd *ActivityStreamStdin) Metadata() command_metadata.CommandMetadata {
- return command_metadata.CommandMetadata{
- Name: "stdin",
- Description: "Show the STDIN stream for a given activity",
- Usage: "BROOKLYN_NAME ACTIVITY-SCOPE ] stdin",
- Flags: []cli.Flag{},
- }
-}
-
-func (cmd *ActivityStreamStdout) Metadata() command_metadata.CommandMetadata {
- return command_metadata.CommandMetadata{
- Name: "stdout",
- Description: "Show the STDOUT stream for a given activity",
- Usage: "BROOKLYN_NAME ACTIVITY-SCOPE stdout",
- Flags: []cli.Flag{},
- }
-}
-
-func (cmd *ActivityStreamEnv) Run(scope scope.Scope, c *cli.Context) {
- if err := net.VerifyLoginURL(cmd.network); err != nil {
- error_handler.ErrorExit(err)
- }
- activityStream, err := activities.ActivityStream(cmd.network, scope.Activity, "env")
- if nil != err {
- error_handler.ErrorExit(err)
- }
- fmt.Println(activityStream)
-}
-
-func (cmd *ActivityStreamStderr) Run(scope scope.Scope, c *cli.Context) {
- if err := net.VerifyLoginURL(cmd.network); err != nil {
- error_handler.ErrorExit(err)
- }
- activityStream, err := activities.ActivityStream(cmd.network, scope.Activity, "stderr")
- if nil != err {
- error_handler.ErrorExit(err)
- }
- fmt.Println(activityStream)
-}
-
-func (cmd *ActivityStreamStdin) Run(scope scope.Scope, c *cli.Context) {
- if err := net.VerifyLoginURL(cmd.network); err != nil {
- error_handler.ErrorExit(err)
- }
- activityStream, err := activities.ActivityStream(cmd.network, scope.Activity, "stdin")
- if nil != err {
- error_handler.ErrorExit(err)
- }
- fmt.Println(activityStream)
-}
-
-func (cmd *ActivityStreamStdout) Run(scope scope.Scope, c *cli.Context) {
- if err := net.VerifyLoginURL(cmd.network); err != nil {
- error_handler.ErrorExit(err)
- }
- activityStream, err := activities.ActivityStream(cmd.network, scope.Activity, "stdout")
- if nil != err {
- error_handler.ErrorExit(err)
- }
- fmt.Println(activityStream)
-}
http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/bdb83934/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/activity.go
----------------------------------------------------------------------
diff --git a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/activity.go b/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/activity.go
deleted file mode 100644
index cee097b..0000000
--- a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/activity.go
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package commands
-
-import (
- "fmt"
- "github.com/apache/brooklyn-client/api/activities"
- "github.com/apache/brooklyn-client/api/entities"
- "github.com/apache/brooklyn-client/command_metadata"
- "github.com/apache/brooklyn-client/error_handler"
- "github.com/apache/brooklyn-client/models"
- "github.com/apache/brooklyn-client/net"
- "github.com/apache/brooklyn-client/scope"
- "github.com/apache/brooklyn-client/terminal"
- "github.com/codegangsta/cli"
- "sort"
- "strconv"
- "strings"
- "time"
-)
-
-type Activity struct {
- network *net.Network
-}
-
-func NewActivity(network *net.Network) (cmd *Activity) {
- cmd = new(Activity)
- cmd.network = network
- return
-}
-
-func (cmd *Activity) Metadata() command_metadata.CommandMetadata {
- return command_metadata.CommandMetadata{
- Name: "activity",
- Aliases: []string{"activities", "act", "acts"},
- Description: "Show the activity for an application / entity",
- Usage: "BROOKLYN_NAME SCOPE activity [ ACTIVITYID]",
- Flags: []cli.Flag{
- cli.StringSliceFlag{
- Name: "children, c",
- Usage: "List children of the activity",
- },
- },
- }
-}
-
-func (cmd *Activity) Run(scope scope.Scope, c *cli.Context) {
- if err := net.VerifyLoginURL(cmd.network); err != nil {
- error_handler.ErrorExit(err)
- }
- if c.NumFlags() > 0 && c.FlagNames()[0] == "children" {
- cmd.listchildren(c.StringSlice("children")[0])
- } else {
- if c.Args().Present() {
- cmd.show(c.Args().First())
- } else {
- if scope.Activity == "" {
- cmd.list(scope.Application, scope.Entity)
- } else {
- cmd.listchildren(scope.Activity)
- }
- }
- }
-}
-
-func (cmd *Activity) show(activityId string) {
- activity, err := activities.Activity(cmd.network, activityId)
- if nil != err {
- error_handler.ErrorExit(err)
- }
-
- table := terminal.NewTable([]string{"Id:", activity.Id})
- table.Add("DisplayName:", activity.DisplayName)
- table.Add("Description:", activity.Description)
- table.Add("EntityId:", activity.EntityId)
- table.Add("EntityDisplayName:", activity.EntityDisplayName)
- table.Add("Submitted:", time.Unix(activity.SubmitTimeUtc/1000, 0).Format(time.UnixDate))
- table.Add("Started:", time.Unix(activity.StartTimeUtc/1000, 0).Format(time.UnixDate))
- table.Add("Ended:", time.Unix(activity.EndTimeUtc/1000, 0).Format(time.UnixDate))
- table.Add("CurrentStatus:", activity.CurrentStatus)
- table.Add("IsError:", strconv.FormatBool(activity.IsError))
- table.Add("IsCancelled:", strconv.FormatBool(activity.IsCancelled))
- table.Add("SubmittedByTask:", activity.SubmittedByTask.Metadata.Id)
- if activity.Streams["stdin"].Metadata.Size > 0 ||
- activity.Streams["stdout"].Metadata.Size > 0 ||
- activity.Streams["stderr"].Metadata.Size > 0 ||
- activity.Streams["env"].Metadata.Size > 0 {
- table.Add("Streams:", fmt.Sprintf("stdin: %d, stdout: %d, stderr: %d, env %d",
- activity.Streams["stdin"].Metadata.Size,
- activity.Streams["stdout"].Metadata.Size,
- activity.Streams["stderr"].Metadata.Size,
- activity.Streams["env"].Metadata.Size))
- } else {
- table.Add("Streams:", "")
- }
- table.Add("DetailedStatus:", fmt.Sprintf("\"%s\"", activity.DetailedStatus))
- table.Print()
-}
-
-func (cmd *Activity) list(application, entity string) {
- activityList, err := entities.GetActivities(cmd.network, application, entity)
- if nil != err {
- error_handler.ErrorExit(err)
- }
- table := terminal.NewTable([]string{"Id", "Task", "Submitted", "Status", "Streams"})
- for _, activity := range activityList {
- table.Add(activity.Id,
- truncate(activity.DisplayName),
- time.Unix(activity.SubmitTimeUtc/1000, 0).Format(time.UnixDate), truncate(activity.CurrentStatus),
- streams(activity))
- }
- table.Print()
-}
-
-func (cmd *Activity) listchildren(activity string) {
- activityList, err := activities.ActivityChildren(cmd.network, activity)
- if nil != err {
- error_handler.ErrorExit(err)
- }
- table := terminal.NewTable([]string{"Id", "Task", "Submitted", "Status", "Streams"})
- for _, activity := range activityList {
- table.Add(activity.Id,
- truncate(activity.DisplayName),
- time.Unix(activity.SubmitTimeUtc/1000, 0).Format(time.UnixDate), truncate(activity.CurrentStatus),
- streams(activity))
- }
- table.Print()
-}
-
-func streams(act models.TaskSummary) string {
- names := make([]string, 0)
- for name, _ := range act.Streams {
- names = append(names, name)
- }
- sort.Strings(names)
- return strings.Join(names, ",")
-}
-
-const truncLimit = 40
-
-func truncate(text string) string {
- if len(text) < truncLimit {
- return text
- }
- return text[0:(truncLimit-3)] + "..."
-}
http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/bdb83934/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/add-catalog.go
----------------------------------------------------------------------
diff --git a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/add-catalog.go b/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/add-catalog.go
deleted file mode 100644
index bf79f23..0000000
--- a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/add-catalog.go
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package commands
-
-import (
- "fmt"
- "github.com/apache/brooklyn-client/api/catalog"
- "github.com/apache/brooklyn-client/command_metadata"
- "github.com/apache/brooklyn-client/error_handler"
- "github.com/apache/brooklyn-client/net"
- "github.com/apache/brooklyn-client/scope"
- "github.com/codegangsta/cli"
-)
-
-type AddCatalog struct {
- network *net.Network
-}
-
-func NewAddCatalog(network *net.Network) (cmd *AddCatalog) {
- cmd = new(AddCatalog)
- cmd.network = network
- return
-}
-
-func (cmd *AddCatalog) Metadata() command_metadata.CommandMetadata {
- return command_metadata.CommandMetadata{
- Name: "add-catalog",
- Description: "* Add a new catalog item from the supplied YAML",
- Usage: "BROOKLYN_NAME add-catalog FILEPATH",
- Flags: []cli.Flag{},
- }
-}
-
-func (cmd *AddCatalog) Run(scope scope.Scope, c *cli.Context) {
- if err := net.VerifyLoginURL(cmd.network); err != nil {
- error_handler.ErrorExit(err)
- }
- create, err := catalog.AddCatalog(cmd.network, c.Args().First())
- if nil != err {
- error_handler.ErrorExit(err)
- }
- fmt.Println(create)
-}
http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/bdb83934/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/add-children.go
----------------------------------------------------------------------
diff --git a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/add-children.go b/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/add-children.go
deleted file mode 100644
index 6492044..0000000
--- a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/add-children.go
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package commands
-
-import (
- "github.com/apache/brooklyn-client/api/entities"
- "github.com/apache/brooklyn-client/command_metadata"
- "github.com/apache/brooklyn-client/error_handler"
- "github.com/apache/brooklyn-client/net"
- "github.com/apache/brooklyn-client/scope"
- "github.com/apache/brooklyn-client/terminal"
- "github.com/codegangsta/cli"
- "time"
-)
-
-type AddChildren struct {
- network *net.Network
-}
-
-func NewAddChildren(network *net.Network) (cmd *AddChildren) {
- cmd = new(AddChildren)
- cmd.network = network
- return
-}
-
-func (cmd *AddChildren) Metadata() command_metadata.CommandMetadata {
- return command_metadata.CommandMetadata{
- Name: "add-children",
- Description: "* Add a child or children to this entity from the supplied YAML",
- Usage: "BROOKLYN_NAME SCOPE add-children FILEPATH",
- Flags: []cli.Flag{},
- }
-}
-
-func (cmd *AddChildren) Run(scope scope.Scope, c *cli.Context) {
- if err := net.VerifyLoginURL(cmd.network); err != nil {
- error_handler.ErrorExit(err)
- }
- activity, err := entities.AddChildren(cmd.network, scope.Application, scope.Entity, c.Args().First())
- if nil != err {
- error_handler.ErrorExit(err)
- }
- table := terminal.NewTable([]string{"Id", "Task", "Submitted", "Status"})
- table.Add(activity.Id, activity.DisplayName, time.Unix(activity.SubmitTimeUtc/1000, 0).Format(time.UnixDate), activity.CurrentStatus)
-
- table.Print()
-}
http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/bdb83934/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/add-location.go
----------------------------------------------------------------------
diff --git a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/add-location.go b/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/add-location.go
deleted file mode 100644
index 32c2db0..0000000
--- a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/add-location.go
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package commands
-
-import (
- "github.com/apache/brooklyn-client/net"
-)
-
-type AddLocation struct {
- network *net.Network
-}
-
-func NewAddLocation(network *net.Network) (cmd *AddLocation) {
- cmd = new(AddLocation)
- cmd.network = network
- return
-}
http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/bdb83934/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/add-policy.go
----------------------------------------------------------------------
diff --git a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/add-policy.go b/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/add-policy.go
deleted file mode 100644
index a17e6c5..0000000
--- a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/add-policy.go
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package commands
-
-import (
- "github.com/codegangsta/cli"
- //"github.com/apache/brooklyn-client/api/entity_policies"
- "github.com/apache/brooklyn-client/command_metadata"
- "github.com/apache/brooklyn-client/net"
- "github.com/apache/brooklyn-client/scope"
-)
-
-type AddPolicy struct {
- network *net.Network
-}
-
-func NewAddPolicy(network *net.Network) (cmd *AddPolicy) {
- cmd = new(AddPolicy)
- cmd.network = network
- return
-}
-
-func (cmd *AddPolicy) Metadata() command_metadata.CommandMetadata {
- return command_metadata.CommandMetadata{
- Name: "add-policy",
- Description: "Add a new policy",
- Usage: "BROOKLYN_NAME [ SCOPE ] add-policy APPLICATION ENTITY POLICY_TYPE",
- Flags: []cli.Flag{},
- }
-}
-
-func (cmd *AddPolicy) Run(scope scope.Scope, c *cli.Context) {
- // Todo
-}
http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/bdb83934/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/application.go
----------------------------------------------------------------------
diff --git a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/application.go b/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/application.go
deleted file mode 100644
index 3538689..0000000
--- a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/application.go
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package commands
-
-import (
- "fmt"
- "github.com/apache/brooklyn-client/api/application"
- "github.com/apache/brooklyn-client/api/entities"
- "github.com/apache/brooklyn-client/api/entity_sensors"
- "github.com/apache/brooklyn-client/api/locations"
- "github.com/apache/brooklyn-client/command_metadata"
- "github.com/apache/brooklyn-client/error_handler"
- "github.com/apache/brooklyn-client/net"
- "github.com/apache/brooklyn-client/scope"
- "github.com/apache/brooklyn-client/terminal"
- "github.com/codegangsta/cli"
- "strings"
-)
-
-type Application struct {
- network *net.Network
-}
-
-func NewApplication(network *net.Network) (cmd *Application) {
- cmd = new(Application)
- cmd.network = network
- return
-}
-
-func (cmd *Application) Metadata() command_metadata.CommandMetadata {
- return command_metadata.CommandMetadata{
- Name: "application",
- Aliases: []string{"applications", "app", "apps"},
- Description: "Show the status and location of running applications",
- Usage: "BROOKLYN_NAME application [APP]",
- Flags: []cli.Flag{},
- }
-}
-
-func (cmd *Application) Run(scope scope.Scope, c *cli.Context) {
- if err := net.VerifyLoginURL(cmd.network); err != nil {
- error_handler.ErrorExit(err)
- }
- if c.Args().Present() {
- cmd.show(c.Args().First())
- } else {
- cmd.list()
- }
-}
-
-const serviceIsUpStr = "service.isUp"
-
-func (cmd *Application) show(appName string) {
- application, err := application.Application(cmd.network, appName)
- if nil != err {
- error_handler.ErrorExit(err)
- }
- entity, err := entities.GetEntity(cmd.network, appName, appName)
- if nil != err {
- error_handler.ErrorExit(err)
- }
- state, err := entity_sensors.CurrentState(cmd.network, appName, appName)
- if nil != err {
- error_handler.ErrorExit(err)
- }
- location, err := locations.GetLocation(cmd.network, application.Spec.Locations[0])
- if nil != err {
- error_handler.ErrorExit(err)
- }
- table := terminal.NewTable([]string{"Id:", application.Id})
- table.Add("Name:", application.Spec.Name)
- table.Add("Status:", string(application.Status))
- if serviceUp, ok := state[serviceIsUpStr]; ok {
- table.Add("ServiceUp:", fmt.Sprintf("%v", serviceUp))
- }
- table.Add("Type:", application.Spec.Type)
- table.Add("CatalogItemId:", entity.CatalogItemId)
- table.Add("LocationId:", strings.Join(application.Spec.Locations, ", "))
- table.Add("LocationName:", location.Name)
- table.Add("LocationSpec:", location.Spec)
- table.Add("LocationType:", location.Type)
- table.Print()
-}
-
-func (cmd *Application) list() {
- applications, err := application.Applications(cmd.network)
- if nil != err {
- error_handler.ErrorExit(err)
- }
- table := terminal.NewTable([]string{"Id", "Name", "Status", "Location"})
- for _, app := range applications {
- table.Add(app.Id, app.Spec.Name, string(app.Status), strings.Join(app.Spec.Locations, ", "))
- }
- table.Print()
-}
http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/bdb83934/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/catalog-applications.go
----------------------------------------------------------------------
diff --git a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/catalog-applications.go b/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/catalog-applications.go
deleted file mode 100644
index 19a4373..0000000
--- a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/catalog-applications.go
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package commands
-
-import (
- "github.com/apache/brooklyn-client/net"
-)
-
-type CatalogApplication struct {
- network *net.Network
-}
-
-func NewCatalogApplication(network *net.Network) (cmd *CatalogApplication) {
- cmd = new(CatalogApplication)
- cmd.network = network
- return
-}
http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/bdb83934/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/catalog-entities.go
----------------------------------------------------------------------
diff --git a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/catalog-entities.go b/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/catalog-entities.go
deleted file mode 100644
index dbec760..0000000
--- a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/catalog-entities.go
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package commands
-
-import (
- "github.com/apache/brooklyn-client/net"
-)
-
-type CatalogEntities struct {
- network *net.Network
-}
-
-func NewCatalogEntities(network *net.Network) (cmd *CatalogEntities) {
- cmd = new(CatalogEntities)
- cmd.network = network
- return
-}
http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/bdb83934/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/catalog-entity.go
----------------------------------------------------------------------
diff --git a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/catalog-entity.go b/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/catalog-entity.go
deleted file mode 100644
index 23cc295..0000000
--- a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/catalog-entity.go
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package commands
-
-import (
- "github.com/apache/brooklyn-client/net"
-)
-
-type CatalogEntity struct {
- network *net.Network
-}
-
-func NewCatalogEntity(network *net.Network) (cmd *CatalogEntity) {
- cmd = new(CatalogEntity)
- cmd.network = network
- return
-}
http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/bdb83934/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/catalog-location.go
----------------------------------------------------------------------
diff --git a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/catalog-location.go b/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/catalog-location.go
deleted file mode 100644
index 40babdd..0000000
--- a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/catalog-location.go
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package commands
-
-import (
- "github.com/apache/brooklyn-client/net"
-)
-
-type CatalogLocation struct {
- network *net.Network
-}
-
-func NewCatalogLocation(network *net.Network) (cmd *CatalogLocation) {
- cmd = new(CatalogLocation)
- cmd.network = network
- return
-}
http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/bdb83934/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/catalog-locations.go
----------------------------------------------------------------------
diff --git a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/catalog-locations.go b/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/catalog-locations.go
deleted file mode 100644
index e1791e8..0000000
--- a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/catalog-locations.go
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package commands
-
-import (
- "github.com/apache/brooklyn-client/net"
-)
-
-type CatalogLocations struct {
- network *net.Network
-}
-
-func NewCatalogLocations(network *net.Network) (cmd *CatalogLocations) {
- cmd = new(CatalogLocations)
- cmd.network = network
- return
-}
http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/bdb83934/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/catalog-policies.go
----------------------------------------------------------------------
diff --git a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/catalog-policies.go b/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/catalog-policies.go
deleted file mode 100644
index 3e245db..0000000
--- a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/catalog-policies.go
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package commands
-
-import (
- "github.com/apache/brooklyn-client/net"
-)
-
-type CatalogPolicies struct {
- network *net.Network
-}
-
-func NewCatalogPolicies(network *net.Network) (cmd *CatalogPolicies) {
- cmd = new(CatalogPolicies)
- cmd.network = network
- return
-}
http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/bdb83934/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/catalog-policy.go
----------------------------------------------------------------------
diff --git a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/catalog-policy.go b/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/catalog-policy.go
deleted file mode 100644
index 82e8a95..0000000
--- a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/catalog-policy.go
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package commands
-
-import (
- "github.com/apache/brooklyn-client/net"
-)
-
-type CatalogPolicy struct {
- network *net.Network
-}
-
-func NewCatalogPolicy(network *net.Network) (cmd *CatalogPolicy) {
- cmd = new(CatalogPolicy)
- cmd.network = network
- return
-}
http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/bdb83934/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/catalog.go
----------------------------------------------------------------------
diff --git a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/catalog.go b/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/catalog.go
deleted file mode 100644
index 2cb884d..0000000
--- a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/catalog.go
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package commands
-
-import (
- "github.com/apache/brooklyn-client/api/catalog"
- "github.com/apache/brooklyn-client/command_metadata"
- "github.com/apache/brooklyn-client/error_handler"
- "github.com/apache/brooklyn-client/net"
- "github.com/apache/brooklyn-client/scope"
- "github.com/apache/brooklyn-client/terminal"
- "github.com/codegangsta/cli"
-)
-
-type Catalog struct {
- network *net.Network
-}
-
-func NewCatalog(network *net.Network) (cmd *Catalog) {
- cmd = new(Catalog)
- cmd.network = network
- return
-}
-
-func (cmd *Catalog) Metadata() command_metadata.CommandMetadata {
- return command_metadata.CommandMetadata{
- Name: "catalog",
- Description: "* List the available catalog applications",
- Usage: "BROOKLYN_NAME catalog",
- Flags: []cli.Flag{},
- }
-}
-
-func (cmd *Catalog) Run(scope scope.Scope, c *cli.Context) {
- if err := net.VerifyLoginURL(cmd.network); err != nil {
- error_handler.ErrorExit(err)
- }
- catalog, err := catalog.Catalog(cmd.network)
- if nil != err {
- error_handler.ErrorExit(err)
- }
- table := terminal.NewTable([]string{"Id", "Name", "Description"})
- for _, app := range catalog {
- table.Add(app.Id, app.Name, app.Description)
- }
- table.Print()
-}
http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/bdb83934/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/config.go
----------------------------------------------------------------------
diff --git a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/config.go b/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/config.go
deleted file mode 100644
index 8af3046..0000000
--- a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/config.go
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package commands
-
-import (
- "fmt"
- "github.com/apache/brooklyn-client/api/entity_config"
- "github.com/apache/brooklyn-client/command_metadata"
- "github.com/apache/brooklyn-client/error_handler"
- "github.com/apache/brooklyn-client/net"
- "github.com/apache/brooklyn-client/scope"
- "github.com/apache/brooklyn-client/terminal"
- "github.com/codegangsta/cli"
-)
-
-type Config struct {
- network *net.Network
-}
-
-func NewConfig(network *net.Network) (cmd *Config) {
- cmd = new(Config)
- cmd.network = network
- return
-}
-
-func (cmd *Config) Metadata() command_metadata.CommandMetadata {
- return command_metadata.CommandMetadata{
- Name: "config",
- Description: "Show the config for an application or entity",
- Usage: "BROOKLYN_NAME SCOPE config",
- Flags: []cli.Flag{},
- }
-}
-
-func (cmd *Config) Run(scope scope.Scope, c *cli.Context) {
- if err := net.VerifyLoginURL(cmd.network); err != nil {
- error_handler.ErrorExit(err)
- }
- if c.Args().Present() {
- configValue, err := entity_config.ConfigValue(cmd.network, scope.Application, scope.Entity, c.Args().First())
-
- if nil != err {
- error_handler.ErrorExit(err)
- }
- displayValue, err := stringRepresentation(configValue)
- if nil != err {
- error_handler.ErrorExit(err)
- }
- fmt.Println(displayValue)
-
- } else {
- config, err := entity_config.ConfigCurrentState(cmd.network, scope.Application, scope.Entity)
- if nil != err {
- error_handler.ErrorExit(err)
- }
- table := terminal.NewTable([]string{"Key", "Value"})
- for key, value := range config {
- table.Add(key, fmt.Sprintf("%v", value))
- }
- table.Print()
- }
-}
http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/bdb83934/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/delete-catalog-application.go
----------------------------------------------------------------------
diff --git a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/delete-catalog-application.go b/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/delete-catalog-application.go
deleted file mode 100644
index f289bbd..0000000
--- a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/delete-catalog-application.go
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package commands
-
-import (
- "github.com/apache/brooklyn-client/net"
-)
-
-type DeleteCatalogApplication struct {
- network *net.Network
-}
-
-func NewDeleteCatalogApplication(network *net.Network) (cmd *DeleteCatalogApplication) {
- cmd = new(DeleteCatalogApplication)
- cmd.network = network
- return
-}
http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/bdb83934/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/delete-catalog-entity.go
----------------------------------------------------------------------
diff --git a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/delete-catalog-entity.go b/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/delete-catalog-entity.go
deleted file mode 100644
index 5953fff..0000000
--- a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/delete-catalog-entity.go
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package commands
-
-import (
- "github.com/apache/brooklyn-client/net"
-)
-
-type DeleteCatalogEntity struct {
- network *net.Network
-}
-
-func NewDeleteCatalogEntity(network *net.Network) (cmd *DeleteCatalogEntity) {
- cmd = new(DeleteCatalogEntity)
- cmd.network = network
- return
-}
http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/bdb83934/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/delete-catalog-policy.go
----------------------------------------------------------------------
diff --git a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/delete-catalog-policy.go b/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/delete-catalog-policy.go
deleted file mode 100644
index c6b29a6..0000000
--- a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/delete-catalog-policy.go
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package commands
-
-import (
- "github.com/apache/brooklyn-client/net"
-)
-
-type DeleteCatalogPolicy struct {
- network *net.Network
-}
-
-func NewDeleteCatalogPolicy(network *net.Network) (cmd *DeleteCatalogPolicy) {
- cmd = new(DeleteCatalogPolicy)
- cmd.network = network
- return
-}
http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/bdb83934/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/delete.go
----------------------------------------------------------------------
diff --git a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/delete.go b/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/delete.go
deleted file mode 100644
index e4bfdae..0000000
--- a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/delete.go
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package commands
-
-import (
- "fmt"
- "github.com/apache/brooklyn-client/api/application"
- "github.com/apache/brooklyn-client/command_metadata"
- "github.com/apache/brooklyn-client/error_handler"
- "github.com/apache/brooklyn-client/net"
- "github.com/apache/brooklyn-client/scope"
- "github.com/codegangsta/cli"
-)
-
-type Delete struct {
- network *net.Network
-}
-
-func NewDelete(network *net.Network) (cmd *Delete) {
- cmd = new(Delete)
- cmd.network = network
- return
-}
-
-func (cmd *Delete) Metadata() command_metadata.CommandMetadata {
- return command_metadata.CommandMetadata{
- Name: "delete",
- Description: "* Delete (expunge) a brooklyn application",
- Usage: "BROOKLYN_NAME SCOPE delete",
- Flags: []cli.Flag{},
- }
-}
-
-func (cmd *Delete) Run(scope scope.Scope, c *cli.Context) {
- if err := net.VerifyLoginURL(cmd.network); err != nil {
- error_handler.ErrorExit(err)
- }
- del, err := application.Delete(cmd.network, scope.Application)
- if nil != err {
- error_handler.ErrorExit(err)
- }
- fmt.Println(del)
-}
http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/bdb83934/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/deploy.go
----------------------------------------------------------------------
diff --git a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/deploy.go b/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/deploy.go
deleted file mode 100644
index 3b0607c..0000000
--- a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/deploy.go
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package commands
-
-import (
- "github.com/apache/brooklyn-client/api/application"
- "github.com/apache/brooklyn-client/command_metadata"
- "github.com/apache/brooklyn-client/error_handler"
- "github.com/apache/brooklyn-client/models"
- "github.com/apache/brooklyn-client/net"
- "github.com/apache/brooklyn-client/scope"
- "github.com/apache/brooklyn-client/terminal"
- "github.com/codegangsta/cli"
- "io/ioutil"
- "os"
- "strings"
-)
-
-type Deploy struct {
- network *net.Network
-}
-
-func NewDeploy(network *net.Network) (cmd *Deploy) {
- cmd = new(Deploy)
- cmd.network = network
- return
-}
-
-func (cmd *Deploy) Metadata() command_metadata.CommandMetadata {
- return command_metadata.CommandMetadata{
- Name: "deploy",
- Description: "Deploy a new application from the given YAML (read from file or stdin)",
- Usage: "BROOKLYN_NAME deploy ( <FILE> | - )",
- Flags: []cli.Flag{},
- }
-}
-
-func (cmd *Deploy) Run(scope scope.Scope, c *cli.Context) {
- if err := net.VerifyLoginURL(cmd.network); err != nil {
- error_handler.ErrorExit(err)
- }
-
- var create models.TaskSummary
- var err error
- var blueprint []byte
- if c.Args().First() == "" {
- error_handler.ErrorExit("A filename or '-' must be provided as the first argument", error_handler.CLIUsageErrorExitCode)
- }
- if c.Args().First() == "-" {
- blueprint, err = ioutil.ReadAll(os.Stdin)
- if err != nil {
- error_handler.ErrorExit(err)
- }
- create, err = application.CreateFromBytes(cmd.network, blueprint)
- } else {
- create, err = application.Create(cmd.network, c.Args().First())
- }
- if nil != err {
- if httpErr, ok := err.(net.HttpError); ok {
- error_handler.ErrorExit(strings.Join([]string{httpErr.Status, httpErr.Body}, "\n"), httpErr.Code)
- } else {
- error_handler.ErrorExit(err)
- }
- }
- table := terminal.NewTable([]string{"Id:", create.EntityId})
- table.Add("Name:", create.EntityDisplayName)
- table.Add("Status:", create.CurrentStatus)
- table.Print()
-}
http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/bdb83934/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/destroy-policy.go
----------------------------------------------------------------------
diff --git a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/destroy-policy.go b/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/destroy-policy.go
deleted file mode 100644
index c358d70..0000000
--- a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/destroy-policy.go
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package commands
-
-import (
- "fmt"
- "github.com/apache/brooklyn-client/api/entity_policies"
- "github.com/apache/brooklyn-client/command_metadata"
- "github.com/apache/brooklyn-client/error_handler"
- "github.com/apache/brooklyn-client/net"
- "github.com/apache/brooklyn-client/scope"
- "github.com/codegangsta/cli"
-)
-
-type DestroyPolicy struct {
- network *net.Network
-}
-
-func NewDestroyPolicy(network *net.Network) (cmd *DestroyPolicy) {
- cmd = new(DestroyPolicy)
- cmd.network = network
- return
-}
-
-func (cmd *DestroyPolicy) Metadata() command_metadata.CommandMetadata {
- return command_metadata.CommandMetadata{
- Name: "destroy-policy",
- Description: "Destroy a policy",
- Usage: "BROOKLYN_NAME SCOPE destroy-policy POLICY",
- Flags: []cli.Flag{},
- }
-}
-
-func (cmd *DestroyPolicy) Run(scope scope.Scope, c *cli.Context) {
- if err := net.VerifyLoginURL(cmd.network); err != nil {
- error_handler.ErrorExit(err)
- }
- spec, err := entity_policies.DestroyPolicy(cmd.network, scope.Application, scope.Entity, c.Args().First())
- if nil != err {
- error_handler.ErrorExit(err)
- }
- fmt.Println(spec)
-}
http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/bdb83934/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/effector.go
----------------------------------------------------------------------
diff --git a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/effector.go b/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/effector.go
deleted file mode 100644
index 7105cf9..0000000
--- a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/effector.go
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package commands
-
-import (
- "github.com/apache/brooklyn-client/api/entity_effectors"
- "github.com/apache/brooklyn-client/command_metadata"
- "github.com/apache/brooklyn-client/error_handler"
- "github.com/apache/brooklyn-client/net"
- "github.com/apache/brooklyn-client/scope"
- "github.com/apache/brooklyn-client/terminal"
- "github.com/codegangsta/cli"
- "strings"
-)
-
-type Effector struct {
- network *net.Network
-}
-
-func NewEffector(network *net.Network) (cmd *Effector) {
- cmd = new(Effector)
- cmd.network = network
- return
-}
-
-func (cmd *Effector) Metadata() command_metadata.CommandMetadata {
- return command_metadata.CommandMetadata{
- Name: "effector",
- Description: "Show the effectors for an application or entity",
- Usage: "BROOKLYN_NAME SCOPE effector [ NAME ]",
- Flags: []cli.Flag{},
- }
-}
-
-func (cmd *Effector) Run(scope scope.Scope, c *cli.Context) {
- if err := net.VerifyLoginURL(cmd.network); err != nil {
- error_handler.ErrorExit(err)
- }
- effectors, err := entity_effectors.EffectorList(cmd.network, scope.Application, scope.Entity)
- if nil != err {
- error_handler.ErrorExit(err)
- }
- table := terminal.NewTable([]string{"Name", "Description", "Parameters"})
- for _, effector := range effectors {
- var parameters []string
- for _, parameter := range effector.Parameters {
- parameters = append(parameters, parameter.Name)
- }
- if !c.Args().Present() || c.Args().First() == effector.Name {
- table.Add(effector.Name, effector.Description, strings.Join(parameters, ","))
- }
- }
- table.Print()
-}
http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/bdb83934/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/entity.go
----------------------------------------------------------------------
diff --git a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/entity.go b/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/entity.go
deleted file mode 100644
index b6688a3..0000000
--- a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/entity.go
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package commands
-
-import (
- "fmt"
- "github.com/apache/brooklyn-client/api/entities"
- "github.com/apache/brooklyn-client/api/entity_sensors"
- "github.com/apache/brooklyn-client/command_metadata"
- "github.com/apache/brooklyn-client/error_handler"
- "github.com/apache/brooklyn-client/net"
- "github.com/apache/brooklyn-client/scope"
- "github.com/apache/brooklyn-client/terminal"
- "github.com/codegangsta/cli"
- "os"
-)
-
-type Entity struct {
- network *net.Network
-}
-
-func NewEntity(network *net.Network) (cmd *Entity) {
- cmd = new(Entity)
- cmd.network = network
- return
-}
-
-func (cmd *Entity) Metadata() command_metadata.CommandMetadata {
- return command_metadata.CommandMetadata{
- Name: "entity",
- Aliases: []string{"entities", "ent", "ents"},
- Description: "Show the entities of an application or entity",
- Usage: "BROOKLYN_NAME SCOPE entity [ENTITYID]",
- Flags: []cli.Flag{
- cli.StringSliceFlag{
- Name: "children, c",
- Usage: "List children of the entity",
- },
- },
- }
-}
-
-func (cmd *Entity) Run(scope scope.Scope, c *cli.Context) {
- if err := net.VerifyLoginURL(cmd.network); err != nil {
- error_handler.ErrorExit(err)
- }
- if c.NumFlags() > 0 && c.FlagNames()[0] == "children" {
- cmd.listentity(scope.Application, c.StringSlice("children")[0])
- } else {
- if c.Args().Present() {
- cmd.show(scope.Application, c.Args().First())
- } else {
- if scope.Entity == scope.Application {
- cmd.listapp(scope.Application)
- } else {
- cmd.listentity(scope.Application, scope.Entity)
- }
- }
- }
-}
-
-const serviceStateSensor = "service.state"
-const serviceIsUp = "service.isUp"
-
-func (cmd *Entity) show(application, entity string) {
- summary, err := entities.GetEntity(cmd.network, application, entity)
- if nil != err {
- fmt.Fprintf(os.Stderr, "Error: %s\n", err)
- os.Exit(1)
- }
- table := terminal.NewTable([]string{"Id:", summary.Id})
- table.Add("Name:", summary.Name)
- configState, err := entity_sensors.CurrentState(cmd.network, application, entity)
- if nil != err {
- error_handler.ErrorExit(err)
- }
- if serviceState, ok := configState[serviceStateSensor]; ok {
- table.Add("Status:", fmt.Sprintf("%v", serviceState))
- }
- if serviceIsUp, ok := configState[serviceIsUp]; ok {
- table.Add("ServiceUp:", fmt.Sprintf("%v", serviceIsUp))
- }
- table.Add("Type:", summary.Type)
- table.Add("CatalogItemId:", summary.CatalogItemId)
- table.Print()
-}
-
-func (cmd *Entity) listapp(application string) {
- entitiesList, err := entities.EntityList(cmd.network, application)
- if nil != err {
- error_handler.ErrorExit(err)
- }
- table := terminal.NewTable([]string{"Id", "Name", "Type"})
- for _, entityitem := range entitiesList {
- table.Add(entityitem.Id, entityitem.Name, entityitem.Type)
- }
- table.Print()
-}
-
-func (cmd *Entity) listentity(application string, entity string) {
- entitiesList, err := entities.Children(cmd.network, application, entity)
- if nil != err {
- error_handler.ErrorExit(err)
- }
-
- table := terminal.NewTable([]string{"Id", "Name", "Type"})
- for _, entityitem := range entitiesList {
- table.Add(entityitem.Id, entityitem.Name, entityitem.Type)
- }
- table.Print()
-}
http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/bdb83934/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/invoke.go
----------------------------------------------------------------------
diff --git a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/invoke.go b/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/invoke.go
deleted file mode 100644
index 1ca6dd8..0000000
--- a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/invoke.go
+++ /dev/null
@@ -1,202 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package commands
-
-import (
- "errors"
- "fmt"
- "github.com/apache/brooklyn-client/api/entity_effectors"
- "github.com/apache/brooklyn-client/command_metadata"
- "github.com/apache/brooklyn-client/error_handler"
- "github.com/apache/brooklyn-client/net"
- "github.com/apache/brooklyn-client/scope"
- "github.com/codegangsta/cli"
- "io/ioutil"
- "strings"
-)
-
-type Invoke struct {
- network *net.Network
-}
-
-type Stop struct {
- Invoke
-}
-
-type Start struct {
- Invoke
-}
-
-type Restart struct {
- Invoke
-}
-
-func NewInvoke(network *net.Network) (cmd *Invoke) {
- cmd = new(Invoke)
- cmd.network = network
- return
-}
-
-func NewInvokeStop(network *net.Network) (cmd *Stop) {
- cmd = new(Stop)
- cmd.network = network
- return
-}
-
-func NewInvokeStart(network *net.Network) (cmd *Start) {
- cmd = new(Start)
- cmd.network = network
- return
-}
-
-func NewInvokeRestart(network *net.Network) (cmd *Restart) {
- cmd = new(Restart)
- cmd.network = network
- return
-}
-
-var paramFlags = []cli.Flag{
- cli.StringSliceFlag{
- Name: "param, P",
- Usage: "Parameter and value separated by '=', e.g. -P x=y",
- },
-}
-
-func (cmd *Invoke) Metadata() command_metadata.CommandMetadata {
- return command_metadata.CommandMetadata{
- Name: "invoke",
- Description: "Invoke an effector of an application and entity",
- Usage: "BROOKLYN_NAME EFF-SCOPE invoke [ parameter-options ]",
- Flags: paramFlags,
- }
-}
-
-func (cmd *Stop) Metadata() command_metadata.CommandMetadata {
- return command_metadata.CommandMetadata{
- Name: "stop",
- Description: "Invoke stop effector on an application and entity",
- Usage: "BROOKLYN_NAME ENT-SCOPE stop [ parameter-options ]",
- Flags: paramFlags,
- }
-}
-
-func (cmd *Start) Metadata() command_metadata.CommandMetadata {
- return command_metadata.CommandMetadata{
- Name: "start",
- Description: "Invoke start effector on an application and entity",
- Usage: "BROOKLYN_NAME ENT-SCOPE start [ parameter-options ]",
- Flags: paramFlags,
- }
-}
-
-func (cmd *Restart) Metadata() command_metadata.CommandMetadata {
- return command_metadata.CommandMetadata{
- Name: "restart",
- Description: "Invoke restart effector on an application and entity",
- Usage: "BROOKLYN_NAME ENT-SCOPE restart [ parameter-options ]",
- Flags: paramFlags,
- }
-}
-
-func (cmd *Invoke) Run(scope scope.Scope, c *cli.Context) {
- if err := net.VerifyLoginURL(cmd.network); err != nil {
- error_handler.ErrorExit(err)
- }
- parms := c.StringSlice("param")
- invoke(cmd.network, scope.Application, scope.Entity, scope.Effector, parms)
-}
-
-const stopEffector = "stop"
-
-func (cmd *Stop) Run(scope scope.Scope, c *cli.Context) {
- if err := net.VerifyLoginURL(cmd.network); err != nil {
- error_handler.ErrorExit(err)
- }
- parms := c.StringSlice("param")
- invoke(cmd.network, scope.Application, scope.Entity, stopEffector, parms)
-}
-
-const startEffector = "start"
-
-func (cmd *Start) Run(scope scope.Scope, c *cli.Context) {
- if err := net.VerifyLoginURL(cmd.network); err != nil {
- error_handler.ErrorExit(err)
- }
- parms := c.StringSlice("param")
- invoke(cmd.network, scope.Application, scope.Entity, startEffector, parms)
-}
-
-const restartEffector = "restart"
-
-func (cmd *Restart) Run(scope scope.Scope, c *cli.Context) {
- if err := net.VerifyLoginURL(cmd.network); err != nil {
- error_handler.ErrorExit(err)
- }
- parms := c.StringSlice("param")
- invoke(cmd.network, scope.Application, scope.Entity, restartEffector, parms)
-}
-
-func invoke(network *net.Network, application, entity, effector string, parms []string) {
- names, vals, err := extractParams(parms)
- result, err := entity_effectors.TriggerEffector(network, application, entity, effector, names, vals)
- if nil != err {
- error_handler.ErrorExit(err)
- } else {
- if "" != result {
- fmt.Println(result)
- }
- }
-}
-
-func extractParams(parms []string) ([]string, []string, error) {
- names := make([]string, len(parms))
- vals := make([]string, len(parms))
- var err error
- for i, parm := range parms {
- index := strings.Index(parm, "=")
- if index < 0 {
- return names, vals, errors.New("Parameter value not provided: " + parm)
- }
- names[i] = parm[0:index]
- vals[i], err = extractParamValue(parm[index+1:])
- }
- return names, vals, err
-}
-
-const paramDataPrefix string = "@"
-
-func extractParamValue(rawParam string) (string, error) {
- var err error
- var val string
- if strings.HasPrefix(rawParam, paramDataPrefix) {
- // strip the data prefix from the filename before reading
- val, err = readParamFromFile(rawParam[len(paramDataPrefix):])
- } else {
- val = rawParam
- err = nil
- }
- return val, err
-}
-
-// returning a string rather than byte array, assuming non-binary
-// TODO - if necessary support binary data sending to effector
-func readParamFromFile(filename string) (string, error) {
- dat, err := ioutil.ReadFile(filename)
- return string(dat), err
-}
http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/bdb83934/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/list.go
----------------------------------------------------------------------
diff --git a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/list.go b/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/list.go
deleted file mode 100644
index d675f77..0000000
--- a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/list.go
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package commands
-
-import (
- "fmt"
- "github.com/apache/brooklyn-client/command"
- "github.com/apache/brooklyn-client/command_metadata"
- "github.com/apache/brooklyn-client/error_handler"
- "github.com/apache/brooklyn-client/net"
- "github.com/apache/brooklyn-client/scope"
- "github.com/codegangsta/cli"
- "strings"
-)
-
-type List struct {
- network *net.Network
- listCommands map[string]command.Command
-}
-
-func NewList(network *net.Network) (cmd *List) {
- cmd = new(List)
- cmd.network = network
- cmd.listCommands = map[string]command.Command{
- // ListApplicationCommand: NewApplications(cmd.network),
- // ListEntityCommand: NewEntities(cmd.network),
- // ListSensorCommand: NewSensors(cmd.network),
- // ListEffectorCommand: NewEffector(cmd.network),
- }
- return
-}
-
-const ListApplicationCommand = "application"
-const ListEntityCommand = "entities"
-const ListSensorCommand = "sensors"
-const ListEffectorCommand = "effectors"
-
-var listCommands = []string{
- ListApplicationCommand,
- ListEntityCommand,
- ListSensorCommand,
- ListEffectorCommand,
-}
-var listCommandsUsage = strings.Join(listCommands, " | ")
-
-func (cmd *List) SubCommandNames() []string {
- return listCommands
-}
-
-func (cmd *List) SubCommand(name string) command.Command {
- return cmd.listCommands[name]
-}
-
-func (cmd *List) Metadata() command_metadata.CommandMetadata {
- return command_metadata.CommandMetadata{
- Name: "list",
- Description: "List details for a variety of operands",
- Usage: "BROOKLYN_NAME SCOPE list (" + listCommandsUsage + ")",
- Flags: []cli.Flag{},
- Operands: []command_metadata.CommandMetadata{
- cmd.SubCommand(ListApplicationCommand).Metadata(),
- cmd.SubCommand(ListEntityCommand).Metadata(),
- cmd.SubCommand(ListSensorCommand).Metadata(),
- cmd.SubCommand(ListEffectorCommand).Metadata(),
- },
- }
-}
-
-func (cmd *List) Run(scope scope.Scope, c *cli.Context) {
- if err := net.VerifyLoginURL(cmd.network); err != nil {
- error_handler.ErrorExit(err)
- }
- fmt.Printf("Unrecognised item for list, please use one of (%s)\n", listCommandsUsage)
-}
http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/bdb83934/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/locations.go
----------------------------------------------------------------------
diff --git a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/locations.go b/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/locations.go
deleted file mode 100644
index 79646d5..0000000
--- a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/locations.go
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package commands
-
-import (
- "github.com/apache/brooklyn-client/api/locations"
- "github.com/apache/brooklyn-client/command_metadata"
- "github.com/apache/brooklyn-client/error_handler"
- "github.com/apache/brooklyn-client/net"
- "github.com/apache/brooklyn-client/scope"
- "github.com/apache/brooklyn-client/terminal"
- "github.com/codegangsta/cli"
-)
-
-type Locations struct {
- network *net.Network
-}
-
-func NewLocations(network *net.Network) (cmd *Locations) {
- cmd = new(Locations)
- cmd.network = network
- return
-}
-
-func (cmd *Locations) Metadata() command_metadata.CommandMetadata {
- return command_metadata.CommandMetadata{
- Name: "locations",
- Description: "* List the available locations",
- Usage: "BROOKLYN_NAME locations",
- Flags: []cli.Flag{},
- }
-}
-
-func (cmd *Locations) Run(scope scope.Scope, c *cli.Context) {
- if err := net.VerifyLoginURL(cmd.network); err != nil {
- error_handler.ErrorExit(err)
- }
- locationList, err := locations.LocationList(cmd.network)
- if nil != err {
- error_handler.ErrorExit(err)
- }
- table := terminal.NewTable([]string{"Id", "Name", "Spec"})
- for _, location := range locationList {
- table.Add(location.Id, location.Name, location.Spec)
- }
- table.Print()
-}
http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/bdb83934/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/login.go
----------------------------------------------------------------------
diff --git a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/login.go b/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/login.go
deleted file mode 100644
index fd47196..0000000
--- a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/login.go
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package commands
-
-import (
- "fmt"
- "github.com/apache/brooklyn-client/api/version"
- "github.com/apache/brooklyn-client/command_metadata"
- "github.com/apache/brooklyn-client/error_handler"
- "github.com/apache/brooklyn-client/io"
- "github.com/apache/brooklyn-client/net"
- "github.com/apache/brooklyn-client/scope"
- "github.com/codegangsta/cli"
- "golang.org/x/crypto/ssh/terminal"
- "syscall"
-)
-
-type Login struct {
- network *net.Network
- config *io.Config
-}
-
-func NewLogin(network *net.Network, config *io.Config) (cmd *Login) {
- cmd = new(Login)
- cmd.network = network
- cmd.config = config
- return
-}
-
-func (cmd *Login) Metadata() command_metadata.CommandMetadata {
- return command_metadata.CommandMetadata{
- Name: "login",
- Description: "Login to brooklyn",
- Usage: "BROOKLYN_NAME login URL [USER [PASSWORD]]",
- Flags: []cli.Flag{},
- }
-}
-
-func (cmd *Login) Run(scope scope.Scope, c *cli.Context) {
- if !c.Args().Present() {
- error_handler.ErrorExit("A URL must be provided as the first argument", error_handler.CLIUsageErrorExitCode)
- }
-
- // If an argument was not supplied, it is set to empty string
- cmd.network.BrooklynUrl = c.Args().Get(0)
- cmd.network.BrooklynUser = c.Args().Get(1)
- cmd.network.BrooklynPass = c.Args().Get(2)
-
- if err := net.VerifyLoginURL(cmd.network); err != nil {
- error_handler.ErrorExit(err)
- }
-
- // Strip off trailing '/' from URL if present.
- if cmd.network.BrooklynUrl[len(cmd.network.BrooklynUrl)-1] == '/' {
- if len(cmd.network.BrooklynUrl) == 1 {
- error_handler.ErrorExit("URL must not be a single \"/\" character", error_handler.CLIUsageErrorExitCode)
- }
- cmd.network.BrooklynUrl = cmd.network.BrooklynUrl[0 : len(cmd.network.BrooklynUrl)-1]
- }
-
- // Prompt for password if not supplied (password is not echoed to screen
- if cmd.network.BrooklynUser != "" && cmd.network.BrooklynPass == "" {
- fmt.Print("Enter Password: ")
- bytePassword, err := terminal.ReadPassword(int(syscall.Stdin))
- if err != nil {
- error_handler.ErrorExit(err)
- }
- fmt.Printf("\n")
- cmd.network.BrooklynPass = string(bytePassword)
- }
-
- if cmd.config.Map == nil {
- cmd.config.Map = make(map[string]interface{})
- }
- // now persist these credentials to the yaml file
- auth, ok := cmd.config.Map["auth"].(map[string]interface{})
- if !ok {
- auth = make(map[string]interface{})
- cmd.config.Map["auth"] = auth
- }
-
- auth[cmd.network.BrooklynUrl] = map[string]string{
- "username": cmd.network.BrooklynUser,
- "password": cmd.network.BrooklynPass,
- }
-
- cmd.config.Map["target"] = cmd.network.BrooklynUrl
- cmd.config.Write()
-
- loginVersion, err := version.Version(cmd.network)
- if nil != err {
- error_handler.ErrorExit(err)
- }
- fmt.Printf("Connected to Brooklyn version %s at %s\n", loginVersion.Version, cmd.network.BrooklynUrl)
-}
http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/bdb83934/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/policy.go
----------------------------------------------------------------------
diff --git a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/policy.go b/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/policy.go
deleted file mode 100644
index b548ab8..0000000
--- a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/policy.go
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package commands
-
-import (
- "github.com/apache/brooklyn-client/api/entity_policies"
- "github.com/apache/brooklyn-client/api/entity_policy_config"
- "github.com/apache/brooklyn-client/command_metadata"
- "github.com/apache/brooklyn-client/error_handler"
- "github.com/apache/brooklyn-client/models"
- "github.com/apache/brooklyn-client/net"
- "github.com/apache/brooklyn-client/scope"
- "github.com/apache/brooklyn-client/terminal"
- "github.com/codegangsta/cli"
- "sort"
-)
-
-type Policy struct {
- network *net.Network
-}
-
-type policyConfigList []models.PolicyConfigList
-
-// Len is the number of elements in the collection.
-func (configs policyConfigList) Len() int {
- return len(configs)
-}
-
-// Less reports whether the element with
-// index i should sort before the element with index j.
-func (configs policyConfigList) Less(i, j int) bool {
- return configs[i].Name < configs[j].Name
-}
-
-// Swap swaps the elements with indexes i and j.
-func (configs policyConfigList) Swap(i, j int) {
- temp := configs[i]
- configs[i] = configs[j]
- configs[j] = temp
-}
-
-func NewPolicy(network *net.Network) (cmd *Policy) {
- cmd = new(Policy)
- cmd.network = network
- return
-}
-
-func (cmd *Policy) Metadata() command_metadata.CommandMetadata {
- return command_metadata.CommandMetadata{
- Name: "policy",
- Aliases: []string{"policies", "pol", "pols"},
- Description: "Show the policies for an application or entity",
- Usage: "BROOKLYN_NAME SCOPE policy [NAME]",
- Flags: []cli.Flag{},
- }
-}
-
-func (cmd *Policy) Run(scope scope.Scope, c *cli.Context) {
- if err := net.VerifyLoginURL(cmd.network); err != nil {
- error_handler.ErrorExit(err)
- }
- if c.Args().Present() {
- cmd.show(scope.Application, scope.Entity, c.Args().First())
- } else {
- cmd.list(scope.Application, scope.Entity)
- }
-}
-
-func (cmd *Policy) show(application, entity, policy string) {
- configs, err := entity_policy_config.GetAllConfigValues(cmd.network, application, entity, policy)
- if nil != err {
- error_handler.ErrorExit(err)
- }
- table := terminal.NewTable([]string{"Name", "Value", "Description"})
- var theConfigs policyConfigList = configs
- sort.Sort(theConfigs)
-
- for _, config := range theConfigs {
- value, err := entity_policy_config.GetConfigValue(cmd.network, application, entity, policy, config.Name)
- if nil != err {
- error_handler.ErrorExit(err)
- }
- table.Add(config.Name, value, config.Description)
- }
- table.Print()
-}
-
-func (cmd *Policy) list(application, entity string) {
- policies, err := entity_policies.PolicyList(cmd.network, application, entity)
- if nil != err {
- error_handler.ErrorExit(err)
- }
- table := terminal.NewTable([]string{"Id", "Name", "State"})
- for _, policy := range policies {
- table.Add(policy.Id, policy.Name, string(policy.State))
- }
- table.Print()
-}
http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/bdb83934/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/rename.go
----------------------------------------------------------------------
diff --git a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/rename.go b/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/rename.go
deleted file mode 100644
index 70df396..0000000
--- a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/rename.go
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package commands
-
-import (
- "fmt"
- "github.com/apache/brooklyn-client/api/entities"
- "github.com/apache/brooklyn-client/command_metadata"
- "github.com/apache/brooklyn-client/error_handler"
- "github.com/apache/brooklyn-client/net"
- "github.com/apache/brooklyn-client/scope"
- "github.com/codegangsta/cli"
-)
-
-type Rename struct {
- network *net.Network
-}
-
-func NewRename(network *net.Network) (cmd *Rename) {
- cmd = new(Rename)
- cmd.network = network
- return
-}
-
-func (cmd *Rename) Metadata() command_metadata.CommandMetadata {
- return command_metadata.CommandMetadata{
- Name: "rename",
- Description: "Rename an application or entity",
- Usage: "BROOKLYN_NAME SCOPE rename NEW_NAME",
- Flags: []cli.Flag{},
- }
-}
-
-func (cmd *Rename) Run(scope scope.Scope, c *cli.Context) {
- if err := net.VerifyLoginURL(cmd.network); err != nil {
- error_handler.ErrorExit(err)
- }
- rename, err := entities.Rename(cmd.network, scope.Application, scope.Entity, c.Args().First())
- if nil != err {
- error_handler.ErrorExit(err)
- }
- fmt.Println(rename)
-}
http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/bdb83934/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/reset-catalog.go
----------------------------------------------------------------------
diff --git a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/reset-catalog.go b/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/reset-catalog.go
deleted file mode 100644
index 6830399..0000000
--- a/br/Godeps/_workspace/src/github.com/apache/brooklyn-client/commands/reset-catalog.go
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package commands
-
-import (
- "github.com/apache/brooklyn-client/net"
-)
-
-type ResetCatalog struct {
- network *net.Network
-}
-
-func NewResetCatalog(network *net.Network) (cmd *ResetCatalog) {
- cmd = new(ResetCatalog)
- cmd.network = network
- return
-}