GithubHelp home page GithubHelp logo

Comments (8)

adizohar avatar adizohar commented on August 13, 2024

I don't see any pagination on your code, also I don't see any use of region set, please check the code I wrote which has backups as well - https://github.com/oracle/oci-python-sdk/tree/master/examples/showoci

from oci-python-sdk.

Gopichand-Heeddata avatar Gopichand-Heeddata commented on August 13, 2024

@adizohar here you can find.

import oci

config = oci.config.from_file()
identity_client = oci.identity.IdentityClient(config)

# Fetch list of compartments
compartments = identity_client.list_compartments(config['tenancy']).data

regions = identity_client.list_region_subscriptions(tenancy_id=config['tenancy']).data
blockstorage_client = oci.core.BlockstorageClient(config)

# Iterate over compartments
for compartment in compartments:
    compartment_id = compartment.id
    compartment_name = compartment.name
    print(f"Fetching backups for compartment: {compartment_name} ({compartment_id})")

    # Iterate over regions
    for region in regions:
        print(f"Fetching backups for compartment: {compartment_name} ({compartment_id}) in region {region.region_name}")

        list_backups_response= oci.pagination.list_call_get_all_results(
            oci.core.BlockstorageClient(config).list_volume_backups,
            compartment_id=compartment_id,
            limit=1000
        ).data
        for backup in list_backups_response:
            print(backup)
``

from oci-python-sdk.

adizohar avatar adizohar commented on August 13, 2024

remove the region loop because it is not correct
change the call to below:

        list_backups_response= oci.pagination.list_call_get_all_results(
            blockstorage_client.list_volume_backups,
            compartment_id=compartment_id
        ).data

boot volume backup has different api calls which you need to add another loop

from oci-python-sdk.

Gopichand-Heeddata avatar Gopichand-Heeddata commented on August 13, 2024

I have changed the code base but getting 42 records only. is the any limitation on this API call?
please provide resolution regarding this behaviours.

from oci-python-sdk.

adizohar avatar adizohar commented on August 13, 2024

Are those on same compartments or other ? the list compartment you mentioned only list one level
Add this to the list compartment
compartment_id_in_subtree=True,
You should check the documentation for each API.
Also, as I mentioned, you only list backup on Volumes not boot volumes

from oci-python-sdk.

Gopichand-Heeddata avatar Gopichand-Heeddata commented on August 13, 2024

Thankyou @adizohar

from oci-python-sdk.

adizohar avatar adizohar commented on August 13, 2024

If it is working, please close ticket and open new one for new .
Appreciate it.

from oci-python-sdk.

Gopichand-Heeddata avatar Gopichand-Heeddata commented on August 13, 2024

working fine @adizohar closing this ticket.

from oci-python-sdk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.