Skip to main content

Client for the Vista API

Project description

Vista API for Python

Python implementation of the Vista API.

Reference

Prerequisites

You'll need to create a Vista API key from the Vista Dashboard.

Usage

Install the dependency:

pip install vista_api_client

Then in your Node application:

from vista_api_client import VistaClient

if __name__ == '__main__':
    client = VistaClient('z9Not6ZyDQn8YGw3GxHZx54k0U1qA_2KIL1HktuYPc5EKEfd', 'branch_name')
    roles = client.resources.list('test')
    print(roles)

After that you are good to go!

Please see the Vista API Documentation for documentation of the API. ://docs.govista.io/api/) for documentation of the API.

All Operator

You can use VistaClient.ALL in place where resource_id is accepted to indicate all.

API

method description
client.admin.create_branch(branch : str) Creates new Branch
client.admin.create_read_tokens() Creates a set of read-only tokens meant to be used by Vista React components
client.resource_types.list() Lists all Resource Types
client.resource_types.upsert(name : str, actions : str[])`
client.roles.list() Lists all Roles
client.roles.upsert(role_id : str, resource_type_to_attribute_to_actions : { resource_type: { attribute: actions[] }}, parent_roles: str[]) Creates a new Role
client.roles.inherit(child_role_id: str, parent_role_id: str) Adds Role as child of parent role
client.users.create(user_id: str) Creates new User
client.users.assign_to_userset(user_id: str, userset_id: str) Adds User to a Userset
client.users.remove_from_userset(user_id: str, userset_id: str) Removes User from Userset
client.users.check(user_id: str, action: str, resource_type: str, resource_id: str, attribute?: str) Checks User access
client.users.expand(user_id: str) Lists all granted permissions for User.
client.users.grant_action(user_id: str, action: str, resource_type: str, resource_id: str, attribute?: str) Allows user to perform action on (resource_id, resource_type)
client.users.revoke_action(user_id: str, action: str, resource_type: str, resource_id: str, attribute?: str) Revokes action on (resource_id, resource_type) for User.
client.users.grant_role(user_id: str, role_id: str, resource_type: str, resource_id: str) Grants Role to User
client.users.revoke_role(user_id: str, role_id: str, resource_type: str, resource_id: str) Revokes Role from User
client.usersets.create(user_id: str) Creates Userset
client.usersets.inherit(child_role_id: str, parent_role_id: str) Adds Userset as child of parent Userset
client.usersets.grant_action(user_id: str, action: str, resource_type: str, resource_id: str, attribute?: str) Allows User to perform action on (resource_id, resource_type)
client.usersets.revoke_action(user_id: str, action: str, resource_type: str, resource_id: str, attribute?: str) Revokes action on (resource_id, resource_type) for Userset
client.usersets.grant_role(user_id: str, role_id: str, resource_type: str, resource_id: str) Grants Role to Userset
client.usersets.revoke_role(user_id: str, role_id: str, resource_type: str, resource_id: str) Revokes Role from Userset

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

vista_api_client-0.3.1.tar.gz (5.6 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: vista_api_client-0.3.1.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.1

File hashes

Hashes for vista_api_client-0.3.1.tar.gz
Algorithm Hash digest
SHA256 d793644bd94d861dcf8f52d4d85e60cb2876ae9359588ea4d9a7de6026f2add0
MD5 8d0783f9307d7ddcb8ae055aced4dd65
BLAKE2b-256 06f5146e5a45a3ebb365f25f63224de1c506b4314a3e951e0945acec2a8404b7

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