oci 2.1.0 → 2.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +11 -3
- data/lib/oci.rb +6 -0
- data/lib/oci/api_client.rb +159 -134
- data/lib/oci/audit/audit.rb +3 -0
- data/lib/oci/audit/audit_client.rb +88 -40
- data/lib/oci/audit/audit_client_composite_operations.rb +64 -0
- data/lib/oci/audit/models/audit_event.rb +151 -200
- data/lib/oci/audit/models/configuration.rb +61 -38
- data/lib/oci/audit/models/update_configuration_details.rb +61 -38
- data/lib/oci/auth/util.rb +1 -1
- data/lib/oci/base_signer.rb +20 -29
- data/lib/oci/config.rb +9 -3
- data/lib/oci/core/blockstorage_client.rb +512 -269
- data/lib/oci/core/blockstorage_client_composite_operations.rb +342 -0
- data/lib/oci/core/compute_client.rb +959 -536
- data/lib/oci/core/compute_client_composite_operations.rb +738 -0
- data/lib/oci/core/core.rb +5 -0
- data/lib/oci/core/models/attach_boot_volume_details.rb +72 -57
- data/lib/oci/core/models/attach_i_scsi_volume_details.rb +76 -53
- data/lib/oci/core/models/attach_paravirtualized_volume_details.rb +69 -45
- data/lib/oci/core/models/attach_vnic_details.rb +79 -68
- data/lib/oci/core/models/attach_volume_details.rb +83 -74
- data/lib/oci/core/models/boot_volume.rb +119 -120
- data/lib/oci/core/models/boot_volume_attachment.rb +114 -111
- data/lib/oci/core/models/bulk_add_virtual_circuit_public_prefixes_details.rb +61 -38
- data/lib/oci/core/models/bulk_delete_virtual_circuit_public_prefixes_details.rb +61 -38
- data/lib/oci/core/models/capture_console_history_details.rb +81 -70
- data/lib/oci/core/models/connect_local_peering_gateways_details.rb +60 -38
- data/lib/oci/core/models/connect_remote_peering_connections_details.rb +67 -49
- data/lib/oci/core/models/console_history.rb +122 -123
- data/lib/oci/core/models/cpe.rb +82 -74
- data/lib/oci/core/models/create_cpe_details.rb +73 -58
- data/lib/oci/core/models/create_cross_connect_details.rb +98 -99
- data/lib/oci/core/models/create_cross_connect_group_details.rb +67 -48
- data/lib/oci/core/models/create_dhcp_details.rb +89 -84
- data/lib/oci/core/models/create_drg_attachment_details.rb +71 -56
- data/lib/oci/core/models/create_drg_details.rb +66 -47
- data/lib/oci/core/models/create_image_details.rb +108 -110
- data/lib/oci/core/models/create_instance_console_connection_details.rb +79 -69
- data/lib/oci/core/models/create_internet_gateway_details.rb +76 -65
- data/lib/oci/core/models/create_ip_sec_connection_details.rb +83 -76
- data/lib/oci/core/models/create_local_peering_gateway_details.rb +72 -57
- data/lib/oci/core/models/create_private_ip_details.rb +97 -94
- data/lib/oci/core/models/create_public_ip_details.rb +90 -77
- data/lib/oci/core/models/create_remote_peering_connection_details.rb +72 -57
- data/lib/oci/core/models/create_route_table_details.rb +90 -87
- data/lib/oci/core/models/create_security_list_details.rb +95 -96
- data/lib/oci/core/models/create_subnet_details.rb +133 -154
- data/lib/oci/core/models/create_vcn_details.rb +96 -93
- data/lib/oci/core/models/create_virtual_circuit_details.rb +136 -153
- data/lib/oci/core/models/create_virtual_circuit_public_prefix_details.rb +62 -39
- data/lib/oci/core/models/create_vnic_details.rb +99 -97
- data/lib/oci/core/models/create_volume_backup_details.rb +94 -85
- data/lib/oci/core/models/create_volume_backup_policy_assignment_details.rb +66 -47
- data/lib/oci/core/models/create_volume_details.rb +117 -130
- data/lib/oci/core/models/cross_connect.rb +120 -121
- data/lib/oci/core/models/cross_connect_group.rb +97 -82
- data/lib/oci/core/models/cross_connect_location.rb +65 -43
- data/lib/oci/core/models/cross_connect_mapping.rb +89 -81
- data/lib/oci/core/models/cross_connect_port_speed_shape.rb +68 -48
- data/lib/oci/core/models/cross_connect_status.rb +110 -87
- data/lib/oci/core/models/delete_virtual_circuit_public_prefix_details.rb +61 -38
- data/lib/oci/core/models/dhcp_dns_option.rb +85 -60
- data/lib/oci/core/models/dhcp_option.rb +62 -38
- data/lib/oci/core/models/dhcp_options.rb +119 -118
- data/lib/oci/core/models/dhcp_search_domain_option.rb +66 -44
- data/lib/oci/core/models/drg.rb +96 -81
- data/lib/oci/core/models/drg_attachment.rb +106 -99
- data/lib/oci/core/models/egress_security_rule.rb +89 -83
- data/lib/oci/core/models/export_image_details.rb +63 -41
- data/lib/oci/core/models/export_image_via_object_storage_tuple_details.rb +74 -59
- data/lib/oci/core/models/export_image_via_object_storage_uri_details.rb +65 -42
- data/lib/oci/core/models/fast_connect_provider_service.rb +155 -126
- data/lib/oci/core/models/get_public_ip_by_ip_address_details.rb +61 -39
- data/lib/oci/core/models/get_public_ip_by_private_ip_id_details.rb +61 -39
- data/lib/oci/core/models/i_scsi_volume_attachment.rb +117 -105
- data/lib/oci/core/models/icmp_options.rb +63 -41
- data/lib/oci/core/models/image.rb +170 -185
- data/lib/oci/core/models/image_source_details.rb +79 -60
- data/lib/oci/core/models/image_source_via_object_storage_tuple_details.rb +77 -62
- data/lib/oci/core/models/image_source_via_object_storage_uri_details.rb +67 -44
- data/lib/oci/core/models/ingress_security_rule.rb +89 -83
- data/lib/oci/core/models/instance.rb +190 -211
- data/lib/oci/core/models/instance_console_connection.rb +118 -117
- data/lib/oci/core/models/instance_credentials.rb +63 -41
- data/lib/oci/core/models/instance_source_details.rb +64 -41
- data/lib/oci/core/models/instance_source_via_boot_volume_details.rb +64 -41
- data/lib/oci/core/models/instance_source_via_image_details.rb +70 -51
- data/lib/oci/core/models/internet_gateway.rb +107 -100
- data/lib/oci/core/models/ip_sec_connection.rb +113 -110
- data/lib/oci/core/models/ip_sec_connection_device_config.rb +73 -59
- data/lib/oci/core/models/ip_sec_connection_device_status.rb +75 -61
- data/lib/oci/core/models/launch_instance_details.rb +163 -189
- data/lib/oci/core/models/launch_options.rb +130 -93
- data/lib/oci/core/models/letter_of_authority.rb +105 -100
- data/lib/oci/core/models/local_peering_gateway.rb +141 -140
- data/lib/oci/core/models/paravirtualized_volume_attachment.rb +83 -60
- data/lib/oci/core/models/peer_region_for_remote_peering.rb +61 -37
- data/lib/oci/core/models/port_range.rb +65 -42
- data/lib/oci/core/models/private_ip.rb +131 -151
- data/lib/oci/core/models/public_ip.rb +160 -149
- data/lib/oci/core/models/remote_peering_connection.rb +148 -151
- data/lib/oci/core/models/route_rule.rb +68 -50
- data/lib/oci/core/models/route_table.rb +120 -121
- data/lib/oci/core/models/security_list.rb +125 -130
- data/lib/oci/core/models/shape.rb +60 -36
- data/lib/oci/core/models/subnet.rb +183 -220
- data/lib/oci/core/models/tcp_options.rb +67 -49
- data/lib/oci/core/models/tunnel_config.rb +76 -62
- data/lib/oci/core/models/tunnel_status.rb +94 -77
- data/lib/oci/core/models/udp_options.rb +67 -49
- data/lib/oci/core/models/update_boot_volume_details.rb +62 -39
- data/lib/oci/core/models/update_console_history_details.rb +76 -61
- data/lib/oci/core/models/update_cpe_details.rb +62 -39
- data/lib/oci/core/models/update_cross_connect_details.rb +68 -50
- data/lib/oci/core/models/update_cross_connect_group_details.rb +62 -39
- data/lib/oci/core/models/update_dhcp_details.rb +80 -67
- data/lib/oci/core/models/update_drg_attachment_details.rb +62 -39
- data/lib/oci/core/models/update_drg_details.rb +62 -39
- data/lib/oci/core/models/update_image_details.rb +77 -62
- data/lib/oci/core/models/update_instance_details.rb +77 -62
- data/lib/oci/core/models/update_internet_gateway_details.rb +67 -48
- data/lib/oci/core/models/update_ip_sec_connection_details.rb +62 -39
- data/lib/oci/core/models/update_local_peering_gateway_details.rb +62 -39
- data/lib/oci/core/models/update_private_ip_details.rb +90 -83
- data/lib/oci/core/models/update_public_ip_details.rb +68 -49
- data/lib/oci/core/models/update_remote_peering_connection_details.rb +62 -39
- data/lib/oci/core/models/update_route_table_details.rb +81 -70
- data/lib/oci/core/models/update_security_list_details.rb +86 -79
- data/lib/oci/core/models/update_subnet_details.rb +76 -61
- data/lib/oci/core/models/update_vcn_details.rb +76 -61
- data/lib/oci/core/models/update_virtual_circuit_details.rb +114 -115
- data/lib/oci/core/models/update_vnic_details.rb +75 -60
- data/lib/oci/core/models/update_volume_backup_details.rb +76 -61
- data/lib/oci/core/models/update_volume_details.rb +76 -61
- data/lib/oci/core/models/vcn.rb +150 -167
- data/lib/oci/core/models/virtual_circuit.rb +254 -269
- data/lib/oci/core/models/virtual_circuit_bandwidth_shape.rb +68 -48
- data/lib/oci/core/models/virtual_circuit_public_prefix.rb +79 -54
- data/lib/oci/core/models/vnic.rb +149 -166
- data/lib/oci/core/models/vnic_attachment.rb +132 -141
- data/lib/oci/core/models/volume.rb +138 -151
- data/lib/oci/core/models/volume_attachment.rb +126 -131
- data/lib/oci/core/models/volume_backup.rb +185 -200
- data/lib/oci/core/models/volume_backup_policy.rb +75 -61
- data/lib/oci/core/models/volume_backup_policy_assignment.rb +75 -63
- data/lib/oci/core/models/volume_backup_schedule.rb +101 -76
- data/lib/oci/core/models/volume_source_details.rb +62 -37
- data/lib/oci/core/models/volume_source_from_volume_backup_details.rb +62 -38
- data/lib/oci/core/models/volume_source_from_volume_details.rb +62 -38
- data/lib/oci/core/virtual_network_client.rb +2683 -1457
- data/lib/oci/core/virtual_network_client_composite_operations.rb +1849 -0
- data/lib/oci/database/database.rb +3 -0
- data/lib/oci/database/database_client.rb +894 -454
- data/lib/oci/database/database_client_composite_operations.rb +462 -0
- data/lib/oci/database/models/backup.rb +131 -128
- data/lib/oci/database/models/backup_summary.rb +131 -128
- data/lib/oci/database/models/create_backup_details.rb +66 -47
- data/lib/oci/database/models/create_data_guard_association_details.rb +112 -102
- data/lib/oci/database/models/create_data_guard_association_to_existing_db_system_details.rb +73 -51
- data/lib/oci/database/models/create_database_details.rb +140 -105
- data/lib/oci/database/models/create_database_from_backup_details.rb +71 -56
- data/lib/oci/database/models/create_db_home_details.rb +70 -53
- data/lib/oci/database/models/create_db_home_with_db_system_id_base.rb +83 -67
- data/lib/oci/database/models/create_db_home_with_db_system_id_details.rb +74 -53
- data/lib/oci/database/models/create_db_home_with_db_system_id_from_backup_details.rb +69 -44
- data/lib/oci/database/models/data_guard_association.rb +205 -204
- data/lib/oci/database/models/data_guard_association_summary.rb +205 -204
- data/lib/oci/database/models/database.rb +175 -156
- data/lib/oci/database/models/database_summary.rb +175 -156
- data/lib/oci/database/models/db_backup_config.rb +60 -38
- data/lib/oci/database/models/db_home.rb +110 -107
- data/lib/oci/database/models/db_home_summary.rb +110 -107
- data/lib/oci/database/models/db_node.rb +113 -108
- data/lib/oci/database/models/db_node_summary.rb +113 -108
- data/lib/oci/database/models/db_system.rb +299 -314
- data/lib/oci/database/models/db_system_shape_summary.rb +88 -86
- data/lib/oci/database/models/db_system_summary.rb +299 -314
- data/lib/oci/database/models/db_version_summary.rb +64 -44
- data/lib/oci/database/models/failover_data_guard_association_details.rb +60 -38
- data/lib/oci/database/models/launch_db_system_details.rb +231 -234
- data/lib/oci/database/models/patch.rb +136 -113
- data/lib/oci/database/models/patch_details.rb +73 -53
- data/lib/oci/database/models/patch_history_entry.rb +114 -99
- data/lib/oci/database/models/patch_history_entry_summary.rb +114 -99
- data/lib/oci/database/models/patch_summary.rb +136 -113
- data/lib/oci/database/models/reinstate_data_guard_association_details.rb +60 -38
- data/lib/oci/database/models/restore_database_details.rb +72 -53
- data/lib/oci/database/models/switchover_data_guard_association_details.rb +60 -38
- data/lib/oci/database/models/update_database_details.rb +97 -38
- data/lib/oci/database/models/update_db_home_details.rb +60 -38
- data/lib/oci/database/models/update_db_system_details.rb +112 -64
- data/lib/oci/dns/dns.rb +3 -0
- data/lib/oci/dns/dns_client.rb +489 -302
- data/lib/oci/dns/dns_client_composite_operations.rb +143 -0
- data/lib/oci/dns/models/create_zone_details.rb +84 -72
- data/lib/oci/dns/models/external_master.rb +67 -47
- data/lib/oci/dns/models/patch_domain_records_details.rb +60 -35
- data/lib/oci/dns/models/patch_rr_set_details.rb +60 -35
- data/lib/oci/dns/models/patch_zone_records_details.rb +60 -35
- data/lib/oci/dns/models/record.rb +92 -86
- data/lib/oci/dns/models/record_collection.rb +59 -35
- data/lib/oci/dns/models/record_details.rb +92 -86
- data/lib/oci/dns/models/record_operation.rb +113 -110
- data/lib/oci/dns/models/rr_set.rb +59 -35
- data/lib/oci/dns/models/sort_order.rb +0 -2
- data/lib/oci/dns/models/tsig.rb +68 -48
- data/lib/oci/dns/models/update_domain_records_details.rb +60 -35
- data/lib/oci/dns/models/update_rr_set_details.rb +60 -35
- data/lib/oci/dns/models/update_zone_details.rb +60 -38
- data/lib/oci/dns/models/update_zone_records_details.rb +60 -35
- data/lib/oci/dns/models/zone.rb +133 -126
- data/lib/oci/dns/models/zone_summary.rb +108 -99
- data/lib/oci/email/email.rb +3 -0
- data/lib/oci/email/email_client.rb +223 -112
- data/lib/oci/email/email_client_composite_operations.rb +103 -0
- data/lib/oci/email/models/create_sender_details.rb +65 -47
- data/lib/oci/email/models/create_suppression_details.rb +66 -48
- data/lib/oci/email/models/sender.rb +97 -84
- data/lib/oci/email/models/sender_summary.rb +89 -70
- data/lib/oci/email/models/suppression.rb +90 -69
- data/lib/oci/email/models/suppression_summary.rb +90 -69
- data/lib/oci/errors.rb +16 -0
- data/lib/oci/file_storage/file_storage.rb +3 -0
- data/lib/oci/file_storage/file_storage_client.rb +587 -333
- data/lib/oci/file_storage/file_storage_client_composite_operations.rb +460 -0
- data/lib/oci/file_storage/models/create_export_details.rb +73 -56
- data/lib/oci/file_storage/models/create_file_system_details.rb +75 -60
- data/lib/oci/file_storage/models/create_mount_target_details.rb +96 -93
- data/lib/oci/file_storage/models/create_snapshot_details.rb +68 -47
- data/lib/oci/file_storage/models/export.rb +102 -89
- data/lib/oci/file_storage/models/export_set.rb +121 -122
- data/lib/oci/file_storage/models/export_set_summary.rb +109 -102
- data/lib/oci/file_storage/models/export_summary.rb +102 -89
- data/lib/oci/file_storage/models/file_system.rb +110 -103
- data/lib/oci/file_storage/models/file_system_summary.rb +110 -103
- data/lib/oci/file_storage/models/mount_target.rb +126 -131
- data/lib/oci/file_storage/models/mount_target_summary.rb +121 -122
- data/lib/oci/file_storage/models/snapshot.rb +98 -81
- data/lib/oci/file_storage/models/snapshot_summary.rb +98 -81
- data/lib/oci/file_storage/models/update_export_set_details.rb +75 -60
- data/lib/oci/file_storage/models/update_file_system_details.rb +63 -40
- data/lib/oci/file_storage/models/update_mount_target_details.rb +63 -40
- data/lib/oci/identity/identity.rb +3 -0
- data/lib/oci/identity/identity_client.rb +1671 -872
- data/lib/oci/identity/identity_client_composite_operations.rb +818 -0
- data/lib/oci/identity/models/add_user_to_group_details.rb +66 -47
- data/lib/oci/identity/models/api_key.rb +108 -101
- data/lib/oci/identity/models/availability_domain.rb +64 -44
- data/lib/oci/identity/models/compartment.rb +118 -115
- data/lib/oci/identity/models/create_api_key_details.rb +60 -35
- data/lib/oci/identity/models/create_compartment_details.rb +83 -72
- data/lib/oci/identity/models/create_customer_secret_key_details.rb +62 -39
- data/lib/oci/identity/models/create_dynamic_group_details.rb +75 -61
- data/lib/oci/identity/models/create_group_details.rb +82 -71
- data/lib/oci/identity/models/create_identity_provider_details.rb +115 -110
- data/lib/oci/identity/models/create_idp_group_mapping_details.rb +67 -48
- data/lib/oci/identity/models/create_policy_details.rb +94 -89
- data/lib/oci/identity/models/create_region_subscription_details.rb +64 -41
- data/lib/oci/identity/models/create_saml2_identity_provider_details.rb +88 -67
- data/lib/oci/identity/models/create_smtp_credential_details.rb +61 -36
- data/lib/oci/identity/models/create_swift_password_details.rb +61 -36
- data/lib/oci/identity/models/create_tag_details.rb +77 -62
- data/lib/oci/identity/models/create_tag_namespace_details.rb +82 -71
- data/lib/oci/identity/models/create_user_details.rb +82 -71
- data/lib/oci/identity/models/customer_secret_key.rb +114 -109
- data/lib/oci/identity/models/customer_secret_key_summary.rb +109 -102
- data/lib/oci/identity/models/dynamic_group.rb +112 -105
- data/lib/oci/identity/models/group.rb +118 -115
- data/lib/oci/identity/models/identity_provider.rb +135 -138
- data/lib/oci/identity/models/idp_group_mapping.rb +112 -109
- data/lib/oci/identity/models/policy.rb +129 -132
- data/lib/oci/identity/models/region.rb +67 -45
- data/lib/oci/identity/models/region_subscription.rb +90 -71
- data/lib/oci/identity/models/saml2_identity_provider.rb +106 -92
- data/lib/oci/identity/models/smtp_credential.rb +118 -113
- data/lib/oci/identity/models/smtp_credential_summary.rb +113 -106
- data/lib/oci/identity/models/swift_password.rb +113 -106
- data/lib/oci/identity/models/tag.rb +108 -116
- data/lib/oci/identity/models/tag_namespace.rb +97 -97
- data/lib/oci/identity/models/tag_namespace_summary.rb +97 -97
- data/lib/oci/identity/models/tag_summary.rb +97 -97
- data/lib/oci/identity/models/tenancy.rb +86 -78
- data/lib/oci/identity/models/ui_password.rb +97 -82
- data/lib/oci/identity/models/update_compartment_details.rb +77 -62
- data/lib/oci/identity/models/update_customer_secret_key_details.rb +61 -38
- data/lib/oci/identity/models/update_dynamic_group_details.rb +65 -45
- data/lib/oci/identity/models/update_group_details.rb +72 -55
- data/lib/oci/identity/models/update_identity_provider_details.rb +89 -74
- data/lib/oci/identity/models/update_idp_group_mapping_details.rb +66 -47
- data/lib/oci/identity/models/update_policy_details.rb +83 -72
- data/lib/oci/identity/models/update_saml2_identity_provider_details.rb +79 -58
- data/lib/oci/identity/models/update_smtp_credential_details.rb +60 -35
- data/lib/oci/identity/models/update_state_details.rb +61 -36
- data/lib/oci/identity/models/update_swift_password_details.rb +60 -35
- data/lib/oci/identity/models/update_tag_details.rb +78 -65
- data/lib/oci/identity/models/update_tag_namespace_details.rb +78 -65
- data/lib/oci/identity/models/update_user_details.rb +72 -55
- data/lib/oci/identity/models/user.rb +120 -117
- data/lib/oci/identity/models/user_group_membership.rb +107 -100
- data/lib/oci/load_balancer/load_balancer.rb +3 -0
- data/lib/oci/load_balancer/load_balancer_client.rb +918 -500
- data/lib/oci/load_balancer/load_balancer_client_composite_operations.rb +795 -0
- data/lib/oci/load_balancer/models/backend.rb +101 -94
- data/lib/oci/load_balancer/models/backend_details.rb +95 -86
- data/lib/oci/load_balancer/models/backend_health.rb +84 -57
- data/lib/oci/load_balancer/models/backend_set.rb +87 -79
- data/lib/oci/load_balancer/models/backend_set_details.rb +80 -70
- data/lib/oci/load_balancer/models/backend_set_health.rb +106 -91
- data/lib/oci/load_balancer/models/certificate.rb +78 -64
- data/lib/oci/load_balancer/models/certificate_details.rb +92 -84
- data/lib/oci/load_balancer/models/connection_configuration.rb +73 -51
- data/lib/oci/load_balancer/models/create_backend_details.rb +95 -86
- data/lib/oci/load_balancer/models/create_backend_set_details.rb +87 -79
- data/lib/oci/load_balancer/models/create_certificate_details.rb +92 -84
- data/lib/oci/load_balancer/models/create_listener_details.rb +97 -93
- data/lib/oci/load_balancer/models/create_load_balancer_details.rb +109 -117
- data/lib/oci/load_balancer/models/create_path_route_set_details.rb +66 -46
- data/lib/oci/load_balancer/models/health_check_result.rb +98 -79
- data/lib/oci/load_balancer/models/health_checker.rb +108 -108
- data/lib/oci/load_balancer/models/health_checker_details.rb +108 -108
- data/lib/oci/load_balancer/models/ip_address.rb +70 -52
- data/lib/oci/load_balancer/models/listener.rb +97 -93
- data/lib/oci/load_balancer/models/listener_details.rb +91 -85
- data/lib/oci/load_balancer/models/load_balancer.rb +144 -157
- data/lib/oci/load_balancer/models/load_balancer_health.rb +110 -95
- data/lib/oci/load_balancer/models/load_balancer_health_summary.rb +88 -61
- data/lib/oci/load_balancer/models/load_balancer_policy.rb +59 -35
- data/lib/oci/load_balancer/models/load_balancer_protocol.rb +59 -35
- data/lib/oci/load_balancer/models/load_balancer_shape.rb +59 -35
- data/lib/oci/load_balancer/models/path_match_type.rb +80 -51
- data/lib/oci/load_balancer/models/path_route.rb +76 -60
- data/lib/oci/load_balancer/models/path_route_set.rb +66 -46
- data/lib/oci/load_balancer/models/path_route_set_details.rb +60 -38
- data/lib/oci/load_balancer/models/session_persistence_configuration_details.rb +71 -55
- data/lib/oci/load_balancer/models/ssl_configuration.rb +78 -66
- data/lib/oci/load_balancer/models/ssl_configuration_details.rb +78 -66
- data/lib/oci/load_balancer/models/update_backend_details.rb +82 -67
- data/lib/oci/load_balancer/models/update_backend_set_details.rb +80 -70
- data/lib/oci/load_balancer/models/update_health_checker_details.rb +108 -108
- data/lib/oci/load_balancer/models/update_listener_details.rb +91 -85
- data/lib/oci/load_balancer/models/update_load_balancer_details.rb +62 -40
- data/lib/oci/load_balancer/models/update_path_route_set_details.rb +60 -38
- data/lib/oci/load_balancer/models/work_request.rb +115 -108
- data/lib/oci/load_balancer/models/work_request_error.rb +76 -49
- data/lib/oci/object_storage/models/bucket.rb +136 -133
- data/lib/oci/object_storage/models/bucket_summary.rb +95 -95
- data/lib/oci/object_storage/models/commit_multipart_upload_details.rb +66 -48
- data/lib/oci/object_storage/models/commit_multipart_upload_part_details.rb +64 -44
- data/lib/oci/object_storage/models/create_bucket_details.rb +113 -111
- data/lib/oci/object_storage/models/create_multipart_upload_details.rb +80 -70
- data/lib/oci/object_storage/models/create_preauthenticated_request_details.rb +87 -74
- data/lib/oci/object_storage/models/list_objects.rb +71 -53
- data/lib/oci/object_storage/models/multipart_upload.rb +77 -65
- data/lib/oci/object_storage/models/multipart_upload_part_summary.rb +72 -56
- data/lib/oci/object_storage/models/namespace_metadata.rb +69 -53
- data/lib/oci/object_storage/models/object_summary.rb +73 -57
- data/lib/oci/object_storage/models/preauthenticated_request.rb +105 -96
- data/lib/oci/object_storage/models/preauthenticated_request_summary.rb +99 -86
- data/lib/oci/object_storage/models/rename_object_details.rb +80 -74
- data/lib/oci/object_storage/models/restore_objects_details.rb +66 -45
- data/lib/oci/object_storage/models/update_bucket_details.rb +101 -97
- data/lib/oci/object_storage/models/update_namespace_metadata_details.rb +65 -47
- data/lib/oci/object_storage/object_storage.rb +2 -0
- data/lib/oci/object_storage/object_storage_client.rb +737 -435
- data/lib/oci/object_storage/object_storage_client_composite_operations.rb +24 -0
- data/lib/oci/signer.rb +20 -7
- data/lib/oci/version.rb +1 -1
- metadata +13 -2
|
@@ -0,0 +1,738 @@
|
|
|
1
|
+
# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
|
|
2
|
+
|
|
3
|
+
# rubocop:disable Lint/UnneededCopDisableDirective, Metrics/LineLength
|
|
4
|
+
module OCI
|
|
5
|
+
# This class provides a wrapper around {OCI::Core::ComputeClient} and offers convenience methods
|
|
6
|
+
# for operations that would otherwise need to be chained together. For example, instead of performing an action
|
|
7
|
+
# on a resource (e.g. launching an instance, creating a load balancer) and then using a waiter to wait for the resource
|
|
8
|
+
# to enter a given state, you can call a single method in this class to accomplish the same functionality
|
|
9
|
+
class Core::ComputeClientCompositeOperations
|
|
10
|
+
# The {OCI::Core::ComputeClient} used to communicate with the service_client
|
|
11
|
+
#
|
|
12
|
+
# @return [OCI::Core::ComputeClient]
|
|
13
|
+
attr_reader :service_client
|
|
14
|
+
|
|
15
|
+
# Initializes a new ComputeClientCompositeOperations
|
|
16
|
+
#
|
|
17
|
+
# @param [OCI::Core::ComputeClient] service_client The client used to communicate with the service.
|
|
18
|
+
# Defaults to a new service client created via {OCI::Core::ComputeClient#initialize} with no arguments
|
|
19
|
+
def initialize(service_client = OCI::Core::ComputeClient.new)
|
|
20
|
+
@service_client = service_client
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/ParameterLists, Metrics/PerceivedComplexity
|
|
24
|
+
# rubocop:disable Layout/EmptyLines
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
# Calls {OCI::Core::ComputeClient#attach_boot_volume} and then waits for the {OCI::Core::Models::BootVolumeAttachment} acted upon
|
|
28
|
+
# to enter the given state(s).
|
|
29
|
+
#
|
|
30
|
+
# @param [OCI::Core::Models::AttachBootVolumeDetails] attach_boot_volume_details Attach boot volume request
|
|
31
|
+
# @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::Core::Models::BootVolumeAttachment#lifecycle_state}
|
|
32
|
+
# @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::Core::ComputeClient#attach_boot_volume}
|
|
33
|
+
# @param [Hash] waiter_opts Optional arguments for the waiter. Keys should be symbols, and the following keys are supported:
|
|
34
|
+
# * max_interval_seconds: The maximum interval between queries, in seconds.
|
|
35
|
+
# * max_wait_seconds The maximum time to wait, in seconds
|
|
36
|
+
#
|
|
37
|
+
# @return [OCI::Response] A {OCI::Response} object with data of type {OCI::Core::Models::BootVolumeAttachment}
|
|
38
|
+
def attach_boot_volume_and_wait_for_state(attach_boot_volume_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
|
|
39
|
+
operation_result = @service_client.attach_boot_volume(attach_boot_volume_details, base_operation_opts)
|
|
40
|
+
|
|
41
|
+
return operation_result if wait_for_states.empty?
|
|
42
|
+
|
|
43
|
+
lowered_wait_for_states = wait_for_states.map(&:downcase)
|
|
44
|
+
wait_for_resource_id = operation_result.data.id
|
|
45
|
+
|
|
46
|
+
begin
|
|
47
|
+
waiter_result = @service_client.get_boot_volume_attachment(wait_for_resource_id).wait_until(
|
|
48
|
+
eval_proc: ->(response) { response.data.respond_to?(:lifecycle_state) && lowered_wait_for_states.include?(response.data.lifecycle_state.downcase) },
|
|
49
|
+
max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
|
|
50
|
+
max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
|
|
51
|
+
)
|
|
52
|
+
result_to_return = waiter_result
|
|
53
|
+
|
|
54
|
+
return result_to_return
|
|
55
|
+
rescue StandardError
|
|
56
|
+
raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/ParameterLists, Metrics/PerceivedComplexity
|
|
60
|
+
# rubocop:enable Layout/EmptyLines
|
|
61
|
+
|
|
62
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/ParameterLists, Metrics/PerceivedComplexity
|
|
63
|
+
# rubocop:disable Layout/EmptyLines
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
# Calls {OCI::Core::ComputeClient#attach_vnic} and then waits for the {OCI::Core::Models::VnicAttachment} acted upon
|
|
67
|
+
# to enter the given state(s).
|
|
68
|
+
#
|
|
69
|
+
# @param [OCI::Core::Models::AttachVnicDetails] attach_vnic_details Attach VNIC details.
|
|
70
|
+
# @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::Core::Models::VnicAttachment#lifecycle_state}
|
|
71
|
+
# @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::Core::ComputeClient#attach_vnic}
|
|
72
|
+
# @param [Hash] waiter_opts Optional arguments for the waiter. Keys should be symbols, and the following keys are supported:
|
|
73
|
+
# * max_interval_seconds: The maximum interval between queries, in seconds.
|
|
74
|
+
# * max_wait_seconds The maximum time to wait, in seconds
|
|
75
|
+
#
|
|
76
|
+
# @return [OCI::Response] A {OCI::Response} object with data of type {OCI::Core::Models::VnicAttachment}
|
|
77
|
+
def attach_vnic_and_wait_for_state(attach_vnic_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
|
|
78
|
+
operation_result = @service_client.attach_vnic(attach_vnic_details, base_operation_opts)
|
|
79
|
+
|
|
80
|
+
return operation_result if wait_for_states.empty?
|
|
81
|
+
|
|
82
|
+
lowered_wait_for_states = wait_for_states.map(&:downcase)
|
|
83
|
+
wait_for_resource_id = operation_result.data.id
|
|
84
|
+
|
|
85
|
+
begin
|
|
86
|
+
waiter_result = @service_client.get_vnic_attachment(wait_for_resource_id).wait_until(
|
|
87
|
+
eval_proc: ->(response) { response.data.respond_to?(:lifecycle_state) && lowered_wait_for_states.include?(response.data.lifecycle_state.downcase) },
|
|
88
|
+
max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
|
|
89
|
+
max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
|
|
90
|
+
)
|
|
91
|
+
result_to_return = waiter_result
|
|
92
|
+
|
|
93
|
+
return result_to_return
|
|
94
|
+
rescue StandardError
|
|
95
|
+
raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
|
|
96
|
+
end
|
|
97
|
+
end
|
|
98
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/ParameterLists, Metrics/PerceivedComplexity
|
|
99
|
+
# rubocop:enable Layout/EmptyLines
|
|
100
|
+
|
|
101
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/ParameterLists, Metrics/PerceivedComplexity
|
|
102
|
+
# rubocop:disable Layout/EmptyLines
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
# Calls {OCI::Core::ComputeClient#attach_volume} and then waits for the {OCI::Core::Models::VolumeAttachment} acted upon
|
|
106
|
+
# to enter the given state(s).
|
|
107
|
+
#
|
|
108
|
+
# @param [OCI::Core::Models::AttachVolumeDetails] attach_volume_details Attach volume request
|
|
109
|
+
# @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::Core::Models::VolumeAttachment#lifecycle_state}
|
|
110
|
+
# @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::Core::ComputeClient#attach_volume}
|
|
111
|
+
# @param [Hash] waiter_opts Optional arguments for the waiter. Keys should be symbols, and the following keys are supported:
|
|
112
|
+
# * max_interval_seconds: The maximum interval between queries, in seconds.
|
|
113
|
+
# * max_wait_seconds The maximum time to wait, in seconds
|
|
114
|
+
#
|
|
115
|
+
# @return [OCI::Response] A {OCI::Response} object with data of type {OCI::Core::Models::VolumeAttachment}
|
|
116
|
+
def attach_volume_and_wait_for_state(attach_volume_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
|
|
117
|
+
operation_result = @service_client.attach_volume(attach_volume_details, base_operation_opts)
|
|
118
|
+
|
|
119
|
+
return operation_result if wait_for_states.empty?
|
|
120
|
+
|
|
121
|
+
lowered_wait_for_states = wait_for_states.map(&:downcase)
|
|
122
|
+
wait_for_resource_id = operation_result.data.id
|
|
123
|
+
|
|
124
|
+
begin
|
|
125
|
+
waiter_result = @service_client.get_volume_attachment(wait_for_resource_id).wait_until(
|
|
126
|
+
eval_proc: ->(response) { response.data.respond_to?(:lifecycle_state) && lowered_wait_for_states.include?(response.data.lifecycle_state.downcase) },
|
|
127
|
+
max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
|
|
128
|
+
max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
|
|
129
|
+
)
|
|
130
|
+
result_to_return = waiter_result
|
|
131
|
+
|
|
132
|
+
return result_to_return
|
|
133
|
+
rescue StandardError
|
|
134
|
+
raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
|
|
135
|
+
end
|
|
136
|
+
end
|
|
137
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/ParameterLists, Metrics/PerceivedComplexity
|
|
138
|
+
# rubocop:enable Layout/EmptyLines
|
|
139
|
+
|
|
140
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/ParameterLists, Metrics/PerceivedComplexity
|
|
141
|
+
# rubocop:disable Layout/EmptyLines
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
# Calls {OCI::Core::ComputeClient#capture_console_history} and then waits for the {OCI::Core::Models::ConsoleHistory} acted upon
|
|
145
|
+
# to enter the given state(s).
|
|
146
|
+
#
|
|
147
|
+
# @param [OCI::Core::Models::CaptureConsoleHistoryDetails] capture_console_history_details Console history details
|
|
148
|
+
# @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::Core::Models::ConsoleHistory#lifecycle_state}
|
|
149
|
+
# @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::Core::ComputeClient#capture_console_history}
|
|
150
|
+
# @param [Hash] waiter_opts Optional arguments for the waiter. Keys should be symbols, and the following keys are supported:
|
|
151
|
+
# * max_interval_seconds: The maximum interval between queries, in seconds.
|
|
152
|
+
# * max_wait_seconds The maximum time to wait, in seconds
|
|
153
|
+
#
|
|
154
|
+
# @return [OCI::Response] A {OCI::Response} object with data of type {OCI::Core::Models::ConsoleHistory}
|
|
155
|
+
def capture_console_history_and_wait_for_state(capture_console_history_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
|
|
156
|
+
operation_result = @service_client.capture_console_history(capture_console_history_details, base_operation_opts)
|
|
157
|
+
|
|
158
|
+
return operation_result if wait_for_states.empty?
|
|
159
|
+
|
|
160
|
+
lowered_wait_for_states = wait_for_states.map(&:downcase)
|
|
161
|
+
wait_for_resource_id = operation_result.data.id
|
|
162
|
+
|
|
163
|
+
begin
|
|
164
|
+
waiter_result = @service_client.get_console_history(wait_for_resource_id).wait_until(
|
|
165
|
+
eval_proc: ->(response) { response.data.respond_to?(:lifecycle_state) && lowered_wait_for_states.include?(response.data.lifecycle_state.downcase) },
|
|
166
|
+
max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
|
|
167
|
+
max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
|
|
168
|
+
)
|
|
169
|
+
result_to_return = waiter_result
|
|
170
|
+
|
|
171
|
+
return result_to_return
|
|
172
|
+
rescue StandardError
|
|
173
|
+
raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
|
|
174
|
+
end
|
|
175
|
+
end
|
|
176
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/ParameterLists, Metrics/PerceivedComplexity
|
|
177
|
+
# rubocop:enable Layout/EmptyLines
|
|
178
|
+
|
|
179
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/ParameterLists, Metrics/PerceivedComplexity
|
|
180
|
+
# rubocop:disable Layout/EmptyLines
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
# Calls {OCI::Core::ComputeClient#create_image} and then waits for the {OCI::Core::Models::Image} acted upon
|
|
184
|
+
# to enter the given state(s).
|
|
185
|
+
#
|
|
186
|
+
# @param [OCI::Core::Models::CreateImageDetails] create_image_details Image creation details
|
|
187
|
+
# @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::Core::Models::Image#lifecycle_state}
|
|
188
|
+
# @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::Core::ComputeClient#create_image}
|
|
189
|
+
# @param [Hash] waiter_opts Optional arguments for the waiter. Keys should be symbols, and the following keys are supported:
|
|
190
|
+
# * max_interval_seconds: The maximum interval between queries, in seconds.
|
|
191
|
+
# * max_wait_seconds The maximum time to wait, in seconds
|
|
192
|
+
#
|
|
193
|
+
# @return [OCI::Response] A {OCI::Response} object with data of type {OCI::Core::Models::Image}
|
|
194
|
+
def create_image_and_wait_for_state(create_image_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
|
|
195
|
+
operation_result = @service_client.create_image(create_image_details, base_operation_opts)
|
|
196
|
+
|
|
197
|
+
return operation_result if wait_for_states.empty?
|
|
198
|
+
|
|
199
|
+
lowered_wait_for_states = wait_for_states.map(&:downcase)
|
|
200
|
+
wait_for_resource_id = operation_result.data.id
|
|
201
|
+
|
|
202
|
+
begin
|
|
203
|
+
waiter_result = @service_client.get_image(wait_for_resource_id).wait_until(
|
|
204
|
+
eval_proc: ->(response) { response.data.respond_to?(:lifecycle_state) && lowered_wait_for_states.include?(response.data.lifecycle_state.downcase) },
|
|
205
|
+
max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
|
|
206
|
+
max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
|
|
207
|
+
)
|
|
208
|
+
result_to_return = waiter_result
|
|
209
|
+
|
|
210
|
+
return result_to_return
|
|
211
|
+
rescue StandardError
|
|
212
|
+
raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
|
|
213
|
+
end
|
|
214
|
+
end
|
|
215
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/ParameterLists, Metrics/PerceivedComplexity
|
|
216
|
+
# rubocop:enable Layout/EmptyLines
|
|
217
|
+
|
|
218
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/ParameterLists, Metrics/PerceivedComplexity
|
|
219
|
+
# rubocop:disable Layout/EmptyLines
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
# Calls {OCI::Core::ComputeClient#create_instance_console_connection} and then waits for the {OCI::Core::Models::InstanceConsoleConnection} acted upon
|
|
223
|
+
# to enter the given state(s).
|
|
224
|
+
#
|
|
225
|
+
# @param [OCI::Core::Models::CreateInstanceConsoleConnectionDetails] create_instance_console_connection_details Request object for creating an InstanceConsoleConnection
|
|
226
|
+
# @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::Core::Models::InstanceConsoleConnection#lifecycle_state}
|
|
227
|
+
# @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::Core::ComputeClient#create_instance_console_connection}
|
|
228
|
+
# @param [Hash] waiter_opts Optional arguments for the waiter. Keys should be symbols, and the following keys are supported:
|
|
229
|
+
# * max_interval_seconds: The maximum interval between queries, in seconds.
|
|
230
|
+
# * max_wait_seconds The maximum time to wait, in seconds
|
|
231
|
+
#
|
|
232
|
+
# @return [OCI::Response] A {OCI::Response} object with data of type {OCI::Core::Models::InstanceConsoleConnection}
|
|
233
|
+
def create_instance_console_connection_and_wait_for_state(create_instance_console_connection_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
|
|
234
|
+
operation_result = @service_client.create_instance_console_connection(create_instance_console_connection_details, base_operation_opts)
|
|
235
|
+
|
|
236
|
+
return operation_result if wait_for_states.empty?
|
|
237
|
+
|
|
238
|
+
lowered_wait_for_states = wait_for_states.map(&:downcase)
|
|
239
|
+
wait_for_resource_id = operation_result.data.id
|
|
240
|
+
|
|
241
|
+
begin
|
|
242
|
+
waiter_result = @service_client.get_instance_console_connection(wait_for_resource_id).wait_until(
|
|
243
|
+
eval_proc: ->(response) { response.data.respond_to?(:lifecycle_state) && lowered_wait_for_states.include?(response.data.lifecycle_state.downcase) },
|
|
244
|
+
max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
|
|
245
|
+
max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
|
|
246
|
+
)
|
|
247
|
+
result_to_return = waiter_result
|
|
248
|
+
|
|
249
|
+
return result_to_return
|
|
250
|
+
rescue StandardError
|
|
251
|
+
raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
|
|
252
|
+
end
|
|
253
|
+
end
|
|
254
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/ParameterLists, Metrics/PerceivedComplexity
|
|
255
|
+
# rubocop:enable Layout/EmptyLines
|
|
256
|
+
|
|
257
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/ParameterLists, Metrics/PerceivedComplexity
|
|
258
|
+
# rubocop:disable Layout/EmptyLines
|
|
259
|
+
|
|
260
|
+
|
|
261
|
+
# Calls {OCI::Core::ComputeClient#delete_console_history} and then waits for the {OCI::Core::Models::ConsoleHistory} acted upon
|
|
262
|
+
# to enter the given state(s).
|
|
263
|
+
#
|
|
264
|
+
# @param [String] instance_console_history_id The OCID of the console history.
|
|
265
|
+
# @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::Core::Models::ConsoleHistory#lifecycle_state}
|
|
266
|
+
# @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::Core::ComputeClient#delete_console_history}
|
|
267
|
+
# @param [Hash] waiter_opts Optional arguments for the waiter. Keys should be symbols, and the following keys are supported:
|
|
268
|
+
# * max_interval_seconds: The maximum interval between queries, in seconds.
|
|
269
|
+
# * max_wait_seconds The maximum time to wait, in seconds
|
|
270
|
+
#
|
|
271
|
+
# @return [OCI::Response] A {OCI::Response} object with data of type nil
|
|
272
|
+
def delete_console_history_and_wait_for_state(instance_console_history_id, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
|
|
273
|
+
initial_get_result = @service_client.get_console_history(instance_console_history_id)
|
|
274
|
+
operation_result = @service_client.delete_console_history(instance_console_history_id, base_operation_opts)
|
|
275
|
+
|
|
276
|
+
return operation_result if wait_for_states.empty?
|
|
277
|
+
|
|
278
|
+
lowered_wait_for_states = wait_for_states.map(&:downcase)
|
|
279
|
+
|
|
280
|
+
begin
|
|
281
|
+
waiter_result = initial_get_result.wait_until(
|
|
282
|
+
eval_proc: ->(response) { response.data.respond_to?(:lifecycle_state) && lowered_wait_for_states.include?(response.data.lifecycle_state.downcase) },
|
|
283
|
+
max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
|
|
284
|
+
max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200,
|
|
285
|
+
succeed_on_not_found: true
|
|
286
|
+
)
|
|
287
|
+
result_to_return = waiter_result
|
|
288
|
+
|
|
289
|
+
return result_to_return
|
|
290
|
+
rescue StandardError
|
|
291
|
+
raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
|
|
292
|
+
end
|
|
293
|
+
end
|
|
294
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/ParameterLists, Metrics/PerceivedComplexity
|
|
295
|
+
# rubocop:enable Layout/EmptyLines
|
|
296
|
+
|
|
297
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/ParameterLists, Metrics/PerceivedComplexity
|
|
298
|
+
# rubocop:disable Layout/EmptyLines
|
|
299
|
+
|
|
300
|
+
|
|
301
|
+
# Calls {OCI::Core::ComputeClient#delete_image} and then waits for the {OCI::Core::Models::Image} acted upon
|
|
302
|
+
# to enter the given state(s).
|
|
303
|
+
#
|
|
304
|
+
# @param [String] image_id The OCID of the image.
|
|
305
|
+
# @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::Core::Models::Image#lifecycle_state}
|
|
306
|
+
# @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::Core::ComputeClient#delete_image}
|
|
307
|
+
# @param [Hash] waiter_opts Optional arguments for the waiter. Keys should be symbols, and the following keys are supported:
|
|
308
|
+
# * max_interval_seconds: The maximum interval between queries, in seconds.
|
|
309
|
+
# * max_wait_seconds The maximum time to wait, in seconds
|
|
310
|
+
#
|
|
311
|
+
# @return [OCI::Response] A {OCI::Response} object with data of type nil
|
|
312
|
+
def delete_image_and_wait_for_state(image_id, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
|
|
313
|
+
initial_get_result = @service_client.get_image(image_id)
|
|
314
|
+
operation_result = @service_client.delete_image(image_id, base_operation_opts)
|
|
315
|
+
|
|
316
|
+
return operation_result if wait_for_states.empty?
|
|
317
|
+
|
|
318
|
+
lowered_wait_for_states = wait_for_states.map(&:downcase)
|
|
319
|
+
|
|
320
|
+
begin
|
|
321
|
+
waiter_result = initial_get_result.wait_until(
|
|
322
|
+
eval_proc: ->(response) { response.data.respond_to?(:lifecycle_state) && lowered_wait_for_states.include?(response.data.lifecycle_state.downcase) },
|
|
323
|
+
max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
|
|
324
|
+
max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200,
|
|
325
|
+
succeed_on_not_found: true
|
|
326
|
+
)
|
|
327
|
+
result_to_return = waiter_result
|
|
328
|
+
|
|
329
|
+
return result_to_return
|
|
330
|
+
rescue StandardError
|
|
331
|
+
raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
|
|
332
|
+
end
|
|
333
|
+
end
|
|
334
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/ParameterLists, Metrics/PerceivedComplexity
|
|
335
|
+
# rubocop:enable Layout/EmptyLines
|
|
336
|
+
|
|
337
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/ParameterLists, Metrics/PerceivedComplexity
|
|
338
|
+
# rubocop:disable Layout/EmptyLines
|
|
339
|
+
|
|
340
|
+
|
|
341
|
+
# Calls {OCI::Core::ComputeClient#delete_instance_console_connection} and then waits for the {OCI::Core::Models::InstanceConsoleConnection} acted upon
|
|
342
|
+
# to enter the given state(s).
|
|
343
|
+
#
|
|
344
|
+
# @param [String] instance_console_connection_id The OCID of the intance console connection
|
|
345
|
+
# @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::Core::Models::InstanceConsoleConnection#lifecycle_state}
|
|
346
|
+
# @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::Core::ComputeClient#delete_instance_console_connection}
|
|
347
|
+
# @param [Hash] waiter_opts Optional arguments for the waiter. Keys should be symbols, and the following keys are supported:
|
|
348
|
+
# * max_interval_seconds: The maximum interval between queries, in seconds.
|
|
349
|
+
# * max_wait_seconds The maximum time to wait, in seconds
|
|
350
|
+
#
|
|
351
|
+
# @return [OCI::Response] A {OCI::Response} object with data of type nil
|
|
352
|
+
def delete_instance_console_connection_and_wait_for_state(instance_console_connection_id, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
|
|
353
|
+
initial_get_result = @service_client.get_instance_console_connection(instance_console_connection_id)
|
|
354
|
+
operation_result = @service_client.delete_instance_console_connection(instance_console_connection_id, base_operation_opts)
|
|
355
|
+
|
|
356
|
+
return operation_result if wait_for_states.empty?
|
|
357
|
+
|
|
358
|
+
lowered_wait_for_states = wait_for_states.map(&:downcase)
|
|
359
|
+
|
|
360
|
+
begin
|
|
361
|
+
waiter_result = initial_get_result.wait_until(
|
|
362
|
+
eval_proc: ->(response) { response.data.respond_to?(:lifecycle_state) && lowered_wait_for_states.include?(response.data.lifecycle_state.downcase) },
|
|
363
|
+
max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
|
|
364
|
+
max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200,
|
|
365
|
+
succeed_on_not_found: true
|
|
366
|
+
)
|
|
367
|
+
result_to_return = waiter_result
|
|
368
|
+
|
|
369
|
+
return result_to_return
|
|
370
|
+
rescue StandardError
|
|
371
|
+
raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
|
|
372
|
+
end
|
|
373
|
+
end
|
|
374
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/ParameterLists, Metrics/PerceivedComplexity
|
|
375
|
+
# rubocop:enable Layout/EmptyLines
|
|
376
|
+
|
|
377
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/ParameterLists, Metrics/PerceivedComplexity
|
|
378
|
+
# rubocop:disable Layout/EmptyLines
|
|
379
|
+
|
|
380
|
+
|
|
381
|
+
# Calls {OCI::Core::ComputeClient#detach_boot_volume} and then waits for the {OCI::Core::Models::BootVolumeAttachment} acted upon
|
|
382
|
+
# to enter the given state(s).
|
|
383
|
+
#
|
|
384
|
+
# @param [String] boot_volume_attachment_id The OCID of the boot volume attachment.
|
|
385
|
+
# @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::Core::Models::BootVolumeAttachment#lifecycle_state}
|
|
386
|
+
# @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::Core::ComputeClient#detach_boot_volume}
|
|
387
|
+
# @param [Hash] waiter_opts Optional arguments for the waiter. Keys should be symbols, and the following keys are supported:
|
|
388
|
+
# * max_interval_seconds: The maximum interval between queries, in seconds.
|
|
389
|
+
# * max_wait_seconds The maximum time to wait, in seconds
|
|
390
|
+
#
|
|
391
|
+
# @return [OCI::Response] A {OCI::Response} object with data of type nil
|
|
392
|
+
def detach_boot_volume_and_wait_for_state(boot_volume_attachment_id, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
|
|
393
|
+
initial_get_result = @service_client.get_boot_volume_attachment(boot_volume_attachment_id)
|
|
394
|
+
operation_result = @service_client.detach_boot_volume(boot_volume_attachment_id, base_operation_opts)
|
|
395
|
+
|
|
396
|
+
return operation_result if wait_for_states.empty?
|
|
397
|
+
|
|
398
|
+
lowered_wait_for_states = wait_for_states.map(&:downcase)
|
|
399
|
+
|
|
400
|
+
begin
|
|
401
|
+
waiter_result = initial_get_result.wait_until(
|
|
402
|
+
eval_proc: ->(response) { response.data.respond_to?(:lifecycle_state) && lowered_wait_for_states.include?(response.data.lifecycle_state.downcase) },
|
|
403
|
+
max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
|
|
404
|
+
max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200,
|
|
405
|
+
succeed_on_not_found: true
|
|
406
|
+
)
|
|
407
|
+
result_to_return = waiter_result
|
|
408
|
+
|
|
409
|
+
return result_to_return
|
|
410
|
+
rescue StandardError
|
|
411
|
+
raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
|
|
412
|
+
end
|
|
413
|
+
end
|
|
414
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/ParameterLists, Metrics/PerceivedComplexity
|
|
415
|
+
# rubocop:enable Layout/EmptyLines
|
|
416
|
+
|
|
417
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/ParameterLists, Metrics/PerceivedComplexity
|
|
418
|
+
# rubocop:disable Layout/EmptyLines
|
|
419
|
+
|
|
420
|
+
|
|
421
|
+
# Calls {OCI::Core::ComputeClient#detach_vnic} and then waits for the {OCI::Core::Models::VnicAttachment} acted upon
|
|
422
|
+
# to enter the given state(s).
|
|
423
|
+
#
|
|
424
|
+
# @param [String] vnic_attachment_id The OCID of the VNIC attachment.
|
|
425
|
+
# @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::Core::Models::VnicAttachment#lifecycle_state}
|
|
426
|
+
# @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::Core::ComputeClient#detach_vnic}
|
|
427
|
+
# @param [Hash] waiter_opts Optional arguments for the waiter. Keys should be symbols, and the following keys are supported:
|
|
428
|
+
# * max_interval_seconds: The maximum interval between queries, in seconds.
|
|
429
|
+
# * max_wait_seconds The maximum time to wait, in seconds
|
|
430
|
+
#
|
|
431
|
+
# @return [OCI::Response] A {OCI::Response} object with data of type nil
|
|
432
|
+
def detach_vnic_and_wait_for_state(vnic_attachment_id, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
|
|
433
|
+
initial_get_result = @service_client.get_vnic_attachment(vnic_attachment_id)
|
|
434
|
+
operation_result = @service_client.detach_vnic(vnic_attachment_id, base_operation_opts)
|
|
435
|
+
|
|
436
|
+
return operation_result if wait_for_states.empty?
|
|
437
|
+
|
|
438
|
+
lowered_wait_for_states = wait_for_states.map(&:downcase)
|
|
439
|
+
|
|
440
|
+
begin
|
|
441
|
+
waiter_result = initial_get_result.wait_until(
|
|
442
|
+
eval_proc: ->(response) { response.data.respond_to?(:lifecycle_state) && lowered_wait_for_states.include?(response.data.lifecycle_state.downcase) },
|
|
443
|
+
max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
|
|
444
|
+
max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200,
|
|
445
|
+
succeed_on_not_found: true
|
|
446
|
+
)
|
|
447
|
+
result_to_return = waiter_result
|
|
448
|
+
|
|
449
|
+
return result_to_return
|
|
450
|
+
rescue StandardError
|
|
451
|
+
raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
|
|
452
|
+
end
|
|
453
|
+
end
|
|
454
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/ParameterLists, Metrics/PerceivedComplexity
|
|
455
|
+
# rubocop:enable Layout/EmptyLines
|
|
456
|
+
|
|
457
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/ParameterLists, Metrics/PerceivedComplexity
|
|
458
|
+
# rubocop:disable Layout/EmptyLines
|
|
459
|
+
|
|
460
|
+
|
|
461
|
+
# Calls {OCI::Core::ComputeClient#detach_volume} and then waits for the {OCI::Core::Models::VolumeAttachment} acted upon
|
|
462
|
+
# to enter the given state(s).
|
|
463
|
+
#
|
|
464
|
+
# @param [String] volume_attachment_id The OCID of the volume attachment.
|
|
465
|
+
# @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::Core::Models::VolumeAttachment#lifecycle_state}
|
|
466
|
+
# @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::Core::ComputeClient#detach_volume}
|
|
467
|
+
# @param [Hash] waiter_opts Optional arguments for the waiter. Keys should be symbols, and the following keys are supported:
|
|
468
|
+
# * max_interval_seconds: The maximum interval between queries, in seconds.
|
|
469
|
+
# * max_wait_seconds The maximum time to wait, in seconds
|
|
470
|
+
#
|
|
471
|
+
# @return [OCI::Response] A {OCI::Response} object with data of type nil
|
|
472
|
+
def detach_volume_and_wait_for_state(volume_attachment_id, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
|
|
473
|
+
initial_get_result = @service_client.get_volume_attachment(volume_attachment_id)
|
|
474
|
+
operation_result = @service_client.detach_volume(volume_attachment_id, base_operation_opts)
|
|
475
|
+
|
|
476
|
+
return operation_result if wait_for_states.empty?
|
|
477
|
+
|
|
478
|
+
lowered_wait_for_states = wait_for_states.map(&:downcase)
|
|
479
|
+
|
|
480
|
+
begin
|
|
481
|
+
waiter_result = initial_get_result.wait_until(
|
|
482
|
+
eval_proc: ->(response) { response.data.respond_to?(:lifecycle_state) && lowered_wait_for_states.include?(response.data.lifecycle_state.downcase) },
|
|
483
|
+
max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
|
|
484
|
+
max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200,
|
|
485
|
+
succeed_on_not_found: true
|
|
486
|
+
)
|
|
487
|
+
result_to_return = waiter_result
|
|
488
|
+
|
|
489
|
+
return result_to_return
|
|
490
|
+
rescue StandardError
|
|
491
|
+
raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
|
|
492
|
+
end
|
|
493
|
+
end
|
|
494
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/ParameterLists, Metrics/PerceivedComplexity
|
|
495
|
+
# rubocop:enable Layout/EmptyLines
|
|
496
|
+
|
|
497
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/ParameterLists, Metrics/PerceivedComplexity
|
|
498
|
+
# rubocop:disable Layout/EmptyLines
|
|
499
|
+
|
|
500
|
+
|
|
501
|
+
# Calls {OCI::Core::ComputeClient#instance_action} and then waits for the {OCI::Core::Models::Instance} acted upon
|
|
502
|
+
# to enter the given state(s).
|
|
503
|
+
#
|
|
504
|
+
# @param [String] instance_id The OCID of the instance.
|
|
505
|
+
# @param [String] action The action to perform on the instance.
|
|
506
|
+
# Allowed values are: STOP, START, SOFTRESET, RESET
|
|
507
|
+
# @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::Core::Models::Instance#lifecycle_state}
|
|
508
|
+
# @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::Core::ComputeClient#instance_action}
|
|
509
|
+
# @param [Hash] waiter_opts Optional arguments for the waiter. Keys should be symbols, and the following keys are supported:
|
|
510
|
+
# * max_interval_seconds: The maximum interval between queries, in seconds.
|
|
511
|
+
# * max_wait_seconds The maximum time to wait, in seconds
|
|
512
|
+
#
|
|
513
|
+
# @return [OCI::Response] A {OCI::Response} object with data of type {OCI::Core::Models::Instance}
|
|
514
|
+
def instance_action_and_wait_for_state(instance_id, action, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
|
|
515
|
+
operation_result = @service_client.instance_action(instance_id, action, base_operation_opts)
|
|
516
|
+
|
|
517
|
+
return operation_result if wait_for_states.empty?
|
|
518
|
+
|
|
519
|
+
lowered_wait_for_states = wait_for_states.map(&:downcase)
|
|
520
|
+
wait_for_resource_id = operation_result.data.id
|
|
521
|
+
|
|
522
|
+
begin
|
|
523
|
+
waiter_result = @service_client.get_instance(wait_for_resource_id).wait_until(
|
|
524
|
+
eval_proc: ->(response) { response.data.respond_to?(:lifecycle_state) && lowered_wait_for_states.include?(response.data.lifecycle_state.downcase) },
|
|
525
|
+
max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
|
|
526
|
+
max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
|
|
527
|
+
)
|
|
528
|
+
result_to_return = waiter_result
|
|
529
|
+
|
|
530
|
+
return result_to_return
|
|
531
|
+
rescue StandardError
|
|
532
|
+
raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
|
|
533
|
+
end
|
|
534
|
+
end
|
|
535
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/ParameterLists, Metrics/PerceivedComplexity
|
|
536
|
+
# rubocop:enable Layout/EmptyLines
|
|
537
|
+
|
|
538
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/ParameterLists, Metrics/PerceivedComplexity
|
|
539
|
+
# rubocop:disable Layout/EmptyLines
|
|
540
|
+
|
|
541
|
+
|
|
542
|
+
# Calls {OCI::Core::ComputeClient#launch_instance} and then waits for the {OCI::Core::Models::Instance} acted upon
|
|
543
|
+
# to enter the given state(s).
|
|
544
|
+
#
|
|
545
|
+
# @param [OCI::Core::Models::LaunchInstanceDetails] launch_instance_details Instance details
|
|
546
|
+
# @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::Core::Models::Instance#lifecycle_state}
|
|
547
|
+
# @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::Core::ComputeClient#launch_instance}
|
|
548
|
+
# @param [Hash] waiter_opts Optional arguments for the waiter. Keys should be symbols, and the following keys are supported:
|
|
549
|
+
# * max_interval_seconds: The maximum interval between queries, in seconds.
|
|
550
|
+
# * max_wait_seconds The maximum time to wait, in seconds
|
|
551
|
+
#
|
|
552
|
+
# @return [OCI::Response] A {OCI::Response} object with data of type {OCI::Core::Models::Instance}
|
|
553
|
+
def launch_instance_and_wait_for_state(launch_instance_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
|
|
554
|
+
operation_result = @service_client.launch_instance(launch_instance_details, base_operation_opts)
|
|
555
|
+
|
|
556
|
+
return operation_result if wait_for_states.empty?
|
|
557
|
+
|
|
558
|
+
lowered_wait_for_states = wait_for_states.map(&:downcase)
|
|
559
|
+
wait_for_resource_id = operation_result.data.id
|
|
560
|
+
|
|
561
|
+
begin
|
|
562
|
+
waiter_result = @service_client.get_instance(wait_for_resource_id).wait_until(
|
|
563
|
+
eval_proc: ->(response) { response.data.respond_to?(:lifecycle_state) && lowered_wait_for_states.include?(response.data.lifecycle_state.downcase) },
|
|
564
|
+
max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
|
|
565
|
+
max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
|
|
566
|
+
)
|
|
567
|
+
result_to_return = waiter_result
|
|
568
|
+
|
|
569
|
+
return result_to_return
|
|
570
|
+
rescue StandardError
|
|
571
|
+
raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
|
|
572
|
+
end
|
|
573
|
+
end
|
|
574
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/ParameterLists, Metrics/PerceivedComplexity
|
|
575
|
+
# rubocop:enable Layout/EmptyLines
|
|
576
|
+
|
|
577
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/ParameterLists, Metrics/PerceivedComplexity
|
|
578
|
+
# rubocop:disable Layout/EmptyLines
|
|
579
|
+
|
|
580
|
+
|
|
581
|
+
# Calls {OCI::Core::ComputeClient#terminate_instance} and then waits for the {OCI::Core::Models::Instance} acted upon
|
|
582
|
+
# to enter the given state(s).
|
|
583
|
+
#
|
|
584
|
+
# @param [String] instance_id The OCID of the instance.
|
|
585
|
+
# @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::Core::Models::Instance#lifecycle_state}
|
|
586
|
+
# @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::Core::ComputeClient#terminate_instance}
|
|
587
|
+
# @param [Hash] waiter_opts Optional arguments for the waiter. Keys should be symbols, and the following keys are supported:
|
|
588
|
+
# * max_interval_seconds: The maximum interval between queries, in seconds.
|
|
589
|
+
# * max_wait_seconds The maximum time to wait, in seconds
|
|
590
|
+
#
|
|
591
|
+
# @return [OCI::Response] A {OCI::Response} object with data of type nil
|
|
592
|
+
def terminate_instance_and_wait_for_state(instance_id, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
|
|
593
|
+
initial_get_result = @service_client.get_instance(instance_id)
|
|
594
|
+
operation_result = @service_client.terminate_instance(instance_id, base_operation_opts)
|
|
595
|
+
|
|
596
|
+
return operation_result if wait_for_states.empty?
|
|
597
|
+
|
|
598
|
+
lowered_wait_for_states = wait_for_states.map(&:downcase)
|
|
599
|
+
|
|
600
|
+
begin
|
|
601
|
+
waiter_result = initial_get_result.wait_until(
|
|
602
|
+
eval_proc: ->(response) { response.data.respond_to?(:lifecycle_state) && lowered_wait_for_states.include?(response.data.lifecycle_state.downcase) },
|
|
603
|
+
max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
|
|
604
|
+
max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200,
|
|
605
|
+
succeed_on_not_found: true
|
|
606
|
+
)
|
|
607
|
+
result_to_return = waiter_result
|
|
608
|
+
|
|
609
|
+
return result_to_return
|
|
610
|
+
rescue StandardError
|
|
611
|
+
raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
|
|
612
|
+
end
|
|
613
|
+
end
|
|
614
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/ParameterLists, Metrics/PerceivedComplexity
|
|
615
|
+
# rubocop:enable Layout/EmptyLines
|
|
616
|
+
|
|
617
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/ParameterLists, Metrics/PerceivedComplexity
|
|
618
|
+
# rubocop:disable Layout/EmptyLines
|
|
619
|
+
|
|
620
|
+
|
|
621
|
+
# Calls {OCI::Core::ComputeClient#update_console_history} and then waits for the {OCI::Core::Models::ConsoleHistory} acted upon
|
|
622
|
+
# to enter the given state(s).
|
|
623
|
+
#
|
|
624
|
+
# @param [String] instance_console_history_id The OCID of the console history.
|
|
625
|
+
# @param [OCI::Core::Models::UpdateConsoleHistoryDetails] update_console_history_details Update instance fields
|
|
626
|
+
# @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::Core::Models::ConsoleHistory#lifecycle_state}
|
|
627
|
+
# @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::Core::ComputeClient#update_console_history}
|
|
628
|
+
# @param [Hash] waiter_opts Optional arguments for the waiter. Keys should be symbols, and the following keys are supported:
|
|
629
|
+
# * max_interval_seconds: The maximum interval between queries, in seconds.
|
|
630
|
+
# * max_wait_seconds The maximum time to wait, in seconds
|
|
631
|
+
#
|
|
632
|
+
# @return [OCI::Response] A {OCI::Response} object with data of type {OCI::Core::Models::ConsoleHistory}
|
|
633
|
+
def update_console_history_and_wait_for_state(instance_console_history_id, update_console_history_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
|
|
634
|
+
operation_result = @service_client.update_console_history(instance_console_history_id, update_console_history_details, base_operation_opts)
|
|
635
|
+
|
|
636
|
+
return operation_result if wait_for_states.empty?
|
|
637
|
+
|
|
638
|
+
lowered_wait_for_states = wait_for_states.map(&:downcase)
|
|
639
|
+
wait_for_resource_id = operation_result.data.id
|
|
640
|
+
|
|
641
|
+
begin
|
|
642
|
+
waiter_result = @service_client.get_console_history(wait_for_resource_id).wait_until(
|
|
643
|
+
eval_proc: ->(response) { response.data.respond_to?(:lifecycle_state) && lowered_wait_for_states.include?(response.data.lifecycle_state.downcase) },
|
|
644
|
+
max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
|
|
645
|
+
max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
|
|
646
|
+
)
|
|
647
|
+
result_to_return = waiter_result
|
|
648
|
+
|
|
649
|
+
return result_to_return
|
|
650
|
+
rescue StandardError
|
|
651
|
+
raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
|
|
652
|
+
end
|
|
653
|
+
end
|
|
654
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/ParameterLists, Metrics/PerceivedComplexity
|
|
655
|
+
# rubocop:enable Layout/EmptyLines
|
|
656
|
+
|
|
657
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/ParameterLists, Metrics/PerceivedComplexity
|
|
658
|
+
# rubocop:disable Layout/EmptyLines
|
|
659
|
+
|
|
660
|
+
|
|
661
|
+
# Calls {OCI::Core::ComputeClient#update_image} and then waits for the {OCI::Core::Models::Image} acted upon
|
|
662
|
+
# to enter the given state(s).
|
|
663
|
+
#
|
|
664
|
+
# @param [String] image_id The OCID of the image.
|
|
665
|
+
# @param [OCI::Core::Models::UpdateImageDetails] update_image_details Updates the image display name field. Avoid entering confidential information.
|
|
666
|
+
# @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::Core::Models::Image#lifecycle_state}
|
|
667
|
+
# @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::Core::ComputeClient#update_image}
|
|
668
|
+
# @param [Hash] waiter_opts Optional arguments for the waiter. Keys should be symbols, and the following keys are supported:
|
|
669
|
+
# * max_interval_seconds: The maximum interval between queries, in seconds.
|
|
670
|
+
# * max_wait_seconds The maximum time to wait, in seconds
|
|
671
|
+
#
|
|
672
|
+
# @return [OCI::Response] A {OCI::Response} object with data of type {OCI::Core::Models::Image}
|
|
673
|
+
def update_image_and_wait_for_state(image_id, update_image_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
|
|
674
|
+
operation_result = @service_client.update_image(image_id, update_image_details, base_operation_opts)
|
|
675
|
+
|
|
676
|
+
return operation_result if wait_for_states.empty?
|
|
677
|
+
|
|
678
|
+
lowered_wait_for_states = wait_for_states.map(&:downcase)
|
|
679
|
+
wait_for_resource_id = operation_result.data.id
|
|
680
|
+
|
|
681
|
+
begin
|
|
682
|
+
waiter_result = @service_client.get_image(wait_for_resource_id).wait_until(
|
|
683
|
+
eval_proc: ->(response) { response.data.respond_to?(:lifecycle_state) && lowered_wait_for_states.include?(response.data.lifecycle_state.downcase) },
|
|
684
|
+
max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
|
|
685
|
+
max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
|
|
686
|
+
)
|
|
687
|
+
result_to_return = waiter_result
|
|
688
|
+
|
|
689
|
+
return result_to_return
|
|
690
|
+
rescue StandardError
|
|
691
|
+
raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
|
|
692
|
+
end
|
|
693
|
+
end
|
|
694
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/ParameterLists, Metrics/PerceivedComplexity
|
|
695
|
+
# rubocop:enable Layout/EmptyLines
|
|
696
|
+
|
|
697
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/ParameterLists, Metrics/PerceivedComplexity
|
|
698
|
+
# rubocop:disable Layout/EmptyLines
|
|
699
|
+
|
|
700
|
+
|
|
701
|
+
# Calls {OCI::Core::ComputeClient#update_instance} and then waits for the {OCI::Core::Models::Instance} acted upon
|
|
702
|
+
# to enter the given state(s).
|
|
703
|
+
#
|
|
704
|
+
# @param [String] instance_id The OCID of the instance.
|
|
705
|
+
# @param [OCI::Core::Models::UpdateInstanceDetails] update_instance_details Update instance fields
|
|
706
|
+
# @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::Core::Models::Instance#lifecycle_state}
|
|
707
|
+
# @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::Core::ComputeClient#update_instance}
|
|
708
|
+
# @param [Hash] waiter_opts Optional arguments for the waiter. Keys should be symbols, and the following keys are supported:
|
|
709
|
+
# * max_interval_seconds: The maximum interval between queries, in seconds.
|
|
710
|
+
# * max_wait_seconds The maximum time to wait, in seconds
|
|
711
|
+
#
|
|
712
|
+
# @return [OCI::Response] A {OCI::Response} object with data of type {OCI::Core::Models::Instance}
|
|
713
|
+
def update_instance_and_wait_for_state(instance_id, update_instance_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
|
|
714
|
+
operation_result = @service_client.update_instance(instance_id, update_instance_details, base_operation_opts)
|
|
715
|
+
|
|
716
|
+
return operation_result if wait_for_states.empty?
|
|
717
|
+
|
|
718
|
+
lowered_wait_for_states = wait_for_states.map(&:downcase)
|
|
719
|
+
wait_for_resource_id = operation_result.data.id
|
|
720
|
+
|
|
721
|
+
begin
|
|
722
|
+
waiter_result = @service_client.get_instance(wait_for_resource_id).wait_until(
|
|
723
|
+
eval_proc: ->(response) { response.data.respond_to?(:lifecycle_state) && lowered_wait_for_states.include?(response.data.lifecycle_state.downcase) },
|
|
724
|
+
max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
|
|
725
|
+
max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
|
|
726
|
+
)
|
|
727
|
+
result_to_return = waiter_result
|
|
728
|
+
|
|
729
|
+
return result_to_return
|
|
730
|
+
rescue StandardError
|
|
731
|
+
raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
|
|
732
|
+
end
|
|
733
|
+
end
|
|
734
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/ParameterLists, Metrics/PerceivedComplexity
|
|
735
|
+
# rubocop:enable Layout/EmptyLines
|
|
736
|
+
end
|
|
737
|
+
end
|
|
738
|
+
# rubocop:enable Lint/UnneededCopDisableDirective, Metrics/LineLength
|