Skip to main content

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=/projects/db name=db
{
  "id": 4707792,
  "name": "db_snapshot",
  "path": "/projects/db"
...

$ 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": "/projects/db",
...

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

Metadata

Release files for vastpy 0.3.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for vastpy 0.3.4
File Size Uploaded
vastpy-0.3.4.tar.gz 8.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for vastpy 0.3.4
File Interpreter ABI Platform
vastpy-0.3.4-py3-none-any.whl Python 3 none any Details

Total release size: 17.0 kB

Release files / vastpy-0.3.4.tar.gz

Download URL vastpy-0.3.4.tar.gz
Size 8.0 kB
Tags Source
SHA-256 checksum
How to use checksums
e69aa299b5d1892a761ac4882ed3c8b613a8a3ea131dfcd01cdadd17aba5056c
BLAKE2b-256 checksum
How to use checksums
7adae80df3bf63fa62fafded9992c65b656753b1135f7deedc3470723808abe9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.2 CPython/3.10.9 Darwin/23.6.0

Release files / vastpy-0.3.4-py3-none-any.whl

Download URL vastpy-0.3.4-py3-none-any.whl
Size 9.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7cdf018ec2369c5bcb7aeb3bf6db0a7e7cb3435c3d17bc6bde7cbbb0075c4278
BLAKE2b-256 checksum
How to use checksums
c29e44d65351079db27f38448242369cbc4f32065dfa9f108e05b2654f6a1287
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.2 CPython/3.10.9 Darwin/23.6.0

Release history Release notifications | RSS feed

0.3.22

2 release files

0.3.21

2 release files

0.3.17

2 release files

0.3.16

2 release files

0.3.15

2 release files

0.3.14

2 release files

0.3.13

2 release files

0.3.11

2 release files

0.3.10

2 release files

0.3.9

2 release files

0.3.8

2 release files

0.3.7

2 release files

0.3.6

2 release files

0.3.5

2 release files

This release

0.3.4 This release

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page