oracle / oracle/oci-cli

oci compute compute-capacity-report says invalid json with generated sample json

Open
#747 5 comments 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

oci compute compute-capacity-report reports Parameter 'shape_availabilities' must be in JSON format. when using example json.

Following the documentation here ...
https://docs.oracle.com/en-us/iaas/tools/oci-cli/3.37.7/oci_cli_docs/cmdref/compute/compute-capacity-report/create.html

oci compute compute-capacity-report create \
--generate-param-json-input shape-availabilities > shape-availabilities.json  

shape-availabilities.json

[
  {
    "faultDomain": "string",
    "instanceShape": "string",
    "instanceShapeConfig": {
      "memoryInGBs": 0.0,
      "nvmes": 0,
      "ocpus": 0.0
    }
  },
  {
    "faultDomain": "string",
    "instanceShape": "string",
    "instanceShapeConfig": {
      "memoryInGBs": 0.0,
      "nvmes": 0,
      "ocpus": 0.0
    }
  }
]

Running

 oci compute compute-capacity-report create --availability-domain $availability_domain \
--compartment-id $compartment_id --shape-availabilities file://shape-availabilities.json

Results in

Parameter 'shape_availabilities' must be in JSON format.
For help with formatting JSON input see our documentation here: https://docs.cloud.oracle.com/iaas/Content/API/SDKDocs/cliusing.htm#ManagingCLIInputandOutput

I followed the examples here https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/cliusing.htm#ManagingCLIInputandOutput but cant seem to make any sense of it.

I suspect there is a bug with the way the report expects input or how the sample data is generated? Thanks in advance.

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

Start with the compute compute-capacity-report create command and its --generate-param-json-input shape-availabilities output. Reproduce the reported validation error with the documented JSON, then trace how the generated sample is parsed; done means the documented sample is accepted or the documentation clearly matches the required input.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.