1 | <?php declare(strict_types=1); |
||
17 | class Network extends OperatorResource implements Listable, Retrievable, Creatable, Deletable |
||
18 | { |
||
19 | use HasWaiterTrait; |
||
20 | |||
21 | /** @var string */ |
||
22 | public $id; |
||
23 | |||
24 | /** @var string */ |
||
25 | public $name; |
||
26 | |||
27 | /** @var bool */ |
||
28 | public $shared; |
||
29 | |||
30 | /** @var string */ |
||
31 | public $status; |
||
32 | |||
33 | /** @var array */ |
||
34 | public $subnets; |
||
35 | |||
36 | /** @var string */ |
||
37 | public $adminStateUp; |
||
38 | |||
39 | /** @var string */ |
||
40 | public $tenantId; |
||
41 | |||
42 | protected $aliases = [ |
||
43 | 'admin_state_up' => 'adminStateUp', |
||
44 | 'tenant_id' => 'tenantId', |
||
45 | ]; |
||
46 | |||
47 | 1 | protected $resourceKey = 'network'; |
|
48 | protected $resourcesKey = 'networks'; |
||
49 | 1 | ||
50 | 1 | /** |
|
51 | 1 | * {@inheritDoc} |
|
52 | */ |
||
53 | public function retrieve() |
||
58 | |||
59 | /** |
||
60 | 2 | * Creates multiple networks in a single request. |
|
61 | * |
||
62 | 2 | * @param array $data {@see \OpenStack\Networking\v2\Api::postNetworks} |
|
63 | 2 | * |
|
64 | * @return Network[] |
||
65 | */ |
||
66 | public function bulkCreate(array $data): array |
||
67 | { |
||
68 | $response = $this->execute($this->api->postNetworks(), ['networks' => $data]); |
||
69 | return $this->extractMultipleInstances($response); |
||
70 | } |
||
71 | 2 | ||
72 | /** |
||
73 | 2 | * {@inheritDoc} |
|
74 | 2 | * |
|
75 | * @param array $data {@see \OpenStack\Networking\v2\Api::postNetwork} |
||
76 | */ |
||
77 | public function create(array $data): Creatable |
||
78 | { |
||
79 | $response = $this->execute($this->api->postNetwork(), $data); |
||
80 | 1 | return $this->populateFromResponse($response); |
|
81 | } |
||
82 | 1 | ||
83 | 1 | /** |
|
84 | * {@inheritDoc} |
||
85 | */ |
||
86 | public function update() |
||
91 | 1 | ||
92 | 1 | /** |
|
93 | * {@inheritDoc} |
||
94 | */ |
||
95 | public function delete() |
||
99 | } |
||
100 |