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 (--json-params <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 --json-params 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.5.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.5-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for vastpy-0.3.5.tar.gz
Algorithm Hash digest
SHA256 6fe3a6e84247eb2f4c43deb868d3354367bc96542b38ca2ae1ec2a5d25f26b5e
MD5 fe1c4c1e17e3953f3b29cb233bdd3b8e
BLAKE2b-256 d50339dbad4d21d6e8e3875bc74c9c9bf045f20c9e47d6792fc1a07ce629b7a3

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for vastpy-0.3.5-py3-none-any.whl
Algorithm Hash digest
SHA256 0f0cc4bf070ab662c62af75daaabb151fddf383eeee38a820a14b0d1efd081f8
MD5 2cc6c1658d040b688ce5e03ba2d455d8
BLAKE2b-256 ac55cedaf8afe695fa4a1b28938afe43796f13d4626ede4f7433ca13983d16a3

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

0.3.7

2 files

0.3.6

2 files

This release

0.3.5 This release

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