Skip to main content

No project description provided

Project description

VASTPY

This package is a Python SDK to the VMS (VAST Management System) REST API.

While developing against the VMS API use the documentation locally available at https://vms-host-name/docs.

Install

pip install vastpy

The package is hosted in PyPI: https://pypi.org/project/vastpy/

SDK Usage

Initialization:

from vastpy import VASTClient

client = VASTClient(user='user', password='********', address='vast-vms')

The API is straightforward:

client.<collection>.get()
client.<collection>.post()
client.<collection>[<object>].get()
client.<collection>[<object>].patch()
client.<collection>[<object>].delete()

Accessing collections:

for view in client.views.get():
    print(view)

Creating objects:

policy, = client.viewpolicies.get(name='default')

view = client.views.post(path='/prod/pgsql', policy_id=policy['id'], create_dir=True)

Modifying/deleting objects:

view, = client.views.get(path='/prod/pgsql')

view = client.views[view['id']].patch(protocols=['NFS', 'SMB'])

client.views[view['id']].delete()

Reading metrics:

client.monitors.ad_hoc_query.get(object_type='cluster',
                                 time_frame='5m',
				 prop_list=['ProtoMetrics,proto_name=ProtoCommon,iops',
				            'ProtoMetrics,proto_name=ProtoCommon,bw'])

CLI Usage

Credentials can be passed through environment variables or parameters:

$ export VMS_USER=admin VMS_PASSWORD=******** VMS_ADDRESS=vast-file-server

$ vastpy-cli get snapshots fields=id,path
[
  {
    "path": "/dbs",
    "id": 12
  },
  {
    "path": "/datasets",
    "id": 43
  },
...

$ vastpy-cli --user=admin --password==******** --address=vast-file-server get snapshots fields=id,path

Any method (get, post, patch, delete) is supported:

$ vastpy-cli post snapshots path=/alon/sdk name=sdk_snapshot
{
  "id": 4707792,
  "name": "sdk_snapshot",
  "path": "/alon/sdk/"
...

$ vastpy-cli post views path=/projects/db create_dir=true policy_id=1
{
  "id": 109,
  "guid": "551b5fc0-42a2-4b77-b385-d5bf6a6c1538",
  "name": "view-109",
  "title": "/alon/sdk",
...

$ vastpy-cli delete views/109

Version Compatibility

This package is compatible with any VAST version as it's schema-less.

Python objects are simply translated to URLs: client.collection[object].get() is translated to GET /api/collection/object.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vastpy-0.3.1.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

vastpy-0.3.1-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

Details for the file vastpy-0.3.1.tar.gz.

File metadata

  • Download URL: vastpy-0.3.1.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.10.9 Darwin/23.6.0

File hashes

Hashes for vastpy-0.3.1.tar.gz
Algorithm Hash digest
SHA256 9060d880823b28df7be1ac3ce44d3a860b7add6067d99d2fa9483408d9dd6efd
MD5 f6d5f114dfd42c8391579f59d1cdcb65
BLAKE2b-256 f6f1549a8763ccaf978eb4e19f5c99df6af3fc379e7e2cefaefb1cc008ae260c

See more details on using hashes here.

File details

Details for the file vastpy-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: vastpy-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 8.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.10.9 Darwin/23.6.0

File hashes

Hashes for vastpy-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e89b676e111c3dcfcdd04b79a52b787a13d7b88987002b8da14e49ddad9a83ff
MD5 9652a4daa4d5dd7e155b18cc37e4acb6
BLAKE2b-256 b0a63cc1d16758058d8daf9de2556077d210d289a13444ab294f0625e6c2e41b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page