OCI CLI Interactive - Default value for compartment-id is not working in interactive mode.
As per https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/cliconfigure.htm#Specifying_Default_Values, We can store default values for options in oci_cli_rc file which works fine when we run the commands in non-interactive mode.
But, when OCI CLI is used in interactive mode, these default values are not being honored or considered - which is resulting in error Error: Missing required parameters ['--compartment-id']
For example with api-gateway.compartment-id default value specified in configuration:
- Command
oci api-gateway deployment list --lifecycle-state ACTIVEworks and returns list of ACTIVE deployments in the default compartment. - Command
oci api-gateway deployment listworks fine in interactive mode, and returns list of all deployments in default compartment. - Command
oci api-gateway deployment list --lifecycle-state ACTIVEdoesn't work in interactive mode, and returns errorError: Missing required parameters ['--compartment-id']
Expected:
- Command
oci api-gateway deployment list --lifecycle-state ACTIVEshould return list of all deployments in the default compartment.
The default breaks whenever an -- option is used.
api-gateway deployment list works, but api-gateway deployment list --all does not.
Same applies for other commands like compute instance list.