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:05 UTC
[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`
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)
-}