GithubHelp home page GithubHelp logo

purestorage-openconnect / rest-client Goto Github PK

View Code? Open in Web Editor NEW
38.0 21.0 23.0 95 KB

Pure Storage FlashArray Python REST 1.X Client

License: BSD 2-Clause "Simplified" License

Python 100.00%
python python3 flasharray purestorage

rest-client's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rest-client's Issues

Copy snapshot as a new volume

copy_volume is handy for copying. But it works only with existing volume (in local array). Can you make it capable for copying the snapshot (from protection group) as a new volume, please?

When copy_volume is used to copy snapshot from protection group, it will say that the volume doesn't exist:

[
  {
    "pure_err_key": "err.friendly",
    "code": 6,
    "ctx": "remote_host_logs_volume",
    "pure_err_code": 1,
    "msg": "Volume does not exist."
  }
]

Thanks

Need method to update request timeout

I am having timeout issues collecting pure device data using the sdk.
Please add the ability to set a timeout value for request calls.

FlashArray(target=ip, username=user, password=password, timeout=90)

def _request(self, method, path, data=None, reestablish_session=True):
        """Perform HTTP request for REST API."""
      ...
            response = requests.request(method, url, data=body, headers=headers,
                                        cookies=self._cookies, **self._request_kwargs)

        response = requests.request(method, url, data=body, headers=headers,
                                    cookies=self._cookies, timeout=self._timeout, **self._request_kwargs)

version 1.14.0

Noticed when running purestorage.VERSION, we are seeing 1.14.0
The git logs show 1.14.1

rest-client/purestorage/purestorage.py
VERSION = '1.14.0'

should be updated to

VERSION = '1.14.1'

purestorage sdk rest_version wont accept higher than default

An option to use different rest_versions is apart of the purestorage.FlashArray() but it wont accept anything higher than 1.19.

Traceback (most recent call last):
File "/repo/my_tests.py", line 94, in
client = get_single_array()
File "/repo/my_tests.py", line 33, in get_single_array
array = purestorage.FlashArray('10.246.95.26',
File "/usr/local/lib/python3.9/site-packages/purestorage/purestorage.py", line 141, in init
self._rest_version = self._check_rest_version(rest_version)
File "/usr/local/lib/python3.9/site-packages/purestorage/purestorage.py", line 214, in _check_rest_version
raise ValueError(msg.format(version))
ValueError: Library is incompatible with REST API version 1.20

'ConnectionError' object has no attribute 'message'

Receive the error "'ConnectionError' object has no attribute 'message'" when a Pure System request times out. It appears to be occurring at line 147 in purestorage.py --- raise PureError(err.message)

This is in version 1.11.3.

Please let me know if I can assist or answer any questions.

Thanks,
Garry

Support for Purity API versions 2.0+

Hi,

Is there any work being done to add support for Purity API versions 2.0+?

It would be great if we could use this SDK to use the new and improved REST API version, not least to be able to authenticate using the more secure OAuth2 method.

KeyError: 'version'

While connecting to array, we are getting below error.

#array = purestorage.FlashArray("xxxxxxxxxxxx", "pureuser", "pureuser")

Traceback (most recent call last):
File "", line 1, in
File "/opt/anaconda3/lib/python3.7/site-packages/purestorage/purestorage.py", line 138, in init
self._rest_version = self._choose_rest_version()
File "/opt/anaconda3/lib/python3.7/site-packages/purestorage/purestorage.py", line 217, in _choose_rest_version
versions = self._list_available_rest_versions()
File "/opt/anaconda3/lib/python3.7/site-packages/purestorage/purestorage.py", line 231, in _list_available_rest_versions
return data["version"]
KeyError: 'version'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.