netapp.santricity package

Subpackages

Submodules

netapp.santricity.api_client module

The Clear BSD License

Copyright (c) – 2016, NetApp, Inc. All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted (subject to the limitations in the disclaimer below) provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  • Neither the name of NetApp, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY’S PATENT RIGHTS ARE GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

class netapp.santricity.api_client.ApiClient(host=None, header_name=None, header_value=None, cookie=None, context_path='/devmgr/v2')[source]

Bases: object

Generic API client for Swagger client library builds.

Swagger generic API client. This client handles the client- server communication, and is invariant across implementations. Specifics of the methods and models for each application are generated from the Swagger templates.

NOTE: This class is auto generated by the swagger code generator program. Ref: https://github.com/swagger-api/swagger-codegen Do not edit the class manually.

Parameters:
  • host – The base path for the server to call.
  • header_name – a header to pass when making calls to the API.
  • header_value – a header value to pass when making calls to the API.
call_api(resource_path, method, path_params=None, query_params=None, header_params=None, body=None, post_params=None, files=None, response_type=None, auth_settings=None, callback=None)[source]

Makes the HTTP request (synchronous) and return the deserialized data. To make an async request, define a function for callback.

Parameters:
  • resource_path – Path to method endpoint.
  • method – Method to call.
  • path_params – Path parameters in the url.
  • query_params – Query parameters in the url.
  • header_params – Header parameters to be placed in the request header.
  • body – Request body.
  • dict (files) – Request post form parameters, for application/x-www-form-urlencoded, multipart/form-data.
  • list (auth_settings) – Auth Settings names for the request.
  • response – Response data type.
  • dict – key -> filename, value -> filepath, for multipart/form-data.
  • function (callback) – Callback function for asynchronous request. If provide this parameter, the request will be called asynchronously.
Returns:

If provide parameter callback, the request will be called asynchronously. The method will return the request thread. If parameter callback is None, then the method will return the response directly.

deserialize(response, response_type)[source]

Deserializes response into an object.

Parameters:
  • response – RESTResponse object to be deserialized.
  • response_type – class literal for deserialzied object, or string of class name.
Returns:

deserialized object.

prepare_post_parameters(post_params=None, files=None)[source]

Builds form parameters.

Parameters:
  • post_params – Normal form parameters.
  • files – File parameters.
Returns:

Form parameters with files.

request(method, url, query_params=None, headers=None, post_params=None, body=None)[source]

Makes the HTTP request using RESTClient.

sanitize_for_serialization(obj)[source]

Builds a JSON POST object.

If obj is None, return None. If obj is str, int, float, bool, return directly. If obj is datetime.datetime, datetime.date

convert to string in iso8601 format.

If obj is list, sanitize each element in the list. If obj is dict, return the dict. If obj is swagger model, return the properties dict.

Parameters:obj – The data to serialize.
Returns:The serialized form of data.
select_header_accept(accepts)[source]

Returns Accept based on an array of accepts provided.

Parameters:accepts – List of headers.
Returns:Accept (e.g. application/json).
select_header_content_type(content_types)[source]

Returns Content-Type based on an array of content_types provided.

Parameters:content_types – List of content-types.
Returns:Content-Type (e.g. application/json).
set_default_header(header_name, header_value)[source]
to_path_value(obj)[source]

Takes value and turn it into a string suitable for inclusion in the path, by url-encoding.

Parameters:obj – object or string value.
Return string:quoted value.
update_params_for_auth(headers, querys, auth_settings)[source]

Updates header and query params based on authentication setting.

Parameters:
  • headers – Header parameters dict to be updated.
  • querys – Query parameters dict to be updated.
  • auth_settings – Authentication setting identifiers list.
user_agent

Gets user agent.

netapp.santricity.configuration module

The Clear BSD License

Copyright (c) – 2016, NetApp, Inc. All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted (subject to the limitations in the disclaimer below) provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  • Neither the name of NetApp, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY’S PATENT RIGHTS ARE GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

netapp.santricity.configuration.Configuration()[source]
netapp.santricity.configuration.singleton(cls, *args, **kw)[source]

netapp.santricity.rest module

The Clear BSD License

Copyright (c) – 2016, NetApp, Inc. All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted (subject to the limitations in the disclaimer below) provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  • Neither the name of NetApp, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY’S PATENT RIGHTS ARE GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

exception netapp.santricity.rest.ApiException(status=None, reason=None, http_resp=None)[source]

Bases: exceptions.Exception

class netapp.santricity.rest.RESTClientObject(pools_size=4)[source]

Bases: object

DELETE(url, headers=None, query_params=None)[source]
GET(url, headers=None, query_params=None)[source]
HEAD(url, headers=None, query_params=None)[source]
OPTIONS(url, headers=None, query_params=None, post_params=None, body=None)[source]
PATCH(url, headers=None, query_params=None, post_params=None, body=None)[source]
POST(url, headers=None, query_params=None, post_params=None, body=None)[source]
PUT(url, headers=None, query_params=None, post_params=None, body=None)[source]
request(method, url, query_params=None, headers=None, body=None, post_params=None)[source]
Parameters:
  • method – http request method
  • url – http request url
  • query_params – query parameters in the url
  • headers – http request headers
  • body – request json body, for application/json
  • post_params – request post parameters, application/x-www-form-urlencode and multipart/form-data
class netapp.santricity.rest.RESTResponse(resp)[source]

Bases: io.IOBase

getheader(name, default=None)[source]

Returns a given response header.

getheaders()[source]

Returns a dictionary of the response headers.

Module contents