Get Collection Name
Overview
Returns the actual under the hood collection name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
collection_name |
str
|
Name to check. |
required |
api_version |
Optional[str]
|
If None, default is "2019-11-01-preview". |
None
|
force_actual_name |
bool
|
Edge case. If True, will check if the actual name is the name passed in. Useful if there are multiple friendly names. |
False
|
Returns:
Type | Description |
---|---|
str
|
The actual name of the collection. |
Source code in purviewautomation/collections.py
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 |
|
Examples
Pass in either an actual or friendly collection name (For more info on what actual and friendly names mean, see: Purview Names Overview). The code will return one of the following:
-
The actual name of the collection (if it exists)
-
A friendly error stating that the collection doesn't exist (if there's no collection by that name)
-
If passing in a friendly name and multiple friendly names exist, an error will return displaying the multiple friendly names in order to choose which to use
For example, if the Purview collections look like this:
To return the actual name of test 1
:
print(client.get_real_collection_name("test 1"))
Will output the actual name of the collection. In this example, it would output: mojpnk
.