Debian Codegraph @

octavia_tempest_plugin/services/load_balancer/v2/provider_client.py

raw symbols SCIP
1 # Copyright 2019 Rackspace US Inc. All rights reserved.
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License"); you may
4 # not use this file except in compliance with the License. You may obtain
5 # a copy of the License at
6 #
7 # http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12 # License for the specific language governing permissions and limitations
13 # under the License.
14 #
15
16 from octavia_tempest_plugin.common.decorators import skip_if_not_implemented
17 from octavia_tempest_plugin.services.load_balancer.v2 import base_client
18
19 Unset = base_client.Unset
20
21
22 class ProviderClient(base_client.BaseLBaaSClient):
23
24 list_root_tag = 'providers'
25
26 @skip_if_not_implemented
27 def list_providers(self, query_params=None, return_object_only=True):
28 """Get a list of provider objects.
29
30 :param query_params: The optional query parameters to append to the
31 request. Ex. fields=id&fields=name
32 :param return_object_only: If True, the response returns the object
33 inside the root tag. False returns the full
34 response from the API.
35 :raises AssertionError: if the expected_code isn't a valid http success
36 response code
37 :raises BadRequest: If a 400 response code is received
38 :raises Conflict: If a 409 response code is received
39 :raises Forbidden: If a 403 response code is received
40 :raises Gone: If a 410 response code is received
41 :raises InvalidContentType: If a 415 response code is received
42 :raises InvalidHTTPResponseBody: The response body wasn't valid JSON
43 :raises InvalidHttpSuccessCode: if the read code isn't an expected
44 http success code
45 :raises NotFound: If a 404 response code is received
46 :raises NotImplemented: If a 501 response code is received
47 :raises OverLimit: If a 413 response code is received and over_limit is
48 not in the response body
49 :raises RateLimitExceeded: If a 413 response code is received and
50 over_limit is in the response body
51 :raises ServerFault: If a 500 response code is received
52 :raises Unauthorized: If a 401 response code is received
53 :raises UnexpectedContentType: If the content-type of the response
54 isn't an expect type
55 :raises UnexpectedResponseCode: If a response code above 400 is
56 received and it doesn't fall into any
57 of the handled checks
58 :raises UnprocessableEntity: If a 422 response code is received and
59 couldn't be parsed
60 :returns: A list of provider objects.
61 """
62 return self._list_objects(query_params=query_params,
63 return_object_only=return_object_only)