oci 2.151.0__py3-none-any.whl → 2.152.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- oci/__init__.py +2 -2
- oci/access_governance_cp/access_governance_cp_client.py +8 -8
- oci/addons/__init__.py +20 -0
- oci/addons/adk/__init__.py +13 -0
- oci/addons/adk/agent.py +852 -0
- oci/addons/adk/agent_client.py +682 -0
- oci/addons/adk/agent_error.py +36 -0
- oci/addons/adk/auth/__init__.py +5 -0
- oci/addons/adk/auth/auth_provider.py +28 -0
- oci/addons/adk/auth/factory.py +78 -0
- oci/addons/adk/auth/oci/__init__.py +5 -0
- oci/addons/adk/auth/oci/instance_principal.py +53 -0
- oci/addons/adk/auth/oci/resource_principal.py +53 -0
- oci/addons/adk/auth/oci/session.py +91 -0
- oci/addons/adk/auth/oci/user_principal.py +64 -0
- oci/addons/adk/constants.py +17 -0
- oci/addons/adk/logger.py +163 -0
- oci/addons/adk/run/__init__.py +5 -0
- oci/addons/adk/run/response.py +56 -0
- oci/addons/adk/run/types.py +32 -0
- oci/addons/adk/tool/__init__.py +13 -0
- oci/addons/adk/tool/function_tool.py +334 -0
- oci/addons/adk/tool/prebuilt/__init__.py +8 -0
- oci/addons/adk/tool/prebuilt/agentic_rag_tool.py +49 -0
- oci/addons/adk/tool/prebuilt/calculator_toolkit.py +104 -0
- oci/addons/adk/tool/tool.py +37 -0
- oci/addons/adk/tool/toolkit.py +189 -0
- oci/addons/adk/tool/utils.py +120 -0
- oci/addons/adk/util.py +325 -0
- oci/adm/application_dependency_management_client.py +36 -36
- oci/ai_anomaly_detection/anomaly_detection_client.py +36 -36
- oci/ai_document/ai_service_document_client.py +26 -26
- oci/ai_language/ai_service_language_client.py +44 -44
- oci/ai_speech/ai_service_speech_client.py +19 -19
- oci/ai_vision/ai_service_vision_client.py +28 -28
- oci/analytics/analytics_client.py +24 -24
- oci/announcements_service/announcement_client.py +5 -5
- oci/announcements_service/announcement_subscription_client.py +9 -9
- oci/announcements_service/announcements_preferences_client.py +4 -4
- oci/announcements_service/service_client.py +1 -1
- oci/apigateway/api_gateway_client.py +21 -21
- oci/apigateway/deployment_client.py +6 -6
- oci/apigateway/gateway_client.py +6 -6
- oci/apigateway/subscribers_client.py +6 -6
- oci/apigateway/usage_plans_client.py +6 -6
- oci/apigateway/work_requests_client.py +5 -5
- oci/apm_config/config_client.py +12 -12
- oci/apm_control_plane/apm_domain_client.py +14 -14
- oci/apm_synthetics/apm_synthetic_client.py +28 -28
- oci/apm_traces/attributes_client.py +8 -8
- oci/apm_traces/query_client.py +2 -2
- oci/apm_traces/trace_client.py +4 -4
- oci/appmgmt_control/appmgmt_control_client.py +8 -8
- oci/artifacts/artifacts_client.py +32 -32
- oci/audit/audit_client.py +3 -3
- oci/autoscaling/auto_scaling_client.py +11 -11
- oci/bastion/bastion_client.py +15 -15
- oci/bds/bds_client.py +84 -84
- oci/blockchain/blockchain_platform_client.py +27 -27
- oci/budget/budget_client.py +10 -10
- oci/capacity_management/capacity_management_client.py +32 -32
- oci/certificates/certificates_client.py +5 -5
- oci/certificates_management/certificates_management_client.py +32 -32
- oci/cims/incident_client.py +6 -6
- oci/cloud_bridge/common_client.py +5 -5
- oci/cloud_bridge/discovery_client.py +15 -15
- oci/cloud_bridge/inventory_client.py +16 -16
- oci/cloud_bridge/ocb_agent_svc_client.py +23 -23
- oci/cloud_guard/cloud_guard_client.py +155 -155
- oci/cloud_migrations/migration_client.py +43 -43
- oci/cluster_placement_groups/cluster_placement_groups_cp_client.py +13 -13
- oci/compute_cloud_at_customer/compute_cloud_at_customer_client.py +12 -12
- oci/compute_instance_agent/compute_instance_agent_client.py +6 -6
- oci/compute_instance_agent/plugin_client.py +2 -2
- oci/compute_instance_agent/pluginconfig_client.py +1 -1
- oci/container_engine/container_engine_client.py +46 -46
- oci/container_instances/container_instance_client.py +18 -18
- oci/core/blockstorage_client.py +60 -60
- oci/core/compute_client.py +117 -117
- oci/core/compute_management_client.py +32 -32
- oci/core/virtual_network_client.py +258 -258
- oci/dashboard_service/dashboard_client.py +6 -6
- oci/dashboard_service/dashboard_group_client.py +6 -6
- oci/data_catalog/data_catalog_client.py +149 -149
- oci/data_flow/data_flow_client.py +45 -45
- oci/data_integration/data_integration_client.py +163 -163
- oci/data_labeling_service/data_labeling_management_client.py +17 -17
- oci/data_labeling_service_dataplane/data_labeling_client.py +15 -15
- oci/data_safe/data_safe_client.py +317 -317
- oci/data_science/data_science_client.py +145 -145
- oci/database/database_client.py +745 -469
- oci/database/models/__init__.py +2 -0
- oci/database/models/autonomous_db_version_summary.py +31 -0
- oci/database/models/backup.py +4 -2
- oci/database/models/backup_summary.py +4 -2
- oci/database/models/create_external_backup_job_details.py +4 -4
- oci/database/models/db_system.py +4 -2
- oci/database/models/db_system_summary.py +4 -2
- oci/database/models/db_system_upgrade_summary.py +152 -0
- oci/database/models/external_container_database.py +4 -2
- oci/database/models/external_container_database_summary.py +4 -2
- oci/database/models/external_database_base.py +4 -2
- oci/database/models/external_non_container_database.py +4 -2
- oci/database/models/external_non_container_database_summary.py +4 -2
- oci/database/models/external_pluggable_database.py +4 -2
- oci/database/models/external_pluggable_database_summary.py +4 -2
- oci/database_management/db_management_client.py +356 -230
- oci/database_management/db_management_client_composite_operations.py +44 -0
- oci/database_management/diagnosability_client.py +4 -4
- oci/database_management/managed_my_sql_databases_client.py +7 -247
- oci/database_management/models/__init__.py +0 -4
- oci/database_management/models/database_diagnostics_and_management_feature_details.py +35 -4
- oci/database_management/models/disable_database_management_feature_details.py +33 -2
- oci/database_management/models/disable_external_container_database_management_feature_details.py +33 -2
- oci/database_management/models/discovered_external_database.py +64 -2
- oci/database_management/models/exadata_infrastructure_lifecycle_state_values.py +40 -36
- oci/database_management/models/external_database_diagnostics_and_management_feature_details.py +64 -2
- oci/database_management/models/managed_database.py +2 -4
- oci/database_management/models/managed_database_summary.py +2 -4
- oci/database_management/models/modify_database_management_feature_details.py +1 -1
- oci/database_management/perfhub_client.py +1 -1
- oci/database_management/sql_tuning_client.py +17 -17
- oci/database_migration/database_migration_client.py +42 -42
- oci/database_tools/database_tools_client.py +23 -23
- oci/dblm/db_life_cycle_management_client.py +14 -14
- oci/delegate_access_control/delegate_access_control_client.py +26 -26
- oci/delegate_access_control/work_request_client.py +4 -4
- oci/demand_signal/occ_demand_signal_client.py +7 -7
- oci/desktops/desktop_service_client.py +21 -21
- oci/devops/devops_client.py +141 -141
- oci/disaster_recovery/disaster_recovery_client.py +31 -31
- oci/distributed_database/__init__.py +20 -0
- oci/distributed_database/distributed_autonomous_db_service_client.py +2315 -0
- oci/distributed_database/distributed_autonomous_db_service_client_composite_operations.py +605 -0
- oci/distributed_database/distributed_db_private_endpoint_service_client.py +944 -0
- oci/distributed_database/distributed_db_private_endpoint_service_client_composite_operations.py +238 -0
- oci/distributed_database/distributed_db_service_client.py +2435 -0
- oci/distributed_database/distributed_db_service_client_composite_operations.py +647 -0
- oci/distributed_database/distributed_db_work_request_service_client.py +654 -0
- oci/distributed_database/distributed_db_work_request_service_client_composite_operations.py +26 -0
- oci/distributed_database/models/__init__.py +158 -0
- oci/distributed_database/models/add_distributed_autonomous_database_gds_control_node_details.py +105 -0
- oci/distributed_database/models/add_distributed_database_gds_control_node_details.py +105 -0
- oci/distributed_database/models/catalog_peer_with_dedicated_infra.py +331 -0
- oci/distributed_database/models/catalog_peer_with_exadb_xs.py +331 -0
- oci/distributed_database/models/change_distributed_autonomous_database_compartment_details.py +74 -0
- oci/distributed_database/models/change_distributed_database_compartment_details.py +74 -0
- oci/distributed_database/models/change_distributed_database_private_endpoint_compartment_details.py +74 -0
- oci/distributed_database/models/change_distributed_db_backup_config_details.py +66 -0
- oci/distributed_database/models/configure_distributed_autonomous_database_gsms_details.py +103 -0
- oci/distributed_database/models/configure_distributed_database_gsms_details.py +103 -0
- oci/distributed_database/models/create_distributed_autonomous_database_catalog_details.py +101 -0
- oci/distributed_database/models/create_distributed_autonomous_database_catalog_with_dedicated_infra_details.py +342 -0
- oci/distributed_database/models/create_distributed_autonomous_database_details.py +799 -0
- oci/distributed_database/models/create_distributed_autonomous_database_shard_details.py +101 -0
- oci/distributed_database/models/create_distributed_autonomous_database_shard_with_dedicated_infra_details.py +377 -0
- oci/distributed_database/models/create_distributed_database_catalog_details.py +99 -0
- oci/distributed_database/models/create_distributed_database_catalog_with_exadb_xs_details.py +282 -0
- oci/distributed_database/models/create_distributed_database_details.py +810 -0
- oci/distributed_database/models/create_distributed_database_private_endpoint_details.py +260 -0
- oci/distributed_database/models/create_distributed_database_shard_details.py +99 -0
- oci/distributed_database/models/create_distributed_database_shard_with_exadb_xs_details.py +282 -0
- oci/distributed_database/models/distributed_autonomous_database.py +1143 -0
- oci/distributed_database/models/distributed_autonomous_database_associated_with_private_endpoint.py +105 -0
- oci/distributed_database/models/distributed_autonomous_database_catalog.py +194 -0
- oci/distributed_database/models/distributed_autonomous_database_catalog_with_dedicated_infra.py +559 -0
- oci/distributed_database/models/distributed_autonomous_database_collection.py +70 -0
- oci/distributed_database/models/distributed_autonomous_database_connection_string.py +70 -0
- oci/distributed_database/models/distributed_autonomous_database_gsm.py +385 -0
- oci/distributed_database/models/distributed_autonomous_database_gsm_image.py +105 -0
- oci/distributed_database/models/distributed_autonomous_database_shard.py +194 -0
- oci/distributed_database/models/distributed_autonomous_database_shard_with_dedicated_infra.py +592 -0
- oci/distributed_database/models/distributed_autonomous_database_summary.py +935 -0
- oci/distributed_database/models/distributed_autonomous_db_metadata.py +70 -0
- oci/distributed_database/models/distributed_database.py +1154 -0
- oci/distributed_database/models/distributed_database_associated_with_private_endpoint.py +105 -0
- oci/distributed_database/models/distributed_database_catalog.py +192 -0
- oci/distributed_database/models/distributed_database_catalog_with_exadb_xs.py +466 -0
- oci/distributed_database/models/distributed_database_collection.py +70 -0
- oci/distributed_database/models/distributed_database_gsm.py +385 -0
- oci/distributed_database/models/distributed_database_private_endpoint.py +639 -0
- oci/distributed_database/models/distributed_database_private_endpoint_collection.py +70 -0
- oci/distributed_database/models/distributed_database_private_endpoint_summary.py +479 -0
- oci/distributed_database/models/distributed_database_shard.py +192 -0
- oci/distributed_database/models/distributed_database_shard_with_exadb_xs.py +499 -0
- oci/distributed_database/models/distributed_database_summary.py +904 -0
- oci/distributed_database/models/distributed_db_backup_config.py +536 -0
- oci/distributed_database/models/distributed_db_backup_destination.py +362 -0
- oci/distributed_database/models/distributed_db_connection_string.py +70 -0
- oci/distributed_database/models/distributed_db_gsm_image.py +105 -0
- oci/distributed_database/models/distributed_db_metadata.py +70 -0
- oci/distributed_database/models/generate_distributed_autonomous_database_wallet_details.py +70 -0
- oci/distributed_database/models/generate_distributed_database_wallet_details.py +70 -0
- oci/distributed_database/models/patch_distributed_autonomous_database_details.py +73 -0
- oci/distributed_database/models/patch_distributed_database_details.py +73 -0
- oci/distributed_database/models/patch_insert_instruction.py +87 -0
- oci/distributed_database/models/patch_instruction.py +154 -0
- oci/distributed_database/models/patch_merge_instruction.py +95 -0
- oci/distributed_database/models/patch_remove_instruction.py +57 -0
- oci/distributed_database/models/shard_peer_with_dedicated_infra.py +331 -0
- oci/distributed_database/models/shard_peer_with_exadb_xs.py +331 -0
- oci/distributed_database/models/update_distributed_autonomous_database_details.py +136 -0
- oci/distributed_database/models/update_distributed_database_details.py +136 -0
- oci/distributed_database/models/update_distributed_database_private_endpoint_details.py +198 -0
- oci/distributed_database/models/upload_distributed_autonomous_database_signed_certificate_and_generate_wallet_details.py +71 -0
- oci/distributed_database/models/upload_distributed_database_signed_certificate_and_generate_wallet_details.py +71 -0
- oci/distributed_database/models/work_request.py +516 -0
- oci/distributed_database/models/work_request_error.py +134 -0
- oci/distributed_database/models/work_request_error_collection.py +70 -0
- oci/distributed_database/models/work_request_log_entry.py +101 -0
- oci/distributed_database/models/work_request_log_entry_collection.py +70 -0
- oci/distributed_database/models/work_request_resource.py +232 -0
- oci/distributed_database/models/work_request_summary.py +516 -0
- oci/distributed_database/models/work_request_summary_collection.py +70 -0
- oci/dns/dns_client.py +54 -54
- oci/dts/appliance_export_job_client.py +6 -6
- oci/dts/shipping_vendors_client.py +1 -1
- oci/dts/transfer_appliance_client.py +8 -8
- oci/dts/transfer_appliance_entitlement_client.py +3 -3
- oci/dts/transfer_device_client.py +5 -5
- oci/dts/transfer_job_client.py +6 -6
- oci/dts/transfer_package_client.py +7 -7
- oci/em_warehouse/em_warehouse_client.py +13 -13
- oci/email/email_client.py +31 -31
- oci/email_data_plane/email_dp_client.py +1 -1
- oci/events/events_client.py +6 -6
- oci/file_storage/file_storage_client.py +74 -74
- oci/fleet_apps_management/fleet_apps_management_admin_client.py +27 -27
- oci/fleet_apps_management/fleet_apps_management_catalog_client.py +7 -7
- oci/fleet_apps_management/fleet_apps_management_client.py +32 -32
- oci/fleet_apps_management/fleet_apps_management_maintenance_window_client.py +5 -5
- oci/fleet_apps_management/fleet_apps_management_operations_client.py +29 -29
- oci/fleet_apps_management/fleet_apps_management_provision_client.py +6 -6
- oci/fleet_apps_management/fleet_apps_management_runbooks_client.py +19 -19
- oci/fleet_apps_management/fleet_apps_management_work_request_client.py +4 -4
- oci/fleet_software_update/fleet_software_update_client.py +46 -46
- oci/functions/functions_invoke_client.py +1 -1
- oci/functions/functions_management_client.py +16 -16
- oci/fusion_apps/fusion_applications_client.py +41 -41
- oci/generative_ai/generative_ai_client.py +22 -22
- oci/generative_ai/models/create_dedicated_ai_cluster_details.py +4 -0
- oci/generative_ai/models/dedicated_ai_cluster.py +11 -3
- oci/generative_ai_agent/generative_ai_agent_client.py +38 -38
- oci/generative_ai_agent_runtime/generative_ai_agent_runtime_client.py +6 -6
- oci/generative_ai_inference/generative_ai_inference_client.py +6 -6
- oci/generic_artifacts_content/generic_artifacts_content_client.py +3 -3
- oci/globally_distributed_database/sharded_database_service_client.py +58 -58
- oci/golden_gate/golden_gate_client.py +89 -89
- oci/governance_rules_control_plane/governance_rule_client.py +15 -15
- oci/governance_rules_control_plane/work_request_client.py +5 -5
- oci/healthchecks/health_checks_client.py +17 -17
- oci/identity/identity_client.py +145 -145
- oci/identity_data_plane/dataplane_client.py +2 -2
- oci/identity_domains/identity_domains_client.py +311 -311
- oci/integration/integration_instance_client.py +19 -19
- oci/jms/java_management_service_client.py +79 -79
- oci/jms_java_downloads/java_download_client.py +25 -25
- oci/key_management/ekm_client.py +5 -5
- oci/key_management/kms_crypto_client.py +6 -6
- oci/key_management/kms_hsm_cluster_client.py +12 -12
- oci/key_management/kms_management_client.py +21 -21
- oci/key_management/kms_vault_client.py +14 -14
- oci/license_manager/license_manager_client.py +18 -18
- oci/limits/limits_client.py +4 -4
- oci/limits/quotas_client.py +7 -7
- oci/load_balancer/load_balancer_client.py +61 -61
- oci/lockbox/lockbox_client.py +24 -24
- oci/log_analytics/log_analytics_client.py +200 -200
- oci/logging/logging_management_client.py +30 -30
- oci/loggingingestion/logging_client.py +1 -1
- oci/loggingsearch/log_search_client.py +1 -1
- oci/lustre_file_storage/lustre_file_storage_client.py +11 -11
- oci/management_agent/management_agent_client.py +28 -28
- oci/management_dashboard/dashx_apis_client.py +14 -14
- oci/marketplace/account_client.py +2 -2
- oci/marketplace/marketplace_client.py +30 -30
- oci/marketplace_private_offer/attachment_client.py +5 -5
- oci/marketplace_private_offer/offer_client.py +6 -6
- oci/marketplace_publisher/attachment_client.py +5 -5
- oci/marketplace_publisher/marketplace_publisher_client.py +71 -71
- oci/marketplace_publisher/offer_client.py +6 -6
- oci/media_services/media_services_client.py +60 -60
- oci/media_services/media_stream_client.py +2 -2
- oci/mngdmac/mac_device_client.py +3 -3
- oci/mngdmac/mac_order_client.py +11 -11
- oci/model_deployment/__init__.py +14 -0
- oci/model_deployment/model_deployment_client.py +331 -0
- oci/model_deployment/model_deployment_client_composite_operations.py +26 -0
- oci/model_deployment/models/__init__.py +14 -0
- oci/model_deployment/models/inference_result.py +70 -0
- oci/monitoring/monitoring_client.py +18 -18
- oci/mysql/channels_client.py +7 -7
- oci/mysql/db_backups_client.py +7 -7
- oci/mysql/db_system_client.py +17 -17
- oci/mysql/models/create_db_system_details.py +31 -0
- oci/mysql/models/db_system.py +31 -0
- oci/mysql/models/db_system_snapshot.py +31 -0
- oci/mysql/models/replica.py +31 -0
- oci/mysql/models/replica_overrides.py +33 -2
- oci/mysql/models/replica_summary.py +31 -0
- oci/mysql/models/update_db_system_details.py +31 -0
- oci/mysql/mysqlaas_client.py +7 -7
- oci/mysql/replicas_client.py +5 -5
- oci/mysql/work_requests_client.py +4 -4
- oci/network_firewall/network_firewall_client.py +86 -86
- oci/network_load_balancer/network_load_balancer_client.py +35 -35
- oci/nosql/nosql_client.py +24 -24
- oci/object_storage/object_storage_client.py +55 -55
- oci/oce/oce_instance_client.py +10 -10
- oci/oci_control_center/occ_metrics_client.py +3 -3
- oci/ocvp/cluster_client.py +5 -5
- oci/ocvp/esxi_host_client.py +8 -8
- oci/ocvp/sddc_client.py +14 -14
- oci/ocvp/work_request_client.py +4 -4
- oci/oda/management_client.py +59 -59
- oci/oda/oda_client.py +17 -17
- oci/oda/odapackage_client.py +7 -7
- oci/onesubscription/billing_schedule_client.py +1 -1
- oci/onesubscription/commitment_client.py +2 -2
- oci/onesubscription/computed_usage_client.py +3 -3
- oci/onesubscription/invoice_summary_client.py +2 -2
- oci/onesubscription/organization_subscription_client.py +1 -1
- oci/onesubscription/ratecard_client.py +1 -1
- oci/onesubscription/subscribed_service_client.py +2 -2
- oci/onesubscription/subscription_client.py +1 -1
- oci/ons/notification_control_plane_client.py +6 -6
- oci/ons/notification_data_plane_client.py +10 -10
- oci/opa/opa_instance_client.py +13 -13
- oci/opensearch/models/__init__.py +2 -0
- oci/opensearch/models/create_opensearch_cluster_details.py +291 -0
- oci/opensearch/models/create_opensearch_cluster_pipeline_details.py +31 -0
- oci/opensearch/models/opensearch_cluster.py +291 -0
- oci/opensearch/models/opensearch_cluster_pipeline.py +31 -0
- oci/opensearch/models/opensearch_cluster_pipeline_summary.py +31 -0
- oci/opensearch/models/resize_opensearch_cluster_horizontal_details.py +31 -0
- oci/opensearch/models/resize_opensearch_cluster_vertical_details.py +217 -0
- oci/opensearch/models/shapes_details.py +70 -0
- oci/opensearch/models/update_cluster_specs_details.py +186 -0
- oci/opensearch/models/update_opensearch_cluster_pipeline_details.py +31 -0
- oci/opensearch/opensearch_cluster_backup_client.py +4 -4
- oci/opensearch/opensearch_cluster_client.py +87 -16
- oci/opensearch/opensearch_cluster_pipeline_client.py +5 -5
- oci/operator_access_control/access_requests_client.py +10 -10
- oci/operator_access_control/operator_actions_client.py +2 -2
- oci/operator_access_control/operator_control_assignment_client.py +8 -8
- oci/operator_access_control/operator_control_client.py +6 -6
- oci/opsi/operations_insights_client.py +181 -181
- oci/optimizer/optimizer_client.py +26 -26
- oci/os_management/event_client.py +8 -8
- oci/os_management/os_management_client.py +69 -69
- oci/os_management_hub/event_client.py +8 -8
- oci/os_management_hub/lifecycle_environment_client.py +13 -13
- oci/os_management_hub/managed_instance_client.py +33 -33
- oci/os_management_hub/managed_instance_group_client.py +26 -26
- oci/os_management_hub/management_station_client.py +10 -10
- oci/os_management_hub/onboarding_client.py +13 -13
- oci/os_management_hub/reporting_managed_instance_client.py +3 -3
- oci/os_management_hub/scheduled_job_client.py +7 -7
- oci/os_management_hub/software_source_client.py +33 -33
- oci/os_management_hub/work_request_client.py +5 -5
- oci/osp_gateway/address_rule_service_client.py +1 -1
- oci/osp_gateway/address_service_client.py +2 -2
- oci/osp_gateway/invoice_service_client.py +5 -5
- oci/osp_gateway/subscription_service_client.py +5 -5
- oci/osub_billing_schedule/billing_schedule_client.py +1 -1
- oci/osub_organization_subscription/organization_subscription_client.py +1 -1
- oci/osub_subscription/commitment_client.py +2 -2
- oci/osub_subscription/ratecard_client.py +1 -1
- oci/osub_subscription/subscription_client.py +1 -1
- oci/osub_usage/computed_usage_client.py +3 -3
- oci/psql/postgresql_client.py +34 -34
- oci/queue/queue_admin_client.py +11 -11
- oci/queue/queue_client.py +8 -8
- oci/recovery/database_recovery_client.py +26 -26
- oci/redis/redis_cluster_client.py +12 -12
- oci/resource_manager/resource_manager_client.py +52 -52
- oci/resource_scheduler/schedule_client.py +14 -14
- oci/resource_search/resource_search_client.py +3 -3
- oci/rover/rover_bundle_client.py +8 -8
- oci/rover/rover_cluster_client.py +8 -8
- oci/rover/rover_entitlement_client.py +6 -6
- oci/rover/rover_node_client.py +15 -15
- oci/rover/shape_client.py +1 -1
- oci/rover/work_requests_client.py +5 -5
- oci/sch/connector_plugins_client.py +2 -2
- oci/sch/service_connector_client.py +12 -12
- oci/secrets/secrets_client.py +3 -3
- oci/security_attribute/security_attribute_client.py +18 -18
- oci/service_catalog/service_catalog_client.py +26 -26
- oci/service_manager_proxy/service_manager_proxy_client.py +2 -2
- oci/service_mesh/service_mesh_client.py +48 -48
- oci/stack_monitoring/stack_monitoring_client.py +87 -87
- oci/streaming/stream_admin_client.py +18 -18
- oci/streaming/stream_client.py +8 -8
- oci/tenant_manager_control_plane/domain_client.py +5 -5
- oci/tenant_manager_control_plane/domain_governance_client.py +5 -5
- oci/tenant_manager_control_plane/governance_client.py +2 -2
- oci/tenant_manager_control_plane/link_client.py +3 -3
- oci/tenant_manager_control_plane/orders_client.py +2 -2
- oci/tenant_manager_control_plane/organization_client.py +10 -10
- oci/tenant_manager_control_plane/recipient_invitation_client.py +5 -5
- oci/tenant_manager_control_plane/sender_invitation_client.py +5 -5
- oci/tenant_manager_control_plane/subscription_client.py +11 -11
- oci/tenant_manager_control_plane/work_request_client.py +4 -4
- oci/threat_intelligence/threatintel_client.py +5 -5
- oci/usage/resources_client.py +2 -2
- oci/usage/rewards_client.py +6 -6
- oci/usage/usagelimits_client.py +1 -1
- oci/usage_api/usageapi_client.py +33 -33
- oci/vault/vaults_client.py +13 -13
- oci/vbs_inst/vbs_instance_client.py +10 -10
- oci/version.py +1 -1
- oci/visual_builder/vb_instance_client.py +14 -14
- oci/vn_monitoring/vn_monitoring_client.py +12 -12
- oci/vulnerability_scanning/vulnerability_scanning_client.py +58 -58
- oci/waa/waa_client.py +13 -13
- oci/waa/work_request_client.py +4 -4
- oci/waas/redirect_client.py +6 -6
- oci/waas/waas_client.py +66 -66
- oci/waf/waf_client.py +24 -24
- oci/work_requests/work_request_client.py +4 -4
- oci/zpr/zpr_client.py +15 -15
- {oci-2.151.0.dist-info → oci-2.152.1.dist-info}/METADATA +6 -1
- {oci-2.151.0.dist-info → oci-2.152.1.dist-info}/RECORD +428 -313
- oci/database_management/models/disable_external_mysql_associated_service_details.py +0 -144
- oci/database_management/models/enable_external_mysql_associated_service_details.py +0 -144
- {oci-2.151.0.dist-info → oci-2.152.1.dist-info}/LICENSE.txt +0 -0
- {oci-2.151.0.dist-info → oci-2.152.1.dist-info}/THIRD_PARTY_LICENSES.txt +0 -0
- {oci-2.151.0.dist-info → oci-2.152.1.dist-info}/WHEEL +0 -0
- {oci-2.151.0.dist-info → oci-2.152.1.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,5 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
# Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
|
3
|
+
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.
|
4
|
+
|
5
|
+
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
# Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
|
3
|
+
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.
|
4
|
+
|
5
|
+
from abc import ABC, abstractmethod
|
6
|
+
from typing import Any, Dict
|
7
|
+
|
8
|
+
|
9
|
+
class AuthProvider(ABC):
|
10
|
+
"""Base class for authentication providers."""
|
11
|
+
|
12
|
+
@abstractmethod
|
13
|
+
def get_config(self) -> Dict[str, Any]:
|
14
|
+
"""Get service-specific configuration.
|
15
|
+
|
16
|
+
Returns:
|
17
|
+
Dict[str, Any]: Configuration dictionary
|
18
|
+
"""
|
19
|
+
pass
|
20
|
+
|
21
|
+
@abstractmethod
|
22
|
+
def get_auth_credentials(self) -> Any:
|
23
|
+
"""Get authentication credentials.
|
24
|
+
|
25
|
+
Returns:
|
26
|
+
Any: Authentication credentials (e.g., API key, signer)
|
27
|
+
"""
|
28
|
+
pass
|
@@ -0,0 +1,78 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
# Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
|
3
|
+
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.
|
4
|
+
|
5
|
+
from enum import Enum
|
6
|
+
from typing import Optional
|
7
|
+
|
8
|
+
import oci.config
|
9
|
+
|
10
|
+
from oci.addons.adk.auth.auth_provider import AuthProvider
|
11
|
+
from oci.addons.adk.auth.oci.instance_principal import OCIInstancePrincipalAuth
|
12
|
+
from oci.addons.adk.auth.oci.resource_principal import OCIResourcePrincipalAuth
|
13
|
+
from oci.addons.adk.auth.oci.session import OCISessionAuth
|
14
|
+
from oci.addons.adk.auth.oci.user_principal import OCIUserPrincipalAuth
|
15
|
+
|
16
|
+
|
17
|
+
class OCIAuthType(str, Enum):
|
18
|
+
"""OCI authentication types as enumerator."""
|
19
|
+
|
20
|
+
API_KEY = "api_key"
|
21
|
+
SECURITY_TOKEN = "security_token"
|
22
|
+
INSTANCE_PRINCIPAL = "instance_principal"
|
23
|
+
RESOURCE_PRINCIPAL = "resource_principal"
|
24
|
+
|
25
|
+
|
26
|
+
class AuthFactory:
|
27
|
+
"""Factory for creating authentication providers."""
|
28
|
+
|
29
|
+
@staticmethod
|
30
|
+
def create_oci_auth(
|
31
|
+
auth_type: OCIAuthType,
|
32
|
+
config_path: Optional[str] = oci.config.DEFAULT_LOCATION,
|
33
|
+
profile: Optional[str] = oci.config.DEFAULT_PROFILE,
|
34
|
+
token: Optional[str] = None,
|
35
|
+
region: Optional[str] = None,
|
36
|
+
) -> AuthProvider:
|
37
|
+
"""Create OCI authentication provider.
|
38
|
+
|
39
|
+
Args:
|
40
|
+
auth_type (str): Type of OCI auth. One of: 'user_principal',
|
41
|
+
'instance_principal', 'security_token'
|
42
|
+
|
43
|
+
config_path (Optional[str]): Path to OCI config file. Required for
|
44
|
+
user_principal and session auth.
|
45
|
+
|
46
|
+
profile (Optional[str]): Profile name in config.
|
47
|
+
Only used with user_principal and session auth. Defaults to "DEFAULT".
|
48
|
+
|
49
|
+
token (Optional[str]): token string.
|
50
|
+
region (Optional[str]): OCI region.
|
51
|
+
|
52
|
+
Returns:
|
53
|
+
AuthProvider: OCI auth provider
|
54
|
+
|
55
|
+
Raises:
|
56
|
+
ValueError: If auth_type is invalid or required args are missing
|
57
|
+
"""
|
58
|
+
# Validate auth_type first
|
59
|
+
if auth_type not in OCIAuthType:
|
60
|
+
raise ValueError(
|
61
|
+
f"Invalid auth_type: {auth_type}. Must be one of: "
|
62
|
+
f"{', '.join(repr(t) for t in OCIAuthType)}"
|
63
|
+
)
|
64
|
+
|
65
|
+
if auth_type == OCIAuthType.INSTANCE_PRINCIPAL:
|
66
|
+
return OCIInstancePrincipalAuth(security_token=token, region=region)
|
67
|
+
|
68
|
+
if auth_type == OCIAuthType.RESOURCE_PRINCIPAL:
|
69
|
+
return OCIResourcePrincipalAuth(security_token=token, region=region)
|
70
|
+
|
71
|
+
if auth_type == OCIAuthType.API_KEY:
|
72
|
+
return OCIUserPrincipalAuth(config_path=config_path, profile=profile)
|
73
|
+
|
74
|
+
if auth_type == OCIAuthType.SECURITY_TOKEN:
|
75
|
+
return OCISessionAuth(config_path=config_path, profile=profile)
|
76
|
+
|
77
|
+
# This code is unreachable since we validate auth_type at the start
|
78
|
+
raise ValueError(f"Unsupported auth_type: {auth_type}") # pragma: no cover
|
@@ -0,0 +1,5 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
# Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
|
3
|
+
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.
|
4
|
+
|
5
|
+
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.
|
@@ -0,0 +1,53 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
# Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
|
3
|
+
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.
|
4
|
+
|
5
|
+
from typing import Any, Dict, Optional
|
6
|
+
|
7
|
+
import oci
|
8
|
+
|
9
|
+
from oci.addons.adk.auth.auth_provider import AuthProvider
|
10
|
+
|
11
|
+
|
12
|
+
class OCIInstancePrincipalAuth(AuthProvider):
|
13
|
+
"""OCI Authentication Provider using instance principal."""
|
14
|
+
|
15
|
+
def __init__(
|
16
|
+
self, security_token: Optional[str] = None, region: Optional[str] = None
|
17
|
+
):
|
18
|
+
"""Initialize OCI Instance Principal Auth Provider.
|
19
|
+
|
20
|
+
Args:
|
21
|
+
security_token (Optional[str]): Security token for authentication
|
22
|
+
region (Optional[str]): OCI region
|
23
|
+
"""
|
24
|
+
self._signer: oci.signer.AbstractBaseSigner | None = None
|
25
|
+
self.region = region
|
26
|
+
|
27
|
+
def get_config(self) -> Dict[str, Any]:
|
28
|
+
"""Get OCI configuration.
|
29
|
+
|
30
|
+
Returns:
|
31
|
+
Dict[str, Any]: OCI configuration dictionary with region and tenancy
|
32
|
+
|
33
|
+
Raises:
|
34
|
+
Exception: If instance principal auth is not configured
|
35
|
+
"""
|
36
|
+
signer = self.get_auth_credentials()
|
37
|
+
config = {"region": signer.region, "tenancy": signer.tenancy_id} # type: ignore[attr-defined]
|
38
|
+
if self.region:
|
39
|
+
config["region"] = self.region
|
40
|
+
return config
|
41
|
+
|
42
|
+
def get_auth_credentials(self) -> oci.signer.AbstractBaseSigner:
|
43
|
+
"""Get OCI instance principal signer.
|
44
|
+
|
45
|
+
Returns:
|
46
|
+
oci.signer.AbstractBaseSigner: OCI instance principal signer
|
47
|
+
|
48
|
+
Raises:
|
49
|
+
Exception: If instance principal auth is not configured
|
50
|
+
"""
|
51
|
+
if self._signer is None:
|
52
|
+
self._signer = oci.auth.signers.InstancePrincipalsSecurityTokenSigner()
|
53
|
+
return self._signer
|
@@ -0,0 +1,53 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
# Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
|
3
|
+
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.
|
4
|
+
|
5
|
+
from typing import Any, Dict, Optional
|
6
|
+
|
7
|
+
import oci
|
8
|
+
|
9
|
+
from oci.addons.adk.auth.auth_provider import AuthProvider
|
10
|
+
|
11
|
+
|
12
|
+
class OCIResourcePrincipalAuth(AuthProvider):
|
13
|
+
"""OCI Authentication Provider using resource principal."""
|
14
|
+
|
15
|
+
def __init__(
|
16
|
+
self, security_token: Optional[str] = None, region: Optional[str] = None
|
17
|
+
):
|
18
|
+
"""Initialize OCI Resource Principal Auth Provider.
|
19
|
+
|
20
|
+
Args:
|
21
|
+
security_token (Optional[str]): Security token for authentication
|
22
|
+
region (Optional[str]): OCI region
|
23
|
+
"""
|
24
|
+
self._signer = None
|
25
|
+
self.region = region
|
26
|
+
|
27
|
+
def get_config(self) -> Dict[str, Any]:
|
28
|
+
"""Get OCI configuration.
|
29
|
+
|
30
|
+
Returns:
|
31
|
+
Dict[str, Any]: OCI configuration dictionary with region and tenancy
|
32
|
+
|
33
|
+
Raises:
|
34
|
+
Exception: If resource principal auth is not configured
|
35
|
+
"""
|
36
|
+
signer = self.get_auth_credentials()
|
37
|
+
config = {"region": signer.region, "tenancy": signer.tenancy_id} # type: ignore[attr-defined]
|
38
|
+
if self.region:
|
39
|
+
config["region"] = self.region
|
40
|
+
return config
|
41
|
+
|
42
|
+
def get_auth_credentials(self) -> oci.signer.AbstractBaseSigner:
|
43
|
+
"""Get OCI resource principal signer.
|
44
|
+
|
45
|
+
Returns:
|
46
|
+
oci.signer.AbstractBaseSigner: OCI resource principal signer
|
47
|
+
|
48
|
+
Raises:
|
49
|
+
Exception: If resource principal auth is not configured
|
50
|
+
"""
|
51
|
+
if self._signer is None:
|
52
|
+
self._signer = oci.auth.signers.get_resource_principals_signer()
|
53
|
+
return self._signer # type: ignore[return-value]
|
@@ -0,0 +1,91 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
# Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
|
3
|
+
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.
|
4
|
+
|
5
|
+
from typing import Any, Dict, Optional
|
6
|
+
|
7
|
+
import oci
|
8
|
+
|
9
|
+
from oci.addons.adk.auth.auth_provider import AuthProvider
|
10
|
+
|
11
|
+
|
12
|
+
class OCISessionAuth(AuthProvider):
|
13
|
+
"""OCI Authentication Provider using session authentication."""
|
14
|
+
|
15
|
+
def __init__(
|
16
|
+
self,
|
17
|
+
config_path: Optional[str] = oci.config.DEFAULT_LOCATION,
|
18
|
+
profile: Optional[str] = oci.config.DEFAULT_PROFILE,
|
19
|
+
):
|
20
|
+
"""Initialize OCI Session Auth Provider.
|
21
|
+
|
22
|
+
Args:
|
23
|
+
config_path (str): Path to OCI config file
|
24
|
+
profile (str): Profile name to use from config file. Defaults to "DEFAULT".
|
25
|
+
"""
|
26
|
+
self.config_path = config_path
|
27
|
+
self.profile = profile
|
28
|
+
self._config: Optional[Dict[str, Any]] = None
|
29
|
+
self._signer: Optional[oci.signer.AbstractBaseSigner] = None
|
30
|
+
|
31
|
+
def get_config(self) -> Dict[str, Any]:
|
32
|
+
"""Get OCI configuration from config file.
|
33
|
+
|
34
|
+
Returns:
|
35
|
+
Dict[str, Any]: OCI configuration
|
36
|
+
|
37
|
+
Raises:
|
38
|
+
oci.exceptions.InvalidConfig: If config validation fails
|
39
|
+
FileNotFoundError: If security token file not found
|
40
|
+
"""
|
41
|
+
if self._config is None:
|
42
|
+
self._config = oci.config.from_file(
|
43
|
+
file_location=self.config_path, profile_name=self.profile
|
44
|
+
)
|
45
|
+
|
46
|
+
# Verify required fields for session auth
|
47
|
+
required_fields = ["key_file", "security_token_file", "region"]
|
48
|
+
missing_fields = [
|
49
|
+
field for field in required_fields if field not in (self._config or {})
|
50
|
+
]
|
51
|
+
if missing_fields:
|
52
|
+
raise oci.exceptions.InvalidConfig(
|
53
|
+
{field: "missing" for field in missing_fields}
|
54
|
+
)
|
55
|
+
return self._config or {}
|
56
|
+
|
57
|
+
def get_auth_credentials(self) -> oci.signer.AbstractBaseSigner:
|
58
|
+
"""Get OCI signer using security token authentication.
|
59
|
+
|
60
|
+
Returns:
|
61
|
+
oci.signer.AbstractBaseSigner: OCI signer for authentication
|
62
|
+
|
63
|
+
Raises:
|
64
|
+
oci.exceptions.InvalidConfig: If config validation fails
|
65
|
+
FileNotFoundError: If key file or security token file not found
|
66
|
+
"""
|
67
|
+
if self._signer is None:
|
68
|
+
config = self.get_config()
|
69
|
+
|
70
|
+
key_file = config.get("key_file")
|
71
|
+
if not key_file:
|
72
|
+
raise oci.exceptions.InvalidConfig({"key_file": "missing"})
|
73
|
+
|
74
|
+
security_token_file = config.get("security_token_file")
|
75
|
+
if not security_token_file:
|
76
|
+
raise oci.exceptions.InvalidConfig({"security_token_file": "missing"})
|
77
|
+
|
78
|
+
# Load private key
|
79
|
+
private_key = oci.signer.load_private_key_from_file(
|
80
|
+
key_file,
|
81
|
+
None, # No passphrase
|
82
|
+
)
|
83
|
+
|
84
|
+
# Load security token
|
85
|
+
with open(security_token_file) as f:
|
86
|
+
security_token = f.read()
|
87
|
+
|
88
|
+
self._signer = oci.auth.signers.SecurityTokenSigner(
|
89
|
+
security_token, private_key
|
90
|
+
)
|
91
|
+
return self._signer
|
@@ -0,0 +1,64 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
# Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
|
3
|
+
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.
|
4
|
+
|
5
|
+
from typing import Any, Dict, Optional
|
6
|
+
|
7
|
+
import oci
|
8
|
+
|
9
|
+
from oci.addons.adk.auth.auth_provider import AuthProvider
|
10
|
+
|
11
|
+
|
12
|
+
class OCIUserPrincipalAuth(AuthProvider):
|
13
|
+
"""OCI Authentication Provider using user principal."""
|
14
|
+
|
15
|
+
def __init__(
|
16
|
+
self,
|
17
|
+
config_path: Optional[str] = oci.config.DEFAULT_LOCATION,
|
18
|
+
profile: Optional[str] = oci.config.DEFAULT_PROFILE,
|
19
|
+
):
|
20
|
+
"""Initialize OCI User Principal Auth Provider.
|
21
|
+
|
22
|
+
Args:
|
23
|
+
config_path (Optional[str]): Path to OCI config file,
|
24
|
+
and defaults to '~/.oci/config'.
|
25
|
+
profile (Optional[str]): Profile to use from config file.
|
26
|
+
Defaults to 'DEFAULT' if not specified.
|
27
|
+
"""
|
28
|
+
self.config_path = config_path
|
29
|
+
self.profile = profile
|
30
|
+
self._config = None
|
31
|
+
self._signer = None
|
32
|
+
|
33
|
+
def get_config(self) -> Dict[str, Any]:
|
34
|
+
"""Get OCI configuration.
|
35
|
+
|
36
|
+
Returns:
|
37
|
+
Dict[str, Any]: OCI configuration dictionary
|
38
|
+
|
39
|
+
Raises:
|
40
|
+
oci.exceptions.ConfigFileError: If config file cannot be read
|
41
|
+
oci.exceptions.InvalidConfig: If config is invalid
|
42
|
+
"""
|
43
|
+
if self._config is None:
|
44
|
+
# Use the specified profile when loading config
|
45
|
+
config = oci.config.from_file(self.config_path, self.profile)
|
46
|
+
# Validate config before caching
|
47
|
+
oci.config.validate_config(config)
|
48
|
+
self._config = config
|
49
|
+
return self._config or {}
|
50
|
+
|
51
|
+
def get_auth_credentials(self) -> oci.signer.AbstractBaseSigner:
|
52
|
+
"""Get OCI signer for authentication.
|
53
|
+
|
54
|
+
Returns:
|
55
|
+
oci.signer.AbstractBaseSigner: OCI signer
|
56
|
+
|
57
|
+
Raises:
|
58
|
+
oci.exceptions.ConfigFileError: If config file cannot be read
|
59
|
+
oci.exceptions.InvalidConfig: If config is invalid
|
60
|
+
"""
|
61
|
+
if self._signer is None:
|
62
|
+
config = self.get_config()
|
63
|
+
self._signer = oci.signer.Signer.from_config(config)
|
64
|
+
return self._signer # type: ignore[return-value]
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
# Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
|
3
|
+
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.
|
4
|
+
|
5
|
+
"""
|
6
|
+
Constants for the Agent Development Kit
|
7
|
+
"""
|
8
|
+
|
9
|
+
FREEFORM_TAGS = {"ConfiguredByADK": "ADK-Python"}
|
10
|
+
|
11
|
+
DESC_SUFFIX = " created by ADK"
|
12
|
+
|
13
|
+
DEFAULT_TIMEOUT = (10, 240)
|
14
|
+
|
15
|
+
MAX_STATUS_CHECK = 20
|
16
|
+
|
17
|
+
DEFAULT_SESSION_NAME = "Default Session"
|
oci/addons/adk/logger.py
ADDED
@@ -0,0 +1,163 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
# Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
|
3
|
+
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.
|
4
|
+
|
5
|
+
import logging
|
6
|
+
import os
|
7
|
+
from typing import Any, Optional, Union
|
8
|
+
|
9
|
+
from rich.console import Console
|
10
|
+
from rich.logging import RichHandler
|
11
|
+
from rich.panel import Panel
|
12
|
+
from rich.traceback import install as install_rich_traceback
|
13
|
+
|
14
|
+
|
15
|
+
class ADKLogger:
|
16
|
+
"""
|
17
|
+
A customized logger for the Agent Development Kit
|
18
|
+
that uses RichHandler for console output
|
19
|
+
and FileHandler for file output.
|
20
|
+
Maintains rich formatting for console output while
|
21
|
+
providing configurable logging levels and file output.
|
22
|
+
"""
|
23
|
+
|
24
|
+
def __init__(
|
25
|
+
self,
|
26
|
+
name: str = "adk",
|
27
|
+
level: Union[int, str] = logging.INFO,
|
28
|
+
file_path: Optional[str] = None,
|
29
|
+
file_level: Union[int, str] = logging.DEBUG,
|
30
|
+
console: Optional[Console] = None,
|
31
|
+
):
|
32
|
+
"""
|
33
|
+
Initialize the ADK logger.
|
34
|
+
|
35
|
+
Args:
|
36
|
+
name: Logger name
|
37
|
+
level: Console logging level
|
38
|
+
(can be string like 'INFO' or int like logging.INFO)
|
39
|
+
file_path: Path to log file, if None, file logging is disabled
|
40
|
+
file_level: File logging level
|
41
|
+
console: Optional Rich console instance
|
42
|
+
"""
|
43
|
+
# Convert string level to int if necessary
|
44
|
+
if isinstance(level, str):
|
45
|
+
level = getattr(logging, level.upper(), logging.INFO)
|
46
|
+
|
47
|
+
if isinstance(file_level, str):
|
48
|
+
file_level = getattr(logging, file_level.upper(), logging.DEBUG)
|
49
|
+
|
50
|
+
# Initialize Rich console or use the provided one
|
51
|
+
self.console = console or Console(log_time=False, log_path=False)
|
52
|
+
|
53
|
+
# Install rich traceback handler for better exception display
|
54
|
+
install_rich_traceback()
|
55
|
+
|
56
|
+
# Create logger
|
57
|
+
self.logger = logging.getLogger(name)
|
58
|
+
self.logger.setLevel(min(level, file_level)) # Set to lowest of the two levels
|
59
|
+
self.logger.propagate = False # Prevent double logging
|
60
|
+
|
61
|
+
# Clear existing handlers if there are any
|
62
|
+
if self.logger.handlers:
|
63
|
+
self.logger.handlers.clear()
|
64
|
+
|
65
|
+
# Configure Rich handler for console output
|
66
|
+
self.shell_handler = RichHandler(
|
67
|
+
console=self.console,
|
68
|
+
rich_tracebacks=True,
|
69
|
+
markup=True,
|
70
|
+
show_time=True,
|
71
|
+
show_level=True,
|
72
|
+
show_path=False,
|
73
|
+
log_time_format="[%x %X] ",
|
74
|
+
)
|
75
|
+
self.shell_handler.setLevel(level)
|
76
|
+
self.logger.addHandler(self.shell_handler)
|
77
|
+
|
78
|
+
# Configure file handler if requested
|
79
|
+
self.file_handler = None
|
80
|
+
if file_path:
|
81
|
+
os.makedirs(os.path.dirname(file_path), exist_ok=True)
|
82
|
+
self.file_handler = logging.FileHandler(file_path)
|
83
|
+
self.file_handler.setLevel(file_level)
|
84
|
+
file_formatter = logging.Formatter(
|
85
|
+
"%(levelname)s %(asctime)s [%(name)s:%(filename)s:%(funcName)s:%(lineno)d] %(message)s" # noqa: E501
|
86
|
+
)
|
87
|
+
self.file_handler.setFormatter(file_formatter)
|
88
|
+
self.logger.addHandler(self.file_handler)
|
89
|
+
|
90
|
+
# Forward standard logging methods to the underlying logger
|
91
|
+
def __getattr__(self, name: str) -> Any:
|
92
|
+
"""
|
93
|
+
Forward any undefined attributes to the underlying logger.
|
94
|
+
This allows direct access to all standard logging methods like
|
95
|
+
debug(), info(), warning(), error(), etc.
|
96
|
+
"""
|
97
|
+
return getattr(self.logger, name)
|
98
|
+
|
99
|
+
def print(
|
100
|
+
self,
|
101
|
+
message: Any,
|
102
|
+
title: Optional[str] = None,
|
103
|
+
border_style: str = "blue",
|
104
|
+
expand: bool = False,
|
105
|
+
) -> None:
|
106
|
+
"""
|
107
|
+
Print a message in a panel with rich formatting,
|
108
|
+
mirroring console.print(Panel()).
|
109
|
+
|
110
|
+
Args:
|
111
|
+
message: The message to print
|
112
|
+
title: Optional title for the panel
|
113
|
+
border_style: Style for the panel border
|
114
|
+
expand: Whether to expand the panel to fill the terminal width
|
115
|
+
"""
|
116
|
+
panel = Panel(message, title=title, border_style=border_style, expand=expand)
|
117
|
+
self.console.print(panel)
|
118
|
+
# Also log to file if file handler is configured, but without rich formatting
|
119
|
+
if self.file_handler:
|
120
|
+
plain_message = f"[{title}] {str(message)}" if title else str(message)
|
121
|
+
self.logger.info(plain_message)
|
122
|
+
|
123
|
+
def print_exception(self, show_locals: bool = False) -> None:
|
124
|
+
"""
|
125
|
+
Print an exception with rich formatting, mirroring console.print_exception().
|
126
|
+
|
127
|
+
Args:
|
128
|
+
show_locals: Whether to show local variables
|
129
|
+
"""
|
130
|
+
self.console.print_exception(show_locals=show_locals)
|
131
|
+
self.logger.exception("Exception occurred")
|
132
|
+
|
133
|
+
|
134
|
+
# Create a default logger instance
|
135
|
+
default_logger = ADKLogger(
|
136
|
+
name="adk",
|
137
|
+
level=os.environ.get("ADK_LOG_LEVEL", "INFO"),
|
138
|
+
file_path=os.environ.get("ADK_LOG_FILE", None),
|
139
|
+
)
|
140
|
+
|
141
|
+
|
142
|
+
# Get a configured logger
|
143
|
+
def get_logger(
|
144
|
+
name: str = "adk",
|
145
|
+
level: Union[int, str] = logging.INFO,
|
146
|
+
file_path: Optional[str] = None,
|
147
|
+
) -> ADKLogger:
|
148
|
+
"""
|
149
|
+
Create and return a configured ADKLogger instance.
|
150
|
+
|
151
|
+
Args:
|
152
|
+
name: Logger name
|
153
|
+
level: Logging level for console output
|
154
|
+
file_path: Path to log file, if None uses the default path
|
155
|
+
|
156
|
+
Returns:
|
157
|
+
ADKLogger instance
|
158
|
+
"""
|
159
|
+
return ADKLogger(
|
160
|
+
name=name,
|
161
|
+
level=level,
|
162
|
+
file_path=file_path or os.environ.get("ADK_LOG_FILE", None),
|
163
|
+
)
|
@@ -0,0 +1,5 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
# Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
|
3
|
+
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.
|
4
|
+
|
5
|
+
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.
|
@@ -0,0 +1,56 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
# Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
|
3
|
+
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.
|
4
|
+
|
5
|
+
"""
|
6
|
+
ADK run response
|
7
|
+
"""
|
8
|
+
|
9
|
+
import json
|
10
|
+
from typing import Any, Dict
|
11
|
+
|
12
|
+
from pydantic import BaseModel, Field, computed_field
|
13
|
+
|
14
|
+
from oci.addons.adk.logger import default_logger as logger
|
15
|
+
|
16
|
+
|
17
|
+
class RunResponse(BaseModel):
|
18
|
+
"""Response from the agent run containing the final output."""
|
19
|
+
|
20
|
+
data: Dict[str, Any] = Field(..., description="Raw response from the agent")
|
21
|
+
session_id: str = Field(..., description="Session ID used for the response")
|
22
|
+
|
23
|
+
@computed_field # type: ignore[prop-decorator]
|
24
|
+
@property
|
25
|
+
def final_output(self) -> str | None:
|
26
|
+
"""Direct access to the agent message text as output"""
|
27
|
+
return self._get_nested_text()
|
28
|
+
|
29
|
+
@computed_field(deprecated="Use 'final_output' instead") # type: ignore[prop-decorator]
|
30
|
+
@property
|
31
|
+
def output(self) -> str | None:
|
32
|
+
"""Direct access to the agent message text as output"""
|
33
|
+
return self.final_output
|
34
|
+
|
35
|
+
def _get_nested_text(self) -> str | None:
|
36
|
+
"""Safely extract text from nested data structure."""
|
37
|
+
try:
|
38
|
+
return self.data["message"]["content"]["text"]
|
39
|
+
except (KeyError, TypeError):
|
40
|
+
return None
|
41
|
+
|
42
|
+
def pretty_print(self, print_data: bool = False) -> None:
|
43
|
+
"""Pretty print this run response."""
|
44
|
+
if self.final_output is None:
|
45
|
+
logger.warning("NO TEXT AVAILABLE IN RESPONSE")
|
46
|
+
|
47
|
+
message_text = f"agent text message:\n[bold green]{self.final_output}[/bold green]"
|
48
|
+
|
49
|
+
if print_data:
|
50
|
+
message_text += f"\n\ndata:\n[bold magenta]{json.dumps(self.data, indent=4)}[/bold magenta]" # noqa: E501
|
51
|
+
|
52
|
+
logger.print(
|
53
|
+
message_text,
|
54
|
+
title="Agent run response",
|
55
|
+
border_style="blue",
|
56
|
+
)
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
# Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
|
3
|
+
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.
|
4
|
+
|
5
|
+
"""
|
6
|
+
ADK Run action models
|
7
|
+
"""
|
8
|
+
|
9
|
+
from pydantic import BaseModel, Field
|
10
|
+
|
11
|
+
|
12
|
+
class FunctionCall(BaseModel):
|
13
|
+
"""Represents a function call that is required from the client."""
|
14
|
+
|
15
|
+
name: str = Field(..., alias="name")
|
16
|
+
arguments: str | dict = Field(..., alias="arguments")
|
17
|
+
|
18
|
+
|
19
|
+
class PerformedAction(BaseModel):
|
20
|
+
"""Represents an action that was performed by the agent."""
|
21
|
+
|
22
|
+
action_id: str = Field(..., alias="action_id")
|
23
|
+
performed_action_type: str = Field(..., alias="performed_action_type")
|
24
|
+
function_call_output: str = Field(..., alias="function_call_output")
|
25
|
+
|
26
|
+
|
27
|
+
class RequiredAction(BaseModel):
|
28
|
+
"""Represents an action that is required from the client."""
|
29
|
+
|
30
|
+
action_id: str = Field(..., alias="action_id")
|
31
|
+
required_action_type: str = Field(..., alias="required_action_type")
|
32
|
+
function_call: FunctionCall = Field(..., alias="function_call")
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
# Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
|
3
|
+
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.
|
4
|
+
|
5
|
+
"""
|
6
|
+
Default import behavior for oci.addons.adk.tool
|
7
|
+
"""
|
8
|
+
|
9
|
+
from oci.addons.adk.tool.function_tool import FunctionTool
|
10
|
+
from oci.addons.adk.tool.tool import tool
|
11
|
+
from oci.addons.adk.tool.toolkit import Toolkit
|
12
|
+
|
13
|
+
__all__ = ["FunctionTool", "Toolkit", "tool"]
|