|
40 | 40 | from openstack.network.v2 import security_group as _security_group |
41 | 41 | from openstack.network.v2 import security_group_rule as _security_group_rule |
42 | 42 | from openstack.network.v2 import segment as _segment |
| 43 | +from openstack.network.v2 import service_profile as _service_profile |
43 | 44 | from openstack.network.v2 import service_provider as _service_provider |
44 | 45 | from openstack.network.v2 import subnet as _subnet |
45 | 46 | from openstack.network.v2 import subnet_pool as _subnet_pool |
@@ -2307,6 +2308,95 @@ def service_providers(self, **query): |
2307 | 2308 | return self._list(_service_provider.ServiceProvider, |
2308 | 2309 | paginated=False, **query) |
2309 | 2310 |
|
| 2311 | + def create_service_profile(self, **attrs): |
| 2312 | + """Create a new network service flavor profile from attributes |
| 2313 | +
|
| 2314 | + :param dict attrs: Keyword arguments which will be used to create |
| 2315 | + a :class:`~openstack.network.v2.service_profile |
| 2316 | + .ServiceProfile`, |
| 2317 | + comprised of the properties on the ServiceProfile |
| 2318 | + class. |
| 2319 | +
|
| 2320 | + :returns: The results of service profile creation |
| 2321 | + :rtype: :class:`~openstack.network.v2.service_profile.ServiceProfile` |
| 2322 | + """ |
| 2323 | + return self._create(_service_profile.ServiceProfile, **attrs) |
| 2324 | + |
| 2325 | + def delete_service_profile(self, service_profile, ignore_missing=True): |
| 2326 | + """Delete a network service flavor profile |
| 2327 | +
|
| 2328 | + :param service_profile: The value can be either the ID of a service |
| 2329 | + profile or a |
| 2330 | + :class:`~openstack.network.v2.service_profile |
| 2331 | + .ServiceProfile` instance. |
| 2332 | + :param bool ignore_missing: When set to ``False`` |
| 2333 | + :class:`~openstack.exceptions.ResourceNotFound` will be |
| 2334 | + raised when the service profile does not exist. |
| 2335 | + When set to ``True``, no exception will be set when |
| 2336 | + attempting to delete a nonexistent service profile. |
| 2337 | +
|
| 2338 | + :returns: ``None`` |
| 2339 | + """ |
| 2340 | + self._delete(_service_profile.ServiceProfile, service_profile, |
| 2341 | + ignore_missing=ignore_missing) |
| 2342 | + |
| 2343 | + def find_service_profile(self, name_or_id, ignore_missing=True): |
| 2344 | + """Find a single network service flavor profile |
| 2345 | +
|
| 2346 | + :param name_or_id: The name or ID of a service profile. |
| 2347 | + :param bool ignore_missing: When set to ``False`` |
| 2348 | + :class:`~openstack.exceptions.ResourceNotFound` will be |
| 2349 | + raised when the resource does not exist. |
| 2350 | + When set to ``True``, None will be returned when |
| 2351 | + attempting to find a nonexistent resource. |
| 2352 | + :returns: One :class:`~openstack.network.v2.service_profile |
| 2353 | + .ServiceProfile` or None |
| 2354 | + """ |
| 2355 | + return self._find(_service_profile.ServiceProfile, name_or_id, |
| 2356 | + ignore_missing=ignore_missing) |
| 2357 | + |
| 2358 | + def get_service_profile(self, service_profile): |
| 2359 | + """Get a single network service flavor profile |
| 2360 | +
|
| 2361 | + :param service_profile: The value can be the ID of a service_profile or |
| 2362 | + a |
| 2363 | + :class:`~openstack.network.v2.service_profile |
| 2364 | + .ServiceProfile` instance. |
| 2365 | +
|
| 2366 | + :returns: One :class:`~openstack.network.v2.service_profile |
| 2367 | + .ServiceProfile` |
| 2368 | + :raises: :class:`~openstack.exceptions.ResourceNotFound` |
| 2369 | + when no resource can be found. |
| 2370 | + """ |
| 2371 | + return self._get(_service_profile.ServiceProfile, service_profile) |
| 2372 | + |
| 2373 | + def service_profiles(self, **query): |
| 2374 | + """Return a generator of network service flavor profiles |
| 2375 | +
|
| 2376 | + :param kwargs \*\*query: Optional query parameters to be sent to limit |
| 2377 | + the resources being returned. |
| 2378 | +
|
| 2379 | + :returns: A generator of service profile objects |
| 2380 | + :rtype: :class:`~openstack.network.v2.service_profile.ServiceProfile` |
| 2381 | + """ |
| 2382 | + return self._list(_service_profile.ServiceProfile, paginated=True, |
| 2383 | + **query) |
| 2384 | + |
| 2385 | + def update_service_profile(self, service_profile, **attrs): |
| 2386 | + """Update a network flavor service profile |
| 2387 | +
|
| 2388 | + :param service_profile: Either the id of a service profile or a |
| 2389 | + :class:`~openstack.network.v2.service_profile |
| 2390 | + .ServiceProfile` instance. |
| 2391 | + :attrs kwargs: The attributes to update on the service profile |
| 2392 | + represented by ``value``. |
| 2393 | +
|
| 2394 | + :returns: The updated service profile |
| 2395 | + :rtype: :class:`~openstack.network.v2.service_profile.ServiceProfile` |
| 2396 | + """ |
| 2397 | + return self._update(_service_profile.ServiceProfile, service_profile, |
| 2398 | + **attrs) |
| 2399 | + |
2310 | 2400 | def create_subnet(self, **attrs): |
2311 | 2401 | """Create a new subnet from attributes |
2312 | 2402 |
|
|
0 commit comments