1 | <?php declare(strict_types=1); |
||
17 | class OpenStack |
||
18 | { |
||
19 | /** @var Builder */ |
||
20 | private $builder; |
||
21 | |||
22 | /** |
||
23 | * @param array $options User-defined options |
||
24 | * |
||
25 | * $options['username'] = (string) Your OpenStack username [REQUIRED] |
||
26 | * ['password'] = (string) Your OpenStack password [REQUIRED] |
||
27 | * ['tenantId'] = (string) Your tenant ID [REQUIRED if tenantName omitted] |
||
28 | 7 | * ['tenantName'] = (string) Your tenant name [REQUIRED if tenantId omitted] |
|
29 | * ['authUrl'] = (string) The Keystone URL [REQUIRED] |
||
30 | 7 | * ['debugLog'] = (bool) Whether to enable HTTP logging [OPTIONAL] |
|
31 | 7 | * ['logger'] = (LoggerInterface) Must set if debugLog is true [OPTIONAL] |
|
32 | * ['messageFormatter'] = (MessageFormatter) Must set if debugLog is true [OPTIONAL] |
||
33 | * ['requestOptions'] = (array) Guzzle Http request options [OPTIONAL] |
||
34 | * |
||
35 | * @param Builder $builder |
||
36 | */ |
||
37 | public function __construct(array $options = [], Builder $builder = null) |
||
45 | |||
46 | /** |
||
47 | * @param array $options |
||
48 | * |
||
49 | * @return Service |
||
50 | */ |
||
51 | private function getDefaultIdentityService(array $options): Service |
||
68 | 1 | ||
69 | 1 | /** |
|
70 | * Creates a new Compute v2 service. |
||
71 | * |
||
72 | * @param array $options Options that will be used in configuring the service. |
||
73 | * |
||
74 | * @return \OpenStack\Compute\v2\Service |
||
75 | */ |
||
76 | public function computeV2(array $options = []): \OpenStack\Compute\v2\Service |
||
77 | { |
||
78 | $defaults = ['catalogName' => 'nova', 'catalogType' => 'compute']; |
||
79 | 1 | return $this->builder->createService('Compute\\v2', array_merge($defaults, $options)); |
|
80 | } |
||
81 | 1 | ||
82 | 1 | /** |
|
83 | * Creates a new Networking v2 service. |
||
84 | * |
||
85 | * @param array $options Options that will be used in configuring the service. |
||
86 | * |
||
87 | * @return \OpenStack\Networking\v2\Service |
||
88 | */ |
||
89 | public function networkingV2(array $options = []): \OpenStack\Networking\v2\Service |
||
90 | { |
||
91 | $defaults = ['catalogName' => 'neutron', 'catalogType' => 'network']; |
||
92 | 1 | return $this->builder->createService('Networking\\v2', array_merge($defaults, $options)); |
|
93 | } |
||
94 | 1 | ||
95 | 1 | /** |
|
96 | * Creates a new Networking v2 Layer 3 service. |
||
97 | * |
||
98 | * @param array $options Options that will be used in configuring the service. |
||
99 | * |
||
100 | * @return \OpenStack\Networking\v2\Extensions\Layer3\Service |
||
101 | */ |
||
102 | public function networkingV2ExtLayer3(array $options = []): \OpenStack\Networking\v2\Extensions\Layer3\Service |
||
107 | 1 | ||
108 | 1 | /** |
|
109 | * Creates a new Networking v2 Layer 3 service. |
||
110 | * |
||
111 | * @param array $options Options that will be used in configuring the service. |
||
112 | * |
||
113 | * @return \OpenStack\Networking\v2\Extensions\SecurityGroups\Service |
||
114 | */ |
||
115 | public function networkingV2ExtSecGroups(array $options = []): \OpenStack\Networking\v2\Extensions\SecurityGroups\Service |
||
120 | 1 | ||
121 | 1 | /** |
|
122 | * Creates a new Identity v2 service. |
||
123 | * |
||
124 | * @param array $options Options that will be used in configuring the service. |
||
125 | * |
||
126 | * @return \OpenStack\Identity\v2\Service |
||
127 | */ |
||
128 | public function identityV2(array $options = []): \OpenStack\Identity\v2\Service |
||
133 | |||
134 | /** |
||
135 | * Creates a new Identity v3 service. |
||
136 | * |
||
137 | * @param array $options Options that will be used in configuring the service. |
||
138 | * |
||
139 | * @return \OpenStack\Identity\v3\Service |
||
140 | */ |
||
141 | public function identityV3(array $options = []): \OpenStack\Identity\v3\Service |
||
146 | |||
147 | /** |
||
148 | * Creates a new Object Store v1 service. |
||
149 | * |
||
150 | * @param array $options Options that will be used in configuring the service. |
||
151 | * |
||
152 | * @return \OpenStack\ObjectStore\v1\Service |
||
153 | */ |
||
154 | public function objectStoreV1(array $options = []): \OpenStack\ObjectStore\v1\Service |
||
159 | |||
160 | /** |
||
161 | * Creates a new Block Storage v2 service. |
||
162 | * |
||
163 | * @param array $options Options that will be used in configuring the service. |
||
164 | * |
||
165 | * @return \OpenStack\BlockStorage\v2\Service |
||
166 | */ |
||
167 | public function blockStorageV2(array $options = []): \OpenStack\BlockStorage\v2\Service |
||
172 | |||
173 | /** |
||
174 | * Creates a new Images v2 service. |
||
175 | * |
||
176 | * @param array $options Options that will be used in configuring the service. |
||
177 | * |
||
178 | * @return \OpenStack\Images\v2\Service |
||
179 | */ |
||
180 | public function imagesV2(array $options = []): \OpenStack\Images\v2\Service |
||
185 | |||
186 | /** |
||
187 | * Creates a new Gnocchi Metric service v1 |
||
188 | * |
||
189 | * @param array $options |
||
190 | * |
||
191 | * @return \OpenStack\Metric\v1\Gnocchi\Service |
||
192 | */ |
||
193 | public function metricGnocchiV1(array $options = []): \OpenStack\Metric\v1\Gnocchi\Service |
||
199 | } |
||
200 |