def get_scope_id(self, *args, **kwargs): self._load_kwargs(kwargs) banner("PCC.Get Scope Id") conn = BuiltIn().get_variable_value("${PCC_CONN}") Id = easy.get_scope_id_by_name(conn, Name=self.scope_name, ParentID=self.parentID) return Id
def delete_scope(self, *args, **kwargs): banner("PCC.Delete Scope") self._load_kwargs(kwargs) conn = BuiltIn().get_variable_value("${PCC_CONN}") Id = easy.get_scope_id_by_name(conn, Name=self.scope_name, ParentID=self.parentID) return pcc.delete_scope_by_id(conn, str(Id))
def apply_policy(self, *args, **kwargs): banner("PCC.Apply Policy To Scope") self._load_kwargs(kwargs) conn = BuiltIn().get_variable_value("${PCC_CONN}") payload = {} Id = easy.get_scope_id_by_name(conn, Name=self.scope_name, ParentID=self.parentID) return pcc.apply_policy(conn, str(Id), data=payload)
def get_scope_details(self, *args, **kwargs): self._load_kwargs(kwargs) banner("PCC.Get Scope Details") try: conn = BuiltIn().get_variable_value("${PCC_CONN}") Id = easy.get_scope_id_by_name(conn, Name=self.scope_name, ParentID=self.parentID) except Exception as e: return "Error in get_scope_details: {}".format(e) response = pcc.get_scope(conn, id=str(Id)) return response
def get_policy_deploy_status_by_scopes(self, *args, **kwargs): self._load_kwargs(kwargs) banner("PCC.Get Policy Deploy Status by Scopes") logger.console("Kwargs: {}".format(kwargs)) try: conn = BuiltIn().get_variable_value("${PCC_CONN}") Id = easy.get_scope_id_by_name(conn, Name=self.scope_name, ParentID=self.parentID) logger.console("Id is: {}".format(Id)) except Exception as e: return "Error in get_policy_deploy_status_by_scopes: {}".format(e) response = pcc.get_policy_deploy_status_by_scopes(conn, id=str(Id)) return response