diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 4358c9722d..d852696e1d 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -3,6 +3,15 @@ Change Log All notable changes to this project will be documented in this file. The format is based on `Keep a Changelog `_. +==================== +2.44.2 - 2021-08-31 +==================== + +Added +----- +* Support for Oracle Analytics Cloud and OCI Vault integration on connections in the Data Catalog service +* Support for critical event monitoring in the OS Management service + ==================== 2.44.1 - 2021-08-24 ==================== diff --git a/docs/api/data_catalog.rst b/docs/api/data_catalog.rst index 37cf8d7b59..5dec0e48e8 100644 --- a/docs/api/data_catalog.rst +++ b/docs/api/data_catalog.rst @@ -81,6 +81,7 @@ Data Catalog oci.data_catalog.models.EntityTag oci.data_catalog.models.EntityTagCollection oci.data_catalog.models.EntityTagSummary + oci.data_catalog.models.EventConfig oci.data_catalog.models.ExportDataAssetDetails oci.data_catalog.models.FacetedSearchAggregation oci.data_catalog.models.FacetedSearchCustomProperty diff --git a/docs/api/data_catalog/models/oci.data_catalog.models.EventConfig.rst b/docs/api/data_catalog/models/oci.data_catalog.models.EventConfig.rst new file mode 100644 index 0000000000..59f71ef247 --- /dev/null +++ b/docs/api/data_catalog/models/oci.data_catalog.models.EventConfig.rst @@ -0,0 +1,11 @@ +EventConfig +=========== + +.. currentmodule:: oci.data_catalog.models + +.. autoclass:: EventConfig + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/landing.rst b/docs/api/landing.rst index dbf9f8fe86..77aa540592 100644 --- a/docs/api/landing.rst +++ b/docs/api/landing.rst @@ -99,6 +99,7 @@ API Reference * :doc:`Operator Control ` * :doc:`Operations Insights ` * :doc:`Optimizer ` +* :doc:`Event ` * :doc:`Os Management ` * :doc:`Resource Manager ` * :doc:`Resource Search ` diff --git a/docs/api/os_management.rst b/docs/api/os_management.rst index 6ef1431170..e2a6ab28b1 100644 --- a/docs/api/os_management.rst +++ b/docs/api/os_management.rst @@ -6,7 +6,9 @@ Os Management :nosignatures: :template: autosummary/service_client.rst + oci.os_management.EventClient oci.os_management.OsManagementClient + oci.os_management.EventClientCompositeOperations oci.os_management.OsManagementClientCompositeOperations -------- @@ -22,12 +24,14 @@ Os Management oci.os_management.models.ApiError oci.os_management.models.AttachChildSoftwareSourceToManagedInstanceDetails oci.os_management.models.AttachParentSoftwareSourceToManagedInstanceDetails + oci.os_management.models.AutonomousSettings oci.os_management.models.AvailableSoftwareSourceSummary oci.os_management.models.AvailableUpdateSummary oci.os_management.models.AvailableWindowsUpdateSummary oci.os_management.models.ChangeManagedInstanceGroupCompartmentDetails oci.os_management.models.ChangeScheduledJobCompartmentDetails oci.os_management.models.ChangeSoftwareSourceCompartmentDetails + oci.os_management.models.CrashEventSystemInformation oci.os_management.models.CreateManagedInstanceGroupDetails oci.os_management.models.CreateScheduledJobDetails oci.os_management.models.CreateSoftwareSourceDetails @@ -35,16 +39,26 @@ Os Management oci.os_management.models.DetachParentSoftwareSourceFromManagedInstanceDetails oci.os_management.models.Erratum oci.os_management.models.ErratumSummary + oci.os_management.models.Event + oci.os_management.models.EventCollection + oci.os_management.models.EventContent + oci.os_management.models.EventReport + oci.os_management.models.EventSummary oci.os_management.models.Id oci.os_management.models.InstallablePackageSummary oci.os_management.models.InstalledPackageSummary oci.os_management.models.InstalledWindowsUpdateSummary + oci.os_management.models.KernelCrashEvent + oci.os_management.models.KernelOopsEvent + oci.os_management.models.KernelVmCoreInformation oci.os_management.models.ManagedInstance oci.os_management.models.ManagedInstanceGroup oci.os_management.models.ManagedInstanceGroupSummary oci.os_management.models.ManagedInstanceSummary oci.os_management.models.PackageName oci.os_management.models.Recurrence + oci.os_management.models.RelatedEventCollection + oci.os_management.models.RelatedEventSummary oci.os_management.models.RemovePackagesFromSoftwareSourceDetails oci.os_management.models.ScheduledJob oci.os_management.models.ScheduledJobSummary @@ -56,6 +70,8 @@ Os Management oci.os_management.models.SoftwareSource oci.os_management.models.SoftwareSourceId oci.os_management.models.SoftwareSourceSummary + oci.os_management.models.UpdateEventDetails + oci.os_management.models.UpdateManagedInstanceDetails oci.os_management.models.UpdateManagedInstanceGroupDetails oci.os_management.models.UpdateScheduledJobDetails oci.os_management.models.UpdateSoftwareSourceDetails diff --git a/docs/api/os_management/client/oci.os_management.EventClient.rst b/docs/api/os_management/client/oci.os_management.EventClient.rst new file mode 100644 index 0000000000..fb01a89b11 --- /dev/null +++ b/docs/api/os_management/client/oci.os_management.EventClient.rst @@ -0,0 +1,8 @@ +EventClient +=========== + +.. currentmodule:: oci.os_management + +.. autoclass:: EventClient + :special-members: __init__ + :members: \ No newline at end of file diff --git a/docs/api/os_management/client/oci.os_management.EventClientCompositeOperations.rst b/docs/api/os_management/client/oci.os_management.EventClientCompositeOperations.rst new file mode 100644 index 0000000000..b676e44ea7 --- /dev/null +++ b/docs/api/os_management/client/oci.os_management.EventClientCompositeOperations.rst @@ -0,0 +1,8 @@ +EventClientCompositeOperations +============================== + +.. currentmodule:: oci.os_management + +.. autoclass:: EventClientCompositeOperations + :special-members: __init__ + :members: \ No newline at end of file diff --git a/docs/api/os_management/models/oci.os_management.models.AutonomousSettings.rst b/docs/api/os_management/models/oci.os_management.models.AutonomousSettings.rst new file mode 100644 index 0000000000..a56cbd59ea --- /dev/null +++ b/docs/api/os_management/models/oci.os_management.models.AutonomousSettings.rst @@ -0,0 +1,11 @@ +AutonomousSettings +================== + +.. currentmodule:: oci.os_management.models + +.. autoclass:: AutonomousSettings + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/os_management/models/oci.os_management.models.CrashEventSystemInformation.rst b/docs/api/os_management/models/oci.os_management.models.CrashEventSystemInformation.rst new file mode 100644 index 0000000000..584736953e --- /dev/null +++ b/docs/api/os_management/models/oci.os_management.models.CrashEventSystemInformation.rst @@ -0,0 +1,11 @@ +CrashEventSystemInformation +=========================== + +.. currentmodule:: oci.os_management.models + +.. autoclass:: CrashEventSystemInformation + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/os_management/models/oci.os_management.models.Event.rst b/docs/api/os_management/models/oci.os_management.models.Event.rst new file mode 100644 index 0000000000..eabe59c885 --- /dev/null +++ b/docs/api/os_management/models/oci.os_management.models.Event.rst @@ -0,0 +1,11 @@ +Event +===== + +.. currentmodule:: oci.os_management.models + +.. autoclass:: Event + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/os_management/models/oci.os_management.models.EventCollection.rst b/docs/api/os_management/models/oci.os_management.models.EventCollection.rst new file mode 100644 index 0000000000..01dcd5efe2 --- /dev/null +++ b/docs/api/os_management/models/oci.os_management.models.EventCollection.rst @@ -0,0 +1,11 @@ +EventCollection +=============== + +.. currentmodule:: oci.os_management.models + +.. autoclass:: EventCollection + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/os_management/models/oci.os_management.models.EventContent.rst b/docs/api/os_management/models/oci.os_management.models.EventContent.rst new file mode 100644 index 0000000000..73b3fe8da5 --- /dev/null +++ b/docs/api/os_management/models/oci.os_management.models.EventContent.rst @@ -0,0 +1,11 @@ +EventContent +============ + +.. currentmodule:: oci.os_management.models + +.. autoclass:: EventContent + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/os_management/models/oci.os_management.models.EventReport.rst b/docs/api/os_management/models/oci.os_management.models.EventReport.rst new file mode 100644 index 0000000000..b629b338a0 --- /dev/null +++ b/docs/api/os_management/models/oci.os_management.models.EventReport.rst @@ -0,0 +1,11 @@ +EventReport +=========== + +.. currentmodule:: oci.os_management.models + +.. autoclass:: EventReport + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/os_management/models/oci.os_management.models.EventSummary.rst b/docs/api/os_management/models/oci.os_management.models.EventSummary.rst new file mode 100644 index 0000000000..55d7115e1e --- /dev/null +++ b/docs/api/os_management/models/oci.os_management.models.EventSummary.rst @@ -0,0 +1,11 @@ +EventSummary +============ + +.. currentmodule:: oci.os_management.models + +.. autoclass:: EventSummary + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/os_management/models/oci.os_management.models.KernelCrashEvent.rst b/docs/api/os_management/models/oci.os_management.models.KernelCrashEvent.rst new file mode 100644 index 0000000000..e30d95c709 --- /dev/null +++ b/docs/api/os_management/models/oci.os_management.models.KernelCrashEvent.rst @@ -0,0 +1,11 @@ +KernelCrashEvent +================ + +.. currentmodule:: oci.os_management.models + +.. autoclass:: KernelCrashEvent + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/os_management/models/oci.os_management.models.KernelOopsEvent.rst b/docs/api/os_management/models/oci.os_management.models.KernelOopsEvent.rst new file mode 100644 index 0000000000..2f474b6b3f --- /dev/null +++ b/docs/api/os_management/models/oci.os_management.models.KernelOopsEvent.rst @@ -0,0 +1,11 @@ +KernelOopsEvent +=============== + +.. currentmodule:: oci.os_management.models + +.. autoclass:: KernelOopsEvent + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/os_management/models/oci.os_management.models.KernelVmCoreInformation.rst b/docs/api/os_management/models/oci.os_management.models.KernelVmCoreInformation.rst new file mode 100644 index 0000000000..d92f7e06d2 --- /dev/null +++ b/docs/api/os_management/models/oci.os_management.models.KernelVmCoreInformation.rst @@ -0,0 +1,11 @@ +KernelVmCoreInformation +======================= + +.. currentmodule:: oci.os_management.models + +.. autoclass:: KernelVmCoreInformation + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/os_management/models/oci.os_management.models.RelatedEventCollection.rst b/docs/api/os_management/models/oci.os_management.models.RelatedEventCollection.rst new file mode 100644 index 0000000000..5e68c20570 --- /dev/null +++ b/docs/api/os_management/models/oci.os_management.models.RelatedEventCollection.rst @@ -0,0 +1,11 @@ +RelatedEventCollection +====================== + +.. currentmodule:: oci.os_management.models + +.. autoclass:: RelatedEventCollection + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/os_management/models/oci.os_management.models.RelatedEventSummary.rst b/docs/api/os_management/models/oci.os_management.models.RelatedEventSummary.rst new file mode 100644 index 0000000000..d1203da939 --- /dev/null +++ b/docs/api/os_management/models/oci.os_management.models.RelatedEventSummary.rst @@ -0,0 +1,11 @@ +RelatedEventSummary +=================== + +.. currentmodule:: oci.os_management.models + +.. autoclass:: RelatedEventSummary + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/os_management/models/oci.os_management.models.UpdateEventDetails.rst b/docs/api/os_management/models/oci.os_management.models.UpdateEventDetails.rst new file mode 100644 index 0000000000..3080341a16 --- /dev/null +++ b/docs/api/os_management/models/oci.os_management.models.UpdateEventDetails.rst @@ -0,0 +1,11 @@ +UpdateEventDetails +================== + +.. currentmodule:: oci.os_management.models + +.. autoclass:: UpdateEventDetails + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/os_management/models/oci.os_management.models.UpdateManagedInstanceDetails.rst b/docs/api/os_management/models/oci.os_management.models.UpdateManagedInstanceDetails.rst new file mode 100644 index 0000000000..b614610df9 --- /dev/null +++ b/docs/api/os_management/models/oci.os_management.models.UpdateManagedInstanceDetails.rst @@ -0,0 +1,11 @@ +UpdateManagedInstanceDetails +============================ + +.. currentmodule:: oci.os_management.models + +.. autoclass:: UpdateManagedInstanceDetails + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/examples/showoci/CHANGELOG.rst b/examples/showoci/CHANGELOG.rst index b13cb2b67d..a29183fe7d 100755 --- a/examples/showoci/CHANGELOG.rst +++ b/examples/showoci/CHANGELOG.rst @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file. The format is based on `Keep a Changelog `_. +===================== +21.08.31 - 21.08.31 +===================== +* Added CSV for database backups +* Added Autonomous Database DG and extra properties + ===================== 21.06.29 - 21.06.29 ===================== diff --git a/examples/showoci/showoci.py b/examples/showoci/showoci.py index df7ae20a67..4a889057be 100755 --- a/examples/showoci/showoci.py +++ b/examples/showoci/showoci.py @@ -95,7 +95,7 @@ import argparse import datetime -version = "21.06.29" +version = "21.08.31" ########################################################################## # check OCI version diff --git a/examples/showoci/showoci_data.py b/examples/showoci/showoci_data.py index fc8263fc3c..7407505d34 100755 --- a/examples/showoci/showoci_data.py +++ b/examples/showoci/showoci_data.py @@ -121,6 +121,7 @@ def get_showoci_config(self, cmdline, start_time): data = { 'program': "showoci.py", 'author': "Adi Zohar", + 'disclaimer': "This is not an official Oracle application, It does not supported by Oracle, It should NOT be used for utilization calculation purposes !", 'config_file': self.service.flags.config_file, 'config_profile': self.service.flags.config_section, 'use_instance_principals': self.service.flags.use_instance_principals, @@ -2024,8 +2025,11 @@ def __get_database_db_backups(self, backups): {'name': str(backup['display_name']) + " - " + str(backup['type']) + " - " + str(backup['lifecycle_state']), 'time': str(backup['time_started'])[0:16] + " - " + str(backup['time_ended'])[0:16], 'size': bsize, + 'display_name': backup['display_name'], + 'lifecycle_state': backup['lifecycle_state'], + 'type': backup['type'], 'sum_info': 'Object Storage - DB Backup (GB)', - 'sum_size_gb': ssize + 'sum_size_gb': ssize, }) return data @@ -2270,8 +2274,15 @@ def __get_database_adb_databases_backups(self, backups): for backup in backups: backup_type = "Automatic Backup, " if backup['is_automatic'] else "Manual Backup , " data.append( - {'name': backup_type + str(backup['display_name']) + " - " + str(backup['type']) + " - " + str(backup['lifecycle_state']), - 'time': str(backup['time_started'])[0:16] + " - " + str(backup['time_ended'])[0:16]}) + { + 'name': backup_type + str(backup['display_name']) + " - " + str(backup['type']) + " - " + str(backup['lifecycle_state']), + 'time': str(backup['time_started'])[0:16] + " - " + str(backup['time_ended'])[0:16], + 'display_name': backup['display_name'], + 'lifecycle_state': backup['lifecycle_state'], + 'type': backup['type'], + 'is_automatic': backup['is_automatic'] + } + ) return data except Exception as e: @@ -2288,7 +2299,7 @@ def __get_database_adb_database_info(self, dbs): freesum = "Free " if dbs['is_free_tier'] else "" value = { 'id': str(dbs['id']), - 'name': str(dbs['db_name']) + " (" + (str(dbs['display_name']) + ") - " + str(dbs['license_model']) + " - " + str(dbs['lifecycle_state']) + " (" + str(dbs['sum_count']) + " OCPUs" + (" AutoScale" if dbs['is_auto_scaling_enabled'] else "") + ") - " + dbs['db_workload'] + " - " + dbs['db_type'] + freemsg), + 'name': str(dbs['db_name']) + " (" + (str(dbs['display_name']) + ") - " + str(dbs['license_model']) + " - " + str(dbs['role']) + " - " + str(dbs['lifecycle_state']) + " (" + str(dbs['sum_count']) + " OCPUs" + (" AutoScale" if dbs['is_auto_scaling_enabled'] else "") + ") - " + dbs['db_workload'] + " - " + dbs['db_type'] + freemsg), 'display_name': dbs['display_name'], 'license_model': dbs['license_model'], 'lifecycle_state': dbs['lifecycle_state'], @@ -2300,13 +2311,13 @@ def __get_database_adb_database_info(self, dbs): 'service_console_url': str(dbs['service_console_url']), 'time_created': str(dbs['time_created'])[0:16], 'connection_strings': str(dbs['connection_strings']), + 'connection_urls': str(dbs['connection_urls']), 'sum_info': "Autonomous Database " + freesum + str(dbs['db_workload']) + " (OCPUs) - " + dbs['license_model'], 'sum_info_stopped': "Stopped Autonomous Database " + freesum + str(dbs['db_workload']) + " (Count) - " + dbs['license_model'], 'sum_info_count': "Autonomous Database " + freesum + str(dbs['db_workload']) + " (Count) - " + dbs['license_model'], 'sum_count': str(dbs['sum_count']), 'sum_info_storage': "Autonomous Database " + freesum + "(TB)", 'sum_size_tb': str(dbs['data_storage_size_in_tbs']), - 'backups': self.__get_database_adb_databases_backups(dbs['backups']), 'whitelisted_ips': dbs['whitelisted_ips'], 'is_auto_scaling_enabled': dbs['is_auto_scaling_enabled'], 'db_workload': dbs['db_workload'], @@ -2336,7 +2347,17 @@ def __get_database_adb_database_info(self, dbs): 'standby_lag_time_in_seconds': dbs['standby_lag_time_in_seconds'], 'standby_lifecycle_state': dbs['standby_lifecycle_state'], 'autonomous_container_database_id': dbs['autonomous_container_database_id'], - 'is_data_guard_enabled': dbs['is_data_guard_enabled'] + 'is_data_guard_enabled': dbs['is_data_guard_enabled'], + 'peer_db_ids': dbs['peer_db_ids'], + 'time_data_guard_role_changed': dbs['time_data_guard_role_changed'], + 'time_local_data_guard_enabled': dbs['time_local_data_guard_enabled'], + 'dataguard_region_type': dbs['dataguard_region_type'], + 'customer_contacts': dbs['customer_contacts'], + 'supported_regions_to_clone_to': dbs['supported_regions_to_clone_to'], + 'key_store_wallet_name': dbs['key_store_wallet_name'], + 'key_store_id': dbs['key_store_id'], + 'role': dbs['role'], + 'backups': self.__get_database_adb_databases_backups(dbs['backups']) } # subnet diff --git a/examples/showoci/showoci_output.py b/examples/showoci/showoci_output.py index 7849f13c3a..bfad13cfc7 100755 --- a/examples/showoci/showoci_output.py +++ b/examples/showoci/showoci_output.py @@ -112,6 +112,7 @@ def print_showoci_config(self, data): try: self.print_header(data['program'], 1) print("Author : " + data['author']) + print("Disclaimer : " + data['disclaimer']) print("Machine : " + data['machine']) print("Python Version : " + data['python']) if data['use_instance_principals']: @@ -3155,6 +3156,7 @@ class ShowOCICSV(object): csv_db_system = [] csv_db_autonomous = [] csv_database = [] + csv_database_backups = [] csv_network_subnet = [] csv_network_security_list = [] csv_network_security_group = [] @@ -3211,6 +3213,7 @@ def generate_csv(self, data, csv_file_header, add_date_field=True): self.__export_to_csv_file("network_dhcp_options", self.csv_network_dhcp_options) self.__export_to_csv_file("database", self.csv_database) self.__export_to_csv_file("database_db_system", self.csv_db_system) + self.__export_to_csv_file("database_db_backups", self.csv_database_backups) self.__export_to_csv_file("database_autonomous", self.csv_db_autonomous) self.__export_to_csv_file("load_balancer_listeners", self.csv_load_balancer) self.__export_to_csv_file("load_balancer_backendset", self.csv_load_balancer_bs) @@ -3735,37 +3738,54 @@ def __csv_database_db_system(self, region_name, list_db_systems): for db in db_home['databases']: # Database CSV - data = {'region_name': region_name, - 'availability_domain': dbs['availability_domain'], - 'compartment_name': dbs['compartment_name'], - 'status': dbs['lifecycle_state'], - 'type': "DB System", - 'name': dbs['display_name'], - 'shape': dbs['shape'], - 'cpu_core_count': dbs['cpu_core_count'], - 'db_storage_gb': dbs['sum_size_gb'], - 'shape_ocpus': dbs['shape_ocpu'], - 'memory_gb': dbs['shape_memory_gb'], - 'local_storage_tb': dbs['shape_storage_tb'], - 'node_count': len(dbs['db_nodes']), - 'database': db['name'], - 'version_license_model': dbs['version'], - 'data_subnet': dbs['data_subnet'], - 'backup_subnet': dbs['backup_subnet'], - 'scan_ips': str(', '.join(x for x in dbs['scan_ips'])), - 'vip_ips': str(', '.join(x for x in dbs['vip_ips'])), - 'cluster_name': dbs['cluster_name'], - 'time_created': dbs['time_created'][0:16], - 'domain': dbs['domain'], - 'db_nodes': str(', '.join(x['desc'] for x in dbs['db_nodes'])), - 'freeform_tags': str(', '.join(key + "=" + dbs['freeform_tags'][key] for key in dbs['freeform_tags'].keys())), - 'defined_tags': self.__get_defined_tags(dbs['defined_tags']), - 'database_id': db['id'], - 'dbsystem_id': dbs['id'] - } + data = { + 'region_name': region_name, + 'availability_domain': dbs['availability_domain'], + 'compartment_name': dbs['compartment_name'], + 'status': dbs['lifecycle_state'], + 'type': "DB System", + 'name': dbs['display_name'], + 'shape': dbs['shape'], + 'cpu_core_count': dbs['cpu_core_count'], + 'db_storage_gb': dbs['sum_size_gb'], + 'shape_ocpus': dbs['shape_ocpu'], + 'memory_gb': dbs['shape_memory_gb'], + 'local_storage_tb': dbs['shape_storage_tb'], + 'node_count': len(dbs['db_nodes']), + 'database': db['name'], + 'version_license_model': dbs['version'], + 'data_subnet': dbs['data_subnet'], + 'backup_subnet': dbs['backup_subnet'], + 'scan_ips': str(', '.join(x for x in dbs['scan_ips'])), + 'vip_ips': str(', '.join(x for x in dbs['vip_ips'])), + 'cluster_name': dbs['cluster_name'], + 'time_created': dbs['time_created'][0:16], + 'domain': dbs['domain'], + 'db_nodes': str(', '.join(x['desc'] for x in dbs['db_nodes'])), + 'freeform_tags': str(', '.join(key + "=" + dbs['freeform_tags'][key] for key in dbs['freeform_tags'].keys())), + 'defined_tags': self.__get_defined_tags(dbs['defined_tags']), + 'database_id': db['id'], + 'dbsystem_id': dbs['id'] + } self.csv_database.append(data) + # database Backups + if 'backups' in db: + for backup in db['backups']: + data = { + 'region_name': region_name, + 'compartment_name': dbs['compartment_name'], + 'dbs_name': dbs['display_name'], + 'database': db['db_name'], + 'shape': dbs['shape'], + 'backup_name': backup['display_name'], + 'time': backup['time'], + 'size': backup['size'], + 'lifecycle_state': backup['lifecycle_state'] + } + self.csv_database_backups.append(data) + except Exception as e: self.__print_error("__csv_database_db_system", e) @@ -3854,6 +3874,22 @@ def __csv_database_db_exadata(self, region_name, list_exa): self.csv_database.append(data) + # database Backups + if 'backups' in db: + for backup in db['backups']: + data = { + 'region_name': region_name, + 'compartment_name': dbs['compartment_name'], + 'dbs_name': dbs['display_name'], + 'database': db['db_name'], + 'shape': dbs['shape'], + 'backup_name': backup['display_name'], + 'time': backup['time'], + 'size': backup['size'], + 'lifecycle_state': backup['lifecycle_state'] + } + self.csv_database_backups.append(data) + except Exception as e: self.__print_error("__csv_database_db_exadata", e) @@ -3926,6 +3962,22 @@ def __csv_database_db_autonomous(self, region_name, databases): self.csv_db_autonomous.append(dadb) + # database Backups + if 'backups' in dbs: + for backup in dbs['backups']: + data = { + 'region_name': region_name, + 'compartment_name': dbs['compartment_name'], + 'dbs_name': dbs['display_name'], + 'database': dbs['db_name'], + 'shape': 'Autononous', + 'backup_name': ("Automatic Backup - " if backup['is_automatic'] == 'True' else "") + backup['display_name'], + 'time': backup['time'], + 'size': "", + 'lifecycle_state': backup['lifecycle_state'] + } + self.csv_database_backups.append(data) + except Exception as e: self.__print_error("__csv_database_db_autonomous", e) diff --git a/examples/showoci/showoci_service.py b/examples/showoci/showoci_service.py index 5f9ee3fed1..a94733adea 100755 --- a/examples/showoci/showoci_service.py +++ b/examples/showoci/showoci_service.py @@ -134,7 +134,7 @@ def is_load_basic_network(self): # class ShowOCIService ########################################################################## class ShowOCIService(object): - oci_compatible_version = "2.39.1" + oci_compatible_version = "2.44.0" ########################################################################## # Global Constants @@ -682,7 +682,7 @@ def check_oci_version_compatible(self): if int(i) < int(rl): print("") print("*********************************************************************") - print("Error, OCI SDK version " + self.oci_compatible_version + " required !") + print("Error, OCI SDK minimum version " + self.oci_compatible_version + " required !") print("OCI SDK Version installed = " + self.get_oci_version()) print("Please use below command to upgrade OCI SDK:") print(" python -m pip install --upgrade oci") @@ -7572,6 +7572,7 @@ def __load_database_adb_database(self, database_client, compartments): 'db_version': str(dbs.db_version), 'service_console_url': str(dbs.service_console_url), 'connection_strings': str(dbs.connection_strings), + 'connection_urls': str(dbs.connection_urls), 'time_created': str(dbs.time_created), 'compartment_name': str(compartment['name']), 'compartment_id': str(compartment['id']), @@ -7602,9 +7603,18 @@ def __load_database_adb_database(self, database_client, compartments): 'time_of_last_switchover': str(dbs.time_of_last_switchover), 'time_of_last_failover': str(dbs.time_of_last_failover), 'failed_data_recovery_in_seconds': str(dbs.failed_data_recovery_in_seconds), - 'available_upgrade_versions': dbs.available_upgrade_versions, 'standby_lag_time_in_seconds': "", - 'standby_lifecycle_state': "" + 'standby_lifecycle_state': "", + 'peer_db_ids': dbs.peer_db_ids, + 'time_data_guard_role_changed': str(dbs.time_data_guard_role_changed), + 'time_local_data_guard_enabled': str(dbs.time_local_data_guard_enabled), + 'dataguard_region_type': str(dbs.dataguard_region_type), + 'customer_contacts': "" if dbs.customer_contacts is None else str(', '.join(x.email for x in dbs.customer_contacts)), + 'supported_regions_to_clone_to': dbs.supported_regions_to_clone_to, + 'key_store_wallet_name': str(dbs.key_store_wallet_name), + 'key_store_id': str(dbs.key_store_id), + 'available_upgrade_versions': str(dbs.available_upgrade_versions), + 'role': str(dbs.role) } # if standby object exist diff --git a/src/oci/base_client.py b/src/oci/base_client.py index d3ead5fdfe..48a99142ef 100644 --- a/src/oci/base_client.py +++ b/src/oci/base_client.py @@ -39,12 +39,11 @@ DICT_VALUE_TYPE_REGEX = re.compile('dict\(str, (.+?)\)$') # noqa: W605 LIST_ITEM_TYPE_REGEX = re.compile('list\[(.+?)\]$') # noqa: W605 -SERVICES_SUPPORTING_EXPECT_HEADER = ["object_storage", "log_analytics"] - - +# Expect header is enabled by default +enable_expect_header = True expect_header_env_var = os.environ.get('OCI_PYSDK_USING_EXPECT_HEADER', True) -if expect_header_env_var == "FALSE": - expect_header_env_var = False +if isinstance(expect_header_env_var, six.string_types) and expect_header_env_var.lower() == "false": + enable_expect_header = False def merge_type_mappings(*dictionaries): @@ -241,7 +240,7 @@ class OCIConnectionPool(urllib3.HTTPSConnectionPool): # Replace the HTTPS connection pool with OCIConnectionPool once the env var `OCI_PYSDK_USING_EXPECT_HEADER` is not set # to "FALSE" -if expect_header_env_var: +if enable_expect_header: urllib3.poolmanager.pool_classes_by_scheme["https"] = OCIConnectionPool @@ -311,9 +310,6 @@ def __init__(self, service, config, signer, type_mapping, **kwargs): self.skip_deserialization = kwargs.get('skip_deserialization') - # Enable expect 100 for select services - self.enable_expect_header = self.service in SERVICES_SUPPORTING_EXPECT_HEADER if expect_header_env_var else False - @property def endpoint(self): return self._endpoint @@ -362,14 +358,13 @@ def call_api(self, resource_path, method, """ - # By default we will add Expect header for all PUT/POST operations, for services which support it - if self.enable_expect_header and (method == 'PUT' or method == 'POST'): - if header_params is None: - header_params = {'expect': '100-continue'} - elif "expect" not in header_params: - header_params['expect'] = '100-continue' - if header_params: + # Remove expect header if user has disabled it, or if the operation is not PUT, POST or PATCH + if not enable_expect_header or method.lower() not in ["put", "post", "patch"]: + map_lowercase_header_params_keys_to_actual_keys = {k.lower(): k for k in header_params} + if "expect" in map_lowercase_header_params_keys_to_actual_keys: + header_params.pop(map_lowercase_header_params_keys_to_actual_keys.get("expect"), None) + header_params = self.sanitize_for_serialization(header_params) header_params = header_params or {} diff --git a/src/oci/data_catalog/data_catalog_client.py b/src/oci/data_catalog/data_catalog_client.py index 4afadff4df..bd700894af 100644 --- a/src/oci/data_catalog/data_catalog_client.py +++ b/src/oci/data_catalog/data_catalog_client.py @@ -19,6 +19,7 @@ class DataCatalogClient(object): """ Use the Data Catalog APIs to collect, organize, find, access, understand, enrich, and activate technical, business, and operational metadata. + For more information, see [Data Catalog](https://docs.oracle.com/iaas/data-catalog/home.htm). """ def __init__(self, config, **kwargs): @@ -7991,12 +7992,12 @@ def list_attributes(self, catalog_id, data_asset_key, entity_key, **kwargs): :param list[str] fields: (optional) Specifies the fields to return in an entity attribute summary response. - Allowed values are: "key", "displayName", "description", "entityKey", "lifecycleState", "timeCreated", "externalDataType", "externalKey", "length", "precision", "scale", "isNullable", "uri", "path", "minCollectionCount", "maxCollectionCount", "datatypeEntityKey", "externalDatatypeEntityKey", "parentAttributeKey", "externalParentAttributeKey" + Allowed values are: "key", "displayName", "description", "entityKey", "lifecycleState", "timeCreated", "externalDataType", "externalKey", "length", "precision", "scale", "isNullable", "uri", "path", "minCollectionCount", "maxCollectionCount", "datatypeEntityKey", "externalDatatypeEntityKey", "parentAttributeKey", "externalParentAttributeKey", "position" :param str sort_by: (optional) - The field to sort by. Only one sort order may be provided. Default order for TIMECREATED is descending. Default order for DISPLAYNAME is ascending. If no value is specified TIMECREATED is default. + The field to sort by. Only one sort order may be provided. Default order for TIMECREATED is descending. Default order for DISPLAYNAME is ascending. Default order for POSITION is ascending. If no value is specified POSITION is default. - Allowed values are: "TIMECREATED", "DISPLAYNAME" + Allowed values are: "TIMECREATED", "DISPLAYNAME", "POSITION" :param str sort_order: (optional) The sort order to use, either 'asc' or 'desc'. @@ -8082,7 +8083,7 @@ def list_attributes(self, catalog_id, data_asset_key, entity_key, **kwargs): ) if 'fields' in kwargs: - fields_allowed_values = ["key", "displayName", "description", "entityKey", "lifecycleState", "timeCreated", "externalDataType", "externalKey", "length", "precision", "scale", "isNullable", "uri", "path", "minCollectionCount", "maxCollectionCount", "datatypeEntityKey", "externalDatatypeEntityKey", "parentAttributeKey", "externalParentAttributeKey"] + fields_allowed_values = ["key", "displayName", "description", "entityKey", "lifecycleState", "timeCreated", "externalDataType", "externalKey", "length", "precision", "scale", "isNullable", "uri", "path", "minCollectionCount", "maxCollectionCount", "datatypeEntityKey", "externalDatatypeEntityKey", "parentAttributeKey", "externalParentAttributeKey", "position"] for fields_item in kwargs['fields']: if fields_item not in fields_allowed_values: raise ValueError( @@ -8090,7 +8091,7 @@ def list_attributes(self, catalog_id, data_asset_key, entity_key, **kwargs): ) if 'sort_by' in kwargs: - sort_by_allowed_values = ["TIMECREATED", "DISPLAYNAME"] + sort_by_allowed_values = ["TIMECREATED", "DISPLAYNAME", "POSITION"] if kwargs['sort_by'] not in sort_by_allowed_values: raise ValueError( "Invalid value for `sort_by`, must be one of {0}".format(sort_by_allowed_values) @@ -8645,7 +8646,7 @@ def list_custom_properties(self, catalog_id, namespace_id, **kwargs): :param list[str] type_name: (optional) A filter to return only resources that match the entire type name given. The match is not case sensitive - Allowed values are: "DATA_ASSET", "AUTONOMOUS_DATA_WAREHOUSE", "HIVE", "KAFKA", "MYSQL", "ORACLE_OBJECT_STORAGE", "AUTONOMOUS_TRANSACTION_PROCESSING", "ORACLE", "POSTGRESQL", "MICROSOFT_AZURE_SQL_DATABASE", "MICROSOFT_SQL_SERVER", "IBM_DB2", "DATA_ENTITY", "LOGICAL_ENTITY", "TABLE", "VIEW", "ATTRIBUTE", "FOLDER", "ORACLE_ANALYTICS_SERVER", "ORACLE_ANALYTICS_CLOUD", "ORACLE_ANALYTICS_SUBJECT_AREA", "ORACLE_ANALYTICS_DASHBOARD", "ORACLE_ANALYTICS_BUSINESS_MODEL", "ORACLE_ANALYTICS_PHYSICAL_DATABASE", "ORACLE_ANALYTICS_PHYSICAL_SCHEMA", "ORACLE_ANALYTICS_PRESENTATION_TABLE", "ORACLE_ANALYTICS_LOGICAL_TABLE", "ORACLE_ANALYTICS_PHYSICAL_TABLE", "ORACLE_ANALYTICS_ANALYSIS", "DATABASE_SCHEMA", "TOPIC", "CONNECTION", "GLOSSARY", "TERM", "CATEGORY", "FILE", "BUCKET", "MESSAGE", "UNRECOGNIZED_FILE" + Allowed values are: "DATA_ASSET", "AUTONOMOUS_DATA_WAREHOUSE", "HIVE", "KAFKA", "MYSQL", "ORACLE_OBJECT_STORAGE", "AUTONOMOUS_TRANSACTION_PROCESSING", "ORACLE", "POSTGRESQL", "MICROSOFT_AZURE_SQL_DATABASE", "MICROSOFT_SQL_SERVER", "IBM_DB2", "DATA_ENTITY", "LOGICAL_ENTITY", "TABLE", "VIEW", "ATTRIBUTE", "FOLDER", "ORACLE_ANALYTICS_SUBJECT_AREA_COLUMN", "ORACLE_ANALYTICS_LOGICAL_COLUMN", "ORACLE_ANALYTICS_PHYSICAL_COLUMN", "ORACLE_ANALYTICS_ANALYSIS_COLUMN", "ORACLE_ANALYTICS_SERVER", "ORACLE_ANALYTICS_CLOUD", "ORACLE_ANALYTICS_SUBJECT_AREA", "ORACLE_ANALYTICS_DASHBOARD", "ORACLE_ANALYTICS_BUSINESS_MODEL", "ORACLE_ANALYTICS_PHYSICAL_DATABASE", "ORACLE_ANALYTICS_PHYSICAL_SCHEMA", "ORACLE_ANALYTICS_PRESENTATION_TABLE", "ORACLE_ANALYTICS_LOGICAL_TABLE", "ORACLE_ANALYTICS_PHYSICAL_TABLE", "ORACLE_ANALYTICS_ANALYSIS", "DATABASE_SCHEMA", "TOPIC", "CONNECTION", "GLOSSARY", "TERM", "CATEGORY", "FILE", "BUCKET", "MESSAGE", "UNRECOGNIZED_FILE" :param str lifecycle_state: (optional) A filter to return only resources that match the specified lifecycle state. The value is case insensitive. @@ -8753,7 +8754,7 @@ def list_custom_properties(self, catalog_id, namespace_id, **kwargs): ) if 'type_name' in kwargs: - type_name_allowed_values = ["DATA_ASSET", "AUTONOMOUS_DATA_WAREHOUSE", "HIVE", "KAFKA", "MYSQL", "ORACLE_OBJECT_STORAGE", "AUTONOMOUS_TRANSACTION_PROCESSING", "ORACLE", "POSTGRESQL", "MICROSOFT_AZURE_SQL_DATABASE", "MICROSOFT_SQL_SERVER", "IBM_DB2", "DATA_ENTITY", "LOGICAL_ENTITY", "TABLE", "VIEW", "ATTRIBUTE", "FOLDER", "ORACLE_ANALYTICS_SERVER", "ORACLE_ANALYTICS_CLOUD", "ORACLE_ANALYTICS_SUBJECT_AREA", "ORACLE_ANALYTICS_DASHBOARD", "ORACLE_ANALYTICS_BUSINESS_MODEL", "ORACLE_ANALYTICS_PHYSICAL_DATABASE", "ORACLE_ANALYTICS_PHYSICAL_SCHEMA", "ORACLE_ANALYTICS_PRESENTATION_TABLE", "ORACLE_ANALYTICS_LOGICAL_TABLE", "ORACLE_ANALYTICS_PHYSICAL_TABLE", "ORACLE_ANALYTICS_ANALYSIS", "DATABASE_SCHEMA", "TOPIC", "CONNECTION", "GLOSSARY", "TERM", "CATEGORY", "FILE", "BUCKET", "MESSAGE", "UNRECOGNIZED_FILE"] + type_name_allowed_values = ["DATA_ASSET", "AUTONOMOUS_DATA_WAREHOUSE", "HIVE", "KAFKA", "MYSQL", "ORACLE_OBJECT_STORAGE", "AUTONOMOUS_TRANSACTION_PROCESSING", "ORACLE", "POSTGRESQL", "MICROSOFT_AZURE_SQL_DATABASE", "MICROSOFT_SQL_SERVER", "IBM_DB2", "DATA_ENTITY", "LOGICAL_ENTITY", "TABLE", "VIEW", "ATTRIBUTE", "FOLDER", "ORACLE_ANALYTICS_SUBJECT_AREA_COLUMN", "ORACLE_ANALYTICS_LOGICAL_COLUMN", "ORACLE_ANALYTICS_PHYSICAL_COLUMN", "ORACLE_ANALYTICS_ANALYSIS_COLUMN", "ORACLE_ANALYTICS_SERVER", "ORACLE_ANALYTICS_CLOUD", "ORACLE_ANALYTICS_SUBJECT_AREA", "ORACLE_ANALYTICS_DASHBOARD", "ORACLE_ANALYTICS_BUSINESS_MODEL", "ORACLE_ANALYTICS_PHYSICAL_DATABASE", "ORACLE_ANALYTICS_PHYSICAL_SCHEMA", "ORACLE_ANALYTICS_PRESENTATION_TABLE", "ORACLE_ANALYTICS_LOGICAL_TABLE", "ORACLE_ANALYTICS_PHYSICAL_TABLE", "ORACLE_ANALYTICS_ANALYSIS", "DATABASE_SCHEMA", "TOPIC", "CONNECTION", "GLOSSARY", "TERM", "CATEGORY", "FILE", "BUCKET", "MESSAGE", "UNRECOGNIZED_FILE"] for type_name_item in kwargs['type_name']: if type_name_item not in type_name_allowed_values: raise ValueError( diff --git a/src/oci/data_catalog/models/__init__.py b/src/oci/data_catalog/models/__init__.py index b6f467030f..dc3464ab6c 100644 --- a/src/oci/data_catalog/models/__init__.py +++ b/src/oci/data_catalog/models/__init__.py @@ -67,6 +67,7 @@ from .entity_tag import EntityTag from .entity_tag_collection import EntityTagCollection from .entity_tag_summary import EntityTagSummary +from .event_config import EventConfig from .export_data_asset_details import ExportDataAssetDetails from .faceted_search_aggregation import FacetedSearchAggregation from .faceted_search_custom_property import FacetedSearchCustomProperty @@ -232,6 +233,7 @@ "EntityTag": EntityTag, "EntityTagCollection": EntityTagCollection, "EntityTagSummary": EntityTagSummary, + "EventConfig": EventConfig, "ExportDataAssetDetails": ExportDataAssetDetails, "FacetedSearchAggregation": FacetedSearchAggregation, "FacetedSearchCustomProperty": FacetedSearchCustomProperty, diff --git a/src/oci/data_catalog/models/attribute_summary.py b/src/oci/data_catalog/models/attribute_summary.py index 43aa6b8c6c..dd7b3708b1 100644 --- a/src/oci/data_catalog/models/attribute_summary.py +++ b/src/oci/data_catalog/models/attribute_summary.py @@ -90,6 +90,10 @@ def __init__(self, **kwargs): The value to assign to the length property of this AttributeSummary. :type length: int + :param position: + The value to assign to the position property of this AttributeSummary. + :type position: int + :param precision: The value to assign to the precision property of this AttributeSummary. :type precision: int @@ -166,6 +170,10 @@ def __init__(self, **kwargs): The value to assign to the time_updated property of this AttributeSummary. :type time_updated: datetime + :param properties: + The value to assign to the properties property of this AttributeSummary. + :type properties: dict(str, dict(str, str)) + """ self.swagger_types = { 'key': 'str', @@ -175,6 +183,7 @@ def __init__(self, **kwargs): 'entity_key': 'str', 'external_key': 'str', 'length': 'int', + 'position': 'int', 'precision': 'int', 'scale': 'int', 'is_nullable': 'bool', @@ -192,7 +201,8 @@ def __init__(self, **kwargs): 'custom_property_members': 'list[CustomPropertyGetUsage]', 'associated_rule_types': 'list[str]', 'is_derived_attribute': 'bool', - 'time_updated': 'datetime' + 'time_updated': 'datetime', + 'properties': 'dict(str, dict(str, str))' } self.attribute_map = { @@ -203,6 +213,7 @@ def __init__(self, **kwargs): 'entity_key': 'entityKey', 'external_key': 'externalKey', 'length': 'length', + 'position': 'position', 'precision': 'precision', 'scale': 'scale', 'is_nullable': 'isNullable', @@ -220,7 +231,8 @@ def __init__(self, **kwargs): 'custom_property_members': 'customPropertyMembers', 'associated_rule_types': 'associatedRuleTypes', 'is_derived_attribute': 'isDerivedAttribute', - 'time_updated': 'timeUpdated' + 'time_updated': 'timeUpdated', + 'properties': 'properties' } self._key = None @@ -230,6 +242,7 @@ def __init__(self, **kwargs): self._entity_key = None self._external_key = None self._length = None + self._position = None self._precision = None self._scale = None self._is_nullable = None @@ -248,6 +261,7 @@ def __init__(self, **kwargs): self._associated_rule_types = None self._is_derived_attribute = None self._time_updated = None + self._properties = None @property def key(self): @@ -419,6 +433,30 @@ def length(self, length): """ self._length = length + @property + def position(self): + """ + Gets the position of this AttributeSummary. + Position of the attribute in the record definition. + + + :return: The position of this AttributeSummary. + :rtype: int + """ + return self._position + + @position.setter + def position(self, position): + """ + Sets the position of this AttributeSummary. + Position of the attribute in the record definition. + + + :param position: The position of this AttributeSummary. + :type: int + """ + self._position = position + @property def precision(self): """ @@ -877,6 +915,38 @@ def time_updated(self, time_updated): """ self._time_updated = time_updated + @property + def properties(self): + """ + Gets the properties of this AttributeSummary. + A map of maps that contains the properties which are specific to the attribute type. Each attribute type + definition defines it's set of required and optional properties. The map keys are category names and the + values are maps of property name to property value. Every property is contained inside of a category. Most + attributes have required properties within the \"default\" category. + Example: `{\"properties\": { \"default\": { \"key1\": \"value1\"}}}` + + + :return: The properties of this AttributeSummary. + :rtype: dict(str, dict(str, str)) + """ + return self._properties + + @properties.setter + def properties(self, properties): + """ + Sets the properties of this AttributeSummary. + A map of maps that contains the properties which are specific to the attribute type. Each attribute type + definition defines it's set of required and optional properties. The map keys are category names and the + values are maps of property name to property value. Every property is contained inside of a category. Most + attributes have required properties within the \"default\" category. + Example: `{\"properties\": { \"default\": { \"key1\": \"value1\"}}}` + + + :param properties: The properties of this AttributeSummary. + :type: dict(str, dict(str, str)) + """ + self._properties = properties + def __repr__(self): return formatted_flat_dict(self) diff --git a/src/oci/data_catalog/models/custom_property.py b/src/oci/data_catalog/models/custom_property.py index 76ba606c58..408c6e84a4 100644 --- a/src/oci/data_catalog/models/custom_property.py +++ b/src/oci/data_catalog/models/custom_property.py @@ -166,6 +166,10 @@ def __init__(self, **kwargs): The value to assign to the allowed_values property of this CustomProperty. :type allowed_values: list[str] + :param events: + The value to assign to the events property of this CustomProperty. + :type events: list[oci.data_catalog.models.EventConfig] + :param properties: The value to assign to the properties property of this CustomProperty. :type properties: dict(str, dict(str, str)) @@ -195,6 +199,7 @@ def __init__(self, **kwargs): 'is_event_enabled': 'bool', 'scope': 'list[CustomPropertyTypeUsage]', 'allowed_values': 'list[str]', + 'events': 'list[EventConfig]', 'properties': 'dict(str, dict(str, str))' } @@ -222,6 +227,7 @@ def __init__(self, **kwargs): 'is_event_enabled': 'isEventEnabled', 'scope': 'scope', 'allowed_values': 'allowedValues', + 'events': 'events', 'properties': 'properties' } @@ -248,6 +254,7 @@ def __init__(self, **kwargs): self._is_event_enabled = None self._scope = None self._allowed_values = None + self._events = None self._properties = None @property @@ -780,7 +787,7 @@ def is_event_enabled(self, is_event_enabled): def scope(self): """ Gets the scope of this CustomProperty. - Type or scope of the custom property belongs to. This will be an array of type id it will be belongs to + The set of object types to which the custom property applies. :return: The scope of this CustomProperty. @@ -792,7 +799,7 @@ def scope(self): def scope(self, scope): """ Sets the scope of this CustomProperty. - Type or scope of the custom property belongs to. This will be an array of type id it will be belongs to + The set of object types to which the custom property applies. :param scope: The scope of this CustomProperty. @@ -824,6 +831,30 @@ def allowed_values(self, allowed_values): """ self._allowed_values = allowed_values + @property + def events(self): + """ + Gets the events of this CustomProperty. + Event configuration for this custom property, against the desired subset of object types to which the property applies. + + + :return: The events of this CustomProperty. + :rtype: list[oci.data_catalog.models.EventConfig] + """ + return self._events + + @events.setter + def events(self, events): + """ + Sets the events of this CustomProperty. + Event configuration for this custom property, against the desired subset of object types to which the property applies. + + + :param events: The events of this CustomProperty. + :type: list[oci.data_catalog.models.EventConfig] + """ + self._events = events + @property def properties(self): """ diff --git a/src/oci/data_catalog/models/custom_property_summary.py b/src/oci/data_catalog/models/custom_property_summary.py index 7011969bf9..f154645b44 100644 --- a/src/oci/data_catalog/models/custom_property_summary.py +++ b/src/oci/data_catalog/models/custom_property_summary.py @@ -162,6 +162,10 @@ def __init__(self, **kwargs): The value to assign to the is_event_enabled property of this CustomPropertySummary. :type is_event_enabled: bool + :param events: + The value to assign to the events property of this CustomPropertySummary. + :type events: list[oci.data_catalog.models.EventConfig] + """ self.swagger_types = { 'key': 'str', @@ -185,7 +189,8 @@ def __init__(self, **kwargs): 'time_updated': 'datetime', 'created_by_id': 'str', 'updated_by_id': 'str', - 'is_event_enabled': 'bool' + 'is_event_enabled': 'bool', + 'events': 'list[EventConfig]' } self.attribute_map = { @@ -210,7 +215,8 @@ def __init__(self, **kwargs): 'time_updated': 'timeUpdated', 'created_by_id': 'createdById', 'updated_by_id': 'updatedById', - 'is_event_enabled': 'isEventEnabled' + 'is_event_enabled': 'isEventEnabled', + 'events': 'events' } self._key = None @@ -235,6 +241,7 @@ def __init__(self, **kwargs): self._created_by_id = None self._updated_by_id = None self._is_event_enabled = None + self._events = None @property def key(self): @@ -786,6 +793,30 @@ def is_event_enabled(self, is_event_enabled): """ self._is_event_enabled = is_event_enabled + @property + def events(self): + """ + Gets the events of this CustomPropertySummary. + Event configuration for this custom property, against the desired subset of object types to which the property applies. + + + :return: The events of this CustomPropertySummary. + :rtype: list[oci.data_catalog.models.EventConfig] + """ + return self._events + + @events.setter + def events(self, events): + """ + Sets the events of this CustomPropertySummary. + Event configuration for this custom property, against the desired subset of object types to which the property applies. + + + :param events: The events of this CustomPropertySummary. + :type: list[oci.data_catalog.models.EventConfig] + """ + self._events = events + def __repr__(self): return formatted_flat_dict(self) diff --git a/src/oci/data_catalog/models/event_config.py b/src/oci/data_catalog/models/event_config.py new file mode 100644 index 0000000000..6b1d52bc32 --- /dev/null +++ b/src/oci/data_catalog/models/event_config.py @@ -0,0 +1,344 @@ +# coding: utf-8 +# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. +# 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. + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class EventConfig(object): + """ + Describes an event configuration, for a given object type and property. Primarily, whether a property change will result in an event being emitted. + """ + + #: A constant which can be used with the event_config_status property of a EventConfig. + #: This constant has a value of "ENABLED" + EVENT_CONFIG_STATUS_ENABLED = "ENABLED" + + #: A constant which can be used with the event_config_status property of a EventConfig. + #: This constant has a value of "DISABLED" + EVENT_CONFIG_STATUS_DISABLED = "DISABLED" + + def __init__(self, **kwargs): + """ + Initializes a new EventConfig object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param type_id: + The value to assign to the type_id property of this EventConfig. + :type type_id: str + + :param type_name: + The value to assign to the type_name property of this EventConfig. + :type type_name: str + + :param property_id: + The value to assign to the property_id property of this EventConfig. + :type property_id: str + + :param property_name: + The value to assign to the property_name property of this EventConfig. + :type property_name: str + + :param event_config_status: + The value to assign to the event_config_status property of this EventConfig. + Allowed values for this property are: "ENABLED", "DISABLED", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :type event_config_status: str + + :param time_created: + The value to assign to the time_created property of this EventConfig. + :type time_created: datetime + + :param time_updated: + The value to assign to the time_updated property of this EventConfig. + :type time_updated: datetime + + :param created_by_id: + The value to assign to the created_by_id property of this EventConfig. + :type created_by_id: str + + :param updated_by_id: + The value to assign to the updated_by_id property of this EventConfig. + :type updated_by_id: str + + """ + self.swagger_types = { + 'type_id': 'str', + 'type_name': 'str', + 'property_id': 'str', + 'property_name': 'str', + 'event_config_status': 'str', + 'time_created': 'datetime', + 'time_updated': 'datetime', + 'created_by_id': 'str', + 'updated_by_id': 'str' + } + + self.attribute_map = { + 'type_id': 'typeId', + 'type_name': 'typeName', + 'property_id': 'propertyId', + 'property_name': 'propertyName', + 'event_config_status': 'eventConfigStatus', + 'time_created': 'timeCreated', + 'time_updated': 'timeUpdated', + 'created_by_id': 'createdById', + 'updated_by_id': 'updatedById' + } + + self._type_id = None + self._type_name = None + self._property_id = None + self._property_name = None + self._event_config_status = None + self._time_created = None + self._time_updated = None + self._created_by_id = None + self._updated_by_id = None + + @property + def type_id(self): + """ + Gets the type_id of this EventConfig. + Unique type key identifier. + + + :return: The type_id of this EventConfig. + :rtype: str + """ + return self._type_id + + @type_id.setter + def type_id(self, type_id): + """ + Sets the type_id of this EventConfig. + Unique type key identifier. + + + :param type_id: The type_id of this EventConfig. + :type: str + """ + self._type_id = type_id + + @property + def type_name(self): + """ + Gets the type_name of this EventConfig. + Name of the type. + + + :return: The type_name of this EventConfig. + :rtype: str + """ + return self._type_name + + @type_name.setter + def type_name(self, type_name): + """ + Sets the type_name of this EventConfig. + Name of the type. + + + :param type_name: The type_name of this EventConfig. + :type: str + """ + self._type_name = type_name + + @property + def property_id(self): + """ + Gets the property_id of this EventConfig. + Unique property key identifier. + + + :return: The property_id of this EventConfig. + :rtype: str + """ + return self._property_id + + @property_id.setter + def property_id(self, property_id): + """ + Sets the property_id of this EventConfig. + Unique property key identifier. + + + :param property_id: The property_id of this EventConfig. + :type: str + """ + self._property_id = property_id + + @property + def property_name(self): + """ + Gets the property_name of this EventConfig. + Name of the property. + + + :return: The property_name of this EventConfig. + :rtype: str + """ + return self._property_name + + @property_name.setter + def property_name(self, property_name): + """ + Sets the property_name of this EventConfig. + Name of the property. + + + :param property_name: The property_name of this EventConfig. + :type: str + """ + self._property_name = property_name + + @property + def event_config_status(self): + """ + Gets the event_config_status of this EventConfig. + Status of the configuration. + + Allowed values for this property are: "ENABLED", "DISABLED", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + + + :return: The event_config_status of this EventConfig. + :rtype: str + """ + return self._event_config_status + + @event_config_status.setter + def event_config_status(self, event_config_status): + """ + Sets the event_config_status of this EventConfig. + Status of the configuration. + + + :param event_config_status: The event_config_status of this EventConfig. + :type: str + """ + allowed_values = ["ENABLED", "DISABLED"] + if not value_allowed_none_or_none_sentinel(event_config_status, allowed_values): + event_config_status = 'UNKNOWN_ENUM_VALUE' + self._event_config_status = event_config_status + + @property + def time_created(self): + """ + Gets the time_created of this EventConfig. + The date and time the event was configured, in the format defined by `RFC3339`__. + Example: `2019-03-25T21:10:29.600Z` + + __ https://tools.ietf.org/html/rfc3339 + + + :return: The time_created of this EventConfig. + :rtype: datetime + """ + return self._time_created + + @time_created.setter + def time_created(self, time_created): + """ + Sets the time_created of this EventConfig. + The date and time the event was configured, in the format defined by `RFC3339`__. + Example: `2019-03-25T21:10:29.600Z` + + __ https://tools.ietf.org/html/rfc3339 + + + :param time_created: The time_created of this EventConfig. + :type: datetime + """ + self._time_created = time_created + + @property + def time_updated(self): + """ + Gets the time_updated of this EventConfig. + The last time that any change was made to the configuration. An `RFC3339`__ formatted datetime string. + + __ https://tools.ietf.org/html/rfc3339 + + + :return: The time_updated of this EventConfig. + :rtype: datetime + """ + return self._time_updated + + @time_updated.setter + def time_updated(self, time_updated): + """ + Sets the time_updated of this EventConfig. + The last time that any change was made to the configuration. An `RFC3339`__ formatted datetime string. + + __ https://tools.ietf.org/html/rfc3339 + + + :param time_updated: The time_updated of this EventConfig. + :type: datetime + """ + self._time_updated = time_updated + + @property + def created_by_id(self): + """ + Gets the created_by_id of this EventConfig. + OCID of the user who created the configuration. + + + :return: The created_by_id of this EventConfig. + :rtype: str + """ + return self._created_by_id + + @created_by_id.setter + def created_by_id(self, created_by_id): + """ + Sets the created_by_id of this EventConfig. + OCID of the user who created the configuration. + + + :param created_by_id: The created_by_id of this EventConfig. + :type: str + """ + self._created_by_id = created_by_id + + @property + def updated_by_id(self): + """ + Gets the updated_by_id of this EventConfig. + OCID of the user who last modified the configuration. + + + :return: The updated_by_id of this EventConfig. + :rtype: str + """ + return self._updated_by_id + + @updated_by_id.setter + def updated_by_id(self, updated_by_id): + """ + Sets the updated_by_id of this EventConfig. + OCID of the user who last modified the configuration. + + + :param updated_by_id: The updated_by_id of this EventConfig. + :type: str + """ + self._updated_by_id = updated_by_id + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/data_catalog/models/object_relationship.py b/src/oci/data_catalog/models/object_relationship.py index 55f1158f88..7fc6945cfd 100644 --- a/src/oci/data_catalog/models/object_relationship.py +++ b/src/oci/data_catalog/models/object_relationship.py @@ -46,6 +46,18 @@ def __init__(self, **kwargs): The value to assign to the time_updated property of this ObjectRelationship. :type time_updated: datetime + :param path: + The value to assign to the path property of this ObjectRelationship. + :type path: str + + :param parent_key: + The value to assign to the parent_key property of this ObjectRelationship. + :type parent_key: str + + :param parent_path: + The value to assign to the parent_path property of this ObjectRelationship. + :type parent_path: str + """ self.swagger_types = { 'relationship_type': 'str', @@ -54,7 +66,10 @@ def __init__(self, **kwargs): 'type_name': 'str', 'type_key': 'str', 'time_created': 'datetime', - 'time_updated': 'datetime' + 'time_updated': 'datetime', + 'path': 'str', + 'parent_key': 'str', + 'parent_path': 'str' } self.attribute_map = { @@ -64,7 +79,10 @@ def __init__(self, **kwargs): 'type_name': 'typeName', 'type_key': 'typeKey', 'time_created': 'timeCreated', - 'time_updated': 'timeUpdated' + 'time_updated': 'timeUpdated', + 'path': 'path', + 'parent_key': 'parentKey', + 'parent_path': 'parentPath' } self._relationship_type = None @@ -74,6 +92,9 @@ def __init__(self, **kwargs): self._type_key = None self._time_created = None self._time_updated = None + self._path = None + self._parent_key = None + self._parent_path = None @property def relationship_type(self): @@ -253,6 +274,78 @@ def time_updated(self, time_updated): """ self._time_updated = time_updated + @property + def path(self): + """ + Gets the path of this ObjectRelationship. + Full path of the object. + + + :return: The path of this ObjectRelationship. + :rtype: str + """ + return self._path + + @path.setter + def path(self, path): + """ + Sets the path of this ObjectRelationship. + Full path of the object. + + + :param path: The path of this ObjectRelationship. + :type: str + """ + self._path = path + + @property + def parent_key(self): + """ + Gets the parent_key of this ObjectRelationship. + Key of the parent object for the resource. + + + :return: The parent_key of this ObjectRelationship. + :rtype: str + """ + return self._parent_key + + @parent_key.setter + def parent_key(self, parent_key): + """ + Sets the parent_key of this ObjectRelationship. + Key of the parent object for the resource. + + + :param parent_key: The parent_key of this ObjectRelationship. + :type: str + """ + self._parent_key = parent_key + + @property + def parent_path(self): + """ + Gets the parent_path of this ObjectRelationship. + Full path of the parent object. + + + :return: The parent_path of this ObjectRelationship. + :rtype: str + """ + return self._parent_path + + @parent_path.setter + def parent_path(self, parent_path): + """ + Sets the parent_path of this ObjectRelationship. + Full path of the parent object. + + + :param parent_path: The parent_path of this ObjectRelationship. + :type: str + """ + self._parent_path = parent_path + def __repr__(self): return formatted_flat_dict(self) diff --git a/src/oci/data_catalog/models/parse_connection_details.py b/src/oci/data_catalog/models/parse_connection_details.py index e2ffeb5f12..894743388c 100644 --- a/src/oci/data_catalog/models/parse_connection_details.py +++ b/src/oci/data_catalog/models/parse_connection_details.py @@ -10,7 +10,8 @@ @init_model_state_from_kwargs class ParseConnectionDetails(object): """ - Parse connections from the connection metadata and oracle wallet file. + Parse connections from the connection metadata and Oracle wallet file. + An error will be returned if more than one of connectionPayload, walletSecretId or walletSecretName are present in the request. """ def __init__(self, **kwargs): @@ -26,19 +27,33 @@ def __init__(self, **kwargs): The value to assign to the connection_payload property of this ParseConnectionDetails. :type connection_payload: str + :param wallet_secret_id: + The value to assign to the wallet_secret_id property of this ParseConnectionDetails. + :type wallet_secret_id: str + + :param wallet_secret_name: + The value to assign to the wallet_secret_name property of this ParseConnectionDetails. + :type wallet_secret_name: str + """ self.swagger_types = { 'connection_detail': 'Connection', - 'connection_payload': 'str' + 'connection_payload': 'str', + 'wallet_secret_id': 'str', + 'wallet_secret_name': 'str' } self.attribute_map = { 'connection_detail': 'connectionDetail', - 'connection_payload': 'connectionPayload' + 'connection_payload': 'connectionPayload', + 'wallet_secret_id': 'walletSecretId', + 'wallet_secret_name': 'walletSecretName' } self._connection_detail = None self._connection_payload = None + self._wallet_secret_id = None + self._wallet_secret_name = None @property def connection_detail(self): @@ -84,6 +99,54 @@ def connection_payload(self, connection_payload): """ self._connection_payload = connection_payload + @property + def wallet_secret_id(self): + """ + Gets the wallet_secret_id of this ParseConnectionDetails. + OCID of the OCI Vault secret holding the Oracle wallet to parse. + + + :return: The wallet_secret_id of this ParseConnectionDetails. + :rtype: str + """ + return self._wallet_secret_id + + @wallet_secret_id.setter + def wallet_secret_id(self, wallet_secret_id): + """ + Sets the wallet_secret_id of this ParseConnectionDetails. + OCID of the OCI Vault secret holding the Oracle wallet to parse. + + + :param wallet_secret_id: The wallet_secret_id of this ParseConnectionDetails. + :type: str + """ + self._wallet_secret_id = wallet_secret_id + + @property + def wallet_secret_name(self): + """ + Gets the wallet_secret_name of this ParseConnectionDetails. + Name of the OCI Vault secret holding the Oracle wallet to parse. + + + :return: The wallet_secret_name of this ParseConnectionDetails. + :rtype: str + """ + return self._wallet_secret_name + + @wallet_secret_name.setter + def wallet_secret_name(self, wallet_secret_name): + """ + Sets the wallet_secret_name of this ParseConnectionDetails. + Name of the OCI Vault secret holding the Oracle wallet to parse. + + + :param wallet_secret_name: The wallet_secret_name of this ParseConnectionDetails. + :type: str + """ + self._wallet_secret_name = wallet_secret_name + def __repr__(self): return formatted_flat_dict(self) diff --git a/src/oci/data_catalog/models/type.py b/src/oci/data_catalog/models/type.py index 9ed99db07c..6cfa17d402 100644 --- a/src/oci/data_catalog/models/type.py +++ b/src/oci/data_catalog/models/type.py @@ -105,6 +105,14 @@ def __init__(self, **kwargs): The value to assign to the custom_properties property of this Type. :type custom_properties: list[oci.data_catalog.models.CustomPropertySummary] + :param parent_type_key: + The value to assign to the parent_type_key property of this Type. + :type parent_type_key: str + + :param parent_type_name: + The value to assign to the parent_type_name property of this Type. + :type parent_type_name: str + """ self.swagger_types = { 'key': 'str', @@ -119,7 +127,9 @@ def __init__(self, **kwargs): 'type_category': 'str', 'external_type_name': 'str', 'uri': 'str', - 'custom_properties': 'list[CustomPropertySummary]' + 'custom_properties': 'list[CustomPropertySummary]', + 'parent_type_key': 'str', + 'parent_type_name': 'str' } self.attribute_map = { @@ -135,7 +145,9 @@ def __init__(self, **kwargs): 'type_category': 'typeCategory', 'external_type_name': 'externalTypeName', 'uri': 'uri', - 'custom_properties': 'customProperties' + 'custom_properties': 'customProperties', + 'parent_type_key': 'parentTypeKey', + 'parent_type_name': 'parentTypeName' } self._key = None @@ -151,6 +163,8 @@ def __init__(self, **kwargs): self._external_type_name = None self._uri = None self._custom_properties = None + self._parent_type_key = None + self._parent_type_name = None @property def key(self): @@ -506,6 +520,54 @@ def custom_properties(self, custom_properties): """ self._custom_properties = custom_properties + @property + def parent_type_key(self): + """ + Gets the parent_type_key of this Type. + Unique key of the parent type. + + + :return: The parent_type_key of this Type. + :rtype: str + """ + return self._parent_type_key + + @parent_type_key.setter + def parent_type_key(self, parent_type_key): + """ + Sets the parent_type_key of this Type. + Unique key of the parent type. + + + :param parent_type_key: The parent_type_key of this Type. + :type: str + """ + self._parent_type_key = parent_type_key + + @property + def parent_type_name(self): + """ + Gets the parent_type_name of this Type. + Name of the parent type. + + + :return: The parent_type_name of this Type. + :rtype: str + """ + return self._parent_type_name + + @parent_type_name.setter + def parent_type_name(self, parent_type_name): + """ + Sets the parent_type_name of this Type. + Name of the parent type. + + + :param parent_type_name: The parent_type_name of this Type. + :type: str + """ + self._parent_type_name = parent_type_name + def __repr__(self): return formatted_flat_dict(self) diff --git a/src/oci/data_catalog/models/type_summary.py b/src/oci/data_catalog/models/type_summary.py index 108f9c62bd..b7517d259f 100644 --- a/src/oci/data_catalog/models/type_summary.py +++ b/src/oci/data_catalog/models/type_summary.py @@ -81,6 +81,14 @@ def __init__(self, **kwargs): Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. :type lifecycle_state: str + :param parent_type_key: + The value to assign to the parent_type_key property of this TypeSummary. + :type parent_type_key: str + + :param parent_type_name: + The value to assign to the parent_type_name property of this TypeSummary. + :type parent_type_name: str + """ self.swagger_types = { 'key': 'str', @@ -89,7 +97,9 @@ def __init__(self, **kwargs): 'catalog_id': 'str', 'type_category': 'str', 'uri': 'str', - 'lifecycle_state': 'str' + 'lifecycle_state': 'str', + 'parent_type_key': 'str', + 'parent_type_name': 'str' } self.attribute_map = { @@ -99,7 +109,9 @@ def __init__(self, **kwargs): 'catalog_id': 'catalogId', 'type_category': 'typeCategory', 'uri': 'uri', - 'lifecycle_state': 'lifecycleState' + 'lifecycle_state': 'lifecycleState', + 'parent_type_key': 'parentTypeKey', + 'parent_type_name': 'parentTypeName' } self._key = None @@ -109,6 +121,8 @@ def __init__(self, **kwargs): self._type_category = None self._uri = None self._lifecycle_state = None + self._parent_type_key = None + self._parent_type_name = None @property def key(self): @@ -284,6 +298,54 @@ def lifecycle_state(self, lifecycle_state): lifecycle_state = 'UNKNOWN_ENUM_VALUE' self._lifecycle_state = lifecycle_state + @property + def parent_type_key(self): + """ + Gets the parent_type_key of this TypeSummary. + Unique key of the parent type. + + + :return: The parent_type_key of this TypeSummary. + :rtype: str + """ + return self._parent_type_key + + @parent_type_key.setter + def parent_type_key(self, parent_type_key): + """ + Sets the parent_type_key of this TypeSummary. + Unique key of the parent type. + + + :param parent_type_key: The parent_type_key of this TypeSummary. + :type: str + """ + self._parent_type_key = parent_type_key + + @property + def parent_type_name(self): + """ + Gets the parent_type_name of this TypeSummary. + Name of the parent type. + + + :return: The parent_type_name of this TypeSummary. + :rtype: str + """ + return self._parent_type_name + + @parent_type_name.setter + def parent_type_name(self, parent_type_name): + """ + Sets the parent_type_name of this TypeSummary. + Name of the parent type. + + + :param parent_type_name: The parent_type_name of this TypeSummary. + :type: str + """ + self._parent_type_name = parent_type_name + def __repr__(self): return formatted_flat_dict(self) diff --git a/src/oci/log_analytics/log_analytics_client.py b/src/oci/log_analytics/log_analytics_client.py index c476edf5ce..25021e86a8 100644 --- a/src/oci/log_analytics/log_analytics_client.py +++ b/src/oci/log_analytics/log_analytics_client.py @@ -166,6 +166,10 @@ def add_entity_association(self, namespace_name, log_analytics_entity_id, add_en "if-match": kwargs.get("if_match", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + # Set default value for expect header if user has not overridden it + lowercase_header_params_keys = [k.lower() for k in header_params] + if "expect" not in lowercase_header_params_keys: + header_params["expect"] = "100-continue" retry_strategy = self.retry_strategy if kwargs.get('retry_strategy'): @@ -259,6 +263,10 @@ def add_source_event_types(self, namespace_name, source_name, add_event_type_det "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + # Set default value for expect header if user has not overridden it + lowercase_header_params_keys = [k.lower() for k in header_params] + if "expect" not in lowercase_header_params_keys: + header_params["expect"] = "100-continue" retry_strategy = self.retry_strategy if kwargs.get('retry_strategy'): @@ -382,6 +390,10 @@ def append_lookup_data(self, namespace_name, lookup_name, append_lookup_file_bod "if-match": kwargs.get("if_match", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + # Set default value for expect header if user has not overridden it + lowercase_header_params_keys = [k.lower() for k in header_params] + if "expect" not in lowercase_header_params_keys: + header_params["expect"] = "100-continue" # If the body parameter is optional we need to assign it to a variable so additional type checking can be performed. try: @@ -531,6 +543,10 @@ def batch_get_basic_info(self, namespace_name, basic_details, is_include_deleted "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + # Set default value for expect header if user has not overridden it + lowercase_header_params_keys = [k.lower() for k in header_params] + if "expect" not in lowercase_header_params_keys: + header_params["expect"] = "100-continue" retry_strategy = self.retry_strategy if kwargs.get('retry_strategy'): @@ -723,6 +739,10 @@ def change_log_analytics_em_bridge_compartment(self, namespace_name, log_analyti "opc-retry-token": kwargs.get("opc_retry_token", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + # Set default value for expect header if user has not overridden it + lowercase_header_params_keys = [k.lower() for k in header_params] + if "expect" not in lowercase_header_params_keys: + header_params["expect"] = "100-continue" retry_strategy = self.retry_strategy if kwargs.get('retry_strategy'): @@ -825,6 +845,10 @@ def change_log_analytics_entity_compartment(self, namespace_name, log_analytics_ "opc-retry-token": kwargs.get("opc_retry_token", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + # Set default value for expect header if user has not overridden it + lowercase_header_params_keys = [k.lower() for k in header_params] + if "expect" not in lowercase_header_params_keys: + header_params["expect"] = "100-continue" retry_strategy = self.retry_strategy if kwargs.get('retry_strategy'): @@ -927,6 +951,10 @@ def change_log_analytics_log_group_compartment(self, namespace_name, log_analyti "opc-retry-token": kwargs.get("opc_retry_token", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + # Set default value for expect header if user has not overridden it + lowercase_header_params_keys = [k.lower() for k in header_params] + if "expect" not in lowercase_header_params_keys: + header_params["expect"] = "100-continue" retry_strategy = self.retry_strategy if kwargs.get('retry_strategy'): @@ -1022,6 +1050,10 @@ def change_log_analytics_object_collection_rule_compartment(self, namespace_name "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + # Set default value for expect header if user has not overridden it + lowercase_header_params_keys = [k.lower() for k in header_params] + if "expect" not in lowercase_header_params_keys: + header_params["expect"] = "100-continue" retry_strategy = self.retry_strategy if kwargs.get('retry_strategy'): @@ -1123,6 +1155,10 @@ def change_scheduled_task_compartment(self, namespace_name, scheduled_task_id, c "opc-retry-token": kwargs.get("opc_retry_token", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + # Set default value for expect header if user has not overridden it + lowercase_header_params_keys = [k.lower() for k in header_params] + if "expect" not in lowercase_header_params_keys: + header_params["expect"] = "100-continue" retry_strategy = self.retry_strategy if kwargs.get('retry_strategy'): @@ -1320,6 +1356,10 @@ def create_log_analytics_em_bridge(self, namespace_name, create_log_analytics_em "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + # Set default value for expect header if user has not overridden it + lowercase_header_params_keys = [k.lower() for k in header_params] + if "expect" not in lowercase_header_params_keys: + header_params["expect"] = "100-continue" retry_strategy = self.retry_strategy if kwargs.get('retry_strategy'): @@ -1411,6 +1451,10 @@ def create_log_analytics_entity(self, namespace_name, create_log_analytics_entit "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + # Set default value for expect header if user has not overridden it + lowercase_header_params_keys = [k.lower() for k in header_params] + if "expect" not in lowercase_header_params_keys: + header_params["expect"] = "100-continue" retry_strategy = self.retry_strategy if kwargs.get('retry_strategy'): @@ -1502,6 +1546,10 @@ def create_log_analytics_entity_type(self, namespace_name, create_log_analytics_ "opc-retry-token": kwargs.get("opc_retry_token", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + # Set default value for expect header if user has not overridden it + lowercase_header_params_keys = [k.lower() for k in header_params] + if "expect" not in lowercase_header_params_keys: + header_params["expect"] = "100-continue" retry_strategy = self.retry_strategy if kwargs.get('retry_strategy'): @@ -1591,6 +1639,10 @@ def create_log_analytics_log_group(self, namespace_name, create_log_analytics_lo "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + # Set default value for expect header if user has not overridden it + lowercase_header_params_keys = [k.lower() for k in header_params] + if "expect" not in lowercase_header_params_keys: + header_params["expect"] = "100-continue" retry_strategy = self.retry_strategy if kwargs.get('retry_strategy'): @@ -1673,6 +1725,10 @@ def create_log_analytics_object_collection_rule(self, namespace_name, create_log "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + # Set default value for expect header if user has not overridden it + lowercase_header_params_keys = [k.lower() for k in header_params] + if "expect" not in lowercase_header_params_keys: + header_params["expect"] = "100-continue" retry_strategy = self.retry_strategy if kwargs.get('retry_strategy'): @@ -1762,6 +1818,10 @@ def create_scheduled_task(self, namespace_name, create_scheduled_task_details, * "opc-retry-token": kwargs.get("opc_retry_token", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + # Set default value for expect header if user has not overridden it + lowercase_header_params_keys = [k.lower() for k in header_params] + if "expect" not in lowercase_header_params_keys: + header_params["expect"] = "100-continue" retry_strategy = self.retry_strategy if kwargs.get('retry_strategy'): @@ -1853,6 +1913,10 @@ def delete_associations(self, namespace_name, delete_log_analytics_association_d "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + # Set default value for expect header if user has not overridden it + lowercase_header_params_keys = [k.lower() for k in header_params] + if "expect" not in lowercase_header_params_keys: + header_params["expect"] = "100-continue" retry_strategy = self.retry_strategy if kwargs.get('retry_strategy'): @@ -3298,6 +3362,10 @@ def disable_auto_association(self, namespace_name, source_name, disable_auto_ass "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + # Set default value for expect header if user has not overridden it + lowercase_header_params_keys = [k.lower() for k in header_params] + if "expect" not in lowercase_header_params_keys: + header_params["expect"] = "100-continue" retry_strategy = self.retry_strategy if kwargs.get('retry_strategy'): @@ -3391,6 +3459,10 @@ def disable_source_event_types(self, namespace_name, source_name, disable_event_ "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + # Set default value for expect header if user has not overridden it + lowercase_header_params_keys = [k.lower() for k in header_params] + if "expect" not in lowercase_header_params_keys: + header_params["expect"] = "100-continue" retry_strategy = self.retry_strategy if kwargs.get('retry_strategy'): @@ -3570,6 +3642,10 @@ def enable_auto_association(self, namespace_name, source_name, enable_auto_assoc "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + # Set default value for expect header if user has not overridden it + lowercase_header_params_keys = [k.lower() for k in header_params] + if "expect" not in lowercase_header_params_keys: + header_params["expect"] = "100-continue" retry_strategy = self.retry_strategy if kwargs.get('retry_strategy'): @@ -3663,6 +3739,10 @@ def enable_source_event_types(self, namespace_name, source_name, enable_event_ty "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + # Set default value for expect header if user has not overridden it + lowercase_header_params_keys = [k.lower() for k in header_params] + if "expect" not in lowercase_header_params_keys: + header_params["expect"] = "100-continue" retry_strategy = self.retry_strategy if kwargs.get('retry_strategy'): @@ -3761,6 +3841,10 @@ def estimate_purge_data_size(self, namespace_name, estimate_purge_data_size_deta "if-match": kwargs.get("if_match", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + # Set default value for expect header if user has not overridden it + lowercase_header_params_keys = [k.lower() for k in header_params] + if "expect" not in lowercase_header_params_keys: + header_params["expect"] = "100-continue" retry_strategy = self.retry_strategy if kwargs.get('retry_strategy'): @@ -3843,6 +3927,10 @@ def estimate_recall_data_size(self, namespace_name, estimate_recall_data_size_de "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + # Set default value for expect header if user has not overridden it + lowercase_header_params_keys = [k.lower() for k in header_params] + if "expect" not in lowercase_header_params_keys: + header_params["expect"] = "100-continue" retry_strategy = self.retry_strategy if kwargs.get('retry_strategy'): @@ -3923,6 +4011,10 @@ def estimate_release_data_size(self, namespace_name, estimate_release_data_size_ "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + # Set default value for expect header if user has not overridden it + lowercase_header_params_keys = [k.lower() for k in header_params] + if "expect" not in lowercase_header_params_keys: + header_params["expect"] = "100-continue" retry_strategy = self.retry_strategy if kwargs.get('retry_strategy'): @@ -4012,6 +4104,10 @@ def export_custom_content(self, namespace_name, export_custom_content_details, * "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + # Set default value for expect header if user has not overridden it + lowercase_header_params_keys = [k.lower() for k in header_params] + if "expect" not in lowercase_header_params_keys: + header_params["expect"] = "100-continue" retry_strategy = self.retry_strategy if kwargs.get('retry_strategy'): @@ -4094,6 +4190,10 @@ def export_query_result(self, namespace_name, export_details, **kwargs): "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + # Set default value for expect header if user has not overridden it + lowercase_header_params_keys = [k.lower() for k in header_params] + if "expect" not in lowercase_header_params_keys: + header_params["expect"] = "100-continue" retry_strategy = self.retry_strategy if kwargs.get('retry_strategy'): @@ -4201,6 +4301,10 @@ def extract_structured_log_field_paths(self, namespace_name, logan_parser_detail "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + # Set default value for expect header if user has not overridden it + lowercase_header_params_keys = [k.lower() for k in header_params] + if "expect" not in lowercase_header_params_keys: + header_params["expect"] = "100-continue" retry_strategy = self.retry_strategy if kwargs.get('retry_strategy'): @@ -4312,6 +4416,10 @@ def extract_structured_log_header_paths(self, namespace_name, logan_parser_detai "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + # Set default value for expect header if user has not overridden it + lowercase_header_params_keys = [k.lower() for k in header_params] + if "expect" not in lowercase_header_params_keys: + header_params["expect"] = "100-continue" retry_strategy = self.retry_strategy if kwargs.get('retry_strategy'): @@ -4396,6 +4504,10 @@ def filter(self, namespace_name, filter_details, **kwargs): "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + # Set default value for expect header if user has not overridden it + lowercase_header_params_keys = [k.lower() for k in header_params] + if "expect" not in lowercase_header_params_keys: + header_params["expect"] = "100-continue" retry_strategy = self.retry_strategy if kwargs.get('retry_strategy'): @@ -6958,6 +7070,10 @@ def import_custom_content(self, namespace_name, import_custom_content_file_body, "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + # Set default value for expect header if user has not overridden it + lowercase_header_params_keys = [k.lower() for k in header_params] + if "expect" not in lowercase_header_params_keys: + header_params["expect"] = "100-continue" # If the body parameter is optional we need to assign it to a variable so additional type checking can be performed. try: @@ -13058,6 +13174,10 @@ def parse_query(self, namespace_name, parse_query_details, **kwargs): "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + # Set default value for expect header if user has not overridden it + lowercase_header_params_keys = [k.lower() for k in header_params] + if "expect" not in lowercase_header_params_keys: + header_params["expect"] = "100-continue" retry_strategy = self.retry_strategy if kwargs.get('retry_strategy'): @@ -13246,6 +13366,10 @@ def purge_storage_data(self, namespace_name, purge_storage_data_details, **kwarg "if-match": kwargs.get("if_match", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + # Set default value for expect header if user has not overridden it + lowercase_header_params_keys = [k.lower() for k in header_params] + if "expect" not in lowercase_header_params_keys: + header_params["expect"] = "100-continue" retry_strategy = self.retry_strategy if kwargs.get('retry_strategy'): @@ -13430,6 +13554,10 @@ def query(self, namespace_name, query_details, **kwargs): "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + # Set default value for expect header if user has not overridden it + lowercase_header_params_keys = [k.lower() for k in header_params] + if "expect" not in lowercase_header_params_keys: + header_params["expect"] = "100-continue" retry_strategy = self.retry_strategy if kwargs.get('retry_strategy'): @@ -13530,6 +13658,10 @@ def recall_archived_data(self, namespace_name, recall_archived_data_details, **k "if-match": kwargs.get("if_match", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + # Set default value for expect header if user has not overridden it + lowercase_header_params_keys = [k.lower() for k in header_params] + if "expect" not in lowercase_header_params_keys: + header_params["expect"] = "100-continue" retry_strategy = self.retry_strategy if kwargs.get('retry_strategy'): @@ -13663,6 +13795,10 @@ def register_lookup(self, namespace_name, type, register_lookup_content_file_bod "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + # Set default value for expect header if user has not overridden it + lowercase_header_params_keys = [k.lower() for k in header_params] + if "expect" not in lowercase_header_params_keys: + header_params["expect"] = "100-continue" # If the body parameter is optional we need to assign it to a variable so additional type checking can be performed. try: @@ -13786,6 +13922,10 @@ def release_recalled_data(self, namespace_name, release_recalled_data_details, * "if-match": kwargs.get("if_match", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + # Set default value for expect header if user has not overridden it + lowercase_header_params_keys = [k.lower() for k in header_params] + if "expect" not in lowercase_header_params_keys: + header_params["expect"] = "100-continue" retry_strategy = self.retry_strategy if kwargs.get('retry_strategy'): @@ -13888,6 +14028,10 @@ def remove_entity_associations(self, namespace_name, log_analytics_entity_id, re "opc-retry-token": kwargs.get("opc_retry_token", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + # Set default value for expect header if user has not overridden it + lowercase_header_params_keys = [k.lower() for k in header_params] + if "expect" not in lowercase_header_params_keys: + header_params["expect"] = "100-continue" retry_strategy = self.retry_strategy if kwargs.get('retry_strategy'): @@ -13981,6 +14125,10 @@ def remove_source_event_types(self, namespace_name, source_name, remove_event_ty "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + # Set default value for expect header if user has not overridden it + lowercase_header_params_keys = [k.lower() for k in header_params] + if "expect" not in lowercase_header_params_keys: + header_params["expect"] = "100-continue" retry_strategy = self.retry_strategy if kwargs.get('retry_strategy'): @@ -14259,6 +14407,10 @@ def suggest(self, namespace_name, suggest_details, **kwargs): "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + # Set default value for expect header if user has not overridden it + lowercase_header_params_keys = [k.lower() for k in header_params] + if "expect" not in lowercase_header_params_keys: + header_params["expect"] = "100-continue" retry_strategy = self.retry_strategy if kwargs.get('retry_strategy'): @@ -14356,6 +14508,10 @@ def suppress_warning(self, namespace_name, warning_reference_details, compartmen "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + # Set default value for expect header if user has not overridden it + lowercase_header_params_keys = [k.lower() for k in header_params] + if "expect" not in lowercase_header_params_keys: + header_params["expect"] = "100-continue" retry_strategy = self.retry_strategy if kwargs.get('retry_strategy'): @@ -14471,6 +14627,10 @@ def test_parser(self, namespace_name, test_parser_payload_details, **kwargs): "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + # Set default value for expect header if user has not overridden it + lowercase_header_params_keys = [k.lower() for k in header_params] + if "expect" not in lowercase_header_params_keys: + header_params["expect"] = "100-continue" retry_strategy = self.retry_strategy if kwargs.get('retry_strategy'): @@ -14572,6 +14732,10 @@ def unsuppress_warning(self, namespace_name, warning_reference_details, compartm "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + # Set default value for expect header if user has not overridden it + lowercase_header_params_keys = [k.lower() for k in header_params] + if "expect" not in lowercase_header_params_keys: + header_params["expect"] = "100-continue" retry_strategy = self.retry_strategy if kwargs.get('retry_strategy'): @@ -14667,6 +14831,10 @@ def update_log_analytics_em_bridge(self, namespace_name, log_analytics_em_bridge "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + # Set default value for expect header if user has not overridden it + lowercase_header_params_keys = [k.lower() for k in header_params] + if "expect" not in lowercase_header_params_keys: + header_params["expect"] = "100-continue" retry_strategy = self.retry_strategy if kwargs.get('retry_strategy'): @@ -14760,6 +14928,10 @@ def update_log_analytics_entity(self, namespace_name, log_analytics_entity_id, u "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + # Set default value for expect header if user has not overridden it + lowercase_header_params_keys = [k.lower() for k in header_params] + if "expect" not in lowercase_header_params_keys: + header_params["expect"] = "100-continue" retry_strategy = self.retry_strategy if kwargs.get('retry_strategy'): @@ -14853,6 +15025,10 @@ def update_log_analytics_entity_type(self, namespace_name, update_log_analytics_ "if-match": kwargs.get("if_match", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + # Set default value for expect header if user has not overridden it + lowercase_header_params_keys = [k.lower() for k in header_params] + if "expect" not in lowercase_header_params_keys: + header_params["expect"] = "100-continue" retry_strategy = self.retry_strategy if kwargs.get('retry_strategy'): @@ -14944,6 +15120,10 @@ def update_log_analytics_log_group(self, namespace_name, log_analytics_log_group "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + # Set default value for expect header if user has not overridden it + lowercase_header_params_keys = [k.lower() for k in header_params] + if "expect" not in lowercase_header_params_keys: + header_params["expect"] = "100-continue" retry_strategy = self.retry_strategy if kwargs.get('retry_strategy'): @@ -15039,6 +15219,10 @@ def update_log_analytics_object_collection_rule(self, namespace_name, log_analyt "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + # Set default value for expect header if user has not overridden it + lowercase_header_params_keys = [k.lower() for k in header_params] + if "expect" not in lowercase_header_params_keys: + header_params["expect"] = "100-continue" retry_strategy = self.retry_strategy if kwargs.get('retry_strategy'): @@ -15141,6 +15325,10 @@ def update_lookup(self, namespace_name, lookup_name, update_lookup_metadata_deta "if-match": kwargs.get("if_match", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + # Set default value for expect header if user has not overridden it + lowercase_header_params_keys = [k.lower() for k in header_params] + if "expect" not in lowercase_header_params_keys: + header_params["expect"] = "100-continue" retry_strategy = self.retry_strategy if kwargs.get('retry_strategy'): @@ -15266,6 +15454,10 @@ def update_lookup_data(self, namespace_name, lookup_name, update_lookup_file_bod "if-match": kwargs.get("if_match", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + # Set default value for expect header if user has not overridden it + lowercase_header_params_keys = [k.lower() for k in header_params] + if "expect" not in lowercase_header_params_keys: + header_params["expect"] = "100-continue" # If the body parameter is optional we need to assign it to a variable so additional type checking can be performed. try: @@ -15384,6 +15576,10 @@ def update_scheduled_task(self, namespace_name, scheduled_task_id, update_schedu "if-match": kwargs.get("if_match", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + # Set default value for expect header if user has not overridden it + lowercase_header_params_keys = [k.lower() for k in header_params] + if "expect" not in lowercase_header_params_keys: + header_params["expect"] = "100-continue" retry_strategy = self.retry_strategy if kwargs.get('retry_strategy'): @@ -15473,6 +15669,10 @@ def update_storage(self, namespace_name, update_storage_details, **kwargs): "if-match": kwargs.get("if_match", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + # Set default value for expect header if user has not overridden it + lowercase_header_params_keys = [k.lower() for k in header_params] + if "expect" not in lowercase_header_params_keys: + header_params["expect"] = "100-continue" retry_strategy = self.retry_strategy if kwargs.get('retry_strategy'): @@ -15605,6 +15805,10 @@ def upload_log_events_file(self, namespace_name, log_group_id, upload_log_events "opc-retry-token": kwargs.get("opc_retry_token", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + # Set default value for expect header if user has not overridden it + lowercase_header_params_keys = [k.lower() for k in header_params] + if "expect" not in lowercase_header_params_keys: + header_params["expect"] = "100-continue" # If the body parameter is optional we need to assign it to a variable so additional type checking can be performed. try: @@ -15796,6 +16000,10 @@ def upload_log_file(self, namespace_name, upload_name, log_source_name, filename "opc-retry-token": kwargs.get("opc_retry_token", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + # Set default value for expect header if user has not overridden it + lowercase_header_params_keys = [k.lower() for k in header_params] + if "expect" not in lowercase_header_params_keys: + header_params["expect"] = "100-continue" # If the body parameter is optional we need to assign it to a variable so additional type checking can be performed. try: @@ -15921,6 +16129,10 @@ def upsert_associations(self, namespace_name, upsert_log_analytics_association_d "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + # Set default value for expect header if user has not overridden it + lowercase_header_params_keys = [k.lower() for k in header_params] + if "expect" not in lowercase_header_params_keys: + header_params["expect"] = "100-continue" retry_strategy = self.retry_strategy if kwargs.get('retry_strategy'): @@ -16021,6 +16233,10 @@ def upsert_field(self, namespace_name, upsert_log_analytics_field_details, **kwa "if-match": kwargs.get("if_match", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + # Set default value for expect header if user has not overridden it + lowercase_header_params_keys = [k.lower() for k in header_params] + if "expect" not in lowercase_header_params_keys: + header_params["expect"] = "100-continue" retry_strategy = self.retry_strategy if kwargs.get('retry_strategy'): @@ -16121,6 +16337,10 @@ def upsert_label(self, namespace_name, upsert_log_analytics_label_details, **kwa "if-match": kwargs.get("if_match", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + # Set default value for expect header if user has not overridden it + lowercase_header_params_keys = [k.lower() for k in header_params] + if "expect" not in lowercase_header_params_keys: + header_params["expect"] = "100-continue" retry_strategy = self.retry_strategy if kwargs.get('retry_strategy'): @@ -16221,6 +16441,10 @@ def upsert_parser(self, namespace_name, upsert_log_analytics_parser_details, **k "if-match": kwargs.get("if_match", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + # Set default value for expect header if user has not overridden it + lowercase_header_params_keys = [k.lower() for k in header_params] + if "expect" not in lowercase_header_params_keys: + header_params["expect"] = "100-continue" retry_strategy = self.retry_strategy if kwargs.get('retry_strategy'): @@ -16342,6 +16566,10 @@ def upsert_source(self, namespace_name, upsert_log_analytics_source_details, **k "if-match": kwargs.get("if_match", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + # Set default value for expect header if user has not overridden it + lowercase_header_params_keys = [k.lower() for k in header_params] + if "expect" not in lowercase_header_params_keys: + header_params["expect"] = "100-continue" retry_strategy = self.retry_strategy if kwargs.get('retry_strategy'): @@ -16477,6 +16705,10 @@ def validate_association_parameters(self, namespace_name, upsert_log_analytics_a "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + # Set default value for expect header if user has not overridden it + lowercase_header_params_keys = [k.lower() for k in header_params] + if "expect" not in lowercase_header_params_keys: + header_params["expect"] = "100-continue" retry_strategy = self.retry_strategy if kwargs.get('retry_strategy'): @@ -16680,6 +16912,10 @@ def validate_source(self, namespace_name, upsert_log_analytics_source_details, * "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + # Set default value for expect header if user has not overridden it + lowercase_header_params_keys = [k.lower() for k in header_params] + if "expect" not in lowercase_header_params_keys: + header_params["expect"] = "100-continue" retry_strategy = self.retry_strategy if kwargs.get('retry_strategy'): @@ -16773,6 +17009,10 @@ def validate_source_extended_field_details(self, namespace_name, log_analytics_s "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + # Set default value for expect header if user has not overridden it + lowercase_header_params_keys = [k.lower() for k in header_params] + if "expect" not in lowercase_header_params_keys: + header_params["expect"] = "100-continue" retry_strategy = self.retry_strategy if kwargs.get('retry_strategy'): diff --git a/src/oci/object_storage/object_storage_client.py b/src/oci/object_storage/object_storage_client.py index 4ec9a524f9..c212c39c22 100644 --- a/src/oci/object_storage/object_storage_client.py +++ b/src/oci/object_storage/object_storage_client.py @@ -4188,6 +4188,10 @@ def put_object(self, namespace_name, bucket_name, object_name, put_object_body, for key, value in six.iteritems(kwargs.get("opc_meta", {})): header_params["opc-meta-" + key] = value header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + # Set default value for expect header if user has not overridden it + lowercase_header_params_keys = [k.lower() for k in header_params] + if "expect" not in lowercase_header_params_keys: + header_params["expect"] = "100-continue" # If the body parameter is optional we need to assign it to a variable so additional type checking can be performed. try: @@ -5209,6 +5213,10 @@ def upload_part(self, namespace_name, bucket_name, object_name, upload_id, uploa "opc-sse-customer-key-sha256": kwargs.get("opc_sse_customer_key_sha256", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + # Set default value for expect header if user has not overridden it + lowercase_header_params_keys = [k.lower() for k in header_params] + if "expect" not in lowercase_header_params_keys: + header_params["expect"] = "100-continue" # If the body parameter is optional we need to assign it to a variable so additional type checking can be performed. try: diff --git a/src/oci/os_management/__init__.py b/src/oci/os_management/__init__.py index 98be74ee31..8b5f565acf 100644 --- a/src/oci/os_management/__init__.py +++ b/src/oci/os_management/__init__.py @@ -5,8 +5,10 @@ from __future__ import absolute_import +from .event_client import EventClient +from .event_client_composite_operations import EventClientCompositeOperations from .os_management_client import OsManagementClient from .os_management_client_composite_operations import OsManagementClientCompositeOperations from . import models -__all__ = ["OsManagementClient", "OsManagementClientCompositeOperations", "models"] +__all__ = ["EventClient", "EventClientCompositeOperations", "OsManagementClient", "OsManagementClientCompositeOperations", "models"] diff --git a/src/oci/os_management/event_client.py b/src/oci/os_management/event_client.py new file mode 100644 index 0000000000..b5eb5036b2 --- /dev/null +++ b/src/oci/os_management/event_client.py @@ -0,0 +1,958 @@ +# coding: utf-8 +# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. +# 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. + +from __future__ import absolute_import + +from oci._vendor import requests # noqa: F401 +from oci._vendor import six + +from oci import retry # noqa: F401 +from oci.base_client import BaseClient +from oci.config import get_config_value_or_default, validate_config +from oci.signer import Signer +from oci.util import Sentinel, get_signer_from_authentication_type, AUTHENTICATION_TYPE_FIELD_NAME +from .models import os_management_type_mapping +missing = Sentinel("Missing") + + +class EventClient(object): + """ + API for the OS Management service. Use these API operations for working + with Managed instances and Managed instance groups. + """ + + def __init__(self, config, **kwargs): + """ + Creates a new service client + + :param dict config: + Configuration keys and values as per `SDK and Tool Configuration `__. + The :py:meth:`~oci.config.from_file` method can be used to load configuration from a file. Alternatively, a ``dict`` can be passed. You can validate_config + the dict using :py:meth:`~oci.config.validate_config` + + :param str service_endpoint: (optional) + The endpoint of the service to call using this client. For example ``https://iaas.us-ashburn-1.oraclecloud.com``. If this keyword argument is + not provided then it will be derived using the region in the config parameter. You should only provide this keyword argument if you have an explicit + need to specify a service endpoint. + + :param timeout: (optional) + The connection and read timeouts for the client. The default values are connection timeout 10 seconds and read timeout 60 seconds. This keyword argument can be provided + as a single float, in which case the value provided is used for both the read and connection timeouts, or as a tuple of two floats. If + a tuple is provided then the first value is used as the connection timeout and the second value as the read timeout. + :type timeout: float or tuple(float, float) + + :param signer: (optional) + The signer to use when signing requests made by the service client. The default is to use a :py:class:`~oci.signer.Signer` based on the values + provided in the config parameter. + + One use case for this parameter is for `Instance Principals authentication `__ + by passing an instance of :py:class:`~oci.auth.signers.InstancePrincipalsSecurityTokenSigner` as the value for this keyword argument + :type signer: :py:class:`~oci.signer.AbstractBaseSigner` + + :param obj retry_strategy: (optional) + A retry strategy to apply to all calls made by this service client (i.e. at the client level). There is no retry strategy applied by default. + Retry strategies can also be applied at the operation level by passing a ``retry_strategy`` keyword argument as part of calling the operation. + Any value provided at the operation level will override whatever is specified at the client level. + + This should be one of the strategies available in the :py:mod:`~oci.retry` module. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` + is also available. The specifics of the default retry strategy are described `here `__. + """ + validate_config(config, signer=kwargs.get('signer')) + if 'signer' in kwargs: + signer = kwargs['signer'] + + elif AUTHENTICATION_TYPE_FIELD_NAME in config: + signer = get_signer_from_authentication_type(config) + + else: + signer = Signer( + tenancy=config["tenancy"], + user=config["user"], + fingerprint=config["fingerprint"], + private_key_file_location=config.get("key_file"), + pass_phrase=get_config_value_or_default(config, "pass_phrase"), + private_key_content=config.get("key_content") + ) + + base_client_init_kwargs = { + 'regional_client': True, + 'service_endpoint': kwargs.get('service_endpoint'), + 'base_path': '/20190801', + 'service_endpoint_template': 'https://osms.{region}.oci.{secondLevelDomain}', + 'skip_deserialization': kwargs.get('skip_deserialization', False) + } + if 'timeout' in kwargs: + base_client_init_kwargs['timeout'] = kwargs.get('timeout') + self.base_client = BaseClient("event", config, signer, os_management_type_mapping, **base_client_init_kwargs) + self.retry_strategy = kwargs.get('retry_strategy') + + def delete_event_content(self, managed_instance_id, event_id, compartment_id, **kwargs): + """ + Delete an event content ZIP archive from the service + + + :param str managed_instance_id: (required) + Instance Oracle Cloud identifier (ocid) + + :param str event_id: (required) + Unique Event identifier (OCID) + + :param str compartment_id: (required) + The ID of the compartment in which to list resources. + + :param str opc_request_id: (optional) + The client request ID for tracing. + + :param str if_match: (optional) + For optimistic concurrency control. In the PUT or DELETE call + for a resource, set the `if-match` parameter to the value of the + etag from a previous GET or POST response for that resource. + The resource will be updated or deleted only if the etag you + provide matches the resource's current etag value. + + :param str opc_retry_token: (optional) + A token that uniquely identifies a request so it can be retried in case of a timeout or + server error without risk of executing that same action again. Retry tokens expire after 24 + hours, but can be invalidated before then due to conflicting operations. For example, if a resource + has been deleted and purged from the system, then a retry of the original creation request + might be rejected. + + :param obj retry_strategy: (optional) + A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. + + This should be one of the strategies available in the :py:mod:`~oci.retry` module. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` + is also available. The specifics of the default retry strategy are described `here `__. + + To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. + + :return: A :class:`~oci.response.Response` object with data of type None + :rtype: :class:`~oci.response.Response` + + :example: + Click `here `__ to see an example of how to use delete_event_content API. + """ + resource_path = "/managedInstances/{managedInstanceId}/events/{eventId}/content" + method = "DELETE" + + # Don't accept unknown kwargs + expected_kwargs = [ + "retry_strategy", + "opc_request_id", + "if_match", + "opc_retry_token" + ] + extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + "delete_event_content got unknown kwargs: {!r}".format(extra_kwargs)) + + path_params = { + "managedInstanceId": managed_instance_id, + "eventId": event_id + } + + path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} + + for (k, v) in six.iteritems(path_params): + if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): + raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k)) + + query_params = { + "compartmentId": compartment_id + } + query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None} + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "opc-request-id": kwargs.get("opc_request_id", missing), + "if-match": kwargs.get("if_match", missing), + "opc-retry-token": kwargs.get("opc_retry_token", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + + retry_strategy = self.retry_strategy + if kwargs.get('retry_strategy'): + retry_strategy = kwargs.get('retry_strategy') + + if retry_strategy: + if not isinstance(retry_strategy, retry.NoneRetryStrategy): + self.base_client.add_opc_retry_token_if_needed(header_params) + return retry_strategy.make_retrying_call( + self.base_client.call_api, + resource_path=resource_path, + method=method, + path_params=path_params, + query_params=query_params, + header_params=header_params) + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + path_params=path_params, + query_params=query_params, + header_params=header_params) + + def get_event(self, managed_instance_id, event_id, compartment_id, **kwargs): + """ + Gets an Event by identifier + + + :param str managed_instance_id: (required) + Instance Oracle Cloud identifier (ocid) + + :param str event_id: (required) + Unique Event identifier (OCID) + + :param str compartment_id: (required) + The ID of the compartment in which to list resources. + + :param str opc_request_id: (optional) + The client request ID for tracing. + + :param obj retry_strategy: (optional) + A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. + + This should be one of the strategies available in the :py:mod:`~oci.retry` module. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` + is also available. The specifics of the default retry strategy are described `here `__. + + To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. + + :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.os_management.models.Event` + :rtype: :class:`~oci.response.Response` + + :example: + Click `here `__ to see an example of how to use get_event API. + """ + resource_path = "/managedInstances/{managedInstanceId}/events/{eventId}" + method = "GET" + + # Don't accept unknown kwargs + expected_kwargs = [ + "retry_strategy", + "opc_request_id" + ] + extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + "get_event got unknown kwargs: {!r}".format(extra_kwargs)) + + path_params = { + "managedInstanceId": managed_instance_id, + "eventId": event_id + } + + path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} + + for (k, v) in six.iteritems(path_params): + if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): + raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k)) + + query_params = { + "compartmentId": compartment_id + } + query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None} + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "opc-request-id": kwargs.get("opc_request_id", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + + retry_strategy = self.retry_strategy + if kwargs.get('retry_strategy'): + retry_strategy = kwargs.get('retry_strategy') + + if retry_strategy: + return retry_strategy.make_retrying_call( + self.base_client.call_api, + resource_path=resource_path, + method=method, + path_params=path_params, + query_params=query_params, + header_params=header_params, + response_type="Event") + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + path_params=path_params, + query_params=query_params, + header_params=header_params, + response_type="Event") + + def get_event_content(self, managed_instance_id, event_id, compartment_id, **kwargs): + """ + Get additional data about a event as a ZIP archive. The archive content depends on the event eventType. + + + :param str managed_instance_id: (required) + Instance Oracle Cloud identifier (ocid) + + :param str event_id: (required) + Unique Event identifier (OCID) + + :param str compartment_id: (required) + The ID of the compartment in which to list resources. + + :param str opc_request_id: (optional) + The client request ID for tracing. + + :param obj retry_strategy: (optional) + A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. + + This should be one of the strategies available in the :py:mod:`~oci.retry` module. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` + is also available. The specifics of the default retry strategy are described `here `__. + + To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. + + :return: A :class:`~oci.response.Response` object with data of type stream + :rtype: :class:`~oci.response.Response` + + :example: + Click `here `__ to see an example of how to use get_event_content API. + """ + resource_path = "/managedInstances/{managedInstanceId}/events/{eventId}/content" + method = "GET" + + # Don't accept unknown kwargs + expected_kwargs = [ + "retry_strategy", + "opc_request_id" + ] + extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + "get_event_content got unknown kwargs: {!r}".format(extra_kwargs)) + + path_params = { + "managedInstanceId": managed_instance_id, + "eventId": event_id + } + + path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} + + for (k, v) in six.iteritems(path_params): + if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): + raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k)) + + query_params = { + "compartmentId": compartment_id + } + query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None} + + header_params = { + "accept": "application/octet-stream", + "content-type": "application/json", + "opc-request-id": kwargs.get("opc_request_id", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + + retry_strategy = self.retry_strategy + if kwargs.get('retry_strategy'): + retry_strategy = kwargs.get('retry_strategy') + + if retry_strategy: + return retry_strategy.make_retrying_call( + self.base_client.call_api, + resource_path=resource_path, + method=method, + path_params=path_params, + query_params=query_params, + header_params=header_params, + response_type="stream") + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + path_params=path_params, + query_params=query_params, + header_params=header_params, + response_type="stream") + + def get_event_report(self, managed_instance_id, compartment_id, **kwargs): + """ + Get summary information about events on this instance. + + + :param str managed_instance_id: (required) + Instance Oracle Cloud identifier (ocid) + + :param str compartment_id: (required) + The ID of the compartment in which to list resources. + + :param datetime latest_timestamp_less_than: (optional) + filter event occurrence. Selecting only those last occurred before given date in ISO 8601 format + Example: 2017-07-14T02:40:00.000Z + + :param datetime latest_timestamp_greater_than_or_equal_to: (optional) + filter event occurrence. Selecting only those last occurred on or after given date in ISO 8601 format + Example: 2017-07-14T02:40:00.000Z + + :param str opc_request_id: (optional) + The client request ID for tracing. + + :param obj retry_strategy: (optional) + A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. + + This should be one of the strategies available in the :py:mod:`~oci.retry` module. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` + is also available. The specifics of the default retry strategy are described `here `__. + + To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. + + :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.os_management.models.EventReport` + :rtype: :class:`~oci.response.Response` + + :example: + Click `here `__ to see an example of how to use get_event_report API. + """ + resource_path = "/managedInstances/{managedInstanceId}/events/report" + method = "GET" + + # Don't accept unknown kwargs + expected_kwargs = [ + "retry_strategy", + "latest_timestamp_less_than", + "latest_timestamp_greater_than_or_equal_to", + "opc_request_id" + ] + extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + "get_event_report got unknown kwargs: {!r}".format(extra_kwargs)) + + path_params = { + "managedInstanceId": managed_instance_id + } + + path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} + + for (k, v) in six.iteritems(path_params): + if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): + raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k)) + + query_params = { + "compartmentId": compartment_id, + "latestTimestampLessThan": kwargs.get("latest_timestamp_less_than", missing), + "latestTimestampGreaterThanOrEqualTo": kwargs.get("latest_timestamp_greater_than_or_equal_to", missing) + } + query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None} + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "opc-request-id": kwargs.get("opc_request_id", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + + retry_strategy = self.retry_strategy + if kwargs.get('retry_strategy'): + retry_strategy = kwargs.get('retry_strategy') + + if retry_strategy: + return retry_strategy.make_retrying_call( + self.base_client.call_api, + resource_path=resource_path, + method=method, + path_params=path_params, + query_params=query_params, + header_params=header_params, + response_type="EventReport") + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + path_params=path_params, + query_params=query_params, + header_params=header_params, + response_type="EventReport") + + def list_events(self, managed_instance_id, compartment_id, **kwargs): + """ + Returns a list of Events. + + + :param str managed_instance_id: (required) + Instance Oracle Cloud identifier (ocid) + + :param str compartment_id: (required) + The ID of the compartment in which to list resources. + + :param str event_id: (optional) + Unique event identifier (OCID) + + :param int limit: (optional) + The maximum number of items to return. + + :param str page: (optional) + The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call. + + :param str sort_order: (optional) + The sort order to use, either 'asc' or 'desc'. + + Allowed values are: "ASC", "DESC" + + :param str sort_by: (optional) + The field to sort by. Only one sort order may be provided. Default order for TIMECREATED is descending. Default order for DISPLAYNAME is ascending. If no value is specified TIMECREATED is default. + + Allowed values are: "TIMECREATED", "DISPLAYNAME" + + :param str opc_request_id: (optional) + The client request ID for tracing. + + :param str event_type: (optional) + A filter to return only event of given type. + + Allowed values are: "KERNEL_OOPS", "KERNEL_CRASH", "CRASH", "EXPLOIT_ATTEMPT", "COMPLIANCE", "TUNING_SUGGESTION", "TUNING_APPLIED", "SECURITY", "ERROR", "WARNING" + + :param datetime latest_timestamp_less_than: (optional) + filter event occurrence. Selecting only those last occurred before given date in ISO 8601 format + Example: 2017-07-14T02:40:00.000Z + + :param datetime latest_timestamp_greater_than_or_equal_to: (optional) + filter event occurrence. Selecting only those last occurred on or after given date in ISO 8601 format + Example: 2017-07-14T02:40:00.000Z + + :param obj retry_strategy: (optional) + A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. + + This should be one of the strategies available in the :py:mod:`~oci.retry` module. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` + is also available. The specifics of the default retry strategy are described `here `__. + + To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. + + :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.os_management.models.EventCollection` + :rtype: :class:`~oci.response.Response` + + :example: + Click `here `__ to see an example of how to use list_events API. + """ + resource_path = "/managedInstances/{managedInstanceId}/events" + method = "GET" + + # Don't accept unknown kwargs + expected_kwargs = [ + "retry_strategy", + "event_id", + "limit", + "page", + "sort_order", + "sort_by", + "opc_request_id", + "event_type", + "latest_timestamp_less_than", + "latest_timestamp_greater_than_or_equal_to" + ] + extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + "list_events got unknown kwargs: {!r}".format(extra_kwargs)) + + path_params = { + "managedInstanceId": managed_instance_id + } + + path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} + + for (k, v) in six.iteritems(path_params): + if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): + raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k)) + + if 'sort_order' in kwargs: + sort_order_allowed_values = ["ASC", "DESC"] + if kwargs['sort_order'] not in sort_order_allowed_values: + raise ValueError( + "Invalid value for `sort_order`, must be one of {0}".format(sort_order_allowed_values) + ) + + if 'sort_by' in kwargs: + sort_by_allowed_values = ["TIMECREATED", "DISPLAYNAME"] + if kwargs['sort_by'] not in sort_by_allowed_values: + raise ValueError( + "Invalid value for `sort_by`, must be one of {0}".format(sort_by_allowed_values) + ) + + if 'event_type' in kwargs: + event_type_allowed_values = ["KERNEL_OOPS", "KERNEL_CRASH", "CRASH", "EXPLOIT_ATTEMPT", "COMPLIANCE", "TUNING_SUGGESTION", "TUNING_APPLIED", "SECURITY", "ERROR", "WARNING"] + if kwargs['event_type'] not in event_type_allowed_values: + raise ValueError( + "Invalid value for `event_type`, must be one of {0}".format(event_type_allowed_values) + ) + + query_params = { + "compartmentId": compartment_id, + "eventId": kwargs.get("event_id", missing), + "limit": kwargs.get("limit", missing), + "page": kwargs.get("page", missing), + "sortOrder": kwargs.get("sort_order", missing), + "sortBy": kwargs.get("sort_by", missing), + "eventType": kwargs.get("event_type", missing), + "latestTimestampLessThan": kwargs.get("latest_timestamp_less_than", missing), + "latestTimestampGreaterThanOrEqualTo": kwargs.get("latest_timestamp_greater_than_or_equal_to", missing) + } + query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None} + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "opc-request-id": kwargs.get("opc_request_id", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + + retry_strategy = self.retry_strategy + if kwargs.get('retry_strategy'): + retry_strategy = kwargs.get('retry_strategy') + + if retry_strategy: + return retry_strategy.make_retrying_call( + self.base_client.call_api, + resource_path=resource_path, + method=method, + path_params=path_params, + query_params=query_params, + header_params=header_params, + response_type="EventCollection") + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + path_params=path_params, + query_params=query_params, + header_params=header_params, + response_type="EventCollection") + + def list_related_events(self, event_fingerprint, compartment_id, **kwargs): + """ + Returns a list of related events. For now pagination is not implemented. + + + :param str event_fingerprint: (required) + Event fingerprint identifier + + :param str compartment_id: (required) + The ID of the compartment in which to list resources. + + :param str opc_request_id: (optional) + The client request ID for tracing. + + :param int limit: (optional) + The maximum number of items to return. + + :param str page: (optional) + The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call. + + :param str sort_order: (optional) + The sort order to use, either 'asc' or 'desc'. + + Allowed values are: "ASC", "DESC" + + :param str sort_by: (optional) + The field to sort by. Only one sort order may be provided. Default order for id is descending. + + Allowed values are: "instanceId", "id", "eventFingerprint" + + :param datetime latest_timestamp_less_than: (optional) + filter event occurrence. Selecting only those last occurred before given date in ISO 8601 format + Example: 2017-07-14T02:40:00.000Z + + :param datetime latest_timestamp_greater_than_or_equal_to: (optional) + filter event occurrence. Selecting only those last occurred on or after given date in ISO 8601 format + Example: 2017-07-14T02:40:00.000Z + + :param obj retry_strategy: (optional) + A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. + + This should be one of the strategies available in the :py:mod:`~oci.retry` module. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` + is also available. The specifics of the default retry strategy are described `here `__. + + To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. + + :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.os_management.models.RelatedEventCollection` + :rtype: :class:`~oci.response.Response` + + :example: + Click `here `__ to see an example of how to use list_related_events API. + """ + resource_path = "/relatedEvents" + method = "GET" + + # Don't accept unknown kwargs + expected_kwargs = [ + "retry_strategy", + "opc_request_id", + "limit", + "page", + "sort_order", + "sort_by", + "latest_timestamp_less_than", + "latest_timestamp_greater_than_or_equal_to" + ] + extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + "list_related_events got unknown kwargs: {!r}".format(extra_kwargs)) + + if 'sort_order' in kwargs: + sort_order_allowed_values = ["ASC", "DESC"] + if kwargs['sort_order'] not in sort_order_allowed_values: + raise ValueError( + "Invalid value for `sort_order`, must be one of {0}".format(sort_order_allowed_values) + ) + + if 'sort_by' in kwargs: + sort_by_allowed_values = ["instanceId", "id", "eventFingerprint"] + if kwargs['sort_by'] not in sort_by_allowed_values: + raise ValueError( + "Invalid value for `sort_by`, must be one of {0}".format(sort_by_allowed_values) + ) + + query_params = { + "limit": kwargs.get("limit", missing), + "page": kwargs.get("page", missing), + "sortOrder": kwargs.get("sort_order", missing), + "sortBy": kwargs.get("sort_by", missing), + "latestTimestampLessThan": kwargs.get("latest_timestamp_less_than", missing), + "latestTimestampGreaterThanOrEqualTo": kwargs.get("latest_timestamp_greater_than_or_equal_to", missing), + "eventFingerprint": event_fingerprint, + "compartmentId": compartment_id + } + query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None} + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "opc-request-id": kwargs.get("opc_request_id", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + + retry_strategy = self.retry_strategy + if kwargs.get('retry_strategy'): + retry_strategy = kwargs.get('retry_strategy') + + if retry_strategy: + return retry_strategy.make_retrying_call( + self.base_client.call_api, + resource_path=resource_path, + method=method, + query_params=query_params, + header_params=header_params, + response_type="RelatedEventCollection") + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + query_params=query_params, + header_params=header_params, + response_type="RelatedEventCollection") + + def update_event(self, managed_instance_id, event_id, compartment_id, update_event_details, **kwargs): + """ + Updates an existing event associated to a managed instance + + + :param str managed_instance_id: (required) + Instance Oracle Cloud identifier (ocid) + + :param str event_id: (required) + Unique Event identifier (OCID) + + :param str compartment_id: (required) + The ID of the compartment in which to list resources. + + :param oci.os_management.models.UpdateEventDetails update_event_details: (required) + Details about the event to update + + :param str opc_request_id: (optional) + The client request ID for tracing. + + :param str if_match: (optional) + For optimistic concurrency control. In the PUT or DELETE call + for a resource, set the `if-match` parameter to the value of the + etag from a previous GET or POST response for that resource. + The resource will be updated or deleted only if the etag you + provide matches the resource's current etag value. + + :param obj retry_strategy: (optional) + A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. + + This should be one of the strategies available in the :py:mod:`~oci.retry` module. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` + is also available. The specifics of the default retry strategy are described `here `__. + + To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. + + :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.os_management.models.Event` + :rtype: :class:`~oci.response.Response` + + :example: + Click `here `__ to see an example of how to use update_event API. + """ + resource_path = "/managedInstances/{managedInstanceId}/events/{eventId}" + method = "PUT" + + # Don't accept unknown kwargs + expected_kwargs = [ + "retry_strategy", + "opc_request_id", + "if_match" + ] + extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + "update_event got unknown kwargs: {!r}".format(extra_kwargs)) + + path_params = { + "managedInstanceId": managed_instance_id, + "eventId": event_id + } + + path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} + + for (k, v) in six.iteritems(path_params): + if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): + raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k)) + + query_params = { + "compartmentId": compartment_id + } + query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None} + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "opc-request-id": kwargs.get("opc_request_id", missing), + "if-match": kwargs.get("if_match", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + + retry_strategy = self.retry_strategy + if kwargs.get('retry_strategy'): + retry_strategy = kwargs.get('retry_strategy') + + if retry_strategy: + return retry_strategy.make_retrying_call( + self.base_client.call_api, + resource_path=resource_path, + method=method, + path_params=path_params, + query_params=query_params, + header_params=header_params, + body=update_event_details, + response_type="Event") + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + path_params=path_params, + query_params=query_params, + header_params=header_params, + body=update_event_details, + response_type="Event") + + def upload_event_content(self, managed_instance_id, event_id, compartment_id, **kwargs): + """ + Upload the event content as a ZIP archive from the managed instance to the service + + + :param str managed_instance_id: (required) + Instance Oracle Cloud identifier (ocid) + + :param str event_id: (required) + Unique Event identifier (OCID) + + :param str compartment_id: (required) + The ID of the compartment in which to list resources. + + :param str opc_request_id: (optional) + The client request ID for tracing. + + :param str if_match: (optional) + For optimistic concurrency control. In the PUT or DELETE call + for a resource, set the `if-match` parameter to the value of the + etag from a previous GET or POST response for that resource. + The resource will be updated or deleted only if the etag you + provide matches the resource's current etag value. + + :param str opc_retry_token: (optional) + A token that uniquely identifies a request so it can be retried in case of a timeout or + server error without risk of executing that same action again. Retry tokens expire after 24 + hours, but can be invalidated before then due to conflicting operations. For example, if a resource + has been deleted and purged from the system, then a retry of the original creation request + might be rejected. + + :param obj retry_strategy: (optional) + A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. + + This should be one of the strategies available in the :py:mod:`~oci.retry` module. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` + is also available. The specifics of the default retry strategy are described `here `__. + + To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. + + :return: A :class:`~oci.response.Response` object with data of type None + :rtype: :class:`~oci.response.Response` + + :example: + Click `here `__ to see an example of how to use upload_event_content API. + """ + resource_path = "/managedInstances/{managedInstanceId}/events/{eventId}/content/actions/upload" + method = "POST" + + # Don't accept unknown kwargs + expected_kwargs = [ + "retry_strategy", + "opc_request_id", + "if_match", + "opc_retry_token" + ] + extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + "upload_event_content got unknown kwargs: {!r}".format(extra_kwargs)) + + path_params = { + "managedInstanceId": managed_instance_id, + "eventId": event_id + } + + path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} + + for (k, v) in six.iteritems(path_params): + if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): + raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k)) + + query_params = { + "compartmentId": compartment_id + } + query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None} + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "opc-request-id": kwargs.get("opc_request_id", missing), + "if-match": kwargs.get("if_match", missing), + "opc-retry-token": kwargs.get("opc_retry_token", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + + retry_strategy = self.retry_strategy + if kwargs.get('retry_strategy'): + retry_strategy = kwargs.get('retry_strategy') + + if retry_strategy: + if not isinstance(retry_strategy, retry.NoneRetryStrategy): + self.base_client.add_opc_retry_token_if_needed(header_params) + return retry_strategy.make_retrying_call( + self.base_client.call_api, + resource_path=resource_path, + method=method, + path_params=path_params, + query_params=query_params, + header_params=header_params) + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + path_params=path_params, + query_params=query_params, + header_params=header_params) diff --git a/src/oci/os_management/event_client_composite_operations.py b/src/oci/os_management/event_client_composite_operations.py new file mode 100644 index 0000000000..55a9817f2a --- /dev/null +++ b/src/oci/os_management/event_client_composite_operations.py @@ -0,0 +1,24 @@ +# coding: utf-8 +# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. +# 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. + +import oci # noqa: F401 +from oci.util import WAIT_RESOURCE_NOT_FOUND # noqa: F401 + + +class EventClientCompositeOperations(object): + """ + This class provides a wrapper around :py:class:`~oci.os_management.EventClient` and offers convenience methods + for operations that would otherwise need to be chained together. For example, instead of performing an action + on a resource (e.g. launching an instance, creating a load balancer) and then using a waiter to wait for the resource + to enter a given state, you can call a single method in this class to accomplish the same functionality + """ + + def __init__(self, client, **kwargs): + """ + Creates a new EventClientCompositeOperations object + + :param EventClient client: + The service client which will be wrapped by this object + """ + self.client = client diff --git a/src/oci/os_management/models/__init__.py b/src/oci/os_management/models/__init__.py index 245743a65a..edd6786e80 100644 --- a/src/oci/os_management/models/__init__.py +++ b/src/oci/os_management/models/__init__.py @@ -8,12 +8,14 @@ from .api_error import ApiError from .attach_child_software_source_to_managed_instance_details import AttachChildSoftwareSourceToManagedInstanceDetails from .attach_parent_software_source_to_managed_instance_details import AttachParentSoftwareSourceToManagedInstanceDetails +from .autonomous_settings import AutonomousSettings from .available_software_source_summary import AvailableSoftwareSourceSummary from .available_update_summary import AvailableUpdateSummary from .available_windows_update_summary import AvailableWindowsUpdateSummary from .change_managed_instance_group_compartment_details import ChangeManagedInstanceGroupCompartmentDetails from .change_scheduled_job_compartment_details import ChangeScheduledJobCompartmentDetails from .change_software_source_compartment_details import ChangeSoftwareSourceCompartmentDetails +from .crash_event_system_information import CrashEventSystemInformation from .create_managed_instance_group_details import CreateManagedInstanceGroupDetails from .create_scheduled_job_details import CreateScheduledJobDetails from .create_software_source_details import CreateSoftwareSourceDetails @@ -21,16 +23,26 @@ from .detach_parent_software_source_from_managed_instance_details import DetachParentSoftwareSourceFromManagedInstanceDetails from .erratum import Erratum from .erratum_summary import ErratumSummary +from .event import Event +from .event_collection import EventCollection +from .event_content import EventContent +from .event_report import EventReport +from .event_summary import EventSummary from .id import Id from .installable_package_summary import InstallablePackageSummary from .installed_package_summary import InstalledPackageSummary from .installed_windows_update_summary import InstalledWindowsUpdateSummary +from .kernel_crash_event import KernelCrashEvent +from .kernel_oops_event import KernelOopsEvent +from .kernel_vm_core_information import KernelVmCoreInformation from .managed_instance import ManagedInstance from .managed_instance_group import ManagedInstanceGroup from .managed_instance_group_summary import ManagedInstanceGroupSummary from .managed_instance_summary import ManagedInstanceSummary from .package_name import PackageName from .recurrence import Recurrence +from .related_event_collection import RelatedEventCollection +from .related_event_summary import RelatedEventSummary from .remove_packages_from_software_source_details import RemovePackagesFromSoftwareSourceDetails from .scheduled_job import ScheduledJob from .scheduled_job_summary import ScheduledJobSummary @@ -42,6 +54,8 @@ from .software_source import SoftwareSource from .software_source_id import SoftwareSourceId from .software_source_summary import SoftwareSourceSummary +from .update_event_details import UpdateEventDetails +from .update_managed_instance_details import UpdateManagedInstanceDetails from .update_managed_instance_group_details import UpdateManagedInstanceGroupDetails from .update_scheduled_job_details import UpdateScheduledJobDetails from .update_software_source_details import UpdateSoftwareSourceDetails @@ -59,12 +73,14 @@ "ApiError": ApiError, "AttachChildSoftwareSourceToManagedInstanceDetails": AttachChildSoftwareSourceToManagedInstanceDetails, "AttachParentSoftwareSourceToManagedInstanceDetails": AttachParentSoftwareSourceToManagedInstanceDetails, + "AutonomousSettings": AutonomousSettings, "AvailableSoftwareSourceSummary": AvailableSoftwareSourceSummary, "AvailableUpdateSummary": AvailableUpdateSummary, "AvailableWindowsUpdateSummary": AvailableWindowsUpdateSummary, "ChangeManagedInstanceGroupCompartmentDetails": ChangeManagedInstanceGroupCompartmentDetails, "ChangeScheduledJobCompartmentDetails": ChangeScheduledJobCompartmentDetails, "ChangeSoftwareSourceCompartmentDetails": ChangeSoftwareSourceCompartmentDetails, + "CrashEventSystemInformation": CrashEventSystemInformation, "CreateManagedInstanceGroupDetails": CreateManagedInstanceGroupDetails, "CreateScheduledJobDetails": CreateScheduledJobDetails, "CreateSoftwareSourceDetails": CreateSoftwareSourceDetails, @@ -72,16 +88,26 @@ "DetachParentSoftwareSourceFromManagedInstanceDetails": DetachParentSoftwareSourceFromManagedInstanceDetails, "Erratum": Erratum, "ErratumSummary": ErratumSummary, + "Event": Event, + "EventCollection": EventCollection, + "EventContent": EventContent, + "EventReport": EventReport, + "EventSummary": EventSummary, "Id": Id, "InstallablePackageSummary": InstallablePackageSummary, "InstalledPackageSummary": InstalledPackageSummary, "InstalledWindowsUpdateSummary": InstalledWindowsUpdateSummary, + "KernelCrashEvent": KernelCrashEvent, + "KernelOopsEvent": KernelOopsEvent, + "KernelVmCoreInformation": KernelVmCoreInformation, "ManagedInstance": ManagedInstance, "ManagedInstanceGroup": ManagedInstanceGroup, "ManagedInstanceGroupSummary": ManagedInstanceGroupSummary, "ManagedInstanceSummary": ManagedInstanceSummary, "PackageName": PackageName, "Recurrence": Recurrence, + "RelatedEventCollection": RelatedEventCollection, + "RelatedEventSummary": RelatedEventSummary, "RemovePackagesFromSoftwareSourceDetails": RemovePackagesFromSoftwareSourceDetails, "ScheduledJob": ScheduledJob, "ScheduledJobSummary": ScheduledJobSummary, @@ -93,6 +119,8 @@ "SoftwareSource": SoftwareSource, "SoftwareSourceId": SoftwareSourceId, "SoftwareSourceSummary": SoftwareSourceSummary, + "UpdateEventDetails": UpdateEventDetails, + "UpdateManagedInstanceDetails": UpdateManagedInstanceDetails, "UpdateManagedInstanceGroupDetails": UpdateManagedInstanceGroupDetails, "UpdateScheduledJobDetails": UpdateScheduledJobDetails, "UpdateSoftwareSourceDetails": UpdateSoftwareSourceDetails, diff --git a/src/oci/os_management/models/autonomous_settings.py b/src/oci/os_management/models/autonomous_settings.py new file mode 100644 index 0000000000..6d90625903 --- /dev/null +++ b/src/oci/os_management/models/autonomous_settings.py @@ -0,0 +1,70 @@ +# coding: utf-8 +# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. +# 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. + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class AutonomousSettings(object): + """ + Managed Instance with Autonomous settings + """ + + def __init__(self, **kwargs): + """ + Initializes a new AutonomousSettings object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param is_auto_update_enabled: + The value to assign to the is_auto_update_enabled property of this AutonomousSettings. + :type is_auto_update_enabled: bool + + """ + self.swagger_types = { + 'is_auto_update_enabled': 'bool' + } + + self.attribute_map = { + 'is_auto_update_enabled': 'isAutoUpdateEnabled' + } + + self._is_auto_update_enabled = None + + @property + def is_auto_update_enabled(self): + """ + Gets the is_auto_update_enabled of this AutonomousSettings. + True if daily updates are enabled + + + :return: The is_auto_update_enabled of this AutonomousSettings. + :rtype: bool + """ + return self._is_auto_update_enabled + + @is_auto_update_enabled.setter + def is_auto_update_enabled(self, is_auto_update_enabled): + """ + Sets the is_auto_update_enabled of this AutonomousSettings. + True if daily updates are enabled + + + :param is_auto_update_enabled: The is_auto_update_enabled of this AutonomousSettings. + :type: bool + """ + self._is_auto_update_enabled = is_auto_update_enabled + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/os_management/models/crash_event_system_information.py b/src/oci/os_management/models/crash_event_system_information.py new file mode 100644 index 0000000000..c3a9dd635d --- /dev/null +++ b/src/oci/os_management/models/crash_event_system_information.py @@ -0,0 +1,304 @@ +# coding: utf-8 +# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. +# 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. + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class CrashEventSystemInformation(object): + """ + Detailed information about system at the time of the crash. + """ + + #: A constant which can be used with the architecture property of a CrashEventSystemInformation. + #: This constant has a value of "IA_32" + ARCHITECTURE_IA_32 = "IA_32" + + #: A constant which can be used with the architecture property of a CrashEventSystemInformation. + #: This constant has a value of "X86_64" + ARCHITECTURE_X86_64 = "X86_64" + + #: A constant which can be used with the architecture property of a CrashEventSystemInformation. + #: This constant has a value of "AARCH64" + ARCHITECTURE_AARCH64 = "AARCH64" + + #: A constant which can be used with the architecture property of a CrashEventSystemInformation. + #: This constant has a value of "SPARC" + ARCHITECTURE_SPARC = "SPARC" + + #: A constant which can be used with the architecture property of a CrashEventSystemInformation. + #: This constant has a value of "AMD64_DEBIAN" + ARCHITECTURE_AMD64_DEBIAN = "AMD64_DEBIAN" + + #: A constant which can be used with the os_family property of a CrashEventSystemInformation. + #: This constant has a value of "LINUX" + OS_FAMILY_LINUX = "LINUX" + + #: A constant which can be used with the os_family property of a CrashEventSystemInformation. + #: This constant has a value of "WINDOWS" + OS_FAMILY_WINDOWS = "WINDOWS" + + #: A constant which can be used with the os_family property of a CrashEventSystemInformation. + #: This constant has a value of "ALL" + OS_FAMILY_ALL = "ALL" + + def __init__(self, **kwargs): + """ + Initializes a new CrashEventSystemInformation object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param architecture: + The value to assign to the architecture property of this CrashEventSystemInformation. + Allowed values for this property are: "IA_32", "X86_64", "AARCH64", "SPARC", "AMD64_DEBIAN", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :type architecture: str + + :param ksplice_effective_kernel_version: + The value to assign to the ksplice_effective_kernel_version property of this CrashEventSystemInformation. + :type ksplice_effective_kernel_version: str + + :param os_family: + The value to assign to the os_family property of this CrashEventSystemInformation. + Allowed values for this property are: "LINUX", "WINDOWS", "ALL", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :type os_family: str + + :param os_name: + The value to assign to the os_name property of this CrashEventSystemInformation. + :type os_name: str + + :param os_kernel_release: + The value to assign to the os_kernel_release property of this CrashEventSystemInformation. + :type os_kernel_release: str + + :param os_kernel_version: + The value to assign to the os_kernel_version property of this CrashEventSystemInformation. + :type os_kernel_version: str + + :param os_system_version: + The value to assign to the os_system_version property of this CrashEventSystemInformation. + :type os_system_version: str + + """ + self.swagger_types = { + 'architecture': 'str', + 'ksplice_effective_kernel_version': 'str', + 'os_family': 'str', + 'os_name': 'str', + 'os_kernel_release': 'str', + 'os_kernel_version': 'str', + 'os_system_version': 'str' + } + + self.attribute_map = { + 'architecture': 'architecture', + 'ksplice_effective_kernel_version': 'kspliceEffectiveKernelVersion', + 'os_family': 'osFamily', + 'os_name': 'osName', + 'os_kernel_release': 'osKernelRelease', + 'os_kernel_version': 'osKernelVersion', + 'os_system_version': 'osSystemVersion' + } + + self._architecture = None + self._ksplice_effective_kernel_version = None + self._os_family = None + self._os_name = None + self._os_kernel_release = None + self._os_kernel_version = None + self._os_system_version = None + + @property + def architecture(self): + """ + Gets the architecture of this CrashEventSystemInformation. + system architecture + + Allowed values for this property are: "IA_32", "X86_64", "AARCH64", "SPARC", "AMD64_DEBIAN", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + + + :return: The architecture of this CrashEventSystemInformation. + :rtype: str + """ + return self._architecture + + @architecture.setter + def architecture(self, architecture): + """ + Sets the architecture of this CrashEventSystemInformation. + system architecture + + + :param architecture: The architecture of this CrashEventSystemInformation. + :type: str + """ + allowed_values = ["IA_32", "X86_64", "AARCH64", "SPARC", "AMD64_DEBIAN"] + if not value_allowed_none_or_none_sentinel(architecture, allowed_values): + architecture = 'UNKNOWN_ENUM_VALUE' + self._architecture = architecture + + @property + def ksplice_effective_kernel_version(self): + """ + Gets the ksplice_effective_kernel_version of this CrashEventSystemInformation. + Active ksplice kernel version (uptrack-uname -r) + + + :return: The ksplice_effective_kernel_version of this CrashEventSystemInformation. + :rtype: str + """ + return self._ksplice_effective_kernel_version + + @ksplice_effective_kernel_version.setter + def ksplice_effective_kernel_version(self, ksplice_effective_kernel_version): + """ + Sets the ksplice_effective_kernel_version of this CrashEventSystemInformation. + Active ksplice kernel version (uptrack-uname -r) + + + :param ksplice_effective_kernel_version: The ksplice_effective_kernel_version of this CrashEventSystemInformation. + :type: str + """ + self._ksplice_effective_kernel_version = ksplice_effective_kernel_version + + @property + def os_family(self): + """ + Gets the os_family of this CrashEventSystemInformation. + The Operating System type of the managed instance. + + Allowed values for this property are: "LINUX", "WINDOWS", "ALL", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + + + :return: The os_family of this CrashEventSystemInformation. + :rtype: str + """ + return self._os_family + + @os_family.setter + def os_family(self, os_family): + """ + Sets the os_family of this CrashEventSystemInformation. + The Operating System type of the managed instance. + + + :param os_family: The os_family of this CrashEventSystemInformation. + :type: str + """ + allowed_values = ["LINUX", "WINDOWS", "ALL"] + if not value_allowed_none_or_none_sentinel(os_family, allowed_values): + os_family = 'UNKNOWN_ENUM_VALUE' + self._os_family = os_family + + @property + def os_name(self): + """ + Gets the os_name of this CrashEventSystemInformation. + Operating System Name (OCA value) + + + :return: The os_name of this CrashEventSystemInformation. + :rtype: str + """ + return self._os_name + + @os_name.setter + def os_name(self, os_name): + """ + Sets the os_name of this CrashEventSystemInformation. + Operating System Name (OCA value) + + + :param os_name: The os_name of this CrashEventSystemInformation. + :type: str + """ + self._os_name = os_name + + @property + def os_kernel_release(self): + """ + Gets the os_kernel_release of this CrashEventSystemInformation. + Operating System Kernel Release (uname -v) + + + :return: The os_kernel_release of this CrashEventSystemInformation. + :rtype: str + """ + return self._os_kernel_release + + @os_kernel_release.setter + def os_kernel_release(self, os_kernel_release): + """ + Sets the os_kernel_release of this CrashEventSystemInformation. + Operating System Kernel Release (uname -v) + + + :param os_kernel_release: The os_kernel_release of this CrashEventSystemInformation. + :type: str + """ + self._os_kernel_release = os_kernel_release + + @property + def os_kernel_version(self): + """ + Gets the os_kernel_version of this CrashEventSystemInformation. + Operating System Kernel Version (uname -r) + + + :return: The os_kernel_version of this CrashEventSystemInformation. + :rtype: str + """ + return self._os_kernel_version + + @os_kernel_version.setter + def os_kernel_version(self, os_kernel_version): + """ + Sets the os_kernel_version of this CrashEventSystemInformation. + Operating System Kernel Version (uname -r) + + + :param os_kernel_version: The os_kernel_version of this CrashEventSystemInformation. + :type: str + """ + self._os_kernel_version = os_kernel_version + + @property + def os_system_version(self): + """ + Gets the os_system_version of this CrashEventSystemInformation. + Version of the OS (VERSION from /etc/os-release) + + + :return: The os_system_version of this CrashEventSystemInformation. + :rtype: str + """ + return self._os_system_version + + @os_system_version.setter + def os_system_version(self, os_system_version): + """ + Sets the os_system_version of this CrashEventSystemInformation. + Version of the OS (VERSION from /etc/os-release) + + + :param os_system_version: The os_system_version of this CrashEventSystemInformation. + :type: str + """ + self._os_system_version = os_system_version + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/os_management/models/create_scheduled_job_details.py b/src/oci/os_management/models/create_scheduled_job_details.py index 9afeecbde1..431ea9a9f1 100644 --- a/src/oci/os_management/models/create_scheduled_job_details.py +++ b/src/oci/os_management/models/create_scheduled_job_details.py @@ -65,6 +65,14 @@ class CreateScheduledJobDetails(object): #: This constant has a value of "ENHANCEMENT" UPDATE_TYPE_ENHANCEMENT = "ENHANCEMENT" + #: A constant which can be used with the update_type property of a CreateScheduledJobDetails. + #: This constant has a value of "OTHER" + UPDATE_TYPE_OTHER = "OTHER" + + #: A constant which can be used with the update_type property of a CreateScheduledJobDetails. + #: This constant has a value of "KSPLICE" + UPDATE_TYPE_KSPLICE = "KSPLICE" + #: A constant which can be used with the update_type property of a CreateScheduledJobDetails. #: This constant has a value of "ALL" UPDATE_TYPE_ALL = "ALL" @@ -131,7 +139,7 @@ def __init__(self, **kwargs): :param update_type: The value to assign to the update_type property of this CreateScheduledJobDetails. - Allowed values for this property are: "SECURITY", "BUGFIX", "ENHANCEMENT", "ALL" + Allowed values for this property are: "SECURITY", "BUGFIX", "ENHANCEMENT", "OTHER", "KSPLICE", "ALL" :type update_type: str :param package_names: @@ -489,7 +497,7 @@ def update_type(self): Gets the update_type of this CreateScheduledJobDetails. Type of the update (only if operation type is UPDATEALL) - Allowed values for this property are: "SECURITY", "BUGFIX", "ENHANCEMENT", "ALL" + Allowed values for this property are: "SECURITY", "BUGFIX", "ENHANCEMENT", "OTHER", "KSPLICE", "ALL" :return: The update_type of this CreateScheduledJobDetails. @@ -507,7 +515,7 @@ def update_type(self, update_type): :param update_type: The update_type of this CreateScheduledJobDetails. :type: str """ - allowed_values = ["SECURITY", "BUGFIX", "ENHANCEMENT", "ALL"] + allowed_values = ["SECURITY", "BUGFIX", "ENHANCEMENT", "OTHER", "KSPLICE", "ALL"] if not value_allowed_none_or_none_sentinel(update_type, allowed_values): raise ValueError( "Invalid value for `update_type`, must be None or one of {0}" diff --git a/src/oci/os_management/models/event.py b/src/oci/os_management/models/event.py new file mode 100644 index 0000000000..92fb5619f1 --- /dev/null +++ b/src/oci/os_management/models/event.py @@ -0,0 +1,488 @@ +# coding: utf-8 +# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. +# 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. + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class Event(object): + """ + Description of Event. + """ + + #: A constant which can be used with the event_type property of a Event. + #: This constant has a value of "KERNEL_OOPS" + EVENT_TYPE_KERNEL_OOPS = "KERNEL_OOPS" + + #: A constant which can be used with the event_type property of a Event. + #: This constant has a value of "KERNEL_CRASH" + EVENT_TYPE_KERNEL_CRASH = "KERNEL_CRASH" + + #: A constant which can be used with the event_type property of a Event. + #: This constant has a value of "CRASH" + EVENT_TYPE_CRASH = "CRASH" + + #: A constant which can be used with the event_type property of a Event. + #: This constant has a value of "EXPLOIT_ATTEMPT" + EVENT_TYPE_EXPLOIT_ATTEMPT = "EXPLOIT_ATTEMPT" + + #: A constant which can be used with the event_type property of a Event. + #: This constant has a value of "COMPLIANCE" + EVENT_TYPE_COMPLIANCE = "COMPLIANCE" + + #: A constant which can be used with the event_type property of a Event. + #: This constant has a value of "TUNING_SUGGESTION" + EVENT_TYPE_TUNING_SUGGESTION = "TUNING_SUGGESTION" + + #: A constant which can be used with the event_type property of a Event. + #: This constant has a value of "TUNING_APPLIED" + EVENT_TYPE_TUNING_APPLIED = "TUNING_APPLIED" + + #: A constant which can be used with the event_type property of a Event. + #: This constant has a value of "SECURITY" + EVENT_TYPE_SECURITY = "SECURITY" + + #: A constant which can be used with the event_type property of a Event. + #: This constant has a value of "ERROR" + EVENT_TYPE_ERROR = "ERROR" + + #: A constant which can be used with the event_type property of a Event. + #: This constant has a value of "WARNING" + EVENT_TYPE_WARNING = "WARNING" + + def __init__(self, **kwargs): + """ + Initializes a new Event object with values from keyword arguments. This class has the following subclasses and if you are using this class as input + to a service operations then you should favor using a subclass over the base class: + + * :class:`~oci.os_management.models.KernelOopsEvent` + * :class:`~oci.os_management.models.KernelCrashEvent` + + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param id: + The value to assign to the id property of this Event. + :type id: str + + :param instance_id: + The value to assign to the instance_id property of this Event. + :type instance_id: str + + :param compartment_id: + The value to assign to the compartment_id property of this Event. + :type compartment_id: str + + :param tenancy_id: + The value to assign to the tenancy_id property of this Event. + :type tenancy_id: str + + :param summary: + The value to assign to the summary property of this Event. + :type summary: str + + :param timestamp: + The value to assign to the timestamp property of this Event. + :type timestamp: datetime + + :param event_fingerprint: + The value to assign to the event_fingerprint property of this Event. + :type event_fingerprint: str + + :param count: + The value to assign to the count property of this Event. + :type count: int + + :param event_type: + The value to assign to the event_type property of this Event. + Allowed values for this property are: "KERNEL_OOPS", "KERNEL_CRASH", "CRASH", "EXPLOIT_ATTEMPT", "COMPLIANCE", "TUNING_SUGGESTION", "TUNING_APPLIED", "SECURITY", "ERROR", "WARNING", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :type event_type: str + + :param freeform_tags: + The value to assign to the freeform_tags property of this Event. + :type freeform_tags: dict(str, str) + + :param defined_tags: + The value to assign to the defined_tags property of this Event. + :type defined_tags: dict(str, dict(str, object)) + + :param system_tags: + The value to assign to the system_tags property of this Event. + :type system_tags: dict(str, dict(str, object)) + + """ + self.swagger_types = { + 'id': 'str', + 'instance_id': 'str', + 'compartment_id': 'str', + 'tenancy_id': 'str', + 'summary': 'str', + 'timestamp': 'datetime', + 'event_fingerprint': 'str', + 'count': 'int', + 'event_type': 'str', + 'freeform_tags': 'dict(str, str)', + 'defined_tags': 'dict(str, dict(str, object))', + 'system_tags': 'dict(str, dict(str, object))' + } + + self.attribute_map = { + 'id': 'id', + 'instance_id': 'instanceId', + 'compartment_id': 'compartmentId', + 'tenancy_id': 'tenancyId', + 'summary': 'summary', + 'timestamp': 'timestamp', + 'event_fingerprint': 'eventFingerprint', + 'count': 'count', + 'event_type': 'eventType', + 'freeform_tags': 'freeformTags', + 'defined_tags': 'definedTags', + 'system_tags': 'systemTags' + } + + self._id = None + self._instance_id = None + self._compartment_id = None + self._tenancy_id = None + self._summary = None + self._timestamp = None + self._event_fingerprint = None + self._count = None + self._event_type = None + self._freeform_tags = None + self._defined_tags = None + self._system_tags = None + + @staticmethod + def get_subtype(object_dictionary): + """ + Given the hash representation of a subtype of this class, + use the info in the hash to return the class of the subtype. + """ + type = object_dictionary['eventType'] + + if type == 'KERNEL_OOPS': + return 'KernelOopsEvent' + + if type == 'KERNEL_CRASH': + return 'KernelCrashEvent' + else: + return 'Event' + + @property + def id(self): + """ + **[Required]** Gets the id of this Event. + OCID identifier of the event + + + :return: The id of this Event. + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """ + Sets the id of this Event. + OCID identifier of the event + + + :param id: The id of this Event. + :type: str + """ + self._id = id + + @property + def instance_id(self): + """ + Gets the instance_id of this Event. + OCI identifier of the instance where the event occurred + + + :return: The instance_id of this Event. + :rtype: str + """ + return self._instance_id + + @instance_id.setter + def instance_id(self, instance_id): + """ + Sets the instance_id of this Event. + OCI identifier of the instance where the event occurred + + + :param instance_id: The instance_id of this Event. + :type: str + """ + self._instance_id = instance_id + + @property + def compartment_id(self): + """ + Gets the compartment_id of this Event. + OCI identifier of the compartement where the instance is + + + :return: The compartment_id of this Event. + :rtype: str + """ + return self._compartment_id + + @compartment_id.setter + def compartment_id(self, compartment_id): + """ + Sets the compartment_id of this Event. + OCI identifier of the compartement where the instance is + + + :param compartment_id: The compartment_id of this Event. + :type: str + """ + self._compartment_id = compartment_id + + @property + def tenancy_id(self): + """ + Gets the tenancy_id of this Event. + OCID identifier of the instance tenancy. + + + :return: The tenancy_id of this Event. + :rtype: str + """ + return self._tenancy_id + + @tenancy_id.setter + def tenancy_id(self, tenancy_id): + """ + Sets the tenancy_id of this Event. + OCID identifier of the instance tenancy. + + + :param tenancy_id: The tenancy_id of this Event. + :type: str + """ + self._tenancy_id = tenancy_id + + @property + def summary(self): + """ + Gets the summary of this Event. + human readable description of the event + + + :return: The summary of this Event. + :rtype: str + """ + return self._summary + + @summary.setter + def summary(self, summary): + """ + Sets the summary of this Event. + human readable description of the event + + + :param summary: The summary of this Event. + :type: str + """ + self._summary = summary + + @property + def timestamp(self): + """ + Gets the timestamp of this Event. + Time of the occurrence of the event + + + :return: The timestamp of this Event. + :rtype: datetime + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """ + Sets the timestamp of this Event. + Time of the occurrence of the event + + + :param timestamp: The timestamp of this Event. + :type: datetime + """ + self._timestamp = timestamp + + @property + def event_fingerprint(self): + """ + Gets the event_fingerprint of this Event. + Unique ID used to group event with the same characteristics together. + The list of such groups of event can be retrieved via /recurringEvents/{EventFingerprint} + + + :return: The event_fingerprint of this Event. + :rtype: str + """ + return self._event_fingerprint + + @event_fingerprint.setter + def event_fingerprint(self, event_fingerprint): + """ + Sets the event_fingerprint of this Event. + Unique ID used to group event with the same characteristics together. + The list of such groups of event can be retrieved via /recurringEvents/{EventFingerprint} + + + :param event_fingerprint: The event_fingerprint of this Event. + :type: str + """ + self._event_fingerprint = event_fingerprint + + @property + def count(self): + """ + Gets the count of this Event. + Event occurrence count. Number of time the event has happen on the system. + + + :return: The count of this Event. + :rtype: int + """ + return self._count + + @count.setter + def count(self, count): + """ + Sets the count of this Event. + Event occurrence count. Number of time the event has happen on the system. + + + :param count: The count of this Event. + :type: int + """ + self._count = count + + @property + def event_type(self): + """ + **[Required]** Gets the event_type of this Event. + Type of the Event. + + Allowed values for this property are: "KERNEL_OOPS", "KERNEL_CRASH", "CRASH", "EXPLOIT_ATTEMPT", "COMPLIANCE", "TUNING_SUGGESTION", "TUNING_APPLIED", "SECURITY", "ERROR", "WARNING", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + + + :return: The event_type of this Event. + :rtype: str + """ + return self._event_type + + @event_type.setter + def event_type(self, event_type): + """ + Sets the event_type of this Event. + Type of the Event. + + + :param event_type: The event_type of this Event. + :type: str + """ + allowed_values = ["KERNEL_OOPS", "KERNEL_CRASH", "CRASH", "EXPLOIT_ATTEMPT", "COMPLIANCE", "TUNING_SUGGESTION", "TUNING_APPLIED", "SECURITY", "ERROR", "WARNING"] + if not value_allowed_none_or_none_sentinel(event_type, allowed_values): + event_type = 'UNKNOWN_ENUM_VALUE' + self._event_type = event_type + + @property + def freeform_tags(self): + """ + Gets the freeform_tags of this Event. + Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. + Example: `{\"bar-key\": \"value\"}` + + + :return: The freeform_tags of this Event. + :rtype: dict(str, str) + """ + return self._freeform_tags + + @freeform_tags.setter + def freeform_tags(self, freeform_tags): + """ + Sets the freeform_tags of this Event. + Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. + Example: `{\"bar-key\": \"value\"}` + + + :param freeform_tags: The freeform_tags of this Event. + :type: dict(str, str) + """ + self._freeform_tags = freeform_tags + + @property + def defined_tags(self): + """ + Gets the defined_tags of this Event. + Defined tags for this resource. Each key is predefined and scoped to a namespace. + Example: `{\"foo-namespace\": {\"bar-key\": \"value\"}}` + + + :return: The defined_tags of this Event. + :rtype: dict(str, dict(str, object)) + """ + return self._defined_tags + + @defined_tags.setter + def defined_tags(self, defined_tags): + """ + Sets the defined_tags of this Event. + Defined tags for this resource. Each key is predefined and scoped to a namespace. + Example: `{\"foo-namespace\": {\"bar-key\": \"value\"}}` + + + :param defined_tags: The defined_tags of this Event. + :type: dict(str, dict(str, object)) + """ + self._defined_tags = defined_tags + + @property + def system_tags(self): + """ + Gets the system_tags of this Event. + Usage of system tag keys. These predefined keys are scoped to namespaces. + Example: `{\"orcl-cloud\": {\"free-tier-retained\": \"true\"}}` + + + :return: The system_tags of this Event. + :rtype: dict(str, dict(str, object)) + """ + return self._system_tags + + @system_tags.setter + def system_tags(self, system_tags): + """ + Sets the system_tags of this Event. + Usage of system tag keys. These predefined keys are scoped to namespaces. + Example: `{\"orcl-cloud\": {\"free-tier-retained\": \"true\"}}` + + + :param system_tags: The system_tags of this Event. + :type: dict(str, dict(str, object)) + """ + self._system_tags = system_tags + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/os_management/models/event_collection.py b/src/oci/os_management/models/event_collection.py new file mode 100644 index 0000000000..21eebb3b69 --- /dev/null +++ b/src/oci/os_management/models/event_collection.py @@ -0,0 +1,70 @@ +# coding: utf-8 +# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. +# 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. + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class EventCollection(object): + """ + Results of a event search. Contains both EventSummary items and other information, such as metadata. + """ + + def __init__(self, **kwargs): + """ + Initializes a new EventCollection object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param items: + The value to assign to the items property of this EventCollection. + :type items: list[oci.os_management.models.EventSummary] + + """ + self.swagger_types = { + 'items': 'list[EventSummary]' + } + + self.attribute_map = { + 'items': 'items' + } + + self._items = None + + @property + def items(self): + """ + **[Required]** Gets the items of this EventCollection. + List of events. + + + :return: The items of this EventCollection. + :rtype: list[oci.os_management.models.EventSummary] + """ + return self._items + + @items.setter + def items(self, items): + """ + Sets the items of this EventCollection. + List of events. + + + :param items: The items of this EventCollection. + :type: list[oci.os_management.models.EventSummary] + """ + self._items = items + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/os_management/models/event_content.py b/src/oci/os_management/models/event_content.py new file mode 100644 index 0000000000..7c7351ea14 --- /dev/null +++ b/src/oci/os_management/models/event_content.py @@ -0,0 +1,160 @@ +# coding: utf-8 +# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. +# 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. + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class EventContent(object): + """ + Information about the data collected as a ZIP file when the event occurred. + """ + + #: A constant which can be used with the content_availability property of a EventContent. + #: This constant has a value of "NOT_AVAILABLE" + CONTENT_AVAILABILITY_NOT_AVAILABLE = "NOT_AVAILABLE" + + #: A constant which can be used with the content_availability property of a EventContent. + #: This constant has a value of "AVAILABLE_ON_INSTANCE" + CONTENT_AVAILABILITY_AVAILABLE_ON_INSTANCE = "AVAILABLE_ON_INSTANCE" + + #: A constant which can be used with the content_availability property of a EventContent. + #: This constant has a value of "AVAILABLE_ON_SERVICE" + CONTENT_AVAILABILITY_AVAILABLE_ON_SERVICE = "AVAILABLE_ON_SERVICE" + + #: A constant which can be used with the content_availability property of a EventContent. + #: This constant has a value of "AVAILABLE_ON_INSTANCE_AND_SERVICE" + CONTENT_AVAILABILITY_AVAILABLE_ON_INSTANCE_AND_SERVICE = "AVAILABLE_ON_INSTANCE_AND_SERVICE" + + #: A constant which can be used with the content_availability property of a EventContent. + #: This constant has a value of "AVAILABLE_ON_INSTANCE_UPLOAD_IN_PROGRESS" + CONTENT_AVAILABILITY_AVAILABLE_ON_INSTANCE_UPLOAD_IN_PROGRESS = "AVAILABLE_ON_INSTANCE_UPLOAD_IN_PROGRESS" + + def __init__(self, **kwargs): + """ + Initializes a new EventContent object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param content_availability: + The value to assign to the content_availability property of this EventContent. + Allowed values for this property are: "NOT_AVAILABLE", "AVAILABLE_ON_INSTANCE", "AVAILABLE_ON_SERVICE", "AVAILABLE_ON_INSTANCE_AND_SERVICE", "AVAILABLE_ON_INSTANCE_UPLOAD_IN_PROGRESS", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :type content_availability: str + + :param instance_path: + The value to assign to the instance_path property of this EventContent. + :type instance_path: str + + :param size: + The value to assign to the size property of this EventContent. + :type size: int + + """ + self.swagger_types = { + 'content_availability': 'str', + 'instance_path': 'str', + 'size': 'int' + } + + self.attribute_map = { + 'content_availability': 'contentAvailability', + 'instance_path': 'instancePath', + 'size': 'size' + } + + self._content_availability = None + self._instance_path = None + self._size = None + + @property + def content_availability(self): + """ + Gets the content_availability of this EventContent. + Status of the event content + + Allowed values for this property are: "NOT_AVAILABLE", "AVAILABLE_ON_INSTANCE", "AVAILABLE_ON_SERVICE", "AVAILABLE_ON_INSTANCE_AND_SERVICE", "AVAILABLE_ON_INSTANCE_UPLOAD_IN_PROGRESS", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + + + :return: The content_availability of this EventContent. + :rtype: str + """ + return self._content_availability + + @content_availability.setter + def content_availability(self, content_availability): + """ + Sets the content_availability of this EventContent. + Status of the event content + + + :param content_availability: The content_availability of this EventContent. + :type: str + """ + allowed_values = ["NOT_AVAILABLE", "AVAILABLE_ON_INSTANCE", "AVAILABLE_ON_SERVICE", "AVAILABLE_ON_INSTANCE_AND_SERVICE", "AVAILABLE_ON_INSTANCE_UPLOAD_IN_PROGRESS"] + if not value_allowed_none_or_none_sentinel(content_availability, allowed_values): + content_availability = 'UNKNOWN_ENUM_VALUE' + self._content_availability = content_availability + + @property + def instance_path(self): + """ + Gets the instance_path of this EventContent. + Path to the event content on the instance + + + :return: The instance_path of this EventContent. + :rtype: str + """ + return self._instance_path + + @instance_path.setter + def instance_path(self, instance_path): + """ + Sets the instance_path of this EventContent. + Path to the event content on the instance + + + :param instance_path: The instance_path of this EventContent. + :type: str + """ + self._instance_path = instance_path + + @property + def size(self): + """ + Gets the size of this EventContent. + size in bytes of the event content (size of the zip file uploaded) + + + :return: The size of this EventContent. + :rtype: int + """ + return self._size + + @size.setter + def size(self, size): + """ + Sets the size of this EventContent. + size in bytes of the event content (size of the zip file uploaded) + + + :param size: The size of this EventContent. + :type: int + """ + self._size = size + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/os_management/models/event_report.py b/src/oci/os_management/models/event_report.py new file mode 100644 index 0000000000..fa9a976f7d --- /dev/null +++ b/src/oci/os_management/models/event_report.py @@ -0,0 +1,70 @@ +# coding: utf-8 +# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. +# 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. + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class EventReport(object): + """ + Summary about event occurrences on a system. + """ + + def __init__(self, **kwargs): + """ + Initializes a new EventReport object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param count: + The value to assign to the count property of this EventReport. + :type count: int + + """ + self.swagger_types = { + 'count': 'int' + } + + self.attribute_map = { + 'count': 'count' + } + + self._count = None + + @property + def count(self): + """ + **[Required]** Gets the count of this EventReport. + count of events currently registered on the system. + + + :return: The count of this EventReport. + :rtype: int + """ + return self._count + + @count.setter + def count(self, count): + """ + Sets the count of this EventReport. + count of events currently registered on the system. + + + :param count: The count of this EventReport. + :type: int + """ + self._count = count + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/os_management/models/event_summary.py b/src/oci/os_management/models/event_summary.py new file mode 100644 index 0000000000..66e1a5a610 --- /dev/null +++ b/src/oci/os_management/models/event_summary.py @@ -0,0 +1,372 @@ +# coding: utf-8 +# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. +# 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. + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class EventSummary(object): + """ + Summary of the Event. + """ + + #: A constant which can be used with the event_type property of a EventSummary. + #: This constant has a value of "KERNEL_OOPS" + EVENT_TYPE_KERNEL_OOPS = "KERNEL_OOPS" + + #: A constant which can be used with the event_type property of a EventSummary. + #: This constant has a value of "KERNEL_CRASH" + EVENT_TYPE_KERNEL_CRASH = "KERNEL_CRASH" + + #: A constant which can be used with the event_type property of a EventSummary. + #: This constant has a value of "CRASH" + EVENT_TYPE_CRASH = "CRASH" + + #: A constant which can be used with the event_type property of a EventSummary. + #: This constant has a value of "EXPLOIT_ATTEMPT" + EVENT_TYPE_EXPLOIT_ATTEMPT = "EXPLOIT_ATTEMPT" + + #: A constant which can be used with the event_type property of a EventSummary. + #: This constant has a value of "COMPLIANCE" + EVENT_TYPE_COMPLIANCE = "COMPLIANCE" + + #: A constant which can be used with the event_type property of a EventSummary. + #: This constant has a value of "TUNING_SUGGESTION" + EVENT_TYPE_TUNING_SUGGESTION = "TUNING_SUGGESTION" + + #: A constant which can be used with the event_type property of a EventSummary. + #: This constant has a value of "TUNING_APPLIED" + EVENT_TYPE_TUNING_APPLIED = "TUNING_APPLIED" + + #: A constant which can be used with the event_type property of a EventSummary. + #: This constant has a value of "SECURITY" + EVENT_TYPE_SECURITY = "SECURITY" + + #: A constant which can be used with the event_type property of a EventSummary. + #: This constant has a value of "ERROR" + EVENT_TYPE_ERROR = "ERROR" + + #: A constant which can be used with the event_type property of a EventSummary. + #: This constant has a value of "WARNING" + EVENT_TYPE_WARNING = "WARNING" + + def __init__(self, **kwargs): + """ + Initializes a new EventSummary object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param id: + The value to assign to the id property of this EventSummary. + :type id: str + + :param instance_id: + The value to assign to the instance_id property of this EventSummary. + :type instance_id: str + + :param summary: + The value to assign to the summary property of this EventSummary. + :type summary: str + + :param event_type: + The value to assign to the event_type property of this EventSummary. + Allowed values for this property are: "KERNEL_OOPS", "KERNEL_CRASH", "CRASH", "EXPLOIT_ATTEMPT", "COMPLIANCE", "TUNING_SUGGESTION", "TUNING_APPLIED", "SECURITY", "ERROR", "WARNING", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :type event_type: str + + :param count: + The value to assign to the count property of this EventSummary. + :type count: int + + :param timestamp: + The value to assign to the timestamp property of this EventSummary. + :type timestamp: datetime + + :param freeform_tags: + The value to assign to the freeform_tags property of this EventSummary. + :type freeform_tags: dict(str, str) + + :param defined_tags: + The value to assign to the defined_tags property of this EventSummary. + :type defined_tags: dict(str, dict(str, object)) + + :param system_tags: + The value to assign to the system_tags property of this EventSummary. + :type system_tags: dict(str, dict(str, object)) + + """ + self.swagger_types = { + 'id': 'str', + 'instance_id': 'str', + 'summary': 'str', + 'event_type': 'str', + 'count': 'int', + 'timestamp': 'datetime', + 'freeform_tags': 'dict(str, str)', + 'defined_tags': 'dict(str, dict(str, object))', + 'system_tags': 'dict(str, dict(str, object))' + } + + self.attribute_map = { + 'id': 'id', + 'instance_id': 'instanceId', + 'summary': 'summary', + 'event_type': 'eventType', + 'count': 'count', + 'timestamp': 'timestamp', + 'freeform_tags': 'freeformTags', + 'defined_tags': 'definedTags', + 'system_tags': 'systemTags' + } + + self._id = None + self._instance_id = None + self._summary = None + self._event_type = None + self._count = None + self._timestamp = None + self._freeform_tags = None + self._defined_tags = None + self._system_tags = None + + @property + def id(self): + """ + **[Required]** Gets the id of this EventSummary. + OCID identifier of the event + + + :return: The id of this EventSummary. + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """ + Sets the id of this EventSummary. + OCID identifier of the event + + + :param id: The id of this EventSummary. + :type: str + """ + self._id = id + + @property + def instance_id(self): + """ + **[Required]** Gets the instance_id of this EventSummary. + Unique OCI identifier of the instance where the event occurred + + + :return: The instance_id of this EventSummary. + :rtype: str + """ + return self._instance_id + + @instance_id.setter + def instance_id(self, instance_id): + """ + Sets the instance_id of this EventSummary. + Unique OCI identifier of the instance where the event occurred + + + :param instance_id: The instance_id of this EventSummary. + :type: str + """ + self._instance_id = instance_id + + @property + def summary(self): + """ + Gets the summary of this EventSummary. + human readable description of the event + + + :return: The summary of this EventSummary. + :rtype: str + """ + return self._summary + + @summary.setter + def summary(self, summary): + """ + Sets the summary of this EventSummary. + human readable description of the event + + + :param summary: The summary of this EventSummary. + :type: str + """ + self._summary = summary + + @property + def event_type(self): + """ + **[Required]** Gets the event_type of this EventSummary. + Type of the event. + + Allowed values for this property are: "KERNEL_OOPS", "KERNEL_CRASH", "CRASH", "EXPLOIT_ATTEMPT", "COMPLIANCE", "TUNING_SUGGESTION", "TUNING_APPLIED", "SECURITY", "ERROR", "WARNING", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + + + :return: The event_type of this EventSummary. + :rtype: str + """ + return self._event_type + + @event_type.setter + def event_type(self, event_type): + """ + Sets the event_type of this EventSummary. + Type of the event. + + + :param event_type: The event_type of this EventSummary. + :type: str + """ + allowed_values = ["KERNEL_OOPS", "KERNEL_CRASH", "CRASH", "EXPLOIT_ATTEMPT", "COMPLIANCE", "TUNING_SUGGESTION", "TUNING_APPLIED", "SECURITY", "ERROR", "WARNING"] + if not value_allowed_none_or_none_sentinel(event_type, allowed_values): + event_type = 'UNKNOWN_ENUM_VALUE' + self._event_type = event_type + + @property + def count(self): + """ + Gets the count of this EventSummary. + Event occurrence count. Number of time the same event happened on the system. + + + :return: The count of this EventSummary. + :rtype: int + """ + return self._count + + @count.setter + def count(self, count): + """ + Sets the count of this EventSummary. + Event occurrence count. Number of time the same event happened on the system. + + + :param count: The count of this EventSummary. + :type: int + """ + self._count = count + + @property + def timestamp(self): + """ + Gets the timestamp of this EventSummary. + Time of the occurrence of the event + + + :return: The timestamp of this EventSummary. + :rtype: datetime + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """ + Sets the timestamp of this EventSummary. + Time of the occurrence of the event + + + :param timestamp: The timestamp of this EventSummary. + :type: datetime + """ + self._timestamp = timestamp + + @property + def freeform_tags(self): + """ + Gets the freeform_tags of this EventSummary. + Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. + Example: `{\"bar-key\": \"value\"}` + + + :return: The freeform_tags of this EventSummary. + :rtype: dict(str, str) + """ + return self._freeform_tags + + @freeform_tags.setter + def freeform_tags(self, freeform_tags): + """ + Sets the freeform_tags of this EventSummary. + Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. + Example: `{\"bar-key\": \"value\"}` + + + :param freeform_tags: The freeform_tags of this EventSummary. + :type: dict(str, str) + """ + self._freeform_tags = freeform_tags + + @property + def defined_tags(self): + """ + Gets the defined_tags of this EventSummary. + Defined tags for this resource. Each key is predefined and scoped to a namespace. + Example: `{\"foo-namespace\": {\"bar-key\": \"value\"}}` + + + :return: The defined_tags of this EventSummary. + :rtype: dict(str, dict(str, object)) + """ + return self._defined_tags + + @defined_tags.setter + def defined_tags(self, defined_tags): + """ + Sets the defined_tags of this EventSummary. + Defined tags for this resource. Each key is predefined and scoped to a namespace. + Example: `{\"foo-namespace\": {\"bar-key\": \"value\"}}` + + + :param defined_tags: The defined_tags of this EventSummary. + :type: dict(str, dict(str, object)) + """ + self._defined_tags = defined_tags + + @property + def system_tags(self): + """ + Gets the system_tags of this EventSummary. + Usage of system tag keys. These predefined keys are scoped to namespaces. + Example: `{\"orcl-cloud\": {\"free-tier-retained\": \"true\"}}` + + + :return: The system_tags of this EventSummary. + :rtype: dict(str, dict(str, object)) + """ + return self._system_tags + + @system_tags.setter + def system_tags(self, system_tags): + """ + Sets the system_tags of this EventSummary. + Usage of system tag keys. These predefined keys are scoped to namespaces. + Example: `{\"orcl-cloud\": {\"free-tier-retained\": \"true\"}}` + + + :param system_tags: The system_tags of this EventSummary. + :type: dict(str, dict(str, object)) + """ + self._system_tags = system_tags + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/os_management/models/kernel_crash_event.py b/src/oci/os_management/models/kernel_crash_event.py new file mode 100644 index 0000000000..9fe597bc5e --- /dev/null +++ b/src/oci/os_management/models/kernel_crash_event.py @@ -0,0 +1,269 @@ +# coding: utf-8 +# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. +# 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. + +from .event import Event +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class KernelCrashEvent(Event): + """ + Information about a Kernel Crash. + """ + + def __init__(self, **kwargs): + """ + Initializes a new KernelCrashEvent object with values from keyword arguments. The default value of the :py:attr:`~oci.os_management.models.KernelCrashEvent.event_type` attribute + of this class is ``KERNEL_CRASH`` and it should not be changed. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param id: + The value to assign to the id property of this KernelCrashEvent. + :type id: str + + :param instance_id: + The value to assign to the instance_id property of this KernelCrashEvent. + :type instance_id: str + + :param compartment_id: + The value to assign to the compartment_id property of this KernelCrashEvent. + :type compartment_id: str + + :param tenancy_id: + The value to assign to the tenancy_id property of this KernelCrashEvent. + :type tenancy_id: str + + :param summary: + The value to assign to the summary property of this KernelCrashEvent. + :type summary: str + + :param timestamp: + The value to assign to the timestamp property of this KernelCrashEvent. + :type timestamp: datetime + + :param event_fingerprint: + The value to assign to the event_fingerprint property of this KernelCrashEvent. + :type event_fingerprint: str + + :param count: + The value to assign to the count property of this KernelCrashEvent. + :type count: int + + :param event_type: + The value to assign to the event_type property of this KernelCrashEvent. + Allowed values for this property are: "KERNEL_OOPS", "KERNEL_CRASH", "CRASH", "EXPLOIT_ATTEMPT", "COMPLIANCE", "TUNING_SUGGESTION", "TUNING_APPLIED", "SECURITY", "ERROR", "WARNING" + :type event_type: str + + :param freeform_tags: + The value to assign to the freeform_tags property of this KernelCrashEvent. + :type freeform_tags: dict(str, str) + + :param defined_tags: + The value to assign to the defined_tags property of this KernelCrashEvent. + :type defined_tags: dict(str, dict(str, object)) + + :param system_tags: + The value to assign to the system_tags property of this KernelCrashEvent. + :type system_tags: dict(str, dict(str, object)) + + :param reason: + The value to assign to the reason property of this KernelCrashEvent. + :type reason: str + + :param time_first_occurred: + The value to assign to the time_first_occurred property of this KernelCrashEvent. + :type time_first_occurred: datetime + + :param vmcore: + The value to assign to the vmcore property of this KernelCrashEvent. + :type vmcore: oci.os_management.models.KernelVmCoreInformation + + :param content: + The value to assign to the content property of this KernelCrashEvent. + :type content: oci.os_management.models.EventContent + + :param system: + The value to assign to the system property of this KernelCrashEvent. + :type system: oci.os_management.models.CrashEventSystemInformation + + """ + self.swagger_types = { + 'id': 'str', + 'instance_id': 'str', + 'compartment_id': 'str', + 'tenancy_id': 'str', + 'summary': 'str', + 'timestamp': 'datetime', + 'event_fingerprint': 'str', + 'count': 'int', + 'event_type': 'str', + 'freeform_tags': 'dict(str, str)', + 'defined_tags': 'dict(str, dict(str, object))', + 'system_tags': 'dict(str, dict(str, object))', + 'reason': 'str', + 'time_first_occurred': 'datetime', + 'vmcore': 'KernelVmCoreInformation', + 'content': 'EventContent', + 'system': 'CrashEventSystemInformation' + } + + self.attribute_map = { + 'id': 'id', + 'instance_id': 'instanceId', + 'compartment_id': 'compartmentId', + 'tenancy_id': 'tenancyId', + 'summary': 'summary', + 'timestamp': 'timestamp', + 'event_fingerprint': 'eventFingerprint', + 'count': 'count', + 'event_type': 'eventType', + 'freeform_tags': 'freeformTags', + 'defined_tags': 'definedTags', + 'system_tags': 'systemTags', + 'reason': 'reason', + 'time_first_occurred': 'timeFirstOccurred', + 'vmcore': 'vmcore', + 'content': 'content', + 'system': 'system' + } + + self._id = None + self._instance_id = None + self._compartment_id = None + self._tenancy_id = None + self._summary = None + self._timestamp = None + self._event_fingerprint = None + self._count = None + self._event_type = None + self._freeform_tags = None + self._defined_tags = None + self._system_tags = None + self._reason = None + self._time_first_occurred = None + self._vmcore = None + self._content = None + self._system = None + self._event_type = 'KERNEL_CRASH' + + @property + def reason(self): + """ + Gets the reason of this KernelCrashEvent. + reason of the crash + + + :return: The reason of this KernelCrashEvent. + :rtype: str + """ + return self._reason + + @reason.setter + def reason(self, reason): + """ + Sets the reason of this KernelCrashEvent. + reason of the crash + + + :param reason: The reason of this KernelCrashEvent. + :type: str + """ + self._reason = reason + + @property + def time_first_occurred(self): + """ + Gets the time_first_occurred of this KernelCrashEvent. + First occurrence time of the event + + + :return: The time_first_occurred of this KernelCrashEvent. + :rtype: datetime + """ + return self._time_first_occurred + + @time_first_occurred.setter + def time_first_occurred(self, time_first_occurred): + """ + Sets the time_first_occurred of this KernelCrashEvent. + First occurrence time of the event + + + :param time_first_occurred: The time_first_occurred of this KernelCrashEvent. + :type: datetime + """ + self._time_first_occurred = time_first_occurred + + @property + def vmcore(self): + """ + Gets the vmcore of this KernelCrashEvent. + + :return: The vmcore of this KernelCrashEvent. + :rtype: oci.os_management.models.KernelVmCoreInformation + """ + return self._vmcore + + @vmcore.setter + def vmcore(self, vmcore): + """ + Sets the vmcore of this KernelCrashEvent. + + :param vmcore: The vmcore of this KernelCrashEvent. + :type: oci.os_management.models.KernelVmCoreInformation + """ + self._vmcore = vmcore + + @property + def content(self): + """ + Gets the content of this KernelCrashEvent. + + :return: The content of this KernelCrashEvent. + :rtype: oci.os_management.models.EventContent + """ + return self._content + + @content.setter + def content(self, content): + """ + Sets the content of this KernelCrashEvent. + + :param content: The content of this KernelCrashEvent. + :type: oci.os_management.models.EventContent + """ + self._content = content + + @property + def system(self): + """ + Gets the system of this KernelCrashEvent. + + :return: The system of this KernelCrashEvent. + :rtype: oci.os_management.models.CrashEventSystemInformation + """ + return self._system + + @system.setter + def system(self, system): + """ + Sets the system of this KernelCrashEvent. + + :param system: The system of this KernelCrashEvent. + :type: oci.os_management.models.CrashEventSystemInformation + """ + self._system = system + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/os_management/models/kernel_oops_event.py b/src/oci/os_management/models/kernel_oops_event.py new file mode 100644 index 0000000000..9c17a4b487 --- /dev/null +++ b/src/oci/os_management/models/kernel_oops_event.py @@ -0,0 +1,269 @@ +# coding: utf-8 +# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. +# 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. + +from .event import Event +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class KernelOopsEvent(Event): + """ + Information about a Kernel Oops. + """ + + def __init__(self, **kwargs): + """ + Initializes a new KernelOopsEvent object with values from keyword arguments. The default value of the :py:attr:`~oci.os_management.models.KernelOopsEvent.event_type` attribute + of this class is ``KERNEL_OOPS`` and it should not be changed. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param id: + The value to assign to the id property of this KernelOopsEvent. + :type id: str + + :param instance_id: + The value to assign to the instance_id property of this KernelOopsEvent. + :type instance_id: str + + :param compartment_id: + The value to assign to the compartment_id property of this KernelOopsEvent. + :type compartment_id: str + + :param tenancy_id: + The value to assign to the tenancy_id property of this KernelOopsEvent. + :type tenancy_id: str + + :param summary: + The value to assign to the summary property of this KernelOopsEvent. + :type summary: str + + :param timestamp: + The value to assign to the timestamp property of this KernelOopsEvent. + :type timestamp: datetime + + :param event_fingerprint: + The value to assign to the event_fingerprint property of this KernelOopsEvent. + :type event_fingerprint: str + + :param count: + The value to assign to the count property of this KernelOopsEvent. + :type count: int + + :param event_type: + The value to assign to the event_type property of this KernelOopsEvent. + Allowed values for this property are: "KERNEL_OOPS", "KERNEL_CRASH", "CRASH", "EXPLOIT_ATTEMPT", "COMPLIANCE", "TUNING_SUGGESTION", "TUNING_APPLIED", "SECURITY", "ERROR", "WARNING" + :type event_type: str + + :param freeform_tags: + The value to assign to the freeform_tags property of this KernelOopsEvent. + :type freeform_tags: dict(str, str) + + :param defined_tags: + The value to assign to the defined_tags property of this KernelOopsEvent. + :type defined_tags: dict(str, dict(str, object)) + + :param system_tags: + The value to assign to the system_tags property of this KernelOopsEvent. + :type system_tags: dict(str, dict(str, object)) + + :param reason: + The value to assign to the reason property of this KernelOopsEvent. + :type reason: str + + :param time_first_occurred: + The value to assign to the time_first_occurred property of this KernelOopsEvent. + :type time_first_occurred: datetime + + :param vmcore: + The value to assign to the vmcore property of this KernelOopsEvent. + :type vmcore: oci.os_management.models.KernelVmCoreInformation + + :param content: + The value to assign to the content property of this KernelOopsEvent. + :type content: oci.os_management.models.EventContent + + :param system: + The value to assign to the system property of this KernelOopsEvent. + :type system: oci.os_management.models.CrashEventSystemInformation + + """ + self.swagger_types = { + 'id': 'str', + 'instance_id': 'str', + 'compartment_id': 'str', + 'tenancy_id': 'str', + 'summary': 'str', + 'timestamp': 'datetime', + 'event_fingerprint': 'str', + 'count': 'int', + 'event_type': 'str', + 'freeform_tags': 'dict(str, str)', + 'defined_tags': 'dict(str, dict(str, object))', + 'system_tags': 'dict(str, dict(str, object))', + 'reason': 'str', + 'time_first_occurred': 'datetime', + 'vmcore': 'KernelVmCoreInformation', + 'content': 'EventContent', + 'system': 'CrashEventSystemInformation' + } + + self.attribute_map = { + 'id': 'id', + 'instance_id': 'instanceId', + 'compartment_id': 'compartmentId', + 'tenancy_id': 'tenancyId', + 'summary': 'summary', + 'timestamp': 'timestamp', + 'event_fingerprint': 'eventFingerprint', + 'count': 'count', + 'event_type': 'eventType', + 'freeform_tags': 'freeformTags', + 'defined_tags': 'definedTags', + 'system_tags': 'systemTags', + 'reason': 'reason', + 'time_first_occurred': 'timeFirstOccurred', + 'vmcore': 'vmcore', + 'content': 'content', + 'system': 'system' + } + + self._id = None + self._instance_id = None + self._compartment_id = None + self._tenancy_id = None + self._summary = None + self._timestamp = None + self._event_fingerprint = None + self._count = None + self._event_type = None + self._freeform_tags = None + self._defined_tags = None + self._system_tags = None + self._reason = None + self._time_first_occurred = None + self._vmcore = None + self._content = None + self._system = None + self._event_type = 'KERNEL_OOPS' + + @property + def reason(self): + """ + Gets the reason of this KernelOopsEvent. + reason of the crash + + + :return: The reason of this KernelOopsEvent. + :rtype: str + """ + return self._reason + + @reason.setter + def reason(self, reason): + """ + Sets the reason of this KernelOopsEvent. + reason of the crash + + + :param reason: The reason of this KernelOopsEvent. + :type: str + """ + self._reason = reason + + @property + def time_first_occurred(self): + """ + Gets the time_first_occurred of this KernelOopsEvent. + First occurrence time of the event + + + :return: The time_first_occurred of this KernelOopsEvent. + :rtype: datetime + """ + return self._time_first_occurred + + @time_first_occurred.setter + def time_first_occurred(self, time_first_occurred): + """ + Sets the time_first_occurred of this KernelOopsEvent. + First occurrence time of the event + + + :param time_first_occurred: The time_first_occurred of this KernelOopsEvent. + :type: datetime + """ + self._time_first_occurred = time_first_occurred + + @property + def vmcore(self): + """ + Gets the vmcore of this KernelOopsEvent. + + :return: The vmcore of this KernelOopsEvent. + :rtype: oci.os_management.models.KernelVmCoreInformation + """ + return self._vmcore + + @vmcore.setter + def vmcore(self, vmcore): + """ + Sets the vmcore of this KernelOopsEvent. + + :param vmcore: The vmcore of this KernelOopsEvent. + :type: oci.os_management.models.KernelVmCoreInformation + """ + self._vmcore = vmcore + + @property + def content(self): + """ + Gets the content of this KernelOopsEvent. + + :return: The content of this KernelOopsEvent. + :rtype: oci.os_management.models.EventContent + """ + return self._content + + @content.setter + def content(self, content): + """ + Sets the content of this KernelOopsEvent. + + :param content: The content of this KernelOopsEvent. + :type: oci.os_management.models.EventContent + """ + self._content = content + + @property + def system(self): + """ + Gets the system of this KernelOopsEvent. + + :return: The system of this KernelOopsEvent. + :rtype: oci.os_management.models.CrashEventSystemInformation + """ + return self._system + + @system.setter + def system(self, system): + """ + Sets the system of this KernelOopsEvent. + + :param system: The system of this KernelOopsEvent. + :type: oci.os_management.models.CrashEventSystemInformation + """ + self._system = system + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/os_management/models/kernel_vm_core_information.py b/src/oci/os_management/models/kernel_vm_core_information.py new file mode 100644 index 0000000000..d5eee72173 --- /dev/null +++ b/src/oci/os_management/models/kernel_vm_core_information.py @@ -0,0 +1,101 @@ +# coding: utf-8 +# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. +# 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. + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class KernelVmCoreInformation(object): + """ + VMcore information. + """ + + def __init__(self, **kwargs): + """ + Initializes a new KernelVmCoreInformation object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param component: + The value to assign to the component property of this KernelVmCoreInformation. + :type component: str + + :param backtrace: + The value to assign to the backtrace property of this KernelVmCoreInformation. + :type backtrace: str + + """ + self.swagger_types = { + 'component': 'str', + 'backtrace': 'str' + } + + self.attribute_map = { + 'component': 'component', + 'backtrace': 'backtrace' + } + + self._component = None + self._backtrace = None + + @property + def component(self): + """ + Gets the component of this KernelVmCoreInformation. + Kernel module responsible of the crash. + + + :return: The component of this KernelVmCoreInformation. + :rtype: str + """ + return self._component + + @component.setter + def component(self, component): + """ + Sets the component of this KernelVmCoreInformation. + Kernel module responsible of the crash. + + + :param component: The component of this KernelVmCoreInformation. + :type: str + """ + self._component = component + + @property + def backtrace(self): + """ + Gets the backtrace of this KernelVmCoreInformation. + Crash backtrace. + + + :return: The backtrace of this KernelVmCoreInformation. + :rtype: str + """ + return self._backtrace + + @backtrace.setter + def backtrace(self, backtrace): + """ + Sets the backtrace of this KernelVmCoreInformation. + Crash backtrace. + + + :param backtrace: The backtrace of this KernelVmCoreInformation. + :type: str + """ + self._backtrace = backtrace + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/os_management/models/managed_instance.py b/src/oci/os_management/models/managed_instance.py index 2f1f18cebe..e859ffed97 100644 --- a/src/oci/os_management/models/managed_instance.py +++ b/src/oci/os_management/models/managed_instance.py @@ -114,6 +114,22 @@ def __init__(self, **kwargs): The value to assign to the is_reboot_required property of this ManagedInstance. :type is_reboot_required: bool + :param notification_topic_id: + The value to assign to the notification_topic_id property of this ManagedInstance. + :type notification_topic_id: str + + :param ksplice_effective_kernel_version: + The value to assign to the ksplice_effective_kernel_version property of this ManagedInstance. + :type ksplice_effective_kernel_version: str + + :param is_data_collection_authorized: + The value to assign to the is_data_collection_authorized property of this ManagedInstance. + :type is_data_collection_authorized: bool + + :param autonomous: + The value to assign to the autonomous property of this ManagedInstance. + :type autonomous: oci.os_management.models.AutonomousSettings + :param security_updates_available: The value to assign to the security_updates_available property of this ManagedInstance. :type security_updates_available: int @@ -156,6 +172,10 @@ def __init__(self, **kwargs): 'managed_instance_groups': 'list[Id]', 'os_family': 'str', 'is_reboot_required': 'bool', + 'notification_topic_id': 'str', + 'ksplice_effective_kernel_version': 'str', + 'is_data_collection_authorized': 'bool', + 'autonomous': 'AutonomousSettings', 'security_updates_available': 'int', 'bug_updates_available': 'int', 'enhancement_updates_available': 'int', @@ -181,6 +201,10 @@ def __init__(self, **kwargs): 'managed_instance_groups': 'managedInstanceGroups', 'os_family': 'osFamily', 'is_reboot_required': 'isRebootRequired', + 'notification_topic_id': 'notificationTopicId', + 'ksplice_effective_kernel_version': 'kspliceEffectiveKernelVersion', + 'is_data_collection_authorized': 'isDataCollectionAuthorized', + 'autonomous': 'autonomous', 'security_updates_available': 'securityUpdatesAvailable', 'bug_updates_available': 'bugUpdatesAvailable', 'enhancement_updates_available': 'enhancementUpdatesAvailable', @@ -205,6 +229,10 @@ def __init__(self, **kwargs): self._managed_instance_groups = None self._os_family = None self._is_reboot_required = None + self._notification_topic_id = None + self._ksplice_effective_kernel_version = None + self._is_data_collection_authorized = None + self._autonomous = None self._security_updates_available = None self._bug_updates_available = None self._enhancement_updates_available = None @@ -610,6 +638,102 @@ def is_reboot_required(self, is_reboot_required): """ self._is_reboot_required = is_reboot_required + @property + def notification_topic_id(self): + """ + Gets the notification_topic_id of this ManagedInstance. + OCID of the ONS topic used to send notification to users + + + :return: The notification_topic_id of this ManagedInstance. + :rtype: str + """ + return self._notification_topic_id + + @notification_topic_id.setter + def notification_topic_id(self, notification_topic_id): + """ + Sets the notification_topic_id of this ManagedInstance. + OCID of the ONS topic used to send notification to users + + + :param notification_topic_id: The notification_topic_id of this ManagedInstance. + :type: str + """ + self._notification_topic_id = notification_topic_id + + @property + def ksplice_effective_kernel_version(self): + """ + Gets the ksplice_effective_kernel_version of this ManagedInstance. + The ksplice effective kernel version + + + :return: The ksplice_effective_kernel_version of this ManagedInstance. + :rtype: str + """ + return self._ksplice_effective_kernel_version + + @ksplice_effective_kernel_version.setter + def ksplice_effective_kernel_version(self, ksplice_effective_kernel_version): + """ + Sets the ksplice_effective_kernel_version of this ManagedInstance. + The ksplice effective kernel version + + + :param ksplice_effective_kernel_version: The ksplice_effective_kernel_version of this ManagedInstance. + :type: str + """ + self._ksplice_effective_kernel_version = ksplice_effective_kernel_version + + @property + def is_data_collection_authorized(self): + """ + Gets the is_data_collection_authorized of this ManagedInstance. + True if user allow data collection for this instance + + + :return: The is_data_collection_authorized of this ManagedInstance. + :rtype: bool + """ + return self._is_data_collection_authorized + + @is_data_collection_authorized.setter + def is_data_collection_authorized(self, is_data_collection_authorized): + """ + Sets the is_data_collection_authorized of this ManagedInstance. + True if user allow data collection for this instance + + + :param is_data_collection_authorized: The is_data_collection_authorized of this ManagedInstance. + :type: bool + """ + self._is_data_collection_authorized = is_data_collection_authorized + + @property + def autonomous(self): + """ + Gets the autonomous of this ManagedInstance. + if present, indicates the Managed Instance is an autonomous instance. Holds all the Autonomous specific information + + + :return: The autonomous of this ManagedInstance. + :rtype: oci.os_management.models.AutonomousSettings + """ + return self._autonomous + + @autonomous.setter + def autonomous(self, autonomous): + """ + Sets the autonomous of this ManagedInstance. + if present, indicates the Managed Instance is an autonomous instance. Holds all the Autonomous specific information + + + :param autonomous: The autonomous of this ManagedInstance. + :type: oci.os_management.models.AutonomousSettings + """ + self._autonomous = autonomous + @property def security_updates_available(self): """ diff --git a/src/oci/os_management/models/related_event_collection.py b/src/oci/os_management/models/related_event_collection.py new file mode 100644 index 0000000000..4d8e279c53 --- /dev/null +++ b/src/oci/os_management/models/related_event_collection.py @@ -0,0 +1,70 @@ +# coding: utf-8 +# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. +# 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. + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class RelatedEventCollection(object): + """ + Results of a event occurence search. Contains RelatedEventSummary. + """ + + def __init__(self, **kwargs): + """ + Initializes a new RelatedEventCollection object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param items: + The value to assign to the items property of this RelatedEventCollection. + :type items: list[oci.os_management.models.RelatedEventSummary] + + """ + self.swagger_types = { + 'items': 'list[RelatedEventSummary]' + } + + self.attribute_map = { + 'items': 'items' + } + + self._items = None + + @property + def items(self): + """ + **[Required]** Gets the items of this RelatedEventCollection. + List of event occurrence. + + + :return: The items of this RelatedEventCollection. + :rtype: list[oci.os_management.models.RelatedEventSummary] + """ + return self._items + + @items.setter + def items(self, items): + """ + Sets the items of this RelatedEventCollection. + List of event occurrence. + + + :param items: The items of this RelatedEventCollection. + :type: list[oci.os_management.models.RelatedEventSummary] + """ + self._items = items + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/os_management/models/related_event_summary.py b/src/oci/os_management/models/related_event_summary.py new file mode 100644 index 0000000000..3002d618b2 --- /dev/null +++ b/src/oci/os_management/models/related_event_summary.py @@ -0,0 +1,132 @@ +# coding: utf-8 +# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. +# 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. + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class RelatedEventSummary(object): + """ + Event occurrence on managed instances. + """ + + def __init__(self, **kwargs): + """ + Initializes a new RelatedEventSummary object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param id: + The value to assign to the id property of this RelatedEventSummary. + :type id: str + + :param instance_id: + The value to assign to the instance_id property of this RelatedEventSummary. + :type instance_id: str + + :param timestamp: + The value to assign to the timestamp property of this RelatedEventSummary. + :type timestamp: datetime + + """ + self.swagger_types = { + 'id': 'str', + 'instance_id': 'str', + 'timestamp': 'datetime' + } + + self.attribute_map = { + 'id': 'id', + 'instance_id': 'instanceId', + 'timestamp': 'timestamp' + } + + self._id = None + self._instance_id = None + self._timestamp = None + + @property + def id(self): + """ + **[Required]** Gets the id of this RelatedEventSummary. + OCID identifier of the event + + + :return: The id of this RelatedEventSummary. + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """ + Sets the id of this RelatedEventSummary. + OCID identifier of the event + + + :param id: The id of this RelatedEventSummary. + :type: str + """ + self._id = id + + @property + def instance_id(self): + """ + **[Required]** Gets the instance_id of this RelatedEventSummary. + OCID identifier of the instance + + + :return: The instance_id of this RelatedEventSummary. + :rtype: str + """ + return self._instance_id + + @instance_id.setter + def instance_id(self, instance_id): + """ + Sets the instance_id of this RelatedEventSummary. + OCID identifier of the instance + + + :param instance_id: The instance_id of this RelatedEventSummary. + :type: str + """ + self._instance_id = instance_id + + @property + def timestamp(self): + """ + Gets the timestamp of this RelatedEventSummary. + time occurence + + + :return: The timestamp of this RelatedEventSummary. + :rtype: datetime + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """ + Sets the timestamp of this RelatedEventSummary. + time occurence + + + :param timestamp: The timestamp of this RelatedEventSummary. + :type: datetime + """ + self._timestamp = timestamp + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/os_management/models/scheduled_job.py b/src/oci/os_management/models/scheduled_job.py index 2d917cae16..7ff4e968f0 100644 --- a/src/oci/os_management/models/scheduled_job.py +++ b/src/oci/os_management/models/scheduled_job.py @@ -65,6 +65,14 @@ class ScheduledJob(object): #: This constant has a value of "ENHANCEMENT" UPDATE_TYPE_ENHANCEMENT = "ENHANCEMENT" + #: A constant which can be used with the update_type property of a ScheduledJob. + #: This constant has a value of "OTHER" + UPDATE_TYPE_OTHER = "OTHER" + + #: A constant which can be used with the update_type property of a ScheduledJob. + #: This constant has a value of "KSPLICE" + UPDATE_TYPE_KSPLICE = "KSPLICE" + #: A constant which can be used with the update_type property of a ScheduledJob. #: This constant has a value of "ALL" UPDATE_TYPE_ALL = "ALL" @@ -166,7 +174,7 @@ def __init__(self, **kwargs): :param update_type: The value to assign to the update_type property of this ScheduledJob. - Allowed values for this property are: "SECURITY", "BUGFIX", "ENHANCEMENT", "ALL", 'UNKNOWN_ENUM_VALUE'. + Allowed values for this property are: "SECURITY", "BUGFIX", "ENHANCEMENT", "OTHER", "KSPLICE", "ALL", 'UNKNOWN_ENUM_VALUE'. Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. :type update_type: str @@ -202,6 +210,10 @@ def __init__(self, **kwargs): Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. :type os_family: str + :param is_restricted: + The value to assign to the is_restricted property of this ScheduledJob. + :type is_restricted: bool + """ self.swagger_types = { 'id': 'str', @@ -223,7 +235,8 @@ def __init__(self, **kwargs): 'freeform_tags': 'dict(str, str)', 'defined_tags': 'dict(str, dict(str, object))', 'update_names': 'list[str]', - 'os_family': 'str' + 'os_family': 'str', + 'is_restricted': 'bool' } self.attribute_map = { @@ -246,7 +259,8 @@ def __init__(self, **kwargs): 'freeform_tags': 'freeformTags', 'defined_tags': 'definedTags', 'update_names': 'updateNames', - 'os_family': 'osFamily' + 'os_family': 'osFamily', + 'is_restricted': 'isRestricted' } self._id = None @@ -269,6 +283,7 @@ def __init__(self, **kwargs): self._defined_tags = None self._update_names = None self._os_family = None + self._is_restricted = None @property def id(self): @@ -582,7 +597,7 @@ def update_type(self): Gets the update_type of this ScheduledJob. Type of the update (only if operation type is UPDATEALL) - Allowed values for this property are: "SECURITY", "BUGFIX", "ENHANCEMENT", "ALL", 'UNKNOWN_ENUM_VALUE'. + Allowed values for this property are: "SECURITY", "BUGFIX", "ENHANCEMENT", "OTHER", "KSPLICE", "ALL", 'UNKNOWN_ENUM_VALUE'. Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. @@ -601,7 +616,7 @@ def update_type(self, update_type): :param update_type: The update_type of this ScheduledJob. :type: str """ - allowed_values = ["SECURITY", "BUGFIX", "ENHANCEMENT", "ALL"] + allowed_values = ["SECURITY", "BUGFIX", "ENHANCEMENT", "OTHER", "KSPLICE", "ALL"] if not value_allowed_none_or_none_sentinel(update_type, allowed_values): update_type = 'UNKNOWN_ENUM_VALUE' self._update_type = update_type @@ -792,6 +807,30 @@ def os_family(self, os_family): os_family = 'UNKNOWN_ENUM_VALUE' self._os_family = os_family + @property + def is_restricted(self): + """ + Gets the is_restricted of this ScheduledJob. + true, if the schedule job has its update capabilities restricted. (Used to track Autonomous Scheduled Job) + + + :return: The is_restricted of this ScheduledJob. + :rtype: bool + """ + return self._is_restricted + + @is_restricted.setter + def is_restricted(self, is_restricted): + """ + Sets the is_restricted of this ScheduledJob. + true, if the schedule job has its update capabilities restricted. (Used to track Autonomous Scheduled Job) + + + :param is_restricted: The is_restricted of this ScheduledJob. + :type: bool + """ + self._is_restricted = is_restricted + def __repr__(self): return formatted_flat_dict(self) diff --git a/src/oci/os_management/models/scheduled_job_summary.py b/src/oci/os_management/models/scheduled_job_summary.py index 13ca7564ef..56f6cb687f 100644 --- a/src/oci/os_management/models/scheduled_job_summary.py +++ b/src/oci/os_management/models/scheduled_job_summary.py @@ -138,6 +138,10 @@ def __init__(self, **kwargs): Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. :type os_family: str + :param is_restricted: + The value to assign to the is_restricted property of this ScheduledJobSummary. + :type is_restricted: bool + """ self.swagger_types = { 'id': 'str', @@ -152,7 +156,8 @@ def __init__(self, **kwargs): 'lifecycle_state': 'str', 'freeform_tags': 'dict(str, str)', 'defined_tags': 'dict(str, dict(str, object))', - 'os_family': 'str' + 'os_family': 'str', + 'is_restricted': 'bool' } self.attribute_map = { @@ -168,7 +173,8 @@ def __init__(self, **kwargs): 'lifecycle_state': 'lifecycleState', 'freeform_tags': 'freeformTags', 'defined_tags': 'definedTags', - 'os_family': 'osFamily' + 'os_family': 'osFamily', + 'is_restricted': 'isRestricted' } self._id = None @@ -184,6 +190,7 @@ def __init__(self, **kwargs): self._freeform_tags = None self._defined_tags = None self._os_family = None + self._is_restricted = None @property def id(self): @@ -525,6 +532,30 @@ def os_family(self, os_family): os_family = 'UNKNOWN_ENUM_VALUE' self._os_family = os_family + @property + def is_restricted(self): + """ + Gets the is_restricted of this ScheduledJobSummary. + true, if the schedule job has its update capabilities restricted. (Used to track Autonomous Scheduled Job) + + + :return: The is_restricted of this ScheduledJobSummary. + :rtype: bool + """ + return self._is_restricted + + @is_restricted.setter + def is_restricted(self, is_restricted): + """ + Sets the is_restricted of this ScheduledJobSummary. + true, if the schedule job has its update capabilities restricted. (Used to track Autonomous Scheduled Job) + + + :param is_restricted: The is_restricted of this ScheduledJobSummary. + :type: bool + """ + self._is_restricted = is_restricted + def __repr__(self): return formatted_flat_dict(self) diff --git a/src/oci/os_management/models/software_package_dependency.py b/src/oci/os_management/models/software_package_dependency.py index 52b1afa3c4..13ab128873 100644 --- a/src/oci/os_management/models/software_package_dependency.py +++ b/src/oci/os_management/models/software_package_dependency.py @@ -10,7 +10,7 @@ @init_model_state_from_kwargs class SoftwarePackageDependency(object): """ - A dependecy for a software package + A dependency for a software package """ def __init__(self, **kwargs): diff --git a/src/oci/os_management/models/update_event_details.py b/src/oci/os_management/models/update_event_details.py new file mode 100644 index 0000000000..10a1594eb5 --- /dev/null +++ b/src/oci/os_management/models/update_event_details.py @@ -0,0 +1,105 @@ +# coding: utf-8 +# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. +# 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. + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class UpdateEventDetails(object): + """ + Information for updating an event associated with a managed instance + """ + + def __init__(self, **kwargs): + """ + Initializes a new UpdateEventDetails object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param freeform_tags: + The value to assign to the freeform_tags property of this UpdateEventDetails. + :type freeform_tags: dict(str, str) + + :param defined_tags: + The value to assign to the defined_tags property of this UpdateEventDetails. + :type defined_tags: dict(str, dict(str, object)) + + """ + self.swagger_types = { + 'freeform_tags': 'dict(str, str)', + 'defined_tags': 'dict(str, dict(str, object))' + } + + self.attribute_map = { + 'freeform_tags': 'freeformTags', + 'defined_tags': 'definedTags' + } + + self._freeform_tags = None + self._defined_tags = None + + @property + def freeform_tags(self): + """ + Gets the freeform_tags of this UpdateEventDetails. + Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. + Example: `{\"bar-key\": \"value\"}` + + + :return: The freeform_tags of this UpdateEventDetails. + :rtype: dict(str, str) + """ + return self._freeform_tags + + @freeform_tags.setter + def freeform_tags(self, freeform_tags): + """ + Sets the freeform_tags of this UpdateEventDetails. + Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. + Example: `{\"bar-key\": \"value\"}` + + + :param freeform_tags: The freeform_tags of this UpdateEventDetails. + :type: dict(str, str) + """ + self._freeform_tags = freeform_tags + + @property + def defined_tags(self): + """ + Gets the defined_tags of this UpdateEventDetails. + Defined tags for this resource. Each key is predefined and scoped to a namespace. + Example: `{\"foo-namespace\": {\"bar-key\": \"value\"}}` + + + :return: The defined_tags of this UpdateEventDetails. + :rtype: dict(str, dict(str, object)) + """ + return self._defined_tags + + @defined_tags.setter + def defined_tags(self, defined_tags): + """ + Sets the defined_tags of this UpdateEventDetails. + Defined tags for this resource. Each key is predefined and scoped to a namespace. + Example: `{\"foo-namespace\": {\"bar-key\": \"value\"}}` + + + :param defined_tags: The defined_tags of this UpdateEventDetails. + :type: dict(str, dict(str, object)) + """ + self._defined_tags = defined_tags + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/os_management/models/update_managed_instance_details.py b/src/oci/os_management/models/update_managed_instance_details.py new file mode 100644 index 0000000000..1399a885da --- /dev/null +++ b/src/oci/os_management/models/update_managed_instance_details.py @@ -0,0 +1,101 @@ +# coding: utf-8 +# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. +# 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. + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class UpdateManagedInstanceDetails(object): + """ + Information to update a managed instance + """ + + def __init__(self, **kwargs): + """ + Initializes a new UpdateManagedInstanceDetails object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param notification_topic_id: + The value to assign to the notification_topic_id property of this UpdateManagedInstanceDetails. + :type notification_topic_id: str + + :param is_data_collection_authorized: + The value to assign to the is_data_collection_authorized property of this UpdateManagedInstanceDetails. + :type is_data_collection_authorized: bool + + """ + self.swagger_types = { + 'notification_topic_id': 'str', + 'is_data_collection_authorized': 'bool' + } + + self.attribute_map = { + 'notification_topic_id': 'notificationTopicId', + 'is_data_collection_authorized': 'isDataCollectionAuthorized' + } + + self._notification_topic_id = None + self._is_data_collection_authorized = None + + @property + def notification_topic_id(self): + """ + Gets the notification_topic_id of this UpdateManagedInstanceDetails. + OCID of the ONS topic used to send notification to users + + + :return: The notification_topic_id of this UpdateManagedInstanceDetails. + :rtype: str + """ + return self._notification_topic_id + + @notification_topic_id.setter + def notification_topic_id(self, notification_topic_id): + """ + Sets the notification_topic_id of this UpdateManagedInstanceDetails. + OCID of the ONS topic used to send notification to users + + + :param notification_topic_id: The notification_topic_id of this UpdateManagedInstanceDetails. + :type: str + """ + self._notification_topic_id = notification_topic_id + + @property + def is_data_collection_authorized(self): + """ + Gets the is_data_collection_authorized of this UpdateManagedInstanceDetails. + True if user allow data collection for this instance + + + :return: The is_data_collection_authorized of this UpdateManagedInstanceDetails. + :rtype: bool + """ + return self._is_data_collection_authorized + + @is_data_collection_authorized.setter + def is_data_collection_authorized(self, is_data_collection_authorized): + """ + Sets the is_data_collection_authorized of this UpdateManagedInstanceDetails. + True if user allow data collection for this instance + + + :param is_data_collection_authorized: The is_data_collection_authorized of this UpdateManagedInstanceDetails. + :type: bool + """ + self._is_data_collection_authorized = is_data_collection_authorized + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/os_management/models/update_scheduled_job_details.py b/src/oci/os_management/models/update_scheduled_job_details.py index 35fda38530..5946168d80 100644 --- a/src/oci/os_management/models/update_scheduled_job_details.py +++ b/src/oci/os_management/models/update_scheduled_job_details.py @@ -65,6 +65,14 @@ class UpdateScheduledJobDetails(object): #: This constant has a value of "ENHANCEMENT" UPDATE_TYPE_ENHANCEMENT = "ENHANCEMENT" + #: A constant which can be used with the update_type property of a UpdateScheduledJobDetails. + #: This constant has a value of "OTHER" + UPDATE_TYPE_OTHER = "OTHER" + + #: A constant which can be used with the update_type property of a UpdateScheduledJobDetails. + #: This constant has a value of "KSPLICE" + UPDATE_TYPE_KSPLICE = "KSPLICE" + #: A constant which can be used with the update_type property of a UpdateScheduledJobDetails. #: This constant has a value of "ALL" UPDATE_TYPE_ALL = "ALL" @@ -107,7 +115,7 @@ def __init__(self, **kwargs): :param update_type: The value to assign to the update_type property of this UpdateScheduledJobDetails. - Allowed values for this property are: "SECURITY", "BUGFIX", "ENHANCEMENT", "ALL" + Allowed values for this property are: "SECURITY", "BUGFIX", "ENHANCEMENT", "OTHER", "KSPLICE", "ALL" :type update_type: str :param package_names: @@ -368,7 +376,7 @@ def update_type(self): Gets the update_type of this UpdateScheduledJobDetails. Type of the update (only if operation type is UPDATEALL) - Allowed values for this property are: "SECURITY", "BUGFIX", "ENHANCEMENT", "ALL" + Allowed values for this property are: "SECURITY", "BUGFIX", "ENHANCEMENT", "OTHER", "KSPLICE", "ALL" :return: The update_type of this UpdateScheduledJobDetails. @@ -386,7 +394,7 @@ def update_type(self, update_type): :param update_type: The update_type of this UpdateScheduledJobDetails. :type: str """ - allowed_values = ["SECURITY", "BUGFIX", "ENHANCEMENT", "ALL"] + allowed_values = ["SECURITY", "BUGFIX", "ENHANCEMENT", "OTHER", "KSPLICE", "ALL"] if not value_allowed_none_or_none_sentinel(update_type, allowed_values): raise ValueError( "Invalid value for `update_type`, must be None or one of {0}" diff --git a/src/oci/os_management/os_management_client.py b/src/oci/os_management/os_management_client.py index 35bc541a7b..1f21dd4a9c 100644 --- a/src/oci/os_management/os_management_client.py +++ b/src/oci/os_management/os_management_client.py @@ -2109,6 +2109,11 @@ def install_all_package_updates_on_managed_instance(self, managed_instance_id, * :param str managed_instance_id: (required) OCID for the managed instance + :param str update_type: (optional) + The type of updates to be applied + + Allowed values are: "SECURITY", "BUGFIX", "ENHANCEMENT", "OTHER", "KSPLICE", "ALL" + :param str opc_request_id: (optional) The client request ID for tracing. @@ -2139,6 +2144,7 @@ def install_all_package_updates_on_managed_instance(self, managed_instance_id, * # Don't accept unknown kwargs expected_kwargs = [ "retry_strategy", + "update_type", "opc_request_id", "opc_retry_token" ] @@ -2157,6 +2163,122 @@ def install_all_package_updates_on_managed_instance(self, managed_instance_id, * if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k)) + if 'update_type' in kwargs: + update_type_allowed_values = ["SECURITY", "BUGFIX", "ENHANCEMENT", "OTHER", "KSPLICE", "ALL"] + if kwargs['update_type'] not in update_type_allowed_values: + raise ValueError( + "Invalid value for `update_type`, must be one of {0}".format(update_type_allowed_values) + ) + + query_params = { + "updateType": kwargs.get("update_type", missing) + } + query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None} + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "opc-request-id": kwargs.get("opc_request_id", missing), + "opc-retry-token": kwargs.get("opc_retry_token", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + + retry_strategy = self.retry_strategy + if kwargs.get('retry_strategy'): + retry_strategy = kwargs.get('retry_strategy') + + if retry_strategy: + if not isinstance(retry_strategy, retry.NoneRetryStrategy): + self.base_client.add_opc_retry_token_if_needed(header_params) + return retry_strategy.make_retrying_call( + self.base_client.call_api, + resource_path=resource_path, + method=method, + path_params=path_params, + query_params=query_params, + header_params=header_params) + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + path_params=path_params, + query_params=query_params, + header_params=header_params) + + def install_all_updates_on_managed_instance_group(self, managed_instance_group_id, **kwargs): + """ + Install all of the available updates for the Managed Instance Group. + + + :param str managed_instance_group_id: (required) + OCID for the managed instance group + + :param str update_type: (optional) + The type of updates to be applied + + Allowed values are: "SECURITY", "BUGFIX", "ENHANCEMENT", "OTHER", "KSPLICE", "ALL" + + :param str opc_request_id: (optional) + The client request ID for tracing. + + :param str opc_retry_token: (optional) + A token that uniquely identifies a request so it can be retried in case of a timeout or + server error without risk of executing that same action again. Retry tokens expire after 24 + hours, but can be invalidated before then due to conflicting operations. For example, if a resource + has been deleted and purged from the system, then a retry of the original creation request + might be rejected. + + :param obj retry_strategy: (optional) + A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. + + This should be one of the strategies available in the :py:mod:`~oci.retry` module. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` + is also available. The specifics of the default retry strategy are described `here `__. + + To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. + + :return: A :class:`~oci.response.Response` object with data of type None + :rtype: :class:`~oci.response.Response` + + :example: + Click `here `__ to see an example of how to use install_all_updates_on_managed_instance_group API. + """ + resource_path = "/managedInstanceGroups/{managedInstanceGroupId}/actions/updates/installAll" + method = "POST" + + # Don't accept unknown kwargs + expected_kwargs = [ + "retry_strategy", + "update_type", + "opc_request_id", + "opc_retry_token" + ] + extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + "install_all_updates_on_managed_instance_group got unknown kwargs: {!r}".format(extra_kwargs)) + + path_params = { + "managedInstanceGroupId": managed_instance_group_id + } + + path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} + + for (k, v) in six.iteritems(path_params): + if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): + raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k)) + + if 'update_type' in kwargs: + update_type_allowed_values = ["SECURITY", "BUGFIX", "ENHANCEMENT", "OTHER", "KSPLICE", "ALL"] + if kwargs['update_type'] not in update_type_allowed_values: + raise ValueError( + "Invalid value for `update_type`, must be one of {0}".format(update_type_allowed_values) + ) + + query_params = { + "updateType": kwargs.get("update_type", missing) + } + query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None} + header_params = { "accept": "application/json", "content-type": "application/json", @@ -2177,12 +2299,14 @@ def install_all_package_updates_on_managed_instance(self, managed_instance_id, * resource_path=resource_path, method=method, path_params=path_params, + query_params=query_params, header_params=header_params) else: return self.base_client.call_api( resource_path=resource_path, method=method, path_params=path_params, + query_params=query_params, header_params=header_params) def install_all_windows_updates_on_managed_instance(self, managed_instance_id, **kwargs): @@ -2193,6 +2317,11 @@ def install_all_windows_updates_on_managed_instance(self, managed_instance_id, * :param str managed_instance_id: (required) OCID for the managed instance + :param str update_type: (optional) + The type of updates to be applied + + Allowed values are: "SECURITY", "BUGFIX", "ENHANCEMENT", "OTHER", "KSPLICE", "ALL" + :param str opc_request_id: (optional) The client request ID for tracing. @@ -2223,6 +2352,7 @@ def install_all_windows_updates_on_managed_instance(self, managed_instance_id, * # Don't accept unknown kwargs expected_kwargs = [ "retry_strategy", + "update_type", "opc_request_id", "opc_retry_token" ] @@ -2241,6 +2371,18 @@ def install_all_windows_updates_on_managed_instance(self, managed_instance_id, * if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k)) + if 'update_type' in kwargs: + update_type_allowed_values = ["SECURITY", "BUGFIX", "ENHANCEMENT", "OTHER", "KSPLICE", "ALL"] + if kwargs['update_type'] not in update_type_allowed_values: + raise ValueError( + "Invalid value for `update_type`, must be one of {0}".format(update_type_allowed_values) + ) + + query_params = { + "updateType": kwargs.get("update_type", missing) + } + query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None} + header_params = { "accept": "application/json", "content-type": "application/json", @@ -2261,12 +2403,14 @@ def install_all_windows_updates_on_managed_instance(self, managed_instance_id, * resource_path=resource_path, method=method, path_params=path_params, + query_params=query_params, header_params=header_params) else: return self.base_client.call_api( resource_path=resource_path, method=method, path_params=path_params, + query_params=query_params, header_params=header_params) def install_package_on_managed_instance(self, managed_instance_id, software_package_name, **kwargs): @@ -3813,6 +3957,9 @@ def list_scheduled_jobs(self, compartment_id, **kwargs): Allowed values are: "LINUX", "WINDOWS", "ALL" + :param bool is_restricted: (optional) + If true, will only filter out restricted Autonomous Linux Scheduled Job + :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. @@ -3843,7 +3990,8 @@ def list_scheduled_jobs(self, compartment_id, **kwargs): "sort_by", "lifecycle_state", "opc_request_id", - "os_family" + "os_family", + "is_restricted" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: @@ -3896,7 +4044,8 @@ def list_scheduled_jobs(self, compartment_id, **kwargs): "sortOrder": kwargs.get("sort_order", missing), "sortBy": kwargs.get("sort_by", missing), "lifecycleState": kwargs.get("lifecycle_state", missing), - "osFamily": kwargs.get("os_family", missing) + "osFamily": kwargs.get("os_family", missing), + "isRestricted": kwargs.get("is_restricted", missing) } query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None} @@ -5448,6 +5597,95 @@ def skip_next_scheduled_job_execution(self, scheduled_job_id, **kwargs): path_params=path_params, header_params=header_params) + def update_managed_instance(self, managed_instance_id, update_managed_instance_details, **kwargs): + """ + Updates a specific Managed Instance. + + + :param str managed_instance_id: (required) + OCID for the managed instance + + :param oci.os_management.models.UpdateManagedInstanceDetails update_managed_instance_details: (required) + Details about a Managed Instance to update + + :param str opc_request_id: (optional) + The client request ID for tracing. + + :param str if_match: (optional) + For optimistic concurrency control. In the PUT or DELETE call + for a resource, set the `if-match` parameter to the value of the + etag from a previous GET or POST response for that resource. + The resource will be updated or deleted only if the etag you + provide matches the resource's current etag value. + + :param obj retry_strategy: (optional) + A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. + + This should be one of the strategies available in the :py:mod:`~oci.retry` module. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` + is also available. The specifics of the default retry strategy are described `here `__. + + To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. + + :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.os_management.models.ManagedInstance` + :rtype: :class:`~oci.response.Response` + + :example: + Click `here `__ to see an example of how to use update_managed_instance API. + """ + resource_path = "/managedInstances/{managedInstanceId}" + method = "PUT" + + # Don't accept unknown kwargs + expected_kwargs = [ + "retry_strategy", + "opc_request_id", + "if_match" + ] + extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + "update_managed_instance got unknown kwargs: {!r}".format(extra_kwargs)) + + path_params = { + "managedInstanceId": managed_instance_id + } + + path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} + + for (k, v) in six.iteritems(path_params): + if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): + raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k)) + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "opc-request-id": kwargs.get("opc_request_id", missing), + "if-match": kwargs.get("if_match", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + + retry_strategy = self.retry_strategy + if kwargs.get('retry_strategy'): + retry_strategy = kwargs.get('retry_strategy') + + if retry_strategy: + return retry_strategy.make_retrying_call( + self.base_client.call_api, + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + body=update_managed_instance_details, + response_type="ManagedInstance") + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + body=update_managed_instance_details, + response_type="ManagedInstance") + def update_managed_instance_group(self, managed_instance_group_id, update_managed_instance_group_details, **kwargs): """ Updates a specific Managed Instance Group. diff --git a/src/oci/os_management/os_management_client_composite_operations.py b/src/oci/os_management/os_management_client_composite_operations.py index fb08f0499f..a1185777c5 100644 --- a/src/oci/os_management/os_management_client_composite_operations.py +++ b/src/oci/os_management/os_management_client_composite_operations.py @@ -316,6 +316,44 @@ def install_all_package_updates_on_managed_instance_and_wait_for_state(self, man except Exception as e: raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e) + def install_all_updates_on_managed_instance_group_and_wait_for_state(self, managed_instance_group_id, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}): + """ + Calls :py:func:`~oci.os_management.OsManagementClient.install_all_updates_on_managed_instance_group` and waits for the :py:class:`~oci.os_management.models.WorkRequest` + to enter the given state(s). + + :param str managed_instance_group_id: (required) + OCID for the managed instance group + + :param list[str] wait_for_states: + An array of states to wait on. These should be valid values for :py:attr:`~oci.os_management.models.WorkRequest.status` + + :param dict operation_kwargs: + A dictionary of keyword arguments to pass to :py:func:`~oci.os_management.OsManagementClient.install_all_updates_on_managed_instance_group` + + :param dict waiter_kwargs: + A dictionary of keyword arguments to pass to the :py:func:`oci.wait_until` function. For example, you could pass ``max_interval_seconds`` or ``max_interval_seconds`` + as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait + """ + operation_result = self.client.install_all_updates_on_managed_instance_group(managed_instance_group_id, **operation_kwargs) + if not wait_for_states: + return operation_result + + lowered_wait_for_states = [w.lower() for w in wait_for_states] + wait_for_resource_id = operation_result.headers['opc-work-request-id'] + + try: + waiter_result = oci.wait_until( + self.client, + self.client.get_work_request(wait_for_resource_id), + evaluate_response=lambda r: getattr(r.data, 'status') and getattr(r.data, 'status').lower() in lowered_wait_for_states, + **waiter_kwargs + ) + result_to_return = waiter_result + + return result_to_return + except Exception as e: + raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e) + def install_all_windows_updates_on_managed_instance_and_wait_for_state(self, managed_instance_id, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}): """ Calls :py:func:`~oci.os_management.OsManagementClient.install_all_windows_updates_on_managed_instance` and waits for the :py:class:`~oci.os_management.models.WorkRequest` diff --git a/src/oci/regions.py b/src/oci/regions.py index 86456e963f..9c93c1bf88 100644 --- a/src/oci/regions.py +++ b/src/oci/regions.py @@ -8,6 +8,7 @@ import logging from enum import Enum +from . import regions_definitions from . import service_endpoints from oci._vendor import six from oci._vendor import requests @@ -15,111 +16,11 @@ from oci._vendor.requests.adapters import HTTPAdapter from oci._vendor.urllib3.util.retry import Retry -REGIONS_SHORT_NAMES = { - 'phx': 'us-phoenix-1', - 'iad': 'us-ashburn-1', - 'sjc': 'us-sanjose-1', - 'fra': 'eu-frankfurt-1', - 'zrh': 'eu-zurich-1', - 'cwl': 'uk-cardiff-1', - 'lhr': 'uk-london-1', - 'yyz': 'ca-toronto-1', - 'nrt': 'ap-tokyo-1', - 'icn': 'ap-seoul-1', - 'bom': 'ap-mumbai-1', - 'gru': 'sa-saopaulo-1', - 'scl': 'sa-santiago-1', - 'syd': 'ap-sydney-1', - 'ltn': 'uk-gov-london-1', - 'kix': 'ap-osaka-1', - 'mel': 'ap-melbourne-1', - 'ams': 'eu-amsterdam-1', - 'jed': 'me-jeddah-1', - 'yul': 'ca-montreal-1', - 'hyd': 'ap-hyderabad-1', - 'yny': 'ap-chuncheon-1', - 'brs': 'uk-gov-cardiff-1', - 'nja': 'ap-chiyoda-1', - 'dxb': 'me-dubai-1', - 'vcp': 'sa-vinhedo-1' -} -REGION_REALMS = { - 'ap-melbourne-1': 'oc1', - 'ap-mumbai-1': 'oc1', - 'ap-hyderabad-1': 'oc1', - 'ap-osaka-1': 'oc1', - 'ap-seoul-1': 'oc1', - 'ap-sydney-1': 'oc1', - 'ap-tokyo-1': 'oc1', - 'ap-chuncheon-1': 'oc1', - 'us-phoenix-1': 'oc1', - 'us-ashburn-1': 'oc1', - 'us-sanjose-1': 'oc1', - 'eu-amsterdam-1': 'oc1', - 'eu-frankfurt-1': 'oc1', - 'eu-zurich-1': 'oc1', - 'me-dubai-1': 'oc1', - 'me-jeddah-1': 'oc1', - 'uk-cardiff-1': 'oc1', - 'uk-london-1': 'oc1', - 'ca-toronto-1': 'oc1', - 'sa-saopaulo-1': 'oc1', - 'sa-santiago-1': 'oc1', - 'ca-montreal-1': 'oc1', - 'sa-vinhedo-1': 'oc1', - - 'us-langley-1': 'oc2', - 'us-luke-1': 'oc2', - - 'us-gov-ashburn-1': 'oc3', - 'us-gov-chicago-1': 'oc3', - 'us-gov-phoenix-1': 'oc3', - - 'uk-gov-london-1': 'oc4', - 'uk-gov-cardiff-1': 'oc4', - - 'ap-chiyoda-1': 'oc8' -} -REALMS = { - 'oc1': 'oraclecloud.com', - 'oc2': 'oraclegovcloud.com', - 'oc3': 'oraclegovcloud.com', - 'oc4': 'oraclegovcloud.uk', - 'oc8': 'oraclecloud8.com' -} -REGIONS = [ - "ap-melbourne-1", - "ap-mumbai-1", - "ap-hyderabad-1", - "ap-osaka-1", - "ap-seoul-1", - "ap-sydney-1", - "ap-tokyo-1", - "ap-chuncheon-1", - "ap-chiyoda-1", - "us-phoenix-1", - "us-ashburn-1", - "us-sanjose-1", - "eu-amsterdam-1", - "eu-frankfurt-1", - "eu-zurich-1", - "me-dubai-1", - "me-jeddah-1", - "uk-cardiff-1", - "uk-london-1", - "uk-gov-cardiff-1", - "ca-toronto-1", - "ca-montreal-1", - "us-langley-1", - "us-luke-1", - "us-gov-ashburn-1", - "us-gov-chicago-1", - "us-gov-phoenix-1", - "sa-saopaulo-1", - "sa-santiago-1", - "uk-gov-london-1", - "sa-vinhedo-1" -] +REGIONS_SHORT_NAMES = regions_definitions.REGIONS_SHORT_NAMES +REGION_REALMS = regions_definitions.REGION_REALMS +REALMS = regions_definitions.REALMS +REGIONS = regions_definitions.REGIONS + SERVICE_ENDPOINTS = service_endpoints.SERVICE_ENDPOINTS SERVICE_ENDPOINTS['auth'] = 'https://auth.{domain}' diff --git a/src/oci/regions_definitions.py b/src/oci/regions_definitions.py new file mode 100644 index 0000000000..817426dd00 --- /dev/null +++ b/src/oci/regions_definitions.py @@ -0,0 +1,109 @@ +# coding: utf-8 +# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. +# 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. + +REGIONS_SHORT_NAMES = { + 'phx': 'us-phoenix-1', + 'iad': 'us-ashburn-1', + 'sjc': 'us-sanjose-1', + 'fra': 'eu-frankfurt-1', + 'zrh': 'eu-zurich-1', + 'cwl': 'uk-cardiff-1', + 'lhr': 'uk-london-1', + 'yyz': 'ca-toronto-1', + 'nrt': 'ap-tokyo-1', + 'icn': 'ap-seoul-1', + 'bom': 'ap-mumbai-1', + 'gru': 'sa-saopaulo-1', + 'scl': 'sa-santiago-1', + 'syd': 'ap-sydney-1', + 'ltn': 'uk-gov-london-1', + 'kix': 'ap-osaka-1', + 'mel': 'ap-melbourne-1', + 'ams': 'eu-amsterdam-1', + 'jed': 'me-jeddah-1', + 'yul': 'ca-montreal-1', + 'hyd': 'ap-hyderabad-1', + 'yny': 'ap-chuncheon-1', + 'brs': 'uk-gov-cardiff-1', + 'nja': 'ap-chiyoda-1', + 'dxb': 'me-dubai-1', + 'vcp': 'sa-vinhedo-1' +} +REGION_REALMS = { + 'ap-melbourne-1': 'oc1', + 'ap-mumbai-1': 'oc1', + 'ap-hyderabad-1': 'oc1', + 'ap-osaka-1': 'oc1', + 'ap-seoul-1': 'oc1', + 'ap-sydney-1': 'oc1', + 'ap-tokyo-1': 'oc1', + 'ap-chuncheon-1': 'oc1', + 'us-phoenix-1': 'oc1', + 'us-ashburn-1': 'oc1', + 'us-sanjose-1': 'oc1', + 'eu-amsterdam-1': 'oc1', + 'eu-frankfurt-1': 'oc1', + 'eu-zurich-1': 'oc1', + 'me-dubai-1': 'oc1', + 'me-jeddah-1': 'oc1', + 'uk-cardiff-1': 'oc1', + 'uk-london-1': 'oc1', + 'ca-toronto-1': 'oc1', + 'sa-saopaulo-1': 'oc1', + 'sa-santiago-1': 'oc1', + 'ca-montreal-1': 'oc1', + 'sa-vinhedo-1': 'oc1', + + 'us-langley-1': 'oc2', + 'us-luke-1': 'oc2', + + 'us-gov-ashburn-1': 'oc3', + 'us-gov-chicago-1': 'oc3', + 'us-gov-phoenix-1': 'oc3', + + 'uk-gov-london-1': 'oc4', + 'uk-gov-cardiff-1': 'oc4', + + 'ap-chiyoda-1': 'oc8' +} +REALMS = { + 'oc1': 'oraclecloud.com', + 'oc2': 'oraclegovcloud.com', + 'oc3': 'oraclegovcloud.com', + 'oc4': 'oraclegovcloud.uk', + 'oc8': 'oraclecloud8.com' +} +REGIONS = [ + "ap-melbourne-1", + "ap-mumbai-1", + "ap-hyderabad-1", + "ap-osaka-1", + "ap-seoul-1", + "ap-sydney-1", + "ap-tokyo-1", + "ap-chuncheon-1", + "ap-chiyoda-1", + "us-phoenix-1", + "us-ashburn-1", + "us-sanjose-1", + "eu-amsterdam-1", + "eu-frankfurt-1", + "eu-zurich-1", + "me-dubai-1", + "me-jeddah-1", + "uk-cardiff-1", + "uk-london-1", + "uk-gov-cardiff-1", + "ca-toronto-1", + "ca-montreal-1", + "us-langley-1", + "us-luke-1", + "us-gov-ashburn-1", + "us-gov-chicago-1", + "us-gov-phoenix-1", + "sa-saopaulo-1", + "sa-santiago-1", + "uk-gov-london-1", + "sa-vinhedo-1" +] diff --git a/src/oci/util.py b/src/oci/util.py index 4819df63b0..ee2cd6bd05 100644 --- a/src/oci/util.py +++ b/src/oci/util.py @@ -27,6 +27,7 @@ logger = logging.getLogger(__name__) INSTANCE_PRINCIPAL_AUTHENTICATION_TYPE_VALUE_NAME = 'instance_principal' DELEGATION_TOKEN_WITH_INSTANCE_PRINCIPAL_AUTHENTICATION_TYPE = 'delegation_token_with_instance_principal' +RESOURCE_PRINCIPAL_AUTHENTICATION_TYPE = 'resource_principal' DELEGATION_TOKEN_FILE_FIELD_NAME = 'delegation_token_file' AUTHENTICATION_TYPE_FIELD_NAME = 'authentication_type' MEBIBYTE = 1024 * 1024 @@ -184,9 +185,17 @@ def _get_signer_from_delegation_token_instance_principal(config): return InstancePrincipalsDelegationTokenSigner(**signer_kwargs) +def _get_signer_from_resource_principal(config): + # Import the signer inside the function to avoid circular imports during initialization + from oci.auth.signers import get_resource_principal_signer + + return get_resource_principal_signer() + + # This map can be easily extended to accommodate support for more auth types through the config file AUTH_TYPE_TO_SIGNER_FUNCTION_MAP = { - DELEGATION_TOKEN_WITH_INSTANCE_PRINCIPAL_AUTHENTICATION_TYPE: _get_signer_from_delegation_token_instance_principal + DELEGATION_TOKEN_WITH_INSTANCE_PRINCIPAL_AUTHENTICATION_TYPE: _get_signer_from_delegation_token_instance_principal, + RESOURCE_PRINCIPAL_AUTHENTICATION_TYPE: _get_signer_from_resource_principal, } diff --git a/src/oci/version.py b/src/oci/version.py index 3501a7670b..d6bdecefc1 100644 --- a/src/oci/version.py +++ b/src/oci/version.py @@ -2,4 +2,4 @@ # Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. # 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. -__version__ = "2.44.1" +__version__ = "2.44.2"