Skip to main content

This package provides a command line interface to Azure Purview's REST API.

Project description

Azure Purview CLI

This package provides a command line interface to Azure Purview's REST API.
purviewcli

Installation

pip install purviewcli

Getting Started

YouTube

  1. Install purviewcli (e.g. pip install purviewcli)

  2. Set environment variable(s).

    • PURVIEW_NAME (mandatory)
    • AZURE_CLIENT_ID (optional)
    • AZURE_TENANT_ID (optional)
    • AZURE_CLIENT_SECRET (optional)

    Note: The environment variables related to authentication are optional as there are several methods in which we can pass credentials to purviewcli in order to authenticate with an instance of Azure Purview. See Authentication for more details.

  3. Execute command (e.g. !pv glossary read)

Snippet of an example Python-based notebook.

purviewcli

Authentication

The purviewcli package leverages the DefaultAzureCredential method from azure-identity. This provides purviewcli a variety of credential sources it can use to attempt authentication (e.g. Environment Variables, Managed Identity, Visual Studio Code, Azure CLI, Interactive). For example, if you are signed into Azure within Visual Studio Code, purviewcli will leverage those existing credentials when executing a command. This negates the need to store and manage credentials specific to the purviewcli package by leveraging what exists already. Read the azure-identity documentation to understand the authentication hierarchy.

Authorization

The identity executing Azure Purview CLI commands will need access to the deployed Azure Purview resource along with the following role assignments:

  • Purview Data Curator
  • Purview Data Source Administrator

Usage

pv command sub-command --parameter1='value' --parameter2='value'

Parameter Types

  • All parameters are required by default.
  • Parameters enclosed with square brackets "[ ]" are optional.
  • Mutually exclusive parameters are enclosed with parens "( )" and separated with a pipe "|".
  • The "=<val>" indicates parameters which require an input (e.g. --parameter=<val>). Input can be specified after a space (e.g. --parameter 'value') or equal "=" sign (e.g. --parameter='value').
  • Parameters that do not require an input are False by default and True if present (e.g. --ignoreRelationships).
  • The ellipsis "..." indicates parameters that are allowed to repeat (e.g. --guid='12345' --guid='23451' --guid='34512')

Commands

Search

pv search query [--keywords=<val> --filter-file=<val> --limit=<val> --offset=<val> --facets-file=<val>]

Entity

pv entity create --name=<val> --qualifiedName=<val> --typeName=<val> [--description=<val>]
pv entity read --guid=<val> [--ignoreRelationships --minExtInfo]
pv entity update --guid=<val> --attrKey=<val> --attrVal=<val>
pv entity delete --guid=<val>
pv entity createBulk --name=<val>... --qualifiedName=<val>... --typeName=<val>...
pv entity readBulk --guid=<val>... [--ignoreRelationships --minExtInfo]
pv entity readHeader --guid=<val>
pv entity createClassifications --guid=<val> --classificationName=<val>...
pv entity readClassifications --guid=<val>
pv entity readClassification --guid=<val> --classificationName=<val>
pv entity deleteClassification --guid=<val> --classificationName=<val>
pv entity createBulkClassification --classificationName=<val> --guid=<val>...
pv entity readUniqueAttributeType --typeName=<val> --attrKey=<val> --attrVal=<val> [--ignoreRelationships --minExtInfo]
pv entity deleteUniqueAttributeType --typeName=<val> --attrKey=<val> --attrVal=<val>
pv entity updateUniqueAttributeType --typeName=<val> --attrKey=<val> --attrVal=<val> [--description=<val>]
pv entity readBulkUniqueAttributeType --typeName=<val> --attrKey=<val>... --attrVal=<val>... [--ignoreRelationships --minExtInfo]
pv entity createUniqueAttributeTypeClassifications --typeName=<val> --attrKey=<val> --attrVal=<val> --classificationName=<val>...
pv entity updateUniqueAttributeTypeClassifications --typeName=<val> --attrKey=<val> --attrVal=<val> --classificationName=<val>...
pv entity deleteUniqueAttributeTypeClassification --typeName=<val> --attrKey=<val> --attrVal=<val> --classificationName=<val>

Glossary

pv glossary read [--glossaryGuid=<val> --limit=<val> --offset=<val> --sort=<val>]
pv glossary create --payload-file=<val>
pv glossary createCategories --payload-file=<val>
pv glossary createCategory --payload-file=<val>
pv glossary deleteCategory --categoryGuid=<val>
pv glossary readCategory --categoryGuid=<val> [--limit=<val> --offset=<val> --sort=<val>]
pv glossary putCategory --categoryGuid=<val> --payload-file=<val>
pv glossary putCategoryPartial --categoryGuid=<val> --payload-file=<val>
pv glossary readCategoryRelated --categoryGuid=<val>
pv glossary readCategoryTerms --categoryGuid=<val> [--limit=<val> --offset=<val> --sort=<val>]
pv glossary createTemplate --payload-file=<val>
pv glossary readTemplate
pv glossary createTerm --payload-file=<val>
pv glossary deleteTerm --termGuid=<val>
pv glossary readTerm --termGuid=<val>
pv glossary putTerm --termGuid=<val> --payload-file=<val>
pv glossary putTermPartial --termGuid=<val> --payload-file=<val>
pv glossary createTerms --payload-file=<val>
pv glossary deleteTermsAssignedEntities --termGuid=<val> --payload-file=<val>
pv glossary readTermsAssignedEntities --termGuid=<val> [--limit=<val> --offset=<val> --sort=<val>]
pv glossary createTermsAssignedEntities --termGuid=<val> --payload-file=<val>
pv glossary putTermsAssignedEntities --termGuid=<val> --payload-file=<val>
pv glossary readTermsRelated --termGuid=<val> [--limit=<val> --offset=<val> --sort=<val>]
pv glossary delete --glossaryGuid=<val>
pv glossary put --glossaryGuid=<val> --payload-file=<val>
pv glossary readCategories --glossaryGuid=<val> [--limit=<val> --offset=<val> --sort=<val>]
pv glossary readCategoriesHeaders --glossaryGuid=<val> [--limit=<val> --offset=<val> --sort=<val>]
pv glossary readDetailed --glossaryGuid=<val>
pv glossary putPartial --glossaryGuid=<val> --payload-file=<val>
pv glossary readTerms --glossaryGuid=<val> [--limit=<val> --offset=<val> --sort=<val>]
pv glossary readTermsHeaders --glossaryGuid=<val> [--limit=<val> --offset=<val> --sort=<val>]

Lineage

pv lineage read --guid=<val> [--depth=<val> --width=<val> --direction=<val>]

Relationship

pv relationship create --typeName=<val> --end1Guid=<val> --end1Type=<val> --end2Guid=<val> --end2Type=<val> [--status=<val>]
pv relationship read --relationshipGuid=<val> [--extendedInfo]
pv relationship update --relationshipGuid=<val> [--status=<val>]
pv relationship delete --relationshipGuid=<val>

Types

pv types readTypedefs [--includeTermTemplate --type=<val>]
pv types readTypedefsHeaders [--includeTermTemplate --type=<val>]
pv types readBusinessmetadatadef (--guid=<val> | --name=<val>)
pv types readClassificationdef (--guid=<val> | --name=<val>)
pv types readEntitydef (--guid=<val> | --name=<val>)
pv types readEnumdef (--guid=<val> | --name=<val>)
pv types readRelationshipdef (--guid=<val> | --name=<val>)
pv types readStructdef (--guid=<val> | --name=<val>)
pv types readTypedef (--guid=<val> | --name=<val>)
pv types deleteTypedef --name=<val>
pv types deleteTypedefs --payload-file
pv types createTypedefs --payload-file
pv types putTypedefs --payload-file

Scan

pv scan readClassificationRules
pv scan readClassificationRule --classificationRuleName=<val>
pv scan readClassificationRuleVersions --classificationRuleName=<val>
pv scan readDatasources
pv scan readDatasource --dataSourceName=<val>
pv scan readScans --dataSourceName=<val>
pv scan readScan --dataSourceName=<val> --scanName=<val>
pv scan readScanHistory --dataSourceName=<val> --scanName=<val>
pv scan readFilters --dataSourceName=<val> --scanName=<val>
pv scan readTrigger --dataSourceName=<val> --scanName=<val>
pv scan readScanRulesets
pv scan readScanRuleset --scanRulesetName=<val>
pv scan readSystemScanRulesets
pv scan readSystemScanRuleset --dataSourceType=<val>
pv scan readSystemScanRulesetVersion --version=<val> --dataSourceType=<val>
pv scan readSystemScanRulesetLatest --dataSourceType=<val>
pv scan readSystemScanRulesetVersions --dataSourceType=<val>
pv scan readKeyVaults
pv scan readKeyVault --keyVaultName=<val>
pv scan deleteClassificationRule --classificationRuleName=<val>
pv scan deleteDataSource --dataSourceName=<val>
pv scan deleteKeyVault --keyVaultName=<val>
pv scan deleteScanRuleset --scanRulesetName=<val>
pv scan deleteScan --dataSourceName=<val> --scanName=<val>
pv scan deleteTrigger --dataSourceName=<val> --scanName=<val>
pv scan putDataSource --dataSourceName=<val> --payload-file=<val>
pv scan putScan --dataSourceName=<val> --scanName=<val> --payload-file=<val>
pv scan putFilter --dataSourceName=<val> --scanName=<val> --payload-file=<val>
pv scan putTrigger --dataSourceName=<val> --scanName=<val> --payload-file=<val>
pv scan runScan --dataSourceName=<val> --scanName=<val>
pv scan cancelScan --dataSourceName=<val> --scanName=<val> --runId=<val>
pv scan putClassificationRule --classificationRuleName=<val> --payload-file=<val>
pv scan putKeyVault --keyVaultName=<val> --payload-file=<val>
pv scan putScanRuleset --scanRulesetName=<val> --payload-file=<val>

Insight (Guardian)

pv insight assetDistributionByDataSource [--registeredSourceGroup=<val> --classificationCategory=<val> --classificationName=<val>]
pv insight assetDistributionByTopPaths --datasource=<val> [--registeredSourceGroup=<val> --classificationCategory=<val> --classificationName=<val>]
pv insight fileTypeSizeTimeSeries --fileType=<val> --window=<val> [--registeredSourceGroup=<val> --datasource=<val>]
pv insight fileTypeSizeTrendByDataSource --fileType=<val> --window=<val> [--registeredSourceGroup=<val> --datasource=<val>]
pv insight topFileTypesBySize [--registeredSourceGroup=<val> --datasource=<val>]
pv insight topLevelSummary [--registeredSourceGroup=<val>]
pv insight registeredSourceGroupsWithAssets

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

purviewcli-0.1.16.tar.gz (17.4 kB view details)

Uploaded Source

Built Distribution

purviewcli-0.1.16-py3-none-any.whl (22.5 kB view details)

Uploaded Python 3

File details

Details for the file purviewcli-0.1.16.tar.gz.

File metadata

  • Download URL: purviewcli-0.1.16.tar.gz
  • Upload date:
  • Size: 17.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.2

File hashes

Hashes for purviewcli-0.1.16.tar.gz
Algorithm Hash digest
SHA256 1bee9ce98d36fd064b70be2a3177148f1983c2169fc63cd34202d2426caaacc4
MD5 105239cbaa6dc38fd12c3c135724b42b
BLAKE2b-256 c781498dbfd7d028197762da3aa5dacbc342949ba5a354c2687961e10541897a

See more details on using hashes here.

File details

Details for the file purviewcli-0.1.16-py3-none-any.whl.

File metadata

  • Download URL: purviewcli-0.1.16-py3-none-any.whl
  • Upload date:
  • Size: 22.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.2

File hashes

Hashes for purviewcli-0.1.16-py3-none-any.whl
Algorithm Hash digest
SHA256 b8df3510fa3aa7f23a6f47476d47120b4d82544b43a7b2e2dfff930b72265df5
MD5 fac8e36425a8a392b6304f942ffef4a2
BLAKE2b-256 b2e649541f251e0145021f22c9bd06c25234b13d4f83ad7f2291bddb9da4eeb8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page