Shared References
Configuration
Configuration
- class pypureclient.configuration.Configuration(ssl_ca_cert=None)
This class contains various settings of the API client.
- Parameters
ssl_ca_cert – str - the path to a file of concatenated CA certificates in PEM format.
- __init__(ssl_ca_cert=None) → None
Constructor
- assert_hostname
Set this to True/False to enable/disable SSL hostname verification.
- cert_file
client certificate file
- connection_pool_maxsize
urllib3 connection pool’s maximum number of connections saved per pool. urllib3 uses 1 connection as default value, but this is not the best value when you are making a lot of possibly parallel requests to the same host, which is often the case here. cpu_count * 5 is used as default value to increase performance.
- date_format
date format
- datetime_format
datetime format
- property debug
Debug switch
- key_file
client key file
- logger
Logging Settings
- property logger_file
Debug file location
- logger_file_handler
Log file handler
- property logger_format
Log format
- logger_stream_handler
Log stream handler
- proxy
Proxy URL
- proxy_headers
Proxy headers
- retries
Adding retries to override urllib3 default value 3
- safe_chars_for_path_param
Safe chars for path_param
- socket_options
Options to pass down to the underlying urllib3 socket
- ssl_ca_cert
Set this to customize the certificate file to verify the peer.
- temp_folder_path
Temp file folder for downloading files
- tls_server_name
SSL/TLS Server Name Indication (SNI) Set this to the SNI value expected by the server.
- verify_ssl
SSL/TLS verification Set this to false to skip verifying SSL certificate when calling API from https server.
Properties
Property
- class pypureclient.properties.Property(value)
A Property object models a property of a resource and allows for easy compounding, sorting, and filtering with them. It is converted to a string when calling any API and can also be replaced by a string.
- __add__(other)
The + operator. Create a subproperty.
- __eq__(other)
The == operator. Create a Filter that checks for equality.
- Parameters
other (str, int, bool) – The value to compare to.
- Returns
Filter
- Raises
PureError – If other is not of the proper type.
- __ge__(other)
The >= operator. Create a Filter that checks for greater than or equal.
- Parameters
other (str, int) – The value to compare to.
- Returns
Filter
- Raises
PureError – If other is not of the proper type.
- __getitem__(index)
The [] operator. Create a list Property with the given index.
- Parameters
index (str) – The list index to use.
- Returns
Property
- Raises
PureError – If index is not “all” or “any”.
- __gt__(other)
The > operator. Create a Filter that checks for greater than.
- Parameters
other (str, int) – The value to compare to.
- Returns
Filter
- Raises
PureError – If other is not of the proper type.
- __init__(value)
Initialize a Property.
- Parameters
value (str) – The name of the property.
- __le__(other)
The <= operator. Create a Filter that checks for less than or equal.
- Parameters
other (str, int) – The value to compare to.
- Returns
Filter
- Raises
PureError – If other is not of the proper type.
- __lt__(other)
The < operator. Create a Filter that checks for less than.
- Parameters
other (str, int) – The value to compare to.
- Returns
Filter
- Raises
PureError – If other is not of the proper type.
- __ne__(other)
The != operator. Create a Filter that checks for inequality.
- Parameters
other (str, int, bool) – The value to compare to.
- Returns
Filter
- Raises
PureError – If other is not of the proper type.
- __repr__()
Return the string value of the Property.
- Returns
str
- all()
Create a list Property indexed by “all”.
- Returns
Property
- any()
Create a list Property indexed by “any”.
- Returns
Property
- ascending()
Create a Property that can be sorted in ascending order.
- Returns
Property
- descending()
Create a property that can be sorted in descending order.
- Returns
Property
- exists()
Create a Filter that checks for existance of the given Property.
- Returns
Filter
Filter
- class pypureclient.properties.Filter(operation, operand1, operand2=None)
A Filter object models a filter string by keeping track of operations between Properties, values, and other Filters. It is converted to a string when calling any API and can also be replaced by a string.
- __and__(other)
The & operator. Create a Filter that is the AND of two Filters.
- __init__(operation, operand1, operand2=None)
Initialize a Filter. Should not be used directly. Instead, use the static methods to create Filters.
- Parameters
operation (_Operation) – The operation.
operand1 (any) – The first operand.
operand2 (any, optional) – The second operand, if the operation is binary. Defaults to None.
- __invert__()
The ~ operator. Create a Filter that is the inverse of another Filter.
- Returns
Filter
- __or__(other)
The | operator. Create a Filter that is the OR of two Filters.
- __repr__()
Return the string value of the Filter.
- Returns
str
- static and_(operand1, operand2)
Create a Filter that is the AND of two Filters.
- static contains(operand1, operand2)
Create a Filter that checks for substring containment.
- static eq(operand1, operand2)
Create a Filter that checks for equality.
- static exists(operand1)
Create a Filter that checks for existance of a Property.
- static ge(operand1, operand2)
Create a Filter that checks for greater than or equal.
- static gt(operand1, operand2)
Create a Filter that checks for greater than.
- static in_(operand1, operand2)
Create a Filter that checks if a Property is in a list of values.
- static le(operand1, operand2)
Create a Filter that checks for less than or equal.
- static lt(operand1, operand2)
Create a Filter that checks for less than.
- static ne(operand1, operand2)
Create a Filter that checks for inequality.
- static not_(operand1)
Create a Filter that is the inverse of another Filter.
- static or_(operand1, operand2)
Create a Filter that is the OR of two Filters.
Responses
ResponseHeaders
- class pypureclient.responses.ResponseHeaders(x_request_id, x_ratelimit_limit_second, x_ratelimit_limit_minute, x_ratelimit_remaining_second, x_ratelimit_remaining_minute)
An object that includes headers from the server response.
- __init__(x_request_id, x_ratelimit_limit_second, x_ratelimit_limit_minute, x_ratelimit_remaining_second, x_ratelimit_remaining_minute)
Initialize a ResponseHeaders.
- Parameters
x_request_id (str) – The X-Request-ID from the client or generated by the server.
x_ratelimit_limit_second (int) – The number of requests available per second.
x_ratelimit_limit_minute (int) – The number of requests available per minute.
x_ratelimit_remaining_second (int) – The number of requests remaining in that second.
x_ratelimit_remaining_minute (int) – The number of requests remaining in that minute.
- __repr__()
Return a pretty formatted string of the object.
- Returns
str
- to_dict()
Return a dictionary of the class attributes.
- Returns
dict
ValidResponse
- class pypureclient.responses.ValidResponse(status_code, continuation_token, total_item_count, items, headers, total=None, more_items_remaining=None, errors=None)
A response that indicates the request was successful and has the returned data.
- __init__(status_code, continuation_token, total_item_count, items, headers, total=None, more_items_remaining=None, errors=None)
Initialize a ValidResponse.
- Parameters
status_code (int) – The HTTP status code.
continuation_token (str) – An opaque token to iterate over a collection of resources. May be None.
total_item_count (int) – The total number of items available in the collection.
items (ItemIterator) – An iterator over the items in the collection.
headers (dict) – Response headers from the server.
- __repr__()
Return a pretty formatted string of the object. Does not convert the items to a list of items by using the iterator.
- Returns
str
- to_dict()
Return a dictionary of the class attributes. It will convert the items to a list of items by exhausting the iterator. If any items were previously iterated, they will be missed.
- Returns
dict
ApiError
- class pypureclient.responses.ApiError(context, message, location_context=None)
An object that models the error response from the server.
- __init__(context, message, location_context=None)
Initialize an ApiError.
- Parameters
context (str) – The context in which the error occurred.
message (str) – The error message.
location_context (str) – The execution context where the error occurred.
- __repr__()
Return a pretty formatted string of the object.
- Returns
str
- to_dict()
Return a dictionary of the class attributes.
- Returns
dict
ErrorResponse
- class pypureclient.responses.ErrorResponse(status_code, errors, headers)
A response that indicates there was an error with the request and has the list of errors.
- __init__(status_code, errors, headers)
Initialize an ErrorResponse.
- Parameters
status_code (int) – The HTTP status code.
errors (list[ApiError]) – The list of errors encountered.
headers (dict) – Response headers from the server.
- __repr__()
Return a pretty formatted string of the object.
- Returns
str
- to_dict()
Return a dictionary of the class attributes.
- Returns
dict
References
ReferenceType
- pydantic model pypureclient.reference_type.ReferenceType(*, id: Optional[StrictStr] = None, name: Optional[StrictStr] = None)
It’s used for reference arg on api function. This allows user to pass collections of Model objects to the method without transforming them to ids or names.
- field id: Optional[StrictStr] = None
A globally unique, system-generated ID. The ID cannot be modified.
- field name: Optional[StrictStr] = None
The resource name, such as volume name, pod name, snapshot name, and so on.
Errors
PureError
- class pypureclient.exceptions.PureError(reason=None)
Exception type raised by Pure Storage code.