|
| 1 | +from ads.aqua.verify_policies.utils import VerifyPoliciesUtils |
| 2 | + |
| 3 | +utils = VerifyPoliciesUtils() |
| 4 | +operation_messages = { |
| 5 | + utils.list_compartments.__name__: { |
| 6 | + "name": "List Compartments", |
| 7 | + "error": "Unable to retrieve the list of compartments. Please verify that you have the required permissions to list compartments in your tenancy. ", |
| 8 | + "policy_hint": "Allow dynamic-group aqua-dynamic-group to inspect compartments in tenancy" |
| 9 | + }, |
| 10 | + utils.list_models.__name__: { |
| 11 | + "name": "List Models", |
| 12 | + "error": "Failed to fetch available models. Ensure that the policies allow you to list models from the Model Catalog in the selected compartment.", |
| 13 | + "policy_hint": "Allow dynamic-group aqua-dynamic-group to manage data-science-models in compartment <your-compartment-name>" |
| 14 | + }, |
| 15 | + utils.list_project.__name__: { |
| 16 | + "name": "List Projects", |
| 17 | + "error": "Failed to list Data Science projects. Verify that you have the appropriate permission to access projects in the selected compartment.", |
| 18 | + "policy_hint": "Allow dynamic-group aqua-dynamic-group to manage data-science-projects in compartment <your-compartment-name>" |
| 19 | + }, |
| 20 | + utils.list_model_version_sets.__name__: { |
| 21 | + "name": "List Model Version Sets", |
| 22 | + "error": "Unable to load model version sets. Check your access rights to list model version sets in the selected compartment.", |
| 23 | + "policy_hint": "Allow dynamic-group aqua-dynamic-group to manage data-science-modelversionsets in compartment <your-compartment-name>" |
| 24 | + }, |
| 25 | + utils.list_jobs.__name__: { |
| 26 | + "name": "List Jobs", |
| 27 | + "error": "Job list could not be retrieved. Please confirm that you have the necessary permissions to view jobs in the compartment.", |
| 28 | + "policy_hint": "Allow dynamic-group aqua-dynamic-group to manage data-science-jobs in compartment <your-compartment-name>" |
| 29 | + }, |
| 30 | + utils.list_job_runs.__name__: { |
| 31 | + "name": "List Job Runs", |
| 32 | + "error": "Job Runs list could not be retrieved. Please confirm that you have the necessary permissions to view job runs in the compartme", |
| 33 | + "policy_hint": "Allow dynamic-group aqua-dynamic-group to manage data-science-job-runs in compartment <your-compartment-name>" |
| 34 | + }, |
| 35 | + utils.list_buckets.__name__: { |
| 36 | + "name": "List Object Storage Buckets", |
| 37 | + "error": "Cannot fetch Object Storage buckets. Verify that you have access to list buckets within the specified compartment.", |
| 38 | + "policy_hint": "Allow dynamic-group aqua-dynamic-group to read objectstorage-namespaces in compartment <your-compartment-name>\nAllow dynamic-group aqua-dynamic-group to read buckets in compartment <your-compartment-name>" |
| 39 | + }, |
| 40 | + utils.manage_bucket.__name__: { |
| 41 | + "name": "Object Storage Access", |
| 42 | + "error": "Failed to access the Object Storage bucket. Verify that the bucket exists and you have write permissions.", |
| 43 | + "policy_hint": "Allow dynamic-group aqua-dynamic-group to manage object-family in compartment <your-compartment-name> where any {target.bucket.name='<your-bucket-name>'}" |
| 44 | + }, |
| 45 | + utils.list_log_groups.__name__: { |
| 46 | + "name": "List Log Groups", |
| 47 | + "error": "Log groups or logs could not be retrieved. Please confirm you have logging read access for the selected compartment.", |
| 48 | + "policy_hint": "Allow dynamic-group aqua-dynamic-group to use logging-family in compartment <your-compartment-name>" |
| 49 | + }, |
| 50 | + utils.get_resource_availability.__name__: { |
| 51 | + "name": "Verify Shape Limits", |
| 52 | + "error": "Failed to retrieve shape limits for your compartment. Make sure the required policies are in place to read shape and quota data.", |
| 53 | + "policy_hint": "Allow dynamic-group aqua-dynamic-group to read resource-availability in compartment <your-compartment-name>" |
| 54 | + }, |
| 55 | + utils.register_model.__name__: { |
| 56 | + "name": "Register Model", |
| 57 | + "error": "Model registration failed. Ensure you have the correct permissions to write to the Model Catalog and access Object Storage.", |
| 58 | + "policy_hint": "Allow dynamic-group aqua-dynamic-group to manage data-science-models in compartment <your-compartment-name>" |
| 59 | + }, |
| 60 | + utils.aqua_model.delete_model.__name__: { |
| 61 | + "name": "Delete Model", |
| 62 | + "error": "Could not delete model. Please confirm you have delete permissions for Model Catalog resources in the compartment.", |
| 63 | + "policy_hint": "Allow dynamic-group aqua-dynamic-group to manage data-science-models in compartment <your-compartment-name>" |
| 64 | + }, |
| 65 | + utils.create_job.__name__: { |
| 66 | + "name": "Create Job", |
| 67 | + "error": "Job could not be created. Please check if you have permissions to create Data Science jobs.", |
| 68 | + "policy_hint": "Allow dynamic-group aqua-dynamic-group to manage data-science-jobs in compartment <your-compartment-name>" |
| 69 | + }, |
| 70 | + utils.create_job_run.__name__: { |
| 71 | + "name": "Create Job Run", |
| 72 | + "error": "Job Run could not be created. Confirm that you are allowed to run jobs in the selected compartment.", |
| 73 | + "policy_hint": "Allow dynamic-group aqua-dynamic-group to manage data-science-job-runs in compartment <your-compartment-name>" |
| 74 | + }, |
| 75 | + "delete_job": { |
| 76 | + "name": "Delete Job", |
| 77 | + "error": "Job could not be deleted. Please check if you have permissions to delete Data Science jobs.", |
| 78 | + "policy_hint": "Allow dynamic-group aqua-dynamic-group to manage data-science-jobs in compartment <your-compartment-name>" |
| 79 | + }, |
| 80 | + utils.aqua_model.create_model_version_set.__name__: { |
| 81 | + "name": "Create Model Version Set", |
| 82 | + "error": "Unable to create a model version set for storing evaluation results. Ensure that required Model Catalog permissions are set.", |
| 83 | + "policy_hint": "Allow dynamic-group aqua-dynamic-group to manage data-science-modelversionsets in compartment <your-compartment-name>" |
| 84 | + }, |
| 85 | + utils.aqua_model.ds_client.delete_model_version_set.__name__: { |
| 86 | + "name": "Delete Model Version Set", |
| 87 | + "error": "Unable to delete a model version. Ensure that required Model Catalog permissions are set.", |
| 88 | + "policy_hint": "Allow dynamic-group aqua-dynamic-group to manage data-science-modelversionsets in compartment <your-compartment-name>" |
| 89 | + }, |
| 90 | + utils.create_model_deployment.__name__: { |
| 91 | + "name": "Create Model Deployment", |
| 92 | + "error": "Model deployment could not be created. Confirm you have correct permissions to deploy models to the Model Deployment service.", |
| 93 | + "policy_hint": "Allow dynamic-group aqua-dynamic-group to manage data-science-model-deployments in compartment <your-compartment-name>" |
| 94 | + }, |
| 95 | + utils.aqua_model.ds_client.delete_model_deployment.__name__: { |
| 96 | + "name": "Delete Model Deployment", |
| 97 | + "error": "Unable to delete the model deployment. Please check if you have appropriate permissions to manage deployments.", |
| 98 | + "policy_hint": "Allow dynamic-group aqua-dynamic-group to manage data-science-model-deployments in compartment <your-compartment-name>" |
| 99 | + } |
| 100 | + |
| 101 | +} |
0 commit comments