Comments (8)
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.
@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.
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.
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.
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.
Thankyou @adizohar
from oci-python-sdk.
If it is working, please close ticket and open new one for new .
Appreciate it.
from oci-python-sdk.
working fine @adizohar closing this ticket.
from oci-python-sdk.
Related Issues (20)
- oci.pagination.list_call_get_all_results fails when using identity domain client HOT 2
- Missing Composite Operations for Identity Domains
- Generate bypass code with python OCI HOT 2
- Packaging Metadata: Classifiers specify as supported already dead python and not mark modern versions HOT 1
- showoci stuck while running for all resources HOT 3
- resource name not getting cost analysis (Usageapi cllent) HOT 13
- Private IP addresses for the db_nodes in ExaCS is not the correct one HOT 21
- problems running in CLI OCI HOT 3
- metrics are geting 429 error when we calling the api filter maximum , minimum and average metrics HOT 6
- Issue with accessing oci.container_instances.ContainerInstanceClient response data HOT 2
- Report with properties of PDBs HOT 4
- Error using FlowLogCaptureFilterRuleDetails
- Missing dependency on sseclient
- oci python SDK while using instance-principals, raising exceptions.ServiceError NotAuthorizedOrNotFound HOT 7
- a little typo in the documentation how to run CLI with help option $ python3 oci_capacity_reporter_gui.py -help HOT 1
- Error in log-analytics storage purge-storage-data HOT 4
- Focus report how we can get it. HOT 1
- call mysql_client_composite_ops.copy_backup_and_wait_for_state display AttributeError: 'DbBackupsClient' object has no attribute 'get_work_request'
- usageapi not working for ap-mumbai region HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from oci-python-sdk.