Skip to content

Commit ad3f414

Browse files
committed
Added some network endpoints
1 parent 7c69175 commit ad3f414

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

src/Endpoint/Networks.php

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,34 @@ public function info($name)
3737
{
3838
return $this->get($this->getEndpoint().$name);
3939
}
40+
41+
/**
42+
* Create a network
43+
*
44+
* @param string $name name of network
45+
* @param array $config configuration of the network (Optional)
46+
* @return object
47+
*/
48+
public function create(string $name, string $description = "", array $config = [])
49+
{
50+
$data = [];
51+
52+
$data["name"] = $name;
53+
$data["description"] = $description;
54+
if (!empty($config)) {
55+
$data["config"] = $config;
56+
}
57+
58+
return $this->post($this->getEndpoint(), $data);
59+
}
60+
61+
/**
62+
* Delete network
63+
* @param string $name name of network
64+
* @return object
65+
*/
66+
public function remove($name)
67+
{
68+
return $this->delete($this->getEndpoint().$name);
69+
}
4070
}

0 commit comments

Comments
 (0)