Package: vista-api-client
Vista API for PythonPython implementation of the Vista API.ReferenceVista API DocumentationPrerequisitesYou'll need to create a Vista API key from the Vista Dashboard.UsageInstall the dependency:pip install vista_api_clientThen in your Node application:fromvista_api_clientimportVistaClientVISTA_API_KEY='create-in-vista-dashboard'client=VistaClient(VISTA_API_KEY,'branch_name')roles=client.roles.list()After that you are good to go!Please see theVista API Documentationfor the API documentation.All OperatorYou can useVistaClient.ALLin place whereresource_idorresource_typeis accepted to indicate all.Changing Branches for OperationAlthoughbranchis required as a part of the constructor, one may useclient.with_branch(branch: str)to use supply a different branch using the same client.UsageThe following describes methods namespaced by Vistaresources.Adminclient.adminmethoddescriptioncreate_branch(branch: str)Creates new Branchclone_branch(branch: str, new_branch: str)ClonestemplatesinbranchtonewBranchcreate_read_tokens()Creates a set of read-only tokens meant to be used by Vista React componentsget_company()Gets Company IDResource Typesclient.resource_typesmethoddescriptionlist()Lists all Resource Typesupsert(name: str, actions: str[], attributes: {id: str, target_resource_type: str, attribute_type: 'RELATIONSHIP' | 'SCALAR'}[])Upserts a Resource Typeadd_relationship(from_id: str, from_resource_type: str, attribute: str, to_id: str, to_resource_type: str)Adds an attribute relationship between 2 resourceIdsRolesclient.rolesmethoddescriptionlist(org_id: str)Lists all Rolesupsert(role_id: str, permissions: { resourceType: str, attribute: str, action: str, ownerId: str }[], owners: { key: str }, parentRoles: string[], orgId: string)Upserts a RoleUsersclient.usersmethoddescriptioncreate(user_id: str, org_id: str)Creates new Userlist(org_id?: str)Lists Users inorg_idlist_orgs()Lists all orgs for set branchassign_to_userset(user_id: str, userset_id: str)Adds User to a Usersetremove_from_userset(user_id: str, userset_id: str)Removes User from Usersetcheck(user_id: str, action: str, resource_type: str, resource_id: str, attribute?: str)Checks User accessexpand(user_id: str)Lists all granted permissions for User.grant_action(user_id: str, action: str, resource_type: str, resource_id: str, attribute?: str)Allows user to performactionon (resource_id,resource_type)revoke_action(user_id: str, action: str, resource_type: str, resource_id: str, attribute?: str)Revokesactionon (resource_id,resource_type) for User.grant_role(user_id: str, role_id: str, resource_type: str, resource_id: str)Grants Role to Userrevoke_role(user_id: str, role_id: str, resource_type: str, resource_id: str)Revokes Role from UserUsersetsclient.usersetsmethoddescriptioncreate(user_id: str, org_id: str)Creates Usersetgrant_action(user_id: str, action: str, resource_type: str, resource_id: str, attribute?: str)Allows User to performactionon (resource_id,resource_type)revoke_action(user_id: str, action: str, resource_type: str, resource_id: str, attribute?: str)Revokesactionon (resource_id,resource_type) for Usersetgrant_role(user_id: str, role_id: str, resource_type: str, resource_id: str)Grants Role to Usersetrevoke_role(user_id: str, role_id: str, resource_type: str, resource_id: str)Revokes Role from UsersetGrantsclient.grantsmethoddescriptionlist(user_id: str | None, action: str | None, resource_id: str | None, resource_type: str | None, attribute: str | None, org_id: str | None, start_time: str | None, end_time: str | None)List & filter grants by arguments,start_timeis inclusive (>=) andend_timeis exclusive (<)list_unflattened(userset_id: str | None, relation: str | None, relation_type: str | None, resource_id: str | None, resource_type: str | None, attribute: str | None, org_id: str | None)Filters User or Userset grants