oracle / oracle/oci-cli

OCI CLI Interactive - Default value for compartment-id is not working in interactive mode.

Open
#872 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
669
Forks
236
Avg merge
1m
Merged PRs (30d)
4

Description

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 ACTIVE works and returns list of ACTIVE deployments in the default compartment.
  • Command oci api-gateway deployment list works fine in interactive mode, and returns list of all deployments in default compartment.
  • Command oci api-gateway deployment list --lifecycle-state ACTIVE doesn't work in interactive mode, and returns error Error: Missing required parameters ['--compartment-id']

Expected:

  • Command oci api-gateway deployment list --lifecycle-state ACTIVE should return list of all deployments in the default compartment.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the two deployment-list commands in interactive and non-interactive modes, using an oci_cli_rc default for api-gateway.compartment-id. Compare how interactive mode handles the default when --lifecycle-state ACTIVE is supplied. Done means the interactive command honors the configured compartment-id and returns the deployments without a missing-parameter error.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli, cloud
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.