### Install py-pure-client using pip Source: https://code.purestorage.com/py-pure-client/installation.html Use this command to install the library directly from the Python Package Index. This is the recommended method for most users. ```bash pip install py-pure-client ``` -------------------------------- ### Manually install py-pure-client from source Source: https://code.purestorage.com/py-pure-client/installation.html Follow these steps to clone the repository, install dependencies, and build the library from its source code. This method is useful for developers contributing to the project or needing the latest unreleased changes. ```bash git clone https://github.com/PureStorage-OpenConnect/py-pure-client.git cd py-pure-client pip install -r requirements.txt python setup.py install ``` -------------------------------- ### InstallAddress Source: https://code.purestorage.com/py-pure-client/pure1_reference.html Represents the installation address of a device. ```APIDOC ## InstallAddress ### Description Represents the installation address of a device. ### Fields - **geolocation** (Optional[Geolocation]): The geolocation containing the latitude and longitude of the address. - **street_address** (Optional[StrictStr]): The 1-line format street address of the array install address. - **updated** (Optional[StrictInt]): The epoch timestamp, in milliseconds, that denotes when the address was updated. ``` -------------------------------- ### Get Volume by Name Source: https://code.purestorage.com/py-pure-client/quick_start.html Retrieves a specific volume by its name. ```python response = client.get_volumes(names='volume1') volume = list(response.items)[0] ``` -------------------------------- ### Get Hardware Source: https://code.purestorage.com/py-pure-client/pure1_reference.html Retrieves information about hardware components. This method allows querying for specific hardware using references, IDs, or names, with options for filtering, sorting, and pagination. ```APIDOC ## GET /api/1.5/hardware ### Description Retrieves information about hardware components. ### Method GET ### Endpoint /api/1.5/hardware ### Parameters #### Query Parameters - **references** (ReferenceType or List[ReferenceType], optional) - A list of references to query for. Overrides ids and names keyword arguments. - **authorization** (str) - Deprecated. Please use Client level authorization - **x_request_id** (str) - Supplied by client during request or generated by server. - **continuation_token** (str) - An opaque token used to iterate over a collection. The token to use on the next request is returned in the continuation_token field of the result. Single quotes are required around all strings. - **filter** (Union[str, Filter], optional) - Exclude resources that don’t match the specified criteria. Single quotes are required around all strings inside the filters. - **ids** (List[str], optional) - A comma-separated list of hardware IDs. If there is not at least one resource that matches each id element, an error is returned. Single quotes are required around all strings. - **limit** (int, optional) - Limit the size of the response to the specified number of resources. A limit of 0 can be used to get the number of resources without getting all of the resources. It will be returned in the total_item_count field. If a client asks for a page size larger than the maximum number, the request is still valid. In that case the server just returns the maximum number of items, disregarding the client’s page size request. If not specified, defaults to 1000. - **names** (List[str], optional) - A comma-separated list of hardware names. If there is not at least one resource that matches each name element, an error is returned. Single quotes are required around all strings. - **offset** (int, optional) - The offset of the first resource to return from a collection. - **sort** (List[str], optional) - Sort the response by the specified fields (in descending order if ‘-’ is appended to the field name). If you provide a sort you will not get a continuation token in the response. - **_preload_content** (bool, optional) - if False, the ApiResponse.data will be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. - **_return_http_data_only** (bool, optional) - response data instead of ApiResponse object with status code, headers, etc - **_request_timeout** (int or (float, float), optional) - timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. ### Response #### Success Response (200) - **id** (str) - The unique identifier for the hardware component. - **name** (str) - The name of the hardware component. - **model** (str) - The model of the hardware component. - **serial_number** (str) - The serial number of the hardware component. - **status** (str) - The current status of the hardware component. - **created** (str) - The timestamp when the hardware component was created. - **last_modified** (str) - The timestamp when the hardware component was last modified. #### Response Example { "id": "123e4567-e89b-12d3-a456-426614174000", "name": "Chassis-1", "model": "FlashArray X70", "serial_number": "FA7-1234567", "status": "online", "created": "2023-10-27T10:00:00Z", "last_modified": "2023-10-27T10:00:00Z" } ``` -------------------------------- ### Configure Pure1 Client with Environment Variables Source: https://code.purestorage.com/py-pure-client/quick_start.html Configure Pure1 client authentication using environment variables for private key file, password, and app ID. This method is recommended for Pure1 client instantiation. ```bash $ export PURE1_PRIVATE_KEY_FILE=[...] $ export PURE1_PRIVATE_KEY_PASSWORD=[...] $ export PURE1_APP_ID=[...] ``` -------------------------------- ### Instantiate FlashBlade Client with Key Files Source: https://code.purestorage.com/py-pure-client/quick_start.html Instantiate a FlashBlade client using authentication parameters like private key file, password, username, client ID, key ID, and issuer. ```python from pypureclient import flashblade client = flashblade.Client('flashblade.example.com', private_key_file=[...], private_key_password=[...], username=[...], client_id=[...], key_id=[...], issuer=[...]) ``` -------------------------------- ### Get Volume by ID Source: https://code.purestorage.com/py-pure-client/quick_start.html Retrieves a specific volume using its unique identifier. ```python response = client.get_volumes(ids='f0510daa-cec8-4544-8015-206d819b3') volume = list(response.items)[0] ``` -------------------------------- ### Instantiate FlashArray Client with Key Files Source: https://code.purestorage.com/py-pure-client/quick_start.html Instantiate a FlashArray client using authentication parameters like private key file, password, username, client ID, key ID, and issuer. ```python from pypureclient import flasharray client = flasharray.Client('flasharray.example.com', private_key_file=[...], private_key_password=[...], username=[...], client_id=[...], key_id=[...], issuer=[...]) ``` -------------------------------- ### Instantiate Pure1 Client Directly Source: https://code.purestorage.com/py-pure-client/quick_start.html Instantiate a Pure1 client by passing authentication parameters directly into the constructor, including private key file, password, and app ID. ```python from pypureclient import pure1 client = pure1.Client(private_key_file=[...], private_key_password=[...], app_id=[...]) ``` -------------------------------- ### Get Multiple Volumes by Names Source: https://code.purestorage.com/py-pure-client/quick_start.html Retrieves a list of volumes specified by their names. ```python response = client.get_volumes(names=['volume1', 'volume2']) volumes = list(response.items) ``` -------------------------------- ### Use Models as Function Arguments (Pure1 Client) Source: https://code.purestorage.com/py-pure-client/quick_start.html Shows how to use models as arguments for client functions, specifically demonstrating fetching arrays related to a volume. This functionality is available on the Pure1 client only. ```python response = client.get_volumes() volume1 = list(response.items)[0] # This works on the Pure1 client only response = client.get_arrays(volume1.arrays) response = client.get_arrays(ids=[array.id for array in volume1.arrays]) # both make the same request ``` -------------------------------- ### Get Ports Source: https://code.purestorage.com/py-pure-client/pure1_reference.html Retrieves information about FlashArray ports. Supports filtering, sorting, and pagination. ```APIDOC ## GET /api/1.5/ports ### Description Retrieves information about FlashArray ports. ### Method GET ### Endpoint /api/1.5/ports ### Parameters #### Query Parameters - **filter** (Union[str, Filter]) - Optional - Exclude resources that don’t match the specified criteria. Single quotes are required around all strings inside the filters. - **limit** (int) - Optional - Limit the size of the response to the specified number of resources. Defaults to 1000. - **member_ids** (List[str]) - Optional - A comma-separated list of member IDs. Single quotes are required around all strings. - **member_names** (List[str]) - Optional - A comma-separated list of member names. Single quotes are required around all strings. - **offset** (int) - Optional - The offset of the first resource to return from a collection. - **policy_ids** (List[str]) - Optional - A comma-separated list of policy IDs. Single quotes are required around all strings. - **policy_names** (List[str]) - Optional - A comma-separated list of policy names. Single quotes are required around all strings. - **sort** (List[str]) - Optional - Sort the response by the specified fields (in descending order if ‘-’ is appended to the field name). - **_preload_content** (bool) - Optional - If False, the ApiResponse.data will be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. - **_return_http_data_only** (bool) - Optional - Response data instead of ApiResponse object with status code, headers, etc. - **_request_timeout** (int or Tuple[float, float]) - Optional - Timeout setting for this request. ### Response #### Success Response (200) - **ValidResponse** - If the call was successful. #### Error Response - **ErrorResponse** - If the call was not successful. ### Raises - **PureError** - If calling the API fails. - **ValueError** - If a parameter is of an invalid type. - **TypeError** - If invalid or missing parameters are used. ``` -------------------------------- ### Get Volume Snapshots Source: https://code.purestorage.com/py-pure-client/pure1_reference.html Retrieves information about snapshots of volumes. Supports filtering, sorting, and pagination. ```APIDOC ## GET /volume_snapshots ### Description Retrieves information about snapshots of volumes. ### Method GET ### Endpoint /volume_snapshots ### Parameters #### Query Parameters - **sources** (ReferenceType or List[ReferenceType]) - Optional - A list of sources to query for. Overrides source_ids and source_names keyword arguments. - **references** (ReferenceType or List[ReferenceType]) - Optional - A list of references to query for. Overrides ids and names keyword arguments. - **authorization** (str) - Deprecated. Please use Client level authorization. - **x_request_id** (str) - Optional - Supplied by client during request or generated by server. - **continuation_token** (str) - Optional - An opaque token used to iterate over a collection. The token to use on the next request is returned in the continuation_token field of the result. Single quotes are required around all strings. - **filter** (Union[str, Filter]) - Optional - Exclude resources that don’t match the specified criteria. Single quotes are required around all strings inside the filters. - **ids** (List[str]) - Optional - A comma-separated list of resource IDs. If there is not at least one resource that matches each id element, an error is returned. Single quotes are required around all strings. - **limit** (int) - Optional - Limit the size of the response to the specified number of resources. A limit of 0 can be used to get the number of resources without getting all of the resources. It will be returned in the total_item_count field. If a client asks for a page size larger than the maximum number, the request is still valid. In that case the server just returns the maximum number of items, disregarding the client’s page size request. If not specified, defaults to 1000. - **names** (List[str]) - Optional - A comma-separated list of resource names. If there is not at least one resource that matches each name element, an error is returned. Single quotes are required around all strings. - **offset** (int) - Optional - The offset of the first resource to return from a collection. - **sort** (List[str]) - Optional - Sort the response by the specified fields (in descending order if ‘-’ is appended to the field name). If you provide a sort you will not get a continuation token in the response. - **source_ids** (List[str]) - Optional - A comma-separated list of ids for the source of the object. If there is not at least one resource that matches each source_id element, an error is returned. Single quotes are required around all strings. - **source_names** (List[str]) - Optional - A comma-separated list of names for the source of the object. If there is not at least one resource that matches each source_name element, an error is returned. Single quotes are required around all strings. - **_preload_content** (bool) - Optional - if False, the ApiResponse.data will be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. - **_return_http_data_only** (bool) - Optional - response data instead of ApiResponse object with status code, headers, etc - **_request_timeout** (int or (float, float)) - Optional - timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. ### Response #### Success Response (200) - **ValidResponse**: If the call was successful. - **ErrorResponse**: If the call was not successful. ### Raises - **PureError**: If calling the API fails. - **ValueError**: If a parameter is of an invalid type. - **TypeError**: If invalid or missing parameters are used. ``` -------------------------------- ### Initialize Pure1 Client Source: https://code.purestorage.com/py-pure-client/pure1_reference.html Initialize a Pure1 Client instance. Various parameters can be configured, including API version, authentication details (App ID, ID token, private key), retry attempts, timeouts, and configuration objects. Defaults are used if parameters are not explicitly provided. ```python pypureclient.pure1.client.Client(_version : str = '1.5'_, _app_id : Optional[str] = None_, _id_token : Optional[str] = None_, _private_key_file : Optional[str] = None_, _private_key_password : Optional[str] = None_, _retries : int = 5_, _timeout : Union[int, Tuple[float, float]] = 15.0_, _configuration : Optional[Configuration] = None_, _model_attribute_error_on_none : bool = True_) ``` -------------------------------- ### Get Protection Group Snapshots Transfer Source: https://code.purestorage.com/py-pure-client/pure1_reference.html Retrieves information about snapshots of protection groups with transfer statistics. ```APIDOC ## GET /protection_group_snapshots/transfer ### Description Get protection group snapshots with transfer statistics. Retrieves information about snapshots of protection groups. ### Method GET ### Endpoint /protection_group_snapshots/transfer ### Parameters #### Query Parameters - **sort** (List[str]) - Optional - Sort the response by the specified fields (in descending order if ‘-’ is appended to the field name). If you provide a sort you will not get a continuation token in the response. - **source_ids** (List[str]) - Optional - A comma-separated list of ids for the source of the object. If there is not at least one resource that matches each source_id element, an error is returned. Single quotes are required around all strings. - **source_names** (List[str]) - Optional - A comma-separated list of names for the source of the object. If there is not at least one resource that matches each source_name element, an error is returned. Single quotes are required around all strings. - **_preload_content** (bool) - Optional - if False, the ApiResponse.data will be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. - **_return_http_data_only** (bool) - Optional - response data instead of ApiResponse object with status code, headers, etc - **_request_timeout** (int or Tuple[float, float]) - Optional - timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - **sources** (ReferenceType or List[ReferenceType]) - Optional - A list of sources to query for. Overrides source_ids and source_names keyword arguments. - **references** (ReferenceType or List[ReferenceType]) - Optional - A list of references to query for. Overrides ids and names keyword arguments. - **authorization** (str) - Deprecated. Please use Client level authorization - **x_request_id** (str) - Supplied by client during request or generated by server. - **continuation_token** (str) - Optional - An opaque token used to iterate over a collection. The token to use on the next request is returned in the continuation_token field of the result. Single quotes are required around all strings. - **filter** (Union[str, Filter]) - Optional - Exclude resources that don’t match the specified criteria. Single quotes are required around all strings inside the filters. - **ids** (List[str]) - Optional - A comma-separated list of resource IDs. If there is not at least one resource that matches each id element, an error is returned. Single quotes are required around all strings. - **limit** (int) - Optional - Limit the size of the response to the specified number of resources. A limit of 0 can be used to get the number of resources without getting all of the resources. It will be returned in the total_item_count field. If a client asks for a page size larger than the maximum number, the request is still valid. In that case the server just returns the maximum number of items, disregarding the client’s page size request. If not specified, defaults to 1000. - **names** (List[str]) - Optional - A comma-separated list of resource names. If there is not at least one resource that matches each name element, an error is returned. Single quotes are required around all strings. - **offset** (int) - Optional - The offset of the first resource to return from a collection. ### Response #### Success Response (200) - **ValidResponse**: If the call was successful. - **ErrorResponse**: If the call was not successful. ### Raises - **PureError**: If calling the API fails. - **ValueError**: If a parameter is of an invalid type. - **TypeError**: If invalid or missing parameters are used. ``` -------------------------------- ### Import FlashBlade Submodule Source: https://code.purestorage.com/py-pure-client/quick_start.html Import the flashblade submodule from pypureclient to begin. ```python from pypureclient import flashblade ``` -------------------------------- ### Instantiate FlashBlade Client with API Token Source: https://code.purestorage.com/py-pure-client/quick_start.html Instantiate a FlashBlade client using an API token generated via pureadmin. ```python from pypureclient import flashblade client = flashblade.Client('flashblade.example.com', api_token=[...]) ``` -------------------------------- ### Get Array Tags Source: https://code.purestorage.com/py-pure-client/pure1_reference.html Retrieves the tags associated with specified arrays. Supports filtering, sorting, and pagination. ```APIDOC ## GET /arrays/tags ### Description Retrieves the tags associated with specified arrays. ### Method GET ### Endpoint /arrays/tags ### Parameters #### Query Parameters - **resources** (List[ReferenceType], optional) - A list of resources to query for. Overrides resource_ids and resource_names keyword arguments. - **authorization** (str) - Deprecated. Please use Client level authorization - **x_request_id** (str) - Supplied by client during request or generated by server. - **continuation_token** (str) - An opaque token used to iterate over a collection. The token to use on the next request is returned in the continuation_token field of the result. Single quotes are required around all strings. - **filter** (Union[str, Filter]) - Exclude resources that don’t match the specified criteria. Single quotes are required around all strings inside the filters. - **keys** (List[str]) - A comma-separated list of tag keys. Single quotes are required around all strings. - **limit** (int, optional) - Limit the size of the response to the specified number of resources. Defaults to 1000. - **namespaces** (List[str]) - A comma-separated list of namespaces. Single quotes are required around all strings. - **offset** (int) - The offset of the first resource to return from a collection. ### Response #### Success Response (200) - **ValidResponse** - If the call was successful. #### Error Response - **ErrorResponse** - If the call was not successful. ### Raises - **PureError**: If calling the API fails. - **ValueError**: If a parameter is of an invalid type. - **TypeError**: If invalid or missing parameters are used. ``` -------------------------------- ### Get Subscription Licenses Source: https://code.purestorage.com/py-pure-client/pure1_reference.html Retrieves information about Pure1 subscription licenses. This method allows filtering and sorting of results. ```APIDOC ## GET /api/1.5/subscriptions/{subscription_id}/licenses ### Description Retrieves information about Pure1 subscription licenses. ### Method GET ### Endpoint /api/1.5/subscriptions/{subscription_id}/licenses ### Parameters #### Query Parameters - **limit** (int) - Optional - Limit the size of the response to the specified number of resources. A limit of 0 can be used to get the number of resources without getting all of the resources. It will be returned in the total_item_count field. If a client asks for a page size larger than the maximum number, the request is still valid. In that case the server just returns the maximum number of items, disregarding the client’s page size request. If not specified, defaults to 1000. - **names** (List[str]) - Optional - A comma-separated list of resource names. If there is not at least one resource that matches each name element, an error is returned. Single quotes are required around all strings. - **offset** (int) - Optional - The offset of the first resource to return from a collection. - **sort** (List[str]) - Optional - Sort the response by the specified fields (in descending order if ‘-’ is appended to the field name). If you provide a sort you will not get a continuation token in the response. - **subscription_ids** (List[str]) - Optional - A comma-separated list of subscription IDs. If there is not at least one resource that matches each subscription.id element, an error is returned. Single quotes are required around all strings. - **subscription_names** (List[str]) - Optional - A comma-separated list of subscription names. If there is not at least one resource that matches each subscription.name element, an error is returned. Single quotes are required around all strings. - **_preload_content** (bool) - Optional - if False, the ApiResponse.data will be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. - **_return_http_data_only** (bool) - Optional - response data instead of ApiResponse object with status code, headers, etc - **_request_timeout** (int or (float, float)) - Optional - timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. ### Response #### Success Response (200) - **ValidResponse**: If the call was successful. #### Error Response - **ErrorResponse**: If the call was not successful. ### Raises - **PureError**: If calling the API fails. - **ValueError**: If a parameter is of an invalid type. - **TypeError**: If invalid or missing parameters are used. ``` -------------------------------- ### Instantiate Pure1 Client with ID Token Source: https://code.purestorage.com/py-pure-client/quick_start.html Instantiate a Pure1 client using a pre-generated ID token. Note that the client will fail upon ID token expiration. ```python client = pure1.Client(id_token=[...]) ``` -------------------------------- ### Get Protection Group Snapshots Source: https://code.purestorage.com/py-pure-client/pure1_reference.html Retrieves information about snapshots of protection groups. This method allows filtering and sorting of results. ```APIDOC ## GET /protectiongroups/snapshots ### Description Retrieves information about snapshots of protection groups. ### Method GET ### Endpoint /protectiongroups/snapshots ### Parameters #### Query Parameters - **limit** (int) - Optional - Limit the size of the response to the specified number of resources. Defaults to 1000. - **names** (List[str]) - Optional - A comma-separated list of resource names. Single quotes are required around all strings. - **offset** (int) - Optional - The offset of the first resource to return from a collection. - **sort** (List[str]) - Optional - Sort the response by the specified fields (in descending order if ‘-’ is appended to the field name). - **_preload_content** (bool) - Optional - If False, the ApiResponse.data will be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. - **_return_http_data_only** (bool) - Optional - Response data instead of ApiResponse object with status code, headers, etc. - **_request_timeout** (int or tuple(float, float)) - Optional - Timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (connection, read) timeouts. #### Request Body None ### Response #### Success Response (200) - **ValidResponse**: If the call was successful. #### Error Response - **ErrorResponse**: If the call was not successful. ### Raises - **PureError**: If calling the API fails. - **ValueError**: If a parameter is of an invalid type. - **TypeError**: If invalid or missing parameters are used. ``` -------------------------------- ### Client Initialization Source: https://code.purestorage.com/py-pure-client/pure1_reference.html Initializes a Pure1 Client for making REST API calls. Configuration can be provided directly or via environment variables. ```APIDOC ## Client Initialization ### Description Initialize a Pure1 Client. ### Parameters * **configuration** (_Configuration_) – configuration object * **app_id** (_str_, optional) – The registered App ID for Pure1 to use. Defaults to the set environment variable under PURE1_APP_ID. * **id_token** (_str_, optional) – The ID token to use. Overrides given App ID and private key. Defaults to environment variable set under PURE1_ID_TOKEN. * **private_key_file** (_str_, optional) – The path of the private key to use. Defaults to the set environment variable under PURE1_PRIVATE_KEY_FILE. * **private_key_password** (_str_, optional) – The password of the private key, if encrypted. Defaults to the set environment variable under PURE1_PRIVATE_KEY_PASSWORD. Defaults to None. * **retries** (_int_, optional) – The number of times to retry an API call if it failed for a non-blocking reason. Defaults to 5. * **timeout** (_float_ or (_float_, _float_), optional) – The timeout duration in seconds, either in total time or (connect and read) times. Defaults to 15.0 total. * **user_agent** (_str_, optional) – User-Agent request header to use. ### Raises **PureError** – If it could not create an ID or access token ``` -------------------------------- ### Instantiate FlashBlade Client with User Agent Source: https://code.purestorage.com/py-pure-client/quick_start.html Instantiate a FlashBlade client with an API token and a user agent string for integration identification. The user agent should be a unique, human-readable string identifying your integration. ```python from pypureclient import flashblade client = flashblade.Client('flashblade.example.com', api_token=[...], user_agent='YourCompanyName_YourProductIntegrationName/YourIntegrationVersion') ``` -------------------------------- ### Get Metrics History Source: https://code.purestorage.com/py-pure-client/pure1_reference.html Retrieves historical metric data for specified resources. Supports batching for multiple time series. ```APIDOC ## GET /metrics/history ### Description Retrieves historical metric data for resources. This endpoint supports batching: Up to 32 time series can be retrieved in one call. It can be multiple metrics for one resource, (e.g., load and bandwidth for one array - 2 time series), one metric for multiple resource (e.g., load for arrayA and arrayB - 2 time series), or a combination of both, multiple metrics for multiple resources, (e.g., load and bandwidth for arrayA and arrayB - 4 time series). ### Method GET ### Endpoint /metrics/history ### Parameters #### Query Parameters - **aggregation** (str) - Required - Aggregation needed on the metric data. Valid values are avg and max. Single quotes are required around all strings. Latency metrics averages are weighted by the IOPS. - **end_time** (int) - Required - Timestamp of when the time window ends. Measured in milliseconds since the UNIX epoch. - **resolution** (int) - Required - The duration of time between individual data points, in milliseconds. - **start_time** (int) - Required - Timestamp of when the time window starts. Measured in milliseconds since the UNIX epoch. - **resources** (ReferenceType or List[ReferenceType]) - Optional - A list of resources to query for. Overrides resource_ids and resource_names keyword arguments. - **references** (ReferenceType or List[ReferenceType]) - Optional - A list of references to query for. Overrides ids and names keyword arguments. - **authorization** (str) - Optional - Deprecated. Please use Client level authorization - **x_request_id** (str) - Optional - Supplied by client during request or generated by server. - **ids** (List[str]) - Optional - REQUIRED: either ids or names. A comma-separated list of object IDs. If there is not at least one resource that matches each id element, an error is returned. Single quotes are required around all strings. - **names** (List[str]) - Optional - REQUIRED: either names or ids. A comma-separated list of resource names. If there is not at least one resource that matches each name element, an error is returned. Single quotes are required around all strings. - **resource_ids** (List[str]) - Optional - REQUIRED: either resource_ids or resource_names. A comma-separated list of resource IDs. If there is not at least one resource that matches each resource_id element, an error is returned. Single quotes are required around all strings. - **resource_names** (List[str]) - Optional - REQUIRED: either resource_ids or resource_names. A comma-separated list of resource names. If there is not at least one resource that matches each resource_name element, an error is returned. Single quotes are required around all strings. - **_preload_content** (bool) - Optional - if False, the ApiResponse.data will be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. - **_return_http_data_only** (bool) - Optional - response data instead of ApiResponse object with status code, headers, etc - **_request_timeout** (int or (float, float)) - Optional - timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. ### Response #### Success Response (200) - **ValidResponse** - If the call was successful. #### Error Response - **ErrorResponse** - If the call was not successful. ### Raises - **PureError**: If calling the API fails. - **ValueError**: If a parameter is of an invalid type. - **TypeError**: If invalid or missing parameters are used. ``` -------------------------------- ### Get Invoices Source: https://code.purestorage.com/py-pure-client/pure1_reference.html Retrieves information about Pure1 subscription invoices. This method allows filtering, sorting, and pagination of invoice data. ```APIDOC ## GET /invoices ### Description Retrieves information about Pure1 subscription invoices. ### Method GET ### Endpoint /invoices ### Parameters #### Query Parameters - **subscriptions** (ReferenceType or List[ReferenceType], optional) - A list of subscriptions to query for. Overrides subscription_ids and subscription_names keyword arguments. - **references** (ReferenceType or List[ReferenceType], optional) - A list of references to query for. Overrides ids keyword argument. - **authorization** (str) - Deprecated. Please use Client level authorization. - **x_request_id** (str) - Supplied by client during request or generated by server. - **continuation_token** (str) - An opaque token used to iterate over a collection. The token to use on the next request is returned in the continuation_token field of the result. Single quotes are required around all strings. - **filter** (Union[str, Filter]) - Exclude resources that don’t match the specified criteria. Single quotes are required around all strings inside the filters. - **ids** (List[str]) - A comma-separated list of resource IDs. If there is not at least one resource that matches each id element, an error is returned. Single quotes are required around all strings. - **limit** (int, optional) - Limit the size of the response to the specified number of resources. A limit of 0 can be used to get the number of resources without getting all of the resources. It will be returned in the total_item_count field. If a client asks for a page size larger than the maximum number, the request is still valid. In that case the server just returns the maximum number of items, disregarding the client’s page size request. If not specified, defaults to 1000. - **offset** (int, optional) - The offset of the first resource to return from a collection. - **partner_purchase_orders** (List[str]) - A comma-separated list of partner purchase order numbers. If there is not at least one resource that matches each partner_purchase_order element, an error is returned. Single quotes are required around all strings. - **sort** (List[str], optional) - Sort the response by the specified fields (in descending order if ‘-’ is appended to the field name). If you provide a sort you will not get a continuation token in the response. - **subscription_ids** (List[str]) - A comma-separated list of subscription IDs. If there is not at least one resource that matches each subscription.id element, an error is returned. Single quotes are required around all strings. - **subscription_names** (List[str]) - A comma-separated list of subscription names. If there is not at least one resource that matches each subscription.name element, an error is returned. Single quotes are required around all strings. ### Response #### Success Response (200) - **ValidResponse**: If the call was successful. #### Error Response - **ErrorResponse**: If the call was not successful. ### Raises - **PureError**: If calling the API fails. - **ValueError**: If a parameter is of an invalid type. - **TypeError**: If invalid or missing parameters are used. ``` -------------------------------- ### Import Pure1 Client Source: https://code.purestorage.com/py-pure-client/pure1_reference.html Import the Client class from the pypureclient.pure1 library. This is the first step to using the Pure1 client. ```python from pypureclient.pure1 import Client ``` -------------------------------- ### Import Pure1 Submodule Source: https://code.purestorage.com/py-pure-client/quick_start.html Import the pure1 submodule from pypureclient to begin. ```python from pypureclient import pure1 ``` -------------------------------- ### Get File System Snapshots Policies Source: https://code.purestorage.com/py-pure-client/pure1_reference.html Retrieves pairs of FlashBlade file system snapshot members and their associated policies. ```APIDOC ## GET /file-system/snapshots/policies ### Description Retrieves pairs of FlashBlade file system snapshot members and their policies. ### Method GET ### Endpoint /file-system/snapshots/policies ### Parameters #### Query Parameters - **policies** (ReferenceType or List[ReferenceType], optional) - A list of policies to query for. Overrides policy_ids and policy_names keyword arguments. - **members** (ReferenceType or List[ReferenceType], optional) - A list of members to query for. Overrides member_ids and member_names keyword arguments. - **authorization** (str, optional) - Deprecated. Please use Client level authorization. - **x_request_id** (str, optional) - Supplied by client during request or generated by server. - **continuation_token** (str, optional) - An opaque token used to iterate over a collection. The token to use on the next request is returned in the continuation_token field of the result. Single quotes are required around all strings. - **filter** (str or Filter, optional) - Exclude resources that don’t match the specified criteria. Single quotes are required around all strings inside the filters. - **limit** (int, optional) - Limit the size of the response to the specified number of resources. A limit of 0 can be used to get the number of resources without getting all of the resources. It will be returned in the total_item_count field. If a client asks for a page size larger than the maximum number, the request is still valid. In that case the server just returns the maximum number of items, disregarding the client’s page size request. If not specified, defaults to 1000. - **member_ids** (List[str], optional) - A comma-separated list of member IDs. If there is not at least one resource that matches each member_id element, an error is returned. Single quotes are required around all strings. - **member_names** (List[str], optional) - A comma-separated list of member names. If there is not at least one resource that matches each member_name element, an error is returned. Single quotes are required around all strings. - **offset** (int, optional) - The offset of the first resource to return from a collection. - **policy_ids** (List[str], optional) - A comma-separated list of policy IDs. If there is not at least one resource that matches each policy_id element, an error is returned. Single quotes are required around all strings. - **policy_names** (List[str], optional) - A comma-separated list of policy names. If there is not at least one resource that matches each policy_name element, an error is returned. Single quotes are required around all strings. - **sort** (List[str], optional) - Sort the response by the specified fields (in descending order if ‘-’ is appended to the field name). If you provide a sort you will not get a continuation token in the response. ### Response #### Success Response (200) - **ValidResponse** - If the call was successful. #### Error Response - **ErrorResponse** - If the call was not successful. ``` -------------------------------- ### Import FlashArray Submodule Source: https://code.purestorage.com/py-pure-client/quick_start.html Import the flasharray submodule from pypureclient to begin. ```python from pypureclient import flasharray ``` -------------------------------- ### Get Managed Directories Source: https://code.purestorage.com/py-pure-client/pure1_reference.html Retrieves information about FlashArray managed directory objects. This method allows filtering and sorting of the results. ```APIDOC ## GET /directories ### Description Retrieves information about FlashArray managed directory objects. ### Method GET ### Endpoint /directories ### Parameters #### Query Parameters - **references** (ReferenceType or List[ReferenceType], optional) - A list of references to query for. Overrides ids and names keyword arguments. - **file_systems** (ReferenceType or List[ReferenceType], optional) - A list of file_systems to query for. Overrides file_system_ids and file_system_names keyword arguments. - **authorization** (str, optional) - Deprecated. Please use Client level authorization - **x_request_id** (str, optional) - Supplied by client during request or generated by server. - **continuation_token** (str, optional) - An opaque token used to iterate over a collection. The token to use on the next request is returned in the continuation_token field of the result. Single quotes are required around all strings. - **file_system_ids** (List[str], optional) - Performs the operation on the file system ID specified. Enter multiple file system IDs in comma-separated format. The file_system_ids and file_system_names parameters cannot be provided together. Single quotes are required around all strings. - **file_system_names** (List[str], optional) - A comma-separated list of resource names. If there is not at least one resource that matches each name element, an error is returned. Single quotes are required around all strings. - **filter** (Union[str, Filter], optional) - Exclude resources that don’t match the specified criteria. Single quotes are required around all strings inside the filters. - **ids** (List[str], optional) - A comma-separated list of resource IDs. If there is not at least one resource that matches each id element, an error is returned. Single quotes are required around all strings. - **limit** (int, optional) - Limit the size of the response to the specified number of resources. A limit of 0 can be used to get the number of resources without getting all of the resources. It will be returned in the total_item_count field. If a client asks for a page size larger than the maximum number, the request is still valid. In that case the server just returns the maximum number of items, disregarding the client’s page size request. If not specified, defaults to 1000. - **names** (List[str], optional) - A comma-separated list of resource names. If there is not at least one resource that matches each name element, an error is returned. Single quotes are required around all strings. - **offset** (int, optional) - The offset of the first resource to return from a collection. - **sort** (List[str], optional) - Sort the response by the specified fields (in descending order if ‘-’ is appended to the field name). If you provide a sort you will not get a continuation token in the response. - **_preload_content** (bool, optional) - if False, the ApiResponse.data will be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. - **_return_http_data_only** (bool, optional) - response data instead of ApiResponse object with status code, headers, etc - **_request_timeout** (int or (float, float), optional) - timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. ### Response #### Success Response (200) - **ValidResponse**: If the call was successful. #### Error Response - **ErrorResponse**: If the call was not successful. ### Raises - **PureError**: If calling the API fails. - **ValueError**: If a parameter is of an invalid type. - **TypeError**: If invalid or missing parameters are used. ``` -------------------------------- ### Get Volumes with Sorting and Limit Source: https://code.purestorage.com/py-pure-client/quick_start.html Retrieves a list of volumes, sorted by name in ascending order, with a limit of 10 items. ```python response = client.get_volumes(sort=pure1.Volume.name.ascending(), limit=10) volumes = list(response.items) ``` -------------------------------- ### Instantiate FlashBlade Client with ID Token Source: https://code.purestorage.com/py-pure-client/quick_start.html Instantiate a FlashBlade client using a pre-generated ID token. Note that the client will fail upon ID token expiration. ```python from pypureclient import flashblade client = flashblade.Client('flashblade.example.com', id_token=[...]) ``` -------------------------------- ### SustainabilityArrayGetResponse Source: https://code.purestorage.com/py-pure-client/pure1_reference.html Represents the response from a request to get sustainability data for arrays. It includes pagination details and a list of sustainability array items. ```APIDOC ## SustainabilityArrayGetResponse ### Description Represents the response from a request to get sustainability data for arrays. It includes pagination details and a list of sustainability array items. ### Fields - **continuation_token** (Optional[StrictStr]) - Continuation token that can be provided in the continuation_token query param to get the next page of data. If you use the continuation token to page through data you are guaranteed to get all items exactly once regardless of how items are modified. If an item is added or deleted during the pagination then it may or may not be returned. The continuation token is generated if the limit is less than the remaining number of items, and the default sort is used (no sort is specified). - **total_item_count** (Optional[StrictInt]) - Total number of items after applying filter params. - **items** (Optional[ConstrainedListValue[SustainabilityArray]]) - List of sustainability array items. ```