Questions tagged [oci-python-sdk]

The Oracle Cloud Infrastructure Python SDK is a python package that provides an interface to the Oracle Cloud Infrastructure (OCI). Use this tag for questions related to using the Python SDK.

The Oracle Cloud Infrastructure Python SDK is a python package that provides an interface to the Oracle Cloud Infrastructure (OCI).

References

27 questions
2
votes
1 answer

Get list of all compartments in OCI Tenancy

I am trying to get the list of all compartments (including child compartments) in OCI Tenancy using Python SDK. But the below OCI API does not give the root compartment details. Is there a way to get root compartment details via any API…
Ibprof
  • 23
  • 6
1
vote
1 answer

I am trying to add the Tag (freefrom_tag) for particular compute instances in OCI using python script and facing TypeError

Please find the error update_volume_response = core_client.update_instance(instance_id=i.id, update_instance_details = oci.core.models.UpdateInstanceDetails(freeform_tags)) TypeError: UpdateInstanceDetails.init() takes 1 positional argument but 2…
1
vote
1 answer

No such file or directory: '/opt/ml/input/data/test/revenue_train.csv' Sagemaker [SM_CHANNEL_TRAIN]

I am trying to deploy my RandomForestClassifier on Amazon Sagemaker using Python SDK. I have been following this example https://github.com/aws/amazon-sagemaker-examples/blob/main/sagemaker-script-mode/sagemaker-script-mode.ipynb but keep getting an…
1
vote
1 answer

OCI response returns a list object with one entry

The response.data attribute seems to return a Python list type object, with just one entry. To get the response data into a Python dict object I have to strip out the list contents before using the json.loads function. Is there a more elegant way to…
mikey
  • 115
  • 8
1
vote
2 answers

python oci: Oracle Cloud Infrastructure: How to list files in a bucket

I am trying to print the files in a bucket on Oracle cloud. I have installed oci library for it and came this far. Now I dont know further how to get list of files in a particular bucket. import os,oci from oci.config import…
LOrD_ARaGOrN
  • 3,884
  • 3
  • 27
  • 49
1
vote
1 answer

Is the 'key_content' field safe to use in the OCI Python SDK?

This primarily directed at the Oracle SDK Dev team but docs say to post non-issue questions here. When passing a config to the OCI SDK, the code accepts a value in the 'key_content' field that can contain the private key details rather than needing…
0
votes
0 answers

Check instance metrics

is there any way to check if instance got any metrics using OCI Python SDK? Will be list_metrics from oci.monitoring.MonitoringClient good method to check if there is some metrics collected for instance?
habakuk
  • 15
  • 3
0
votes
0 answers

Structured search returns only a limited set of attributes

A couple of questions about OCI structured search, using the Python SDK. # Create a search client search_client=oci.resource_search.ResourceSearchClient(config) # Create a structured search query query_string=("query instance resources where…
mikey
  • 115
  • 8
0
votes
0 answers

Unable to use the OCI Python SDK os_management_client, with a cross tenancy access instance principal setup

Not able to use the OCI Python SDK os_management_client, with a cross tenancy access instance principal setup. I have setup the instance principal, with all the required policies, in both the source and destination tenancy. Do I have to do some…
0
votes
0 answers

Creating cross region autonomous database failing with 'message': "The following tag namespaces / keys are not authorized or not found: 'oracle-tags'"

Need help in creating cross region standby database via python have tried creating with oci.database.models.CreateCrossRegionAutonomousDatabaseDataGuardDetails I am unable to find an example for the same so i tried with whatever i can find through…
0
votes
1 answer

Latest OCI SDK documantation page API reference does not list all service clients

Latest 2.88.1 (updated 11/15) documentation site under API reference, it does not list all service clients for navigation and search. oci sdk 2.88.0 lists dozens of service clients. oci sdk 2.88.1 only lists three service clients. Need to provide…
ardai
  • 58
  • 4
0
votes
1 answer

Python sdk OCI : Remove backup policy of boot volume

How do we remove the assigned backup policy of boot volume attached to an instance using python sdk OCI package Didn't find with UpdateBootVolume https://docs.oracle.com/en-us/iaas/api/#/en/iaas/20160918/BootVolume/UpdateBootVolume
0
votes
1 answer

Python oci sdk question regarding boot volume backup

How do we find boot volume backups of the particular instance using python oci package list_boot_volume_backups function will return all the backups in the compartment. ref:…
RV.
  • 3
  • 2
0
votes
1 answer

Can't import ModelConfigurationDetails in the OCI notebooksession using conda env

I am using OCI notebook session for model deployment. cloned oci-python-sdk in the env. env: Python [conda env:generalmachinelearningforgpusv1] (/home/datascience/conda/generalmachinelearningforgpusv1) bash-4.2$ oci --version 2.16.1 Facing below…
0
votes
1 answer

Creating compute instance from instance configuration

I want to create a compute instance using oci-python-sdk in the same way as I would by clicking 'launch instance' in the "compute >> instance configurations >> instance configuration details" on the Oracle website. I only found references to…
1
2