octavia_tempest_plugin.services.load_balancer.v2 package

octavia_tempest_plugin.services.load_balancer.v2 package

Submodules

octavia_tempest_plugin.services.load_balancer.v2.loadbalancer_client module

class LoadbalancerClient(auth_provider, service, region, **kwargs)[source]

Bases: tempest.lib.common.rest_client.RestClient

create_loadbalancer(admin_state_up=None, description=None, flavor=None, listeners=None, name=None, project_id=None, provider=None, vip_address=None, vip_network_id=None, vip_port_id=None, vip_qos_policy_id=None, vip_subnet_id=None, return_object_only=True)[source]

Create a load balancer.

Parameters:
  • admin_state_up – The administrative state of the resource, which is up (true) or down (false).
  • description – A human-readable description for the resource.
  • flavor – The load balancer flavor ID.
  • listeners – A list of listner dictionaries.
  • name – Human-readable name of the resource.
  • project_id – The ID of the project owning this resource.
  • provider – Provider name for the load balancer.
  • vip_address – The IP address of the Virtual IP (VIP).
  • vip_network_id – The ID of the network for the Virtual IP (VIP).
  • vip_port_id – The ID of the Virtual IP (VIP) port.
  • vip_qos_policy_id – The ID of the QoS Policy which will apply to the Virtual IP (VIP).
  • vip_subnet_id – The ID of the subnet for the Virtual IP (VIP).
  • return_object_only – If True, the response returns the object inside the root tag. False returns the full response from the API.
Raises:
  • AssertionError – if the expected_code isn’t a valid http success response code
  • BadRequest – If a 400 response code is received
  • Conflict – If a 409 response code is received
  • Forbidden – If a 403 response code is received
  • Gone – If a 410 response code is received
  • InvalidContentType – If a 415 response code is received
  • InvalidHTTPResponseBody – The response body wasn’t valid JSON
  • InvalidHttpSuccessCode – if the read code isn’t an expected http success code
  • NotFound – If a 404 response code is received
  • NotImplemented – If a 501 response code is received
  • OverLimit – If a 413 response code is received and over_limit is not in the response body
  • RateLimitExceeded – If a 413 response code is received and over_limit is in the response body
  • ServerFault – If a 500 response code is received
  • Unauthorized – If a 401 response code is received
  • UnexpectedContentType – If the content-type of the response isn’t an expect type
  • UnexpectedResponseCode – If a response code above 400 is received and it doesn’t fall into any of the handled checks
  • UnprocessableEntity – If a 422 response code is received and couldn’t be parsed
Returns:

A load balancer object.

create_loadbalancer_dict(lb_dict, return_object_only=True)[source]

Create a load balancer using a dictionary.

Example lb_dict:

lb_dict = {'loadbalancer': {
    'vip_network_id': 'd0be73da-921a-4e03-9c49-f13f18f7e39f',
    'name': 'TEMPEST_TEST_LB',
    'description': 'LB for Tempest tests'}
}
Parameters:
  • lb_dict – A dictionary describing the load balancer.
  • return_object_only – If True, the response returns the object inside the root tag. False returns the full response from the API.
Raises:
  • AssertionError – if the expected_code isn’t a valid http success response code
  • BadRequest – If a 400 response code is received
  • Conflict – If a 409 response code is received
  • Forbidden – If a 403 response code is received
  • Gone – If a 410 response code is received
  • InvalidContentType – If a 415 response code is received
  • InvalidHTTPResponseBody – The response body wasn’t valid JSON
  • InvalidHttpSuccessCode – if the read code isn’t an expected http success code
  • NotFound – If a 404 response code is received
  • NotImplemented – If a 501 response code is received
  • OverLimit – If a 413 response code is received and over_limit is not in the response body
  • RateLimitExceeded – If a 413 response code is received and over_limit is in the response body
  • ServerFault – If a 500 response code is received
  • Unauthorized – If a 401 response code is received
  • UnexpectedContentType – If the content-type of the response isn’t an expect type
  • UnexpectedResponseCode – If a response code above 400 is received and it doesn’t fall into any of the handled checks
  • UnprocessableEntity – If a 422 response code is received and couldn’t be parsed
Returns:

A load balancer object.

delete_loadbalancer(lb_id, cascade=False, ignore_errors=False)[source]

Delete a load balancer.

Parameters:
  • lb_id – The load balancer ID to delete.
  • cascade – If true will delete all child objects of the load balancer.
  • ignore_errors – True if errors should be ignored.
Raises:
  • AssertionError – if the expected_code isn’t a valid http success response code
  • BadRequest – If a 400 response code is received
  • Conflict – If a 409 response code is received
  • Forbidden – If a 403 response code is received
  • Gone – If a 410 response code is received
  • InvalidContentType – If a 415 response code is received
  • InvalidHTTPResponseBody – The response body wasn’t valid JSON
  • InvalidHttpSuccessCode – if the read code isn’t an expected http success code
  • NotFound – If a 404 response code is received
  • NotImplemented – If a 501 response code is received
  • OverLimit – If a 413 response code is received and over_limit is not in the response body
  • RateLimitExceeded – If a 413 response code is received and over_limit is in the response body
  • ServerFault – If a 500 response code is received
  • Unauthorized – If a 401 response code is received
  • UnexpectedContentType – If the content-type of the response isn’t an expect type
  • UnexpectedResponseCode – If a response code above 400 is received and it doesn’t fall into any of the handled checks
  • UnprocessableEntity – If a 422 response code is received and couldn’t be parsed
Returns:

None if ignore_errors is True, the response status code if not.

failover_loadbalancer(lb_id)[source]

Failover a load balancer.

Parameters:

lb_id – The load balancer ID to query.

Raises:
  • AssertionError – if the expected_code isn’t a valid http success response code
  • BadRequest – If a 400 response code is received
  • Conflict – If a 409 response code is received
  • Forbidden – If a 403 response code is received
  • Gone – If a 410 response code is received
  • InvalidContentType – If a 415 response code is received
  • InvalidHTTPResponseBody – The response body wasn’t valid JSON
  • InvalidHttpSuccessCode – if the read code isn’t an expected http success code
  • NotFound – If a 404 response code is received
  • NotImplemented – If a 501 response code is received
  • OverLimit – If a 413 response code is received and over_limit is not in the response body
  • RateLimitExceeded – If a 413 response code is received and over_limit is in the response body
  • ServerFault – If a 500 response code is received
  • Unauthorized – If a 401 response code is received
  • UnexpectedContentType – If the content-type of the response isn’t an expect type
  • UnexpectedResponseCode – If a response code above 400 is received and it doesn’t fall into any of the handled checks
  • UnprocessableEntity – If a 422 response code is received and couldn’t be parsed
Returns:

None

get_loadbalancer_stats(lb_id, query_params=None, return_object_only=True)[source]

Get load balancer statistics.

Parameters:
  • lb_id – The load balancer ID to query.
  • query_params – The optional query parameters to append to the request. Ex. fields=id&fields=name
  • return_object_only – If True, the response returns the object inside the root tag. False returns the full response from the API.
Raises:
  • AssertionError – if the expected_code isn’t a valid http success response code
  • BadRequest – If a 400 response code is received
  • Conflict – If a 409 response code is received
  • Forbidden – If a 403 response code is received
  • Gone – If a 410 response code is received
  • InvalidContentType – If a 415 response code is received
  • InvalidHTTPResponseBody – The response body wasn’t valid JSON
  • InvalidHttpSuccessCode – if the read code isn’t an expected http success code
  • NotFound – If a 404 response code is received
  • NotImplemented – If a 501 response code is received
  • OverLimit – If a 413 response code is received and over_limit is not in the response body
  • RateLimitExceeded – If a 413 response code is received and over_limit is in the response body
  • ServerFault – If a 500 response code is received
  • Unauthorized – If a 401 response code is received
  • UnexpectedContentType – If the content-type of the response isn’t an expect type
  • UnexpectedResponseCode – If a response code above 400 is received and it doesn’t fall into any of the handled checks
  • UnprocessableEntity – If a 422 response code is received and couldn’t be parsed
Returns:

A load balancer statistics object.

get_loadbalancer_status(lb_id, query_params=None, return_object_only=True)[source]

Get a load balancer status tree.

Parameters:
  • lb_id – The load balancer ID to query.
  • query_params – The optional query parameters to append to the request. Ex. fields=id&fields=name
  • return_object_only – If True, the response returns the object inside the root tag. False returns the full response from the API.
Raises:
  • AssertionError – if the expected_code isn’t a valid http success response code
  • BadRequest – If a 400 response code is received
  • Conflict – If a 409 response code is received
  • Forbidden – If a 403 response code is received
  • Gone – If a 410 response code is received
  • InvalidContentType – If a 415 response code is received
  • InvalidHTTPResponseBody – The response body wasn’t valid JSON
  • InvalidHttpSuccessCode – if the read code isn’t an expected http success code
  • NotFound – If a 404 response code is received
  • NotImplemented – If a 501 response code is received
  • OverLimit – If a 413 response code is received and over_limit is not in the response body
  • RateLimitExceeded – If a 413 response code is received and over_limit is in the response body
  • ServerFault – If a 500 response code is received
  • Unauthorized – If a 401 response code is received
  • UnexpectedContentType – If the content-type of the response isn’t an expect type
  • UnexpectedResponseCode – If a response code above 400 is received and it doesn’t fall into any of the handled checks
  • UnprocessableEntity – If a 422 response code is received and couldn’t be parsed
Returns:

A load balancer statuses object.

list_loadbalancers(query_params=None, return_object_only=True)[source]

Get a list of load balancers.

Parameters:
  • query_params – The optional query parameters to append to the request. Ex. fields=id&fields=name
  • return_object_only – If True, the response returns the object inside the root tag. False returns the full response from the API.
Raises:
  • AssertionError – if the expected_code isn’t a valid http success response code
  • BadRequest – If a 400 response code is received
  • Conflict – If a 409 response code is received
  • Forbidden – If a 403 response code is received
  • Gone – If a 410 response code is received
  • InvalidContentType – If a 415 response code is received
  • InvalidHTTPResponseBody – The response body wasn’t valid JSON
  • InvalidHttpSuccessCode – if the read code isn’t an expected http success code
  • NotFound – If a 404 response code is received
  • NotImplemented – If a 501 response code is received
  • OverLimit – If a 413 response code is received and over_limit is not in the response body
  • RateLimitExceeded – If a 413 response code is received and over_limit is in the response body
  • ServerFault – If a 500 response code is received
  • Unauthorized – If a 401 response code is received
  • UnexpectedContentType – If the content-type of the response isn’t an expect type
  • UnexpectedResponseCode – If a response code above 400 is received and it doesn’t fall into any of the handled checks
  • UnprocessableEntity – If a 422 response code is received and couldn’t be parsed
Returns:

A list of load balancers object.

show_loadbalancer(lb_id, query_params=None, return_object_only=True)[source]

Get load balancer details.

Parameters:
  • lb_id – The load balancer ID to query.
  • query_params – The optional query parameters to append to the request. Ex. fields=id&fields=name
  • return_object_only – If True, the response returns the object inside the root tag. False returns the full response from the API.
Raises:
  • AssertionError – if the expected_code isn’t a valid http success response code
  • BadRequest – If a 400 response code is received
  • Conflict – If a 409 response code is received
  • Forbidden – If a 403 response code is received
  • Gone – If a 410 response code is received
  • InvalidContentType – If a 415 response code is received
  • InvalidHTTPResponseBody – The response body wasn’t valid JSON
  • InvalidHttpSuccessCode – if the read code isn’t an expected http success code
  • NotFound – If a 404 response code is received
  • NotImplemented – If a 501 response code is received
  • OverLimit – If a 413 response code is received and over_limit is not in the response body
  • RateLimitExceeded – If a 413 response code is received and over_limit is in the response body
  • ServerFault – If a 500 response code is received
  • Unauthorized – If a 401 response code is received
  • UnexpectedContentType – If the content-type of the response isn’t an expect type
  • UnexpectedResponseCode – If a response code above 400 is received and it doesn’t fall into any of the handled checks
  • UnprocessableEntity – If a 422 response code is received and couldn’t be parsed
Returns:

A load balancer object.

update_loadbalancer(lb_id, admin_state_up=None, description=None, name=None, vip_qos_policy_id=None, return_object_only=True)[source]

Update a load balancer.

Parameters:
  • lb_id – The load balancer ID to update.
  • admin_state_up – The administrative state of the resource, which is up (true) or down (false).
  • description – A human-readable description for the resource.
  • name – Human-readable name of the resource.
  • vip_qos_policy_id – The ID of the QoS Policy which will apply to the Virtual IP (VIP).
  • return_object_only – If True, the response returns the object inside the root tag. False returns the full response from the API.
Raises:
  • AssertionError – if the expected_code isn’t a valid http success response code
  • BadRequest – If a 400 response code is received
  • Conflict – If a 409 response code is received
  • Forbidden – If a 403 response code is received
  • Gone – If a 410 response code is received
  • InvalidContentType – If a 415 response code is received
  • InvalidHTTPResponseBody – The response body wasn’t valid JSON
  • InvalidHttpSuccessCode – if the read code isn’t an expected http success code
  • NotFound – If a 404 response code is received
  • NotImplemented – If a 501 response code is received
  • OverLimit – If a 413 response code is received and over_limit is not in the response body
  • RateLimitExceeded – If a 413 response code is received and over_limit is in the response body
  • ServerFault – If a 500 response code is received
  • Unauthorized – If a 401 response code is received
  • UnexpectedContentType – If the content-type of the response isn’t an expect type
  • UnexpectedResponseCode – If a response code above 400 is received and it doesn’t fall into any of the handled checks
  • UnprocessableEntity – If a 422 response code is received and couldn’t be parsed
Returns:

A load balancer object.

update_loadbalancer_dict(lb_id, lb_dict, return_object_only=True)[source]

Update a load balancer using a dictionary.

Example lb_dict:

lb_dict = {'loadbalancer': {'name': 'TEMPEST_TEST_LB_UPDATED'} }
Parameters:
  • lb_id – The load balancer ID to update.
  • lb_dict – A dictionary of elements to update on the load balancer.
  • return_object_only – If True, the response returns the object inside the root tag. False returns the full response from the API.
Raises:
  • AssertionError – if the expected_code isn’t a valid http success response code
  • BadRequest – If a 400 response code is received
  • Conflict – If a 409 response code is received
  • Forbidden – If a 403 response code is received
  • Gone – If a 410 response code is received
  • InvalidContentType – If a 415 response code is received
  • InvalidHTTPResponseBody – The response body wasn’t valid JSON
  • InvalidHttpSuccessCode – if the read code isn’t an expected http success code
  • NotFound – If a 404 response code is received
  • NotImplemented – If a 501 response code is received
  • OverLimit – If a 413 response code is received and over_limit is not in the response body
  • RateLimitExceeded – If a 413 response code is received and over_limit is in the response body
  • ServerFault – If a 500 response code is received
  • Unauthorized – If a 401 response code is received
  • UnexpectedContentType – If the content-type of the response isn’t an expect type
  • UnexpectedResponseCode – If a response code above 400 is received and it doesn’t fall into any of the handled checks
  • UnprocessableEntity – If a 422 response code is received and couldn’t be parsed
Returns:

A load balancer object.

Module contents

class LoadbalancerClient(auth_provider, service, region, **kwargs)[source]

Bases: tempest.lib.common.rest_client.RestClient

create_loadbalancer(admin_state_up=None, description=None, flavor=None, listeners=None, name=None, project_id=None, provider=None, vip_address=None, vip_network_id=None, vip_port_id=None, vip_qos_policy_id=None, vip_subnet_id=None, return_object_only=True)[source]

Create a load balancer.

Parameters:
  • admin_state_up – The administrative state of the resource, which is up (true) or down (false).
  • description – A human-readable description for the resource.
  • flavor – The load balancer flavor ID.
  • listeners – A list of listner dictionaries.
  • name – Human-readable name of the resource.
  • project_id – The ID of the project owning this resource.
  • provider – Provider name for the load balancer.
  • vip_address – The IP address of the Virtual IP (VIP).
  • vip_network_id – The ID of the network for the Virtual IP (VIP).
  • vip_port_id – The ID of the Virtual IP (VIP) port.
  • vip_qos_policy_id – The ID of the QoS Policy which will apply to the Virtual IP (VIP).
  • vip_subnet_id – The ID of the subnet for the Virtual IP (VIP).
  • return_object_only – If True, the response returns the object inside the root tag. False returns the full response from the API.
Raises:
  • AssertionError – if the expected_code isn’t a valid http success response code
  • BadRequest – If a 400 response code is received
  • Conflict – If a 409 response code is received
  • Forbidden – If a 403 response code is received
  • Gone – If a 410 response code is received
  • InvalidContentType – If a 415 response code is received
  • InvalidHTTPResponseBody – The response body wasn’t valid JSON
  • InvalidHttpSuccessCode – if the read code isn’t an expected http success code
  • NotFound – If a 404 response code is received
  • NotImplemented – If a 501 response code is received
  • OverLimit – If a 413 response code is received and over_limit is not in the response body
  • RateLimitExceeded – If a 413 response code is received and over_limit is in the response body
  • ServerFault – If a 500 response code is received
  • Unauthorized – If a 401 response code is received
  • UnexpectedContentType – If the content-type of the response isn’t an expect type
  • UnexpectedResponseCode – If a response code above 400 is received and it doesn’t fall into any of the handled checks
  • UnprocessableEntity – If a 422 response code is received and couldn’t be parsed
Returns:

A load balancer object.

create_loadbalancer_dict(lb_dict, return_object_only=True)[source]

Create a load balancer using a dictionary.

Example lb_dict:

lb_dict = {'loadbalancer': {
    'vip_network_id': 'd0be73da-921a-4e03-9c49-f13f18f7e39f',
    'name': 'TEMPEST_TEST_LB',
    'description': 'LB for Tempest tests'}
}
Parameters:
  • lb_dict – A dictionary describing the load balancer.
  • return_object_only – If True, the response returns the object inside the root tag. False returns the full response from the API.
Raises:
  • AssertionError – if the expected_code isn’t a valid http success response code
  • BadRequest – If a 400 response code is received
  • Conflict – If a 409 response code is received
  • Forbidden – If a 403 response code is received
  • Gone – If a 410 response code is received
  • InvalidContentType – If a 415 response code is received
  • InvalidHTTPResponseBody – The response body wasn’t valid JSON
  • InvalidHttpSuccessCode – if the read code isn’t an expected http success code
  • NotFound – If a 404 response code is received
  • NotImplemented – If a 501 response code is received
  • OverLimit – If a 413 response code is received and over_limit is not in the response body
  • RateLimitExceeded – If a 413 response code is received and over_limit is in the response body
  • ServerFault – If a 500 response code is received
  • Unauthorized – If a 401 response code is received
  • UnexpectedContentType – If the content-type of the response isn’t an expect type
  • UnexpectedResponseCode – If a response code above 400 is received and it doesn’t fall into any of the handled checks
  • UnprocessableEntity – If a 422 response code is received and couldn’t be parsed
Returns:

A load balancer object.

delete_loadbalancer(lb_id, cascade=False, ignore_errors=False)[source]

Delete a load balancer.

Parameters:
  • lb_id – The load balancer ID to delete.
  • cascade – If true will delete all child objects of the load balancer.
  • ignore_errors – True if errors should be ignored.
Raises:
  • AssertionError – if the expected_code isn’t a valid http success response code
  • BadRequest – If a 400 response code is received
  • Conflict – If a 409 response code is received
  • Forbidden – If a 403 response code is received
  • Gone – If a 410 response code is received
  • InvalidContentType – If a 415 response code is received
  • InvalidHTTPResponseBody – The response body wasn’t valid JSON
  • InvalidHttpSuccessCode – if the read code isn’t an expected http success code
  • NotFound – If a 404 response code is received
  • NotImplemented – If a 501 response code is received
  • OverLimit – If a 413 response code is received and over_limit is not in the response body
  • RateLimitExceeded – If a 413 response code is received and over_limit is in the response body
  • ServerFault – If a 500 response code is received
  • Unauthorized – If a 401 response code is received
  • UnexpectedContentType – If the content-type of the response isn’t an expect type
  • UnexpectedResponseCode – If a response code above 400 is received and it doesn’t fall into any of the handled checks
  • UnprocessableEntity – If a 422 response code is received and couldn’t be parsed
Returns:

None if ignore_errors is True, the response status code if not.

failover_loadbalancer(lb_id)[source]

Failover a load balancer.

Parameters:

lb_id – The load balancer ID to query.

Raises:
  • AssertionError – if the expected_code isn’t a valid http success response code
  • BadRequest – If a 400 response code is received
  • Conflict – If a 409 response code is received
  • Forbidden – If a 403 response code is received
  • Gone – If a 410 response code is received
  • InvalidContentType – If a 415 response code is received
  • InvalidHTTPResponseBody – The response body wasn’t valid JSON
  • InvalidHttpSuccessCode – if the read code isn’t an expected http success code
  • NotFound – If a 404 response code is received
  • NotImplemented – If a 501 response code is received
  • OverLimit – If a 413 response code is received and over_limit is not in the response body
  • RateLimitExceeded – If a 413 response code is received and over_limit is in the response body
  • ServerFault – If a 500 response code is received
  • Unauthorized – If a 401 response code is received
  • UnexpectedContentType – If the content-type of the response isn’t an expect type
  • UnexpectedResponseCode – If a response code above 400 is received and it doesn’t fall into any of the handled checks
  • UnprocessableEntity – If a 422 response code is received and couldn’t be parsed
Returns:

None

get_loadbalancer_stats(lb_id, query_params=None, return_object_only=True)[source]

Get load balancer statistics.

Parameters:
  • lb_id – The load balancer ID to query.
  • query_params – The optional query parameters to append to the request. Ex. fields=id&fields=name
  • return_object_only – If True, the response returns the object inside the root tag. False returns the full response from the API.
Raises:
  • AssertionError – if the expected_code isn’t a valid http success response code
  • BadRequest – If a 400 response code is received
  • Conflict – If a 409 response code is received
  • Forbidden – If a 403 response code is received
  • Gone – If a 410 response code is received
  • InvalidContentType – If a 415 response code is received
  • InvalidHTTPResponseBody – The response body wasn’t valid JSON
  • InvalidHttpSuccessCode – if the read code isn’t an expected http success code
  • NotFound – If a 404 response code is received
  • NotImplemented – If a 501 response code is received
  • OverLimit – If a 413 response code is received and over_limit is not in the response body
  • RateLimitExceeded – If a 413 response code is received and over_limit is in the response body
  • ServerFault – If a 500 response code is received
  • Unauthorized – If a 401 response code is received
  • UnexpectedContentType – If the content-type of the response isn’t an expect type
  • UnexpectedResponseCode – If a response code above 400 is received and it doesn’t fall into any of the handled checks
  • UnprocessableEntity – If a 422 response code is received and couldn’t be parsed
Returns:

A load balancer statistics object.

get_loadbalancer_status(lb_id, query_params=None, return_object_only=True)[source]

Get a load balancer status tree.

Parameters:
  • lb_id – The load balancer ID to query.
  • query_params – The optional query parameters to append to the request. Ex. fields=id&fields=name
  • return_object_only – If True, the response returns the object inside the root tag. False returns the full response from the API.
Raises:
  • AssertionError – if the expected_code isn’t a valid http success response code
  • BadRequest – If a 400 response code is received
  • Conflict – If a 409 response code is received
  • Forbidden – If a 403 response code is received
  • Gone – If a 410 response code is received
  • InvalidContentType – If a 415 response code is received
  • InvalidHTTPResponseBody – The response body wasn’t valid JSON
  • InvalidHttpSuccessCode – if the read code isn’t an expected http success code
  • NotFound – If a 404 response code is received
  • NotImplemented – If a 501 response code is received
  • OverLimit – If a 413 response code is received and over_limit is not in the response body
  • RateLimitExceeded – If a 413 response code is received and over_limit is in the response body
  • ServerFault – If a 500 response code is received
  • Unauthorized – If a 401 response code is received
  • UnexpectedContentType – If the content-type of the response isn’t an expect type
  • UnexpectedResponseCode – If a response code above 400 is received and it doesn’t fall into any of the handled checks
  • UnprocessableEntity – If a 422 response code is received and couldn’t be parsed
Returns:

A load balancer statuses object.

list_loadbalancers(query_params=None, return_object_only=True)[source]

Get a list of load balancers.

Parameters:
  • query_params – The optional query parameters to append to the request. Ex. fields=id&fields=name
  • return_object_only – If True, the response returns the object inside the root tag. False returns the full response from the API.
Raises:
  • AssertionError – if the expected_code isn’t a valid http success response code
  • BadRequest – If a 400 response code is received
  • Conflict – If a 409 response code is received
  • Forbidden – If a 403 response code is received
  • Gone – If a 410 response code is received
  • InvalidContentType – If a 415 response code is received
  • InvalidHTTPResponseBody – The response body wasn’t valid JSON
  • InvalidHttpSuccessCode – if the read code isn’t an expected http success code
  • NotFound – If a 404 response code is received
  • NotImplemented – If a 501 response code is received
  • OverLimit – If a 413 response code is received and over_limit is not in the response body
  • RateLimitExceeded – If a 413 response code is received and over_limit is in the response body
  • ServerFault – If a 500 response code is received
  • Unauthorized – If a 401 response code is received
  • UnexpectedContentType – If the content-type of the response isn’t an expect type
  • UnexpectedResponseCode – If a response code above 400 is received and it doesn’t fall into any of the handled checks
  • UnprocessableEntity – If a 422 response code is received and couldn’t be parsed
Returns:

A list of load balancers object.

show_loadbalancer(lb_id, query_params=None, return_object_only=True)[source]

Get load balancer details.

Parameters:
  • lb_id – The load balancer ID to query.
  • query_params – The optional query parameters to append to the request. Ex. fields=id&fields=name
  • return_object_only – If True, the response returns the object inside the root tag. False returns the full response from the API.
Raises:
  • AssertionError – if the expected_code isn’t a valid http success response code
  • BadRequest – If a 400 response code is received
  • Conflict – If a 409 response code is received
  • Forbidden – If a 403 response code is received
  • Gone – If a 410 response code is received
  • InvalidContentType – If a 415 response code is received
  • InvalidHTTPResponseBody – The response body wasn’t valid JSON
  • InvalidHttpSuccessCode – if the read code isn’t an expected http success code
  • NotFound – If a 404 response code is received
  • NotImplemented – If a 501 response code is received
  • OverLimit – If a 413 response code is received and over_limit is not in the response body
  • RateLimitExceeded – If a 413 response code is received and over_limit is in the response body
  • ServerFault – If a 500 response code is received
  • Unauthorized – If a 401 response code is received
  • UnexpectedContentType – If the content-type of the response isn’t an expect type
  • UnexpectedResponseCode – If a response code above 400 is received and it doesn’t fall into any of the handled checks
  • UnprocessableEntity – If a 422 response code is received and couldn’t be parsed
Returns:

A load balancer object.

update_loadbalancer(lb_id, admin_state_up=None, description=None, name=None, vip_qos_policy_id=None, return_object_only=True)[source]

Update a load balancer.

Parameters:
  • lb_id – The load balancer ID to update.
  • admin_state_up – The administrative state of the resource, which is up (true) or down (false).
  • description – A human-readable description for the resource.
  • name – Human-readable name of the resource.
  • vip_qos_policy_id – The ID of the QoS Policy which will apply to the Virtual IP (VIP).
  • return_object_only – If True, the response returns the object inside the root tag. False returns the full response from the API.
Raises:
  • AssertionError – if the expected_code isn’t a valid http success response code
  • BadRequest – If a 400 response code is received
  • Conflict – If a 409 response code is received
  • Forbidden – If a 403 response code is received
  • Gone – If a 410 response code is received
  • InvalidContentType – If a 415 response code is received
  • InvalidHTTPResponseBody – The response body wasn’t valid JSON
  • InvalidHttpSuccessCode – if the read code isn’t an expected http success code
  • NotFound – If a 404 response code is received
  • NotImplemented – If a 501 response code is received
  • OverLimit – If a 413 response code is received and over_limit is not in the response body
  • RateLimitExceeded – If a 413 response code is received and over_limit is in the response body
  • ServerFault – If a 500 response code is received
  • Unauthorized – If a 401 response code is received
  • UnexpectedContentType – If the content-type of the response isn’t an expect type
  • UnexpectedResponseCode – If a response code above 400 is received and it doesn’t fall into any of the handled checks
  • UnprocessableEntity – If a 422 response code is received and couldn’t be parsed
Returns:

A load balancer object.

update_loadbalancer_dict(lb_id, lb_dict, return_object_only=True)[source]

Update a load balancer using a dictionary.

Example lb_dict:

lb_dict = {'loadbalancer': {'name': 'TEMPEST_TEST_LB_UPDATED'} }
Parameters:
  • lb_id – The load balancer ID to update.
  • lb_dict – A dictionary of elements to update on the load balancer.
  • return_object_only – If True, the response returns the object inside the root tag. False returns the full response from the API.
Raises:
  • AssertionError – if the expected_code isn’t a valid http success response code
  • BadRequest – If a 400 response code is received
  • Conflict – If a 409 response code is received
  • Forbidden – If a 403 response code is received
  • Gone – If a 410 response code is received
  • InvalidContentType – If a 415 response code is received
  • InvalidHTTPResponseBody – The response body wasn’t valid JSON
  • InvalidHttpSuccessCode – if the read code isn’t an expected http success code
  • NotFound – If a 404 response code is received
  • NotImplemented – If a 501 response code is received
  • OverLimit – If a 413 response code is received and over_limit is not in the response body
  • RateLimitExceeded – If a 413 response code is received and over_limit is in the response body
  • ServerFault – If a 500 response code is received
  • Unauthorized – If a 401 response code is received
  • UnexpectedContentType – If the content-type of the response isn’t an expect type
  • UnexpectedResponseCode – If a response code above 400 is received and it doesn’t fall into any of the handled checks
  • UnprocessableEntity – If a 422 response code is received and couldn’t be parsed
Returns:

A load balancer object.

Creative Commons Attribution 3.0 License

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.