Documentation ¶
Overview ¶
******************************************************************************
- Copyright 2017 Samsung Electronics All Rights Reserved. *
- 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. * ******************************************************************************
Index ¶
- Constants
- type Command
- type Executor
- func (Executor) AddAppToNode(nodeId string, appId string) error
- func (Executor) AddNode(id, ip, status string, config map[string]interface{}, apps []string) (map[string]interface{}, error)
- func (Executor) DeleteAppFromNode(nodeId string, appId string) error
- func (Executor) DeleteNode(nodeId string) error
- func (Executor) GetNode(nodeId string) (map[string]interface{}, error)
- func (Executor) GetNodeByAppID(nodeId string, appId string) (map[string]interface{}, error)
- func (Executor) GetNodeByIP(ip string) (map[string]interface{}, error)
- func (Executor) GetNodes(queryOptional ...map[string]interface{}) ([]map[string]interface{}, error)
- func (Executor) UpdateNodeAddress(nodeId string, host string, port string) error
- func (Executor) UpdateNodeConfiguration(nodeId string, config map[string]interface{}) error
- func (Executor) UpdateNodeStatus(nodeId string, status string) error
- type Node
Constants ¶
const ( DB_NAME = "DeploymentManagerDB" NODE_COLLECTION = "NODE" DB_URL = "127.0.0.1:27017" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Command ¶
type Command interface { // AddNode insert new Node. AddNode(id, ip, status string, config map[string]interface{}, apps []string) (map[string]interface{}, error) // UpdateNodeAddress updates ip,port of node from db related to node. UpdateNodeAddress(nodeId string, host string, port string) error // UpdateNodeStatus updates status of node from db related to node. UpdateNodeStatus(nodeId string, status string) error // UpdateNodeConfiguration updates configuration information of node from db related to node. UpdateNodeConfiguration(nodeId string, config map[string]interface{}) error // GetNode returns single document from db related to node. GetNode(nodeId string) (map[string]interface{}, error) // GetNodes returns all matches for the query-string which is passed in call to function. GetNodes(queryOptional ...map[string]interface{}) ([]map[string]interface{}, error) // GetNodeByAppID returns single document including specific app. GetNodeByAppID(nodeId string, appId string) (map[string]interface{}, error) // GetNodeByIP returns single document from db related to node. GetNodeByIP(ip string) (map[string]interface{}, error) // AddAppToNode add specific app to the target node. AddAppToNode(nodeId string, appId string) error // DeleteAppFromNode delete specific app from the target node. DeleteAppFromNode(nodeId string, appId string) error // DeleteNode delete single document from db related to node. DeleteNode(nodeId string) error }
type Executor ¶
type Executor struct{}
func (Executor) AddAppToNode ¶
AddAppToNode adds the specific app to the target node. If successful, this function returns an error as nil. otherwise, an appropriate error will be returned.
func (Executor) AddNode ¶
func (Executor) AddNode(id, ip, status string, config map[string]interface{}, apps []string) (map[string]interface{}, error)
AddNode inserts new node to 'node' collection. If successful, this function returns an error as nil. otherwise, an appropriate error will be returned.
func (Executor) DeleteAppFromNode ¶
DeleteAppFromNode deletes the specific app from the target node. If successful, this function returns an error as nil. otherwise, an appropriate error will be returned.
func (Executor) DeleteNode ¶
DeleteNode deletes single document from 'node' collection. If successful, this function returns an error as nil. otherwise, an appropriate error will be returned.
func (Executor) GetNode ¶
GetNode returns single document specified by nodeId parameter. If successful, this function returns an error as nil. otherwise, an appropriate error will be returned.
func (Executor) GetNodeByAppID ¶
GetNodeByAppID returns single document specified by nodeId parameter. If successful, this function returns an error as nil. But if the target node does not include the given appId, an appropriate error will be returned.
func (Executor) GetNodeByIP ¶
GetNodeByIP returns single document specified by ip parameter. If successful, this function returns an error as nil. But if the target node does not include the given appId, an appropriate error will be returned.
func (Executor) GetNodes ¶
GetNodes returns all documents from 'node' collection. If successful, this function returns an error as nil. otherwise, an appropriate error will be returned.
func (Executor) UpdateNodeAddress ¶
UpdateNodeAddress updates ip,port of node specified by nodeId parameter. If successful, this function returns an error as nil. otherwise, an appropriate error will be returned.