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.8.tar.gz (8.5 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.8-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: vastpy-0.3.8.tar.gz
  • Upload date:
  • Size: 8.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.8.tar.gz
Algorithm Hash digest
SHA256 a6ca5f8df00f69ec46dc0a58c4a8638dd4a3cc8fd2f187057a7a3eba4e31e9d6
MD5 736d9cb20e6c363406d5d50c05fb2950
BLAKE2b-256 7f12e6cc7be1110e7a95416aae504182d0b5f8cf96fd816bae440a8aedad0cfd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vastpy-0.3.8-py3-none-any.whl
  • Upload date:
  • Size: 9.6 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.8-py3-none-any.whl
Algorithm Hash digest
SHA256 b8f55fc4ec1ff10e412097154842b61d36a65f2ce3b533fa0c8a684592f76688
MD5 9820a4e99f100fb7418b94da8a6760bc
BLAKE2b-256 a86fd2b7e438ec9164f2e46abd223e9c4982afa1b8cec069afc36263dfef41a5

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

This release

0.3.8 This release

2 files

0.3.7

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