Skip to content

Commit

Permalink
Allowing for LB Nodes to be updated
Browse files Browse the repository at this point in the history
  • Loading branch information
jamiehannaford committed Dec 13, 2013
1 parent da4fcaa commit d81c8cf
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions lib/OpenCloud/LoadBalancer/Resource/Node.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,6 @@ public function name()
return get_class() . '[' . $this->Id() . ']';
}

/**
* returns the object for the Create JSON
*
* @return \stdClass
*/
protected function createJson()
{
$nodes = (object) array('node' => new \stdClass);
Expand All @@ -137,6 +132,21 @@ protected function createJson()
return (object) array('nodes' => array($nodes));
}

protected function updateJson($params = array())
{
if ($this->condition) {
$params['condition'] = $this->condition;
}
if ($this->type) {
$params['type'] = $this->type;
}
if ($this->weight) {
$params['weight'] = $this->weight;
}

return (object) array('node' => (object) $params);
}

/**
* factory method to create a new Metadata child of the Node
*
Expand Down

0 comments on commit d81c8cf

Please sign in to comment.