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

Requirements

The purviewcli package works on Python versions:

  • Python 3.6+
  • Python 3.7+
  • Python 3.8+
  • Python 3.9+

Installation

pip install purviewcli

Getting Started

YouTube

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

  2. [OPTIONAL] Set environment variable(s).

    • PURVIEW_NAME
    • AZURE_CLIENT_ID
    • AZURE_TENANT_ID
    • AZURE_CLIENT_SECRET

    Note #1: 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.

    Note #2: While an Azure Purview account name must be specified, you can provide this value within the command itself (as opposed to via an environment variable). Simply add --purviewName=<val> at the end of any command.

  3. Execute a command (e.g. pv glossary read --purviewName PURVIEW_ACCOUNT_NAME).

Snippet of an example Python-based notebook below.
Note: If you are executing purviewcli commands within a Python notebook, you will need to prefix the command with an exclamation mark !. This will ensure the command is passed to the shell (not the Python interpreter).

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> --limit=<val> --offset=<val> --filter-file=<val> --facets-file=<val>]

Entity

pv entity create --payload-file=<val>
pv entity createBulk --payload-file=<val>
pv entity createBulkClassification --payload-file=<val>
pv entity createBulkSetClassifications --payload-file=<val>
pv entity createClassifications --guid=<val> --payload-file=<val>
pv entity createUniqueAttributeClassifications --typeName=<val> --payload-file=<val>
pv entity delete --guid=<val>
pv entity deleteBulk --guid=<val>...
pv entity deleteClassification --guid=<val> --classificationName=<val>
pv entity deleteUniqueAttribute --typeName=<val>
pv entity deleteUniqueAttributeClassification --typeName=<val> --classificationName=<val>
pv entity put --guid=<val> --name=<val> --payload-file=<val>
pv entity putClassifications --guid=<val> --payload-file=<val>
pv entity putUniqueAttribute --typeName=<val> --payload-file=<val>
pv entity putUniqueAttributeClassifications --typeName=<val> --payload-file=<val>
pv entity read --guid=<val> [--ignoreRelationships --minExtInfo]
pv entity readBulk --guid=<val>... [--ignoreRelationships --minExtInfo]
pv entity readBulkUniqueAttribute --typeName=<val> [--ignoreRelationships --minExtInfo]
pv entity readClassification --guid=<val> --classificationName=<val>
pv entity readClassifications --guid=<val>
pv entity readHeader --guid=<val>
pv entity readUniqueAttribute --typeName=<val> --qualifiedName=<val> [--ignoreRelationships --minExtInfo]

Glossary

pv glossary createTermsExport --glossaryGuid=<val> --termGuid=<val>...
pv glossary createTermsImport (--glossaryGuid=<val> | --glossaryName=<val>)
pv glossary readTerms --glossaryName=<val>
pv glossary readTermsImport --operationGuid=<val>
pv glossary create --payload-file=<val>
pv glossary createCategories --payload-file=<val>
pv glossary createCategory --payload-file=<val>
pv glossary createTerm --payload-file=<val>
pv glossary createTerms --payload-file=<val>
pv glossary createTermsAssignedEntities --termGuid=<val> --payload-file=<val>
pv glossary delete --glossaryGuid=<val>
pv glossary deleteCategory --categoryGuid=<val>
pv glossary deleteTerm --termGuid=<val>
pv glossary deleteTermsAssignedEntities --termGuid=<val> --payload-file=<val>
pv glossary put --glossaryGuid=<val> --payload-file=<val>
pv glossary putCategory --categoryGuid=<val> --payload-file=<val>
pv glossary putCategoryPartial --categoryGuid=<val> --payload-file=<val>
pv glossary putPartial --glossaryGuid=<val> --payload-file=<val>
pv glossary putTerm --termGuid=<val> --payload-file=<val>
pv glossary putTermPartial --termGuid=<val> --payload-file=<val>
pv glossary putTermsAssignedEntities --termGuid=<val> --payload-file=<val>
pv glossary read [--glossaryGuid=<val> --limit=<val> --offset=<val> --sort=<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 readCategory --categoryGuid=<val> [--limit=<val> --offset=<val> --sort=<val>]
pv glossary readCategoryRelated --categoryGuid=<val>
pv glossary readCategoryTerms --categoryGuid=<val> [--limit=<val> --offset=<val> --sort=<val>]
pv glossary readDetailed --glossaryGuid=<val>
pv glossary readTerm --termGuid=<val>
pv glossary readTerms --glossaryGuid=<val> [--limit=<val> --offset=<val> --sort=<val>]
pv glossary readTermsAssignedEntities --termGuid=<val> [--limit=<val> --offset=<val> --sort=<val>]
pv glossary readTermsHeaders --glossaryGuid=<val> [--limit=<val> --offset=<val> --sort=<val>]
pv glossary readTermsRelated --termGuid=<val> [--limit=<val> --offset=<val> --sort=<val>]

Lineage

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

Relationship

pv relationship create --payload-file=<val>
pv relationship delete --guid=<val>
pv relationship put --payload-file=<val>
pv relationship read --guid=<val> [--extendedInfo]

Types

pv types createTypeDefs --payload-file=<val>
pv types deleteTypeDef --name=<val>
pv types deleteTypeDefs --payload-file=<val>
pv types putTypeDefs --payload-file=<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 readStatistics
pv types readStructDef (--guid=<val> | --name=<val>)
pv types readTermTemplateDef (--guid=<val> | --name=<val>)
pv types readTypeDef (--guid=<val> | --name=<val>)
pv types readTypeDefs [--includeTermTemplate --type=<val>]
pv types readTypeDefsHeaders [--includeTermTemplate --type=<val>]

Scan

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

Credential

pv credential delete --credentialName=<val>
pv credential put --credentialName=<val> --payload-file=<val>
pv credential read [--credentialName=<val>]

Management

pv management checkNameAvailability --subscriptionId=<val> --accountName=<val>
pv management createAccount --subscriptionId=<val> --resourceGroupName=<val> --accountName=<val> --payload-file=<val>
pv management defaultAccount --scopeTenantId=<val> --scopeType=<val> --scope=<val>
pv management deleteAccount --subscriptionId=<val> --resourceGroupName=<val> --accountName=<val>
pv management deletePrivateEndpoint --subscriptionId=<val> --resourceGroupName=<val> --accountName=<val> --privateEndpointConnectionName=<val>
pv management listKeys --subscriptionId=<val> --resourceGroupName=<val> --accountName=<val>
pv management listOperations
pv management listPrivateLinkResources --subscriptionId=<val> --resourceGroupName=<val> --accountName=<val> [--groupId=<val>]
pv management putPrivateEndpoint --subscriptionId=<val> --resourceGroupName=<val> --accountName=<val> --privateEndpointConnectionName=<val> --payload-file=<val>
pv management putResourceGroup --subscriptionId=<val> --resourceGroupName=<val> --location=<val>
pv management putRoleAssignment --subscriptionId=<val> --resourceGroupName=<val> --accountName=<val> --roleDefinitionId=<val> --principalId=<val>
pv management readAccount --subscriptionId=<val> --resourceGroupName=<val> --accountName=<val>
pv management readAccounts --subscriptionId=<val> [--resourceGroupName=<val>]
pv management readPrivateEndpoint --subscriptionId=<val> --resourceGroupName=<val> --accountName=<val> --privateEndpointConnectionName=<val>
pv management readPrivateEndpoints --subscriptionId=<val> --resourceGroupName=<val> --accountName=<val>
pv management removeDefaultAccount --scopeTenantId=<val> --scopeType=<val> --scope=<val>
pv management setDefaultAccount --subscriptionId=<val> --resourceGroupName=<val> --accountName=<val> --scopeTenantId=<val> --scopeType=<val> --scope=<val>
pv management updateAccount --subscriptionId=<val> --resourceGroupName=<val> --accountName=<val> --payload-file=<val>

Insight (Guardian)

pv insight assetDataSources
pv insight assetDistribution
pv insight fileExtensions [--numberOfDays=<val> --takeTopCount=<val>]
pv insight fileTypeSizeTimeSeries [--numberOfDays=<val> --fileType=<val> --dataSource=<val>]
pv insight filesWithoutResourceSet
pv insight graphql --payload-file=<val>
pv insight scanStatusSummaries [--numberOfDays=<val>]
pv insight scanStatusSummariesByTs [--numberOfDays=<val>]
pv insight topFileTypesBySize

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.26.tar.gz (670.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

purviewcli-0.1.26-py3-none-any.whl (736.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: purviewcli-0.1.26.tar.gz
  • Upload date:
  • Size: 670.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/51.1.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.6

File hashes

Hashes for purviewcli-0.1.26.tar.gz
Algorithm Hash digest
SHA256 643c2f3ea6fff6bc80ae459b48e22d90516950d9dcb16e4200ab7f42ed27da42
MD5 930ad4d79e709448b5f451a91e903b02
BLAKE2b-256 e344282ca16b324854f8b32ceaf396a477f71ed145e40cd62cc1abe054445e13

See more details on using hashes here.

File details

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

File metadata

  • Download URL: purviewcli-0.1.26-py3-none-any.whl
  • Upload date:
  • Size: 736.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/51.1.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.6

File hashes

Hashes for purviewcli-0.1.26-py3-none-any.whl
Algorithm Hash digest
SHA256 c9e7e81119ea8664ced1f44ac5051d80ab99409a25c3d3c87f9e7a0c6883a807
MD5 cb83a570e8b2508efdd541d83852bd68
BLAKE2b-256 d2e3f624cd90808ec402de872ebcf5a748c9558a148ca3b3708246a52b60bdaa

See more details on using hashes here.

Supported by

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