How to disable "delete" operation on the container

My yang file is as below. Requirement is to disable ‘delete’ operation on the main container and all mandatory leaves and lists. How can I do it?
container mycontainer {
leaf mandatory-leaf {
}
leaf optional-leaf {
}
list mandatory-list {
}
list optional-list {
}
}

Use Command rules under NACM tree to deny the delete operation.

@nabil, thanks! I understand that i have to add something like this:

my-module-delete-deny
mymodule
/mycontainer
delete
deny

Is it possible to hide the ‘delete’ command itself?

Requirement is to deny the operation but still seeing the delete command on the CLI is misleading.

My another problem is when I have rule to deny delete on the container, i am not able to delete optional parameters in the container. I did try to add rule to allow delete for those parameters but the delete-deny-of-container is overriding the optional parameter delete-allow

There is a way to hide the delete command but it will apply globally: You won’t be able to delete anything.
If this is what you want, you can use the clispec modifications node. You can find info on this in the user guide.
Example:

  <configureMode>
        <modifications>
                <delete src="delete"/>
        </modifications>
  </configureMode>

Deleting sub nodes rule should be present before the delete of the container rule.

Can you share what the use case is that requires the delete to be blocked for a container while allowing it for sub-nodes?