Start by selecting policies, here using a FluentSearch-based approach.
You can select the policy by whatever you like, in this example we are selecting based on the resources it controls (specifically in this example any assets in a particular snowflake connection).
Include details about the policy itself in each search result, such as the access control mechanism the policy is defined within (the persona).
Include all the attributes you want about the access control mechanism on the relations of the search results. Here we are including the name of and whether that persona is enabled or not.
You can then directly stream the results of the search.
For each result of the search (itself an AuthPolicy), you can then decide what to do with it.
Start by selecting policies, here using a FluentSearch-based approach.
You can select the policy by whatever you like, in this example we are selecting based on the resources it controls (specifically in this example any assets in a particular snowflake connection).
Include details about the policy itself in each search result, such as the access control mechanism the policy is defined within (the persona).
Include all the attributes you want about the access control mechanism on the relations of the search results. Here we are including the name of and whether that persona is enabled or not.
You can then translate the FluentSearch into a search request.
Run a search using the search request.
For each result of the search (itself an AuthPolicy), you can then decide what to do with it.
Start by selecting policies, here using a FluentSearch-based approach.
You can select the policy by whatever you like, in this example we are selecting based on the resources it controls (specifically in this example any assets in a particular snowflake connection).
Include details about the policy itself in each search result, such as the access control mechanism the policy is defined within (the persona).
Include all the attributes you want about the access control mechanism on the relations of the search results. Here we are including the name of and whether that persona is enabled or not.
You can then directly stream the results of the search.
For each result of the search (itself an AuthPolicy), you can then decide what to do with it.
You can select the policy by whatever you like, in this example we are selecting based on the resources it controls.
Include details about the policy itself in each search result, such as the accessControl mechanism the policy is defined within (the persona).
Include all the attributes you want about the access control mechanism on the relations of the search results. Here we are including the name of and whether that persona is enabled or not.
Since purposes work around Atlan tags, you may first want to retrieve the tag of interest (you need its internal ID rather than human-readable name).
Start by selecting policies, here using a FluentSearch-based approach.
You can select the policy by whatever you like, in this example we are selecting based on the resources it controls (specifically in this example the tag we retrieved earlier).
Include details about the policy itself in each search result, such as the access control mechanism the policy is defined within (the purpose).
Include all the attributes you want about the access control mechanism on the relations of the search results. Here we are including the name of and whether that purpose is enabled or not.
You can then directly stream the results of the search.
For each result of the search (itself an AuthPolicy), you can then decide what to do with it.
Since purposes work around Atlan tags, you may first want to retrieve the tag of interest (you need its internal ID rather than human-readable name).
Start by selecting policies, here using a FluentSearch-based approach.
You can select the policy by whatever you like, in this example we are selecting based on the resources it controls (specifically in this example the tag we retrieved earlier).
Include details about the policy itself in each search result, such as the access control mechanism the policy is defined within (the purpose).
Include all the attributes you want about the access control mechanism on the relations of the search results. Here we are including the name of and whether that purpose is enabled or not.
You can then translate the FluentSearch into a search request.
Run a search using the search request.
For each result of the search (itself an AuthPolicy), you can then decide what to do with it.
Since purposes work around Atlan tags, you may first want to retrieve the tag of interest (you need its internal ID rather than human-readable name).
Start by selecting policies, here using a FluentSearch-based approach.
You can select the policy by whatever you like, in this example we are selecting based on the resources it controls (specifically in this example the tag we retrieved earlier).
Include details about the policy itself in each search result, such as the access control mechanism the policy is defined within (the purpose).
Include all the attributes you want about the access control mechanism on the relations of the search results. Here we are including the name of and whether that purpose is enabled or not.
You can then directly stream the results of the search.
For each result of the search (itself an AuthPolicy), you can then decide what to do with it.
You can select the policy by whatever you like, in this example we are selecting based on the resources it controls (specifically via the tag defined as part of the purpose). Note that the tag needs to be given as its internal ID, not the human-readable name.
Include details about the policy itself in each search result, such as the accessControl mechanism the policy is defined within (the purpose).
Include all the attributes you want about the access control mechanism on the relations of the search results. Here we are including the name of and whether that purpose is enabled or not.
Unlike most assets, to update policies you should first retrieve the existing policy and then update it in its entirety. You can do this by either retrieving the entire policy asset by its GUID (if you know it), or by retrieving the policy using the instructions above under Retrieve policies. You must request at least the attributes defined in that section on each policy to be able to update the policy.
To update an existing policies, once you have retrieved it:
Update an existing policy
14151617
AuthPolicypolicy=policy.toBuilder()// (1).description("Revised explanation about what this policy does.")// (2).build();// (3)AssetMutationResponseresponse=policy.save();// (4)
Assuming you have already retrieved the policy you want to update (policy in this example), you can turn it into a mutable object using toBuilder().
You can then apply any updates you want to the policy. These will either overwrite (where only a single value is allowed, such as description) or append to the existing values defined in the policy.
Build up your changes.
You can then save the revised policy back to Atlan.
Update an existing policy
2223
policy.description="Revised explanation about what this policy does."# (1)response=policy.save()# (2)
Assuming you have already retrieved the policy you want to update (policy in this example), you can apply any updates you want to that policy. These will overwrite the existing values defined in the policy.
You can then save the revised policy back to Atlan.
Update an existing policy
14151617
valtoUpdate=policy.toBuilder()// (1).description("Revised explanation about what this policy does.")// (2).build()// (3)valresponse=toUpdate.save()// (4)
Assuming you have already retrieved the policy you want to update (policy in this example), you can turn it into a mutable object using toBuilder().
You can then apply any updates you want to the policy. These will either overwrite (where only a single value is allowed, such as description) or append to the existing values defined in the policy.
Build up your changes.
You can then save the revised policy back to Atlan.
If you already have the persona or its GUID or qualifiedName, you can simply use it directly. This example reuses the search by name to obtain it.
Once you have the minimal information about the persona, you may still need to retrieve the full persona itself (to ensure you have all of its policies and their inner details).
You can then iterate through these policies...
...and check each policy's displayText for the name that's been given to the policy.
...and retrieve each policy's guid to be able to individually delete the appropriate policy.
If you already have the persona or its GUID or qualified_name, you can simply use it directly. This example reuses the search by name to obtain it.
Once you have the minimal information about the persona, you may still need to retrieve the full persona itself (to ensure you have all of its policies and their inner details).
You can then iterate through these policies...
...and check each policy's display_text for the name that's been given to the policy, and retrieve each policy's guid to be able to individually delete the appropriate policy.
If you already have the persona or its GUID or qualifiedName, you can simply use it directly. This example reuses the search by name to obtain it.
Once you have the minimal information about the persona, you may still need to retrieve the full persona itself (to ensure you have all of its policies and their inner details).
You can then iterate through these policies...
...and check each policy's displayText for the name that's been given to the policy and each policy's guid to be able to individually delete the appropriate policy.
You can then iterate through those details to see the displayText for the name that's been given to each policy, and retrieve each policy's guid to be able to individually delete the appropriate policy.
If you already have the purpose or its GUID or qualifiedName, you can simply use it directly. This example reuses the search by name to obtain it.
Once you have the minimal information about the purpose, you may still need to retrieve the full purpose itself (to ensure you have all of its policies and their inner details).
You can then iterate through these policies...
...and check each policy's displayText for the name that's been given to the policy.
...and retrieve each policy's guid to be able to individually delete the appropriate policy.
If you already have the purpose or its GUID or qualified_name, you can simply use it directly. This example reuses the search by name to obtain it.
Once you have the minimal information about the purpose, you may still need to retrieve the full purpose itself (to ensure you have all of its policies and their inner details).
You can then iterate through these policies...
...and check each policy's display_text for the name that's been given to the policy, and retrieve each policy's guid to be able to individually delete the appropriate policy.
If you already have the purpose or its GUID or qualifiedName, you can simply use it directly. This example reuses the search by name to obtain it.
Once you have the minimal information about the purpose, you may still need to retrieve the full purpose itself (to ensure you have all of its policies and their inner details).
You can then iterate through these policies...
...and check each policy's displayText for the name that's been given to the policy, and retrieve each policy's guid to be able to individually delete the appropriate policy.
You can then iterate through those details to see the displayText for the name that's been given to each policy, and retrieve each policy's guid to be able to individually delete the appropriate policy.