Skip to content

Commit d81c8cf

Browse files
Allowing for LB Nodes to be updated
1 parent da4fcaa commit d81c8cf

File tree

1 file changed

+15
-5
lines changed
  • lib/OpenCloud/LoadBalancer/Resource

1 file changed

+15
-5
lines changed

lib/OpenCloud/LoadBalancer/Resource/Node.php

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -122,11 +122,6 @@ public function name()
122122
return get_class() . '[' . $this->Id() . ']';
123123
}
124124

125-
/**
126-
* returns the object for the Create JSON
127-
*
128-
* @return \stdClass
129-
*/
130125
protected function createJson()
131126
{
132127
$nodes = (object) array('node' => new \stdClass);
@@ -137,6 +132,21 @@ protected function createJson()
137132
return (object) array('nodes' => array($nodes));
138133
}
139134

135+
protected function updateJson($params = array())
136+
{
137+
if ($this->condition) {
138+
$params['condition'] = $this->condition;
139+
}
140+
if ($this->type) {
141+
$params['type'] = $this->type;
142+
}
143+
if ($this->weight) {
144+
$params['weight'] = $this->weight;
145+
}
146+
147+
return (object) array('node' => (object) $params);
148+
}
149+
140150
/**
141151
* factory method to create a new Metadata child of the Node
142152
*

0 commit comments

Comments
 (0)