-1
import oci

bucket_name = "BACKUP_W_STAGE"

signer = oci.auth.signers.InstancePrincipalsSecurityTokenSigner()

client = oci.object_storage.ObjectStorageClient(config={"region": "us-phoenix-1"}, signer=signer)

objects = client.list_objects(bucket_name)

for object in objects:
    print(object.name)
Traceback (most recent call last):
  File "oci_bucket.py", line 13, in <module>
    objects = client.list_objects(bucket_name)
TypeError: list_objects() missing 1 required positional argument: 'bucket_name'

Getting above error, can someone please help to solve this issue.

Asit Dey
  • 11
  • 1
  • 1
    [RTFM](https://oracle-cloud-infrastructure-python-sdk.readthedocs.io/en/latest/api/object_storage/client/oci.object_storage.ObjectStorageClient.html#oci.object_storage.ObjectStorageClient.list_objects) – Yevhen Kuzmovych Jun 08 '23 at 10:25

1 Answers1

0

list_objects has two required arguments - the namespace name and the bucket name:

# namespace_name should be initialized somehow, similar to bucket_name
objects = client.list_objects(namespace_name, bucket_name)
Mureinik
  • 297,002
  • 52
  • 306
  • 350