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

Accepts JSON file input (--file-input <JSON_file>):

$ cat input.json
{
  "read_access_users": [
    "vastadmin"
  ],
  "read_access_users_groups": [
    "vastadmin"
  ],
  "protocols_audit": {
    "log_full_path": true,
    "modify_data_md": true,
    "create_delete_files_dirs_objects": true
  },
  "enable_vast_db_audit": true
}

$ vastpy-cli patch clusters/<cluster_id>/auditing --file-input input.json

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.

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.7.tar.gz (8.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vastpy-0.3.7-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: vastpy-0.3.7.tar.gz
  • Upload date:
  • Size: 8.3 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.7.tar.gz
Algorithm Hash digest
SHA256 4e0c611b338dce3a741ab157fc328f7f98f2f7346880dc0f5249e26d6c08ba12
MD5 ff32ae9328ecf256f068cba31ec8948f
BLAKE2b-256 f4342f56f75aae9d8d5f1b2a4c90a60a8c78f739a300b8715f536ef062267c97

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vastpy-0.3.7-py3-none-any.whl
  • Upload date:
  • Size: 9.4 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.7-py3-none-any.whl
Algorithm Hash digest
SHA256 20f0104c8d4f9f4b9effadda70d323e29c74692c03bb87ecd67598f9aeeb620e
MD5 05856e6c0c81230ae0b10e6b486a0564
BLAKE2b-256 a4a29e2f04f4762bbdbfd99205c78395f962ec87d04b5b0d2512ab3ef319a22e

See more details on using hashes here.

Release history Release notifications | RSS feed

0.3.22

2 files

0.3.21

2 files

0.3.20

2 files

0.3.19

2 files

0.3.18

2 files

0.3.17

2 files

0.3.16

2 files

0.3.15

2 files

0.3.14

2 files

0.3.13

2 files

0.3.12

2 files

0.3.11

2 files

0.3.10

2 files

0.3.9

2 files

0.3.8

2 files

This release

0.3.7 This release

2 files

0.3.6

2 files

0.3.5

2 files

0.3.4

2 files

0.3.3

2 files

0.3.2

2 files

0.3.1

2 files

0.3.0

2 files

0.2.3

2 files

0.2.2

2 files

0.2.1

2 files

0.2.0

2 files

0.1.0

2 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