Shared References

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.

Parameters

other (Property) – The Property to be the subproperty of the given Property.

Returns

Property

Raises

PureError – If other is not of the proper type.

__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

subproperty(other)

Create a subproperty.

Parameters

other (Property) – The Property to be the subproperty of the given Property.

Returns

Property

Raises

PureError – If other is not of the proper type.

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.

Parameters

other (Filter) – The Filter to AND.

Returns

Filter

Raises

PureError – If other is not of the proper type.

__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.

Parameters

other (Filter) – The Filter to OR.

Returns

Filter

Raises

PureError – If other is not of the proper type.

__repr__()

Return the string value of the Filter.

Returns

str

static and_(operand1, operand2)

Create a Filter that is the AND of two Filters.

Parameters
  • operand1 (Filter) – The first Filter.

  • operand2 (Filter) – The second Filter.

Returns

Filter

Raises

PureError – If either operand is not of the proper type.

static contains(operand1, operand2)

Create a Filter that checks for substring containment.

Parameters
  • operand1 (Property, str) – The Property to check.

  • operand2 (str) – The value to check for.

Returns

Filter

Raises

PureError – If either operand is not of the proper type.

static eq(operand1, operand2)

Create a Filter that checks for equality.

Parameters
  • operand1 (Property, str) – The Property to compare.

  • operand2 (str, int, bool) – The value to compare to.

Returns

Filter

Raises

PureError – If either operand is not of the proper type.

static exists(operand1)

Create a Filter that checks for existance of a Property.

Parameters

operand1 (Property, str) – The Property to check for.

Returns

Filter

Raises

PureError – If the operand is not of the proper type.

static ge(operand1, operand2)

Create a Filter that checks for greater than or equal.

Parameters
  • operand1 (Property, str) – The Property to compare.

  • operand2 (str, int) – The value to compare to.

Returns

Filter

Raises

PureError – If either operand is not of the proper type.

static gt(operand1, operand2)

Create a Filter that checks for greater than.

Parameters
  • operand1 (Property, str) – The Property to compare.

  • operand2 (str, int) – The value to compare to.

Returns

Filter

Raises

PureError – If either operand is not of the proper type.

static in_(operand1, operand2)

Create a Filter that checks if a Property is in a list of values.

Parameters
  • operand1 (Property, str) – The Property to check.

  • operand2 (list[str], list[int]) – The list of values.

Returns

Filter

Raises

PureError – If either operand is not of the proper type.

static le(operand1, operand2)

Create a Filter that checks for less than or equal.

Parameters
  • operand1 (Property, str) – The Property to compare.

  • operand2 (str, int) – The value to compare to.

Returns

Filter

Raises

PureError – If either operand is not of the proper type.

static lt(operand1, operand2)

Create a Filter that checks for less than.

Parameters
  • operand1 (Property, str) – The Property to compare.

  • operand2 (str, int) – The value to compare to.

Returns

Filter

Raises

PureError – If either operand is not of the proper type.

static ne(operand1, operand2)

Create a Filter that checks for inequality.

Parameters
  • operand1 (Property, str) – The Property to compare.

  • operand2 (str, int, bool) – The value to compare to.

Returns

Filter

Raises

PureError – If either operand is not of the proper type.

static not_(operand1)

Create a Filter that is the inverse of another Filter.

Parameters

operand1 (Filter) – The Filter to invert.

Returns

Filter

Raises

PureError – If the operand is not of the proper type.

static or_(operand1, operand2)

Create a Filter that is the OR of two Filters.

Parameters
  • operand1 (Filter) – The first Filter.

  • operand2 (Filter) – The second Filter.

Returns

Filter

Raises

PureError – If either operand is not of the proper type.

static tags(operand1, operand2)

Create a Filter that checks for a key-value tag.

Parameters
  • operand1 (str) – The key of the tag.

  • operand2 (str) – The value of the tag.

Returns

Filter

Raises

PureError – If either operand is not of the proper type.

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.