1# coding: utf-8 2# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. 3# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. 4 5from __future__ import absolute_import 6 7from oci._vendor import requests # noqa: F401 8from oci._vendor import six 9 10from oci import retry, circuit_breaker # noqa: F401 11from oci.base_client import BaseClient 12from oci.config import get_config_value_or_default, validate_config 13from oci.signer import Signer 14from oci.util import Sentinel, get_signer_from_authentication_type, AUTHENTICATION_TYPE_FIELD_NAME 15from .models import core_type_mapping 16missing = Sentinel("Missing") 17 18 19class BlockstorageClient(object): 20 """ 21 Use the Core Services API to manage resources such as virtual cloud networks (VCNs), 22 compute instances, and block storage volumes. For more information, see the console 23 documentation for the [Networking](/iaas/Content/Network/Concepts/overview.htm), 24 [Compute](/iaas/Content/Compute/Concepts/computeoverview.htm), and 25 [Block Volume](/iaas/Content/Block/Concepts/overview.htm) services. 26 """ 27 28 def __init__(self, config, **kwargs): 29 """ 30 Creates a new service client 31 32 :param dict config: 33 Configuration keys and values as per `SDK and Tool Configuration <https://docs.cloud.oracle.com/Content/API/Concepts/sdkconfig.htm>`__. 34 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 35 the dict using :py:meth:`~oci.config.validate_config` 36 37 :param str service_endpoint: (optional) 38 The endpoint of the service to call using this client. For example ``https://iaas.us-ashburn-1.oraclecloud.com``. If this keyword argument is 39 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 40 need to specify a service endpoint. 41 42 :param timeout: (optional) 43 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 44 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 45 a tuple is provided then the first value is used as the connection timeout and the second value as the read timeout. 46 :type timeout: float or tuple(float, float) 47 48 :param signer: (optional) 49 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 50 provided in the config parameter. 51 52 One use case for this parameter is for `Instance Principals authentication <https://docs.cloud.oracle.com/Content/Identity/Tasks/callingservicesfrominstances.htm>`__ 53 by passing an instance of :py:class:`~oci.auth.signers.InstancePrincipalsSecurityTokenSigner` as the value for this keyword argument 54 :type signer: :py:class:`~oci.signer.AbstractBaseSigner` 55 56 :param obj retry_strategy: (optional) 57 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. 58 Retry strategies can also be applied at the operation level by passing a ``retry_strategy`` keyword argument as part of calling the operation. 59 Any value provided at the operation level will override whatever is specified at the client level. 60 61 This should be one of the strategies available in the :py:mod:`~oci.retry` module. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` 62 is also available. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. 63 64 :param obj circuit_breaker_strategy: (optional) 65 A circuit breaker strategy to apply to all calls made by this service client (i.e. at the client level). 66 This client uses :py:data:`~oci.circuit_breaker.DEFAULT_CIRCUIT_BREAKER_STRATEGY` as default if no circuit breaker strategy is provided. 67 The specifics of circuit breaker strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/circuit_breakers.html>`__. 68 69 :param function circuit_breaker_callback: (optional) 70 Callback function to receive any exceptions triggerred by the circuit breaker. 71 """ 72 validate_config(config, signer=kwargs.get('signer')) 73 if 'signer' in kwargs: 74 signer = kwargs['signer'] 75 76 elif AUTHENTICATION_TYPE_FIELD_NAME in config: 77 signer = get_signer_from_authentication_type(config) 78 79 else: 80 signer = Signer( 81 tenancy=config["tenancy"], 82 user=config["user"], 83 fingerprint=config["fingerprint"], 84 private_key_file_location=config.get("key_file"), 85 pass_phrase=get_config_value_or_default(config, "pass_phrase"), 86 private_key_content=config.get("key_content") 87 ) 88 89 base_client_init_kwargs = { 90 'regional_client': True, 91 'service_endpoint': kwargs.get('service_endpoint'), 92 'base_path': '/20160918', 93 'service_endpoint_template': 'https://iaas.{region}.{secondLevelDomain}', 94 'skip_deserialization': kwargs.get('skip_deserialization', False), 95 'circuit_breaker_strategy': kwargs.get('circuit_breaker_strategy', circuit_breaker.GLOBAL_CIRCUIT_BREAKER_STRATEGY) 96 } 97 if 'timeout' in kwargs: 98 base_client_init_kwargs['timeout'] = kwargs.get('timeout') 99 if base_client_init_kwargs.get('circuit_breaker_strategy') is None: 100 base_client_init_kwargs['circuit_breaker_strategy'] = circuit_breaker.DEFAULT_CIRCUIT_BREAKER_STRATEGY 101 self.base_client = BaseClient("blockstorage", config, signer, core_type_mapping, **base_client_init_kwargs) 102 self.retry_strategy = kwargs.get('retry_strategy') 103 self.circuit_breaker_callback = kwargs.get('circuit_breaker_callback') 104 self._config = config 105 self._kwargs = kwargs 106 107 def change_boot_volume_backup_compartment(self, boot_volume_backup_id, change_boot_volume_backup_compartment_details, **kwargs): 108 """ 109 Moves a boot volume backup into a different compartment within the same tenancy. 110 For information about moving resources between compartments, 111 see `Moving Resources to a Different Compartment`__. 112 113 __ https://docs.cloud.oracle.com/iaas/Content/Identity/Tasks/managingcompartments.htm#moveRes 114 115 116 :param str boot_volume_backup_id: (required) 117 The OCID of the boot volume backup. 118 119 :param oci.core.models.ChangeBootVolumeBackupCompartmentDetails change_boot_volume_backup_compartment_details: (required) 120 Request to change the compartment of given boot volume backup. 121 122 :param str opc_request_id: (optional) 123 Unique identifier for the request. 124 If you need to contact Oracle about a particular request, please provide the request ID. 125 126 :param obj retry_strategy: (optional) 127 A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. 128 129 This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. 130 The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. 131 132 To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. 133 134 :return: A :class:`~oci.response.Response` object with data of type None 135 :rtype: :class:`~oci.response.Response` 136 137 :example: 138 Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.53.1/core/change_boot_volume_backup_compartment.py.html>`__ to see an example of how to use change_boot_volume_backup_compartment API. 139 """ 140 resource_path = "/bootVolumeBackups/{bootVolumeBackupId}/actions/changeCompartment" 141 method = "POST" 142 143 # Don't accept unknown kwargs 144 expected_kwargs = [ 145 "retry_strategy", 146 "opc_request_id" 147 ] 148 extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] 149 if extra_kwargs: 150 raise ValueError( 151 "change_boot_volume_backup_compartment got unknown kwargs: {!r}".format(extra_kwargs)) 152 153 path_params = { 154 "bootVolumeBackupId": boot_volume_backup_id 155 } 156 157 path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} 158 159 for (k, v) in six.iteritems(path_params): 160 if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): 161 raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k)) 162 163 header_params = { 164 "accept": "application/json", 165 "content-type": "application/json", 166 "opc-request-id": kwargs.get("opc_request_id", missing) 167 } 168 header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} 169 170 retry_strategy = self.base_client.get_preferred_retry_strategy( 171 operation_retry_strategy=kwargs.get('retry_strategy'), 172 client_retry_strategy=self.retry_strategy 173 ) 174 175 if retry_strategy: 176 if not isinstance(retry_strategy, retry.NoneRetryStrategy): 177 self.base_client.add_opc_client_retries_header(header_params) 178 retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) 179 return retry_strategy.make_retrying_call( 180 self.base_client.call_api, 181 resource_path=resource_path, 182 method=method, 183 path_params=path_params, 184 header_params=header_params, 185 body=change_boot_volume_backup_compartment_details) 186 else: 187 return self.base_client.call_api( 188 resource_path=resource_path, 189 method=method, 190 path_params=path_params, 191 header_params=header_params, 192 body=change_boot_volume_backup_compartment_details) 193 194 def change_boot_volume_compartment(self, boot_volume_id, change_boot_volume_compartment_details, **kwargs): 195 """ 196 Moves a boot volume into a different compartment within the same tenancy. 197 For information about moving resources between compartments, 198 see `Moving Resources to a Different Compartment`__. 199 200 __ https://docs.cloud.oracle.com/iaas/Content/Identity/Tasks/managingcompartments.htm#moveRes 201 202 203 :param str boot_volume_id: (required) 204 The OCID of the boot volume. 205 206 :param oci.core.models.ChangeBootVolumeCompartmentDetails change_boot_volume_compartment_details: (required) 207 Request to change the compartment of given boot volume. 208 209 :param str opc_request_id: (optional) 210 Unique identifier for the request. 211 If you need to contact Oracle about a particular request, please provide the request ID. 212 213 :param obj retry_strategy: (optional) 214 A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. 215 216 This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. 217 The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. 218 219 To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. 220 221 :return: A :class:`~oci.response.Response` object with data of type None 222 :rtype: :class:`~oci.response.Response` 223 224 :example: 225 Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.53.1/core/change_boot_volume_compartment.py.html>`__ to see an example of how to use change_boot_volume_compartment API. 226 """ 227 resource_path = "/bootVolumes/{bootVolumeId}/actions/changeCompartment" 228 method = "POST" 229 230 # Don't accept unknown kwargs 231 expected_kwargs = [ 232 "retry_strategy", 233 "opc_request_id" 234 ] 235 extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] 236 if extra_kwargs: 237 raise ValueError( 238 "change_boot_volume_compartment got unknown kwargs: {!r}".format(extra_kwargs)) 239 240 path_params = { 241 "bootVolumeId": boot_volume_id 242 } 243 244 path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} 245 246 for (k, v) in six.iteritems(path_params): 247 if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): 248 raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k)) 249 250 header_params = { 251 "accept": "application/json", 252 "content-type": "application/json", 253 "opc-request-id": kwargs.get("opc_request_id", missing) 254 } 255 header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} 256 257 retry_strategy = self.base_client.get_preferred_retry_strategy( 258 operation_retry_strategy=kwargs.get('retry_strategy'), 259 client_retry_strategy=self.retry_strategy 260 ) 261 262 if retry_strategy: 263 if not isinstance(retry_strategy, retry.NoneRetryStrategy): 264 self.base_client.add_opc_client_retries_header(header_params) 265 retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) 266 return retry_strategy.make_retrying_call( 267 self.base_client.call_api, 268 resource_path=resource_path, 269 method=method, 270 path_params=path_params, 271 header_params=header_params, 272 body=change_boot_volume_compartment_details) 273 else: 274 return self.base_client.call_api( 275 resource_path=resource_path, 276 method=method, 277 path_params=path_params, 278 header_params=header_params, 279 body=change_boot_volume_compartment_details) 280 281 def change_volume_backup_compartment(self, volume_backup_id, change_volume_backup_compartment_details, **kwargs): 282 """ 283 Moves a volume backup into a different compartment within the same tenancy. 284 For information about moving resources between compartments, 285 see `Moving Resources to a Different Compartment`__. 286 287 __ https://docs.cloud.oracle.com/iaas/Content/Identity/Tasks/managingcompartments.htm#moveRes 288 289 290 :param str volume_backup_id: (required) 291 The OCID of the volume backup. 292 293 :param oci.core.models.ChangeVolumeBackupCompartmentDetails change_volume_backup_compartment_details: (required) 294 Request to change the compartment of given volume backup. 295 296 :param str opc_request_id: (optional) 297 Unique identifier for the request. 298 If you need to contact Oracle about a particular request, please provide the request ID. 299 300 :param obj retry_strategy: (optional) 301 A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. 302 303 This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. 304 The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. 305 306 To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. 307 308 :return: A :class:`~oci.response.Response` object with data of type None 309 :rtype: :class:`~oci.response.Response` 310 311 :example: 312 Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.53.1/core/change_volume_backup_compartment.py.html>`__ to see an example of how to use change_volume_backup_compartment API. 313 """ 314 resource_path = "/volumeBackups/{volumeBackupId}/actions/changeCompartment" 315 method = "POST" 316 317 # Don't accept unknown kwargs 318 expected_kwargs = [ 319 "retry_strategy", 320 "opc_request_id" 321 ] 322 extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] 323 if extra_kwargs: 324 raise ValueError( 325 "change_volume_backup_compartment got unknown kwargs: {!r}".format(extra_kwargs)) 326 327 path_params = { 328 "volumeBackupId": volume_backup_id 329 } 330 331 path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} 332 333 for (k, v) in six.iteritems(path_params): 334 if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): 335 raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k)) 336 337 header_params = { 338 "accept": "application/json", 339 "content-type": "application/json", 340 "opc-request-id": kwargs.get("opc_request_id", missing) 341 } 342 header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} 343 344 retry_strategy = self.base_client.get_preferred_retry_strategy( 345 operation_retry_strategy=kwargs.get('retry_strategy'), 346 client_retry_strategy=self.retry_strategy 347 ) 348 349 if retry_strategy: 350 if not isinstance(retry_strategy, retry.NoneRetryStrategy): 351 self.base_client.add_opc_client_retries_header(header_params) 352 retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) 353 return retry_strategy.make_retrying_call( 354 self.base_client.call_api, 355 resource_path=resource_path, 356 method=method, 357 path_params=path_params, 358 header_params=header_params, 359 body=change_volume_backup_compartment_details) 360 else: 361 return self.base_client.call_api( 362 resource_path=resource_path, 363 method=method, 364 path_params=path_params, 365 header_params=header_params, 366 body=change_volume_backup_compartment_details) 367 368 def change_volume_compartment(self, volume_id, change_volume_compartment_details, **kwargs): 369 """ 370 Moves a volume into a different compartment within the same tenancy. 371 For information about moving resources between compartments, 372 see `Moving Resources to a Different Compartment`__. 373 374 __ https://docs.cloud.oracle.com/iaas/Content/Identity/Tasks/managingcompartments.htm#moveRes 375 376 377 :param str volume_id: (required) 378 The OCID of the volume. 379 380 :param oci.core.models.ChangeVolumeCompartmentDetails change_volume_compartment_details: (required) 381 Request to change the compartment of given volume. 382 383 :param str opc_request_id: (optional) 384 Unique identifier for the request. 385 If you need to contact Oracle about a particular request, please provide the request ID. 386 387 :param obj retry_strategy: (optional) 388 A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. 389 390 This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. 391 The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. 392 393 To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. 394 395 :return: A :class:`~oci.response.Response` object with data of type None 396 :rtype: :class:`~oci.response.Response` 397 398 :example: 399 Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.53.1/core/change_volume_compartment.py.html>`__ to see an example of how to use change_volume_compartment API. 400 """ 401 resource_path = "/volumes/{volumeId}/actions/changeCompartment" 402 method = "POST" 403 404 # Don't accept unknown kwargs 405 expected_kwargs = [ 406 "retry_strategy", 407 "opc_request_id" 408 ] 409 extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] 410 if extra_kwargs: 411 raise ValueError( 412 "change_volume_compartment got unknown kwargs: {!r}".format(extra_kwargs)) 413 414 path_params = { 415 "volumeId": volume_id 416 } 417 418 path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} 419 420 for (k, v) in six.iteritems(path_params): 421 if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): 422 raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k)) 423 424 header_params = { 425 "accept": "application/json", 426 "content-type": "application/json", 427 "opc-request-id": kwargs.get("opc_request_id", missing) 428 } 429 header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} 430 431 retry_strategy = self.base_client.get_preferred_retry_strategy( 432 operation_retry_strategy=kwargs.get('retry_strategy'), 433 client_retry_strategy=self.retry_strategy 434 ) 435 436 if retry_strategy: 437 if not isinstance(retry_strategy, retry.NoneRetryStrategy): 438 self.base_client.add_opc_client_retries_header(header_params) 439 retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) 440 return retry_strategy.make_retrying_call( 441 self.base_client.call_api, 442 resource_path=resource_path, 443 method=method, 444 path_params=path_params, 445 header_params=header_params, 446 body=change_volume_compartment_details) 447 else: 448 return self.base_client.call_api( 449 resource_path=resource_path, 450 method=method, 451 path_params=path_params, 452 header_params=header_params, 453 body=change_volume_compartment_details) 454 455 def change_volume_group_backup_compartment(self, volume_group_backup_id, change_volume_group_backup_compartment_details, **kwargs): 456 """ 457 Moves a volume group backup into a different compartment within the same tenancy. 458 For information about moving resources between compartments, 459 see `Moving Resources to a Different Compartment`__. 460 461 __ https://docs.cloud.oracle.com/iaas/Content/Identity/Tasks/managingcompartments.htm#moveRes 462 463 464 :param str volume_group_backup_id: (required) 465 The Oracle Cloud ID (OCID) that uniquely identifies the volume group backup. 466 467 :param oci.core.models.ChangeVolumeGroupBackupCompartmentDetails change_volume_group_backup_compartment_details: (required) 468 Request to change the compartment of given volume group backup. 469 470 :param str opc_request_id: (optional) 471 Unique identifier for the request. 472 If you need to contact Oracle about a particular request, please provide the request ID. 473 474 :param obj retry_strategy: (optional) 475 A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. 476 477 This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. 478 The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. 479 480 To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. 481 482 :return: A :class:`~oci.response.Response` object with data of type None 483 :rtype: :class:`~oci.response.Response` 484 485 :example: 486 Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.53.1/core/change_volume_group_backup_compartment.py.html>`__ to see an example of how to use change_volume_group_backup_compartment API. 487 """ 488 resource_path = "/volumeGroupBackups/{volumeGroupBackupId}/actions/changeCompartment" 489 method = "POST" 490 491 # Don't accept unknown kwargs 492 expected_kwargs = [ 493 "retry_strategy", 494 "opc_request_id" 495 ] 496 extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] 497 if extra_kwargs: 498 raise ValueError( 499 "change_volume_group_backup_compartment got unknown kwargs: {!r}".format(extra_kwargs)) 500 501 path_params = { 502 "volumeGroupBackupId": volume_group_backup_id 503 } 504 505 path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} 506 507 for (k, v) in six.iteritems(path_params): 508 if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): 509 raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k)) 510 511 header_params = { 512 "accept": "application/json", 513 "content-type": "application/json", 514 "opc-request-id": kwargs.get("opc_request_id", missing) 515 } 516 header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} 517 518 retry_strategy = self.base_client.get_preferred_retry_strategy( 519 operation_retry_strategy=kwargs.get('retry_strategy'), 520 client_retry_strategy=self.retry_strategy 521 ) 522 523 if retry_strategy: 524 if not isinstance(retry_strategy, retry.NoneRetryStrategy): 525 self.base_client.add_opc_client_retries_header(header_params) 526 retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) 527 return retry_strategy.make_retrying_call( 528 self.base_client.call_api, 529 resource_path=resource_path, 530 method=method, 531 path_params=path_params, 532 header_params=header_params, 533 body=change_volume_group_backup_compartment_details) 534 else: 535 return self.base_client.call_api( 536 resource_path=resource_path, 537 method=method, 538 path_params=path_params, 539 header_params=header_params, 540 body=change_volume_group_backup_compartment_details) 541 542 def change_volume_group_compartment(self, volume_group_id, change_volume_group_compartment_details, **kwargs): 543 """ 544 Moves a volume group into a different compartment within the same tenancy. 545 For information about moving resources between compartments, 546 see `Moving Resources to a Different Compartment`__. 547 548 __ https://docs.cloud.oracle.com/iaas/Content/Identity/Tasks/managingcompartments.htm#moveRes 549 550 551 :param str volume_group_id: (required) 552 The Oracle Cloud ID (OCID) that uniquely identifies the volume group. 553 554 :param oci.core.models.ChangeVolumeGroupCompartmentDetails change_volume_group_compartment_details: (required) 555 Request to change the compartment of given volume group. 556 557 :param str opc_request_id: (optional) 558 Unique identifier for the request. 559 If you need to contact Oracle about a particular request, please provide the request ID. 560 561 :param obj retry_strategy: (optional) 562 A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. 563 564 This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. 565 The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. 566 567 To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. 568 569 :return: A :class:`~oci.response.Response` object with data of type None 570 :rtype: :class:`~oci.response.Response` 571 572 :example: 573 Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.53.1/core/change_volume_group_compartment.py.html>`__ to see an example of how to use change_volume_group_compartment API. 574 """ 575 resource_path = "/volumeGroups/{volumeGroupId}/actions/changeCompartment" 576 method = "POST" 577 578 # Don't accept unknown kwargs 579 expected_kwargs = [ 580 "retry_strategy", 581 "opc_request_id" 582 ] 583 extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] 584 if extra_kwargs: 585 raise ValueError( 586 "change_volume_group_compartment got unknown kwargs: {!r}".format(extra_kwargs)) 587 588 path_params = { 589 "volumeGroupId": volume_group_id 590 } 591 592 path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} 593 594 for (k, v) in six.iteritems(path_params): 595 if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): 596 raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k)) 597 598 header_params = { 599 "accept": "application/json", 600 "content-type": "application/json", 601 "opc-request-id": kwargs.get("opc_request_id", missing) 602 } 603 header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} 604 605 retry_strategy = self.base_client.get_preferred_retry_strategy( 606 operation_retry_strategy=kwargs.get('retry_strategy'), 607 client_retry_strategy=self.retry_strategy 608 ) 609 610 if retry_strategy: 611 if not isinstance(retry_strategy, retry.NoneRetryStrategy): 612 self.base_client.add_opc_client_retries_header(header_params) 613 retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) 614 return retry_strategy.make_retrying_call( 615 self.base_client.call_api, 616 resource_path=resource_path, 617 method=method, 618 path_params=path_params, 619 header_params=header_params, 620 body=change_volume_group_compartment_details) 621 else: 622 return self.base_client.call_api( 623 resource_path=resource_path, 624 method=method, 625 path_params=path_params, 626 header_params=header_params, 627 body=change_volume_group_compartment_details) 628 629 def copy_boot_volume_backup(self, boot_volume_backup_id, copy_boot_volume_backup_details, **kwargs): 630 """ 631 Creates a boot volume backup copy in specified region. For general information about volume backups, 632 see `Overview of Boot Volume Backups`__ 633 634 __ https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/bootvolumebackups.htm 635 636 637 :param str boot_volume_backup_id: (required) 638 The OCID of the boot volume backup. 639 640 :param oci.core.models.CopyBootVolumeBackupDetails copy_boot_volume_backup_details: (required) 641 Request to create a cross-region copy of given boot volume backup. 642 643 :param str opc_retry_token: (optional) 644 A token that uniquely identifies a request so it can be retried in case of a timeout or 645 server error without risk of executing that same action again. Retry tokens expire after 24 646 hours, but can be invalidated before then due to conflicting operations (for example, if a resource 647 has been deleted and purged from the system, then a retry of the original creation request 648 may be rejected). 649 650 :param str opc_request_id: (optional) 651 Unique identifier for the request. 652 If you need to contact Oracle about a particular request, please provide the request ID. 653 654 :param obj retry_strategy: (optional) 655 A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. 656 657 This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. 658 The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. 659 660 To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. 661 662 :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.core.models.BootVolumeBackup` 663 :rtype: :class:`~oci.response.Response` 664 665 :example: 666 Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.53.1/core/copy_boot_volume_backup.py.html>`__ to see an example of how to use copy_boot_volume_backup API. 667 """ 668 resource_path = "/bootVolumeBackups/{bootVolumeBackupId}/actions/copy" 669 method = "POST" 670 671 # Don't accept unknown kwargs 672 expected_kwargs = [ 673 "retry_strategy", 674 "opc_retry_token", 675 "opc_request_id" 676 ] 677 extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] 678 if extra_kwargs: 679 raise ValueError( 680 "copy_boot_volume_backup got unknown kwargs: {!r}".format(extra_kwargs)) 681 682 path_params = { 683 "bootVolumeBackupId": boot_volume_backup_id 684 } 685 686 path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} 687 688 for (k, v) in six.iteritems(path_params): 689 if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): 690 raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k)) 691 692 header_params = { 693 "accept": "application/json", 694 "content-type": "application/json", 695 "opc-retry-token": kwargs.get("opc_retry_token", missing), 696 "opc-request-id": kwargs.get("opc_request_id", missing) 697 } 698 header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} 699 700 retry_strategy = self.base_client.get_preferred_retry_strategy( 701 operation_retry_strategy=kwargs.get('retry_strategy'), 702 client_retry_strategy=self.retry_strategy 703 ) 704 705 if retry_strategy: 706 if not isinstance(retry_strategy, retry.NoneRetryStrategy): 707 self.base_client.add_opc_retry_token_if_needed(header_params) 708 self.base_client.add_opc_client_retries_header(header_params) 709 retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) 710 return retry_strategy.make_retrying_call( 711 self.base_client.call_api, 712 resource_path=resource_path, 713 method=method, 714 path_params=path_params, 715 header_params=header_params, 716 body=copy_boot_volume_backup_details, 717 response_type="BootVolumeBackup") 718 else: 719 return self.base_client.call_api( 720 resource_path=resource_path, 721 method=method, 722 path_params=path_params, 723 header_params=header_params, 724 body=copy_boot_volume_backup_details, 725 response_type="BootVolumeBackup") 726 727 def copy_volume_backup(self, volume_backup_id, copy_volume_backup_details, **kwargs): 728 """ 729 Creates a volume backup copy in specified region. For general information about volume backups, 730 see `Overview of Block Volume Service Backups`__ 731 732 __ https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/blockvolumebackups.htm 733 734 735 :param str volume_backup_id: (required) 736 The OCID of the volume backup. 737 738 :param oci.core.models.CopyVolumeBackupDetails copy_volume_backup_details: (required) 739 Request to create a cross-region copy of given backup. 740 741 :param str opc_retry_token: (optional) 742 A token that uniquely identifies a request so it can be retried in case of a timeout or 743 server error without risk of executing that same action again. Retry tokens expire after 24 744 hours, but can be invalidated before then due to conflicting operations (for example, if a resource 745 has been deleted and purged from the system, then a retry of the original creation request 746 may be rejected). 747 748 :param str opc_request_id: (optional) 749 Unique identifier for the request. 750 If you need to contact Oracle about a particular request, please provide the request ID. 751 752 :param obj retry_strategy: (optional) 753 A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. 754 755 This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. 756 The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. 757 758 To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. 759 760 :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.core.models.VolumeBackup` 761 :rtype: :class:`~oci.response.Response` 762 763 :example: 764 Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.53.1/core/copy_volume_backup.py.html>`__ to see an example of how to use copy_volume_backup API. 765 """ 766 resource_path = "/volumeBackups/{volumeBackupId}/actions/copy" 767 method = "POST" 768 769 # Don't accept unknown kwargs 770 expected_kwargs = [ 771 "retry_strategy", 772 "opc_retry_token", 773 "opc_request_id" 774 ] 775 extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] 776 if extra_kwargs: 777 raise ValueError( 778 "copy_volume_backup got unknown kwargs: {!r}".format(extra_kwargs)) 779 780 path_params = { 781 "volumeBackupId": volume_backup_id 782 } 783 784 path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} 785 786 for (k, v) in six.iteritems(path_params): 787 if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): 788 raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k)) 789 790 header_params = { 791 "accept": "application/json", 792 "content-type": "application/json", 793 "opc-retry-token": kwargs.get("opc_retry_token", missing), 794 "opc-request-id": kwargs.get("opc_request_id", missing) 795 } 796 header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} 797 798 retry_strategy = self.base_client.get_preferred_retry_strategy( 799 operation_retry_strategy=kwargs.get('retry_strategy'), 800 client_retry_strategy=self.retry_strategy 801 ) 802 803 if retry_strategy: 804 if not isinstance(retry_strategy, retry.NoneRetryStrategy): 805 self.base_client.add_opc_retry_token_if_needed(header_params) 806 self.base_client.add_opc_client_retries_header(header_params) 807 retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) 808 return retry_strategy.make_retrying_call( 809 self.base_client.call_api, 810 resource_path=resource_path, 811 method=method, 812 path_params=path_params, 813 header_params=header_params, 814 body=copy_volume_backup_details, 815 response_type="VolumeBackup") 816 else: 817 return self.base_client.call_api( 818 resource_path=resource_path, 819 method=method, 820 path_params=path_params, 821 header_params=header_params, 822 body=copy_volume_backup_details, 823 response_type="VolumeBackup") 824 825 def copy_volume_group_backup(self, volume_group_backup_id, copy_volume_group_backup_details, **kwargs): 826 """ 827 Creates a volume group backup copy in specified region. For general information about volume group backups, 828 see `Overview of Block Volume Service Backups`__ 829 830 __ https://docs.cloud.oracle.com/Content/Block/Concepts/blockvolumebackups.htm 831 832 833 :param str volume_group_backup_id: (required) 834 The Oracle Cloud ID (OCID) that uniquely identifies the volume group backup. 835 836 :param oci.core.models.CopyVolumeGroupBackupDetails copy_volume_group_backup_details: (required) 837 Request to create a cross-region copy of given volume group backup. 838 839 :param str opc_retry_token: (optional) 840 A token that uniquely identifies a request so it can be retried in case of a timeout or 841 server error without risk of executing that same action again. Retry tokens expire after 24 842 hours, but can be invalidated before then due to conflicting operations (for example, if a resource 843 has been deleted and purged from the system, then a retry of the original creation request 844 may be rejected). 845 846 :param str opc_request_id: (optional) 847 Unique identifier for the request. 848 If you need to contact Oracle about a particular request, please provide the request ID. 849 850 :param obj retry_strategy: (optional) 851 A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. 852 853 This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. 854 The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. 855 856 To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. 857 858 :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.core.models.VolumeGroupBackup` 859 :rtype: :class:`~oci.response.Response` 860 861 :example: 862 Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.53.1/core/copy_volume_group_backup.py.html>`__ to see an example of how to use copy_volume_group_backup API. 863 """ 864 resource_path = "/volumeGroupBackups/{volumeGroupBackupId}/actions/copy" 865 method = "POST" 866 867 # Don't accept unknown kwargs 868 expected_kwargs = [ 869 "retry_strategy", 870 "opc_retry_token", 871 "opc_request_id" 872 ] 873 extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] 874 if extra_kwargs: 875 raise ValueError( 876 "copy_volume_group_backup got unknown kwargs: {!r}".format(extra_kwargs)) 877 878 path_params = { 879 "volumeGroupBackupId": volume_group_backup_id 880 } 881 882 path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} 883 884 for (k, v) in six.iteritems(path_params): 885 if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): 886 raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k)) 887 888 header_params = { 889 "accept": "application/json", 890 "content-type": "application/json", 891 "opc-retry-token": kwargs.get("opc_retry_token", missing), 892 "opc-request-id": kwargs.get("opc_request_id", missing) 893 } 894 header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} 895 896 retry_strategy = self.base_client.get_preferred_retry_strategy( 897 operation_retry_strategy=kwargs.get('retry_strategy'), 898 client_retry_strategy=self.retry_strategy 899 ) 900 901 if retry_strategy: 902 if not isinstance(retry_strategy, retry.NoneRetryStrategy): 903 self.base_client.add_opc_retry_token_if_needed(header_params) 904 self.base_client.add_opc_client_retries_header(header_params) 905 retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) 906 return retry_strategy.make_retrying_call( 907 self.base_client.call_api, 908 resource_path=resource_path, 909 method=method, 910 path_params=path_params, 911 header_params=header_params, 912 body=copy_volume_group_backup_details, 913 response_type="VolumeGroupBackup") 914 else: 915 return self.base_client.call_api( 916 resource_path=resource_path, 917 method=method, 918 path_params=path_params, 919 header_params=header_params, 920 body=copy_volume_group_backup_details, 921 response_type="VolumeGroupBackup") 922 923 def create_boot_volume(self, create_boot_volume_details, **kwargs): 924 """ 925 Creates a new boot volume in the specified compartment from an existing boot volume or a boot volume backup. 926 For general information about boot volumes, see `Boot Volumes`__. 927 You may optionally specify a *display name* for the volume, which is simply a friendly name or 928 description. It does not have to be unique, and you can change it. Avoid entering confidential information. 929 930 __ https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/bootvolumes.htm 931 932 933 :param oci.core.models.CreateBootVolumeDetails create_boot_volume_details: (required) 934 Request to create a new boot volume. 935 936 :param str opc_retry_token: (optional) 937 A token that uniquely identifies a request so it can be retried in case of a timeout or 938 server error without risk of executing that same action again. Retry tokens expire after 24 939 hours, but can be invalidated before then due to conflicting operations (for example, if a resource 940 has been deleted and purged from the system, then a retry of the original creation request 941 may be rejected). 942 943 :param obj retry_strategy: (optional) 944 A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. 945 946 This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. 947 The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. 948 949 To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. 950 951 :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.core.models.BootVolume` 952 :rtype: :class:`~oci.response.Response` 953 954 :example: 955 Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.53.1/core/create_boot_volume.py.html>`__ to see an example of how to use create_boot_volume API. 956 """ 957 resource_path = "/bootVolumes" 958 method = "POST" 959 960 # Don't accept unknown kwargs 961 expected_kwargs = [ 962 "retry_strategy", 963 "opc_retry_token" 964 ] 965 extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] 966 if extra_kwargs: 967 raise ValueError( 968 "create_boot_volume got unknown kwargs: {!r}".format(extra_kwargs)) 969 970 header_params = { 971 "accept": "application/json", 972 "content-type": "application/json", 973 "opc-retry-token": kwargs.get("opc_retry_token", missing) 974 } 975 header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} 976 977 retry_strategy = self.base_client.get_preferred_retry_strategy( 978 operation_retry_strategy=kwargs.get('retry_strategy'), 979 client_retry_strategy=self.retry_strategy 980 ) 981 982 if retry_strategy: 983 if not isinstance(retry_strategy, retry.NoneRetryStrategy): 984 self.base_client.add_opc_retry_token_if_needed(header_params) 985 self.base_client.add_opc_client_retries_header(header_params) 986 retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) 987 return retry_strategy.make_retrying_call( 988 self.base_client.call_api, 989 resource_path=resource_path, 990 method=method, 991 header_params=header_params, 992 body=create_boot_volume_details, 993 response_type="BootVolume") 994 else: 995 return self.base_client.call_api( 996 resource_path=resource_path, 997 method=method, 998 header_params=header_params, 999 body=create_boot_volume_details, 1000 response_type="BootVolume") 1001 1002 def create_boot_volume_backup(self, create_boot_volume_backup_details, **kwargs): 1003 """ 1004 Creates a new boot volume backup of the specified boot volume. For general information about boot volume backups, 1005 see `Overview of Boot Volume Backups`__ 1006 1007 When the request is received, the backup object is in a REQUEST_RECEIVED state. 1008 When the data is imaged, it goes into a CREATING state. 1009 After the backup is fully uploaded to the cloud, it goes into an AVAILABLE state. 1010 1011 __ https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/bootvolumebackups.htm 1012 1013 1014 :param oci.core.models.CreateBootVolumeBackupDetails create_boot_volume_backup_details: (required) 1015 Request to create a new backup of given boot volume. 1016 1017 :param str opc_retry_token: (optional) 1018 A token that uniquely identifies a request so it can be retried in case of a timeout or 1019 server error without risk of executing that same action again. Retry tokens expire after 24 1020 hours, but can be invalidated before then due to conflicting operations (for example, if a resource 1021 has been deleted and purged from the system, then a retry of the original creation request 1022 may be rejected). 1023 1024 :param obj retry_strategy: (optional) 1025 A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. 1026 1027 This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. 1028 The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. 1029 1030 To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. 1031 1032 :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.core.models.BootVolumeBackup` 1033 :rtype: :class:`~oci.response.Response` 1034 1035 :example: 1036 Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.53.1/core/create_boot_volume_backup.py.html>`__ to see an example of how to use create_boot_volume_backup API. 1037 """ 1038 resource_path = "/bootVolumeBackups" 1039 method = "POST" 1040 1041 # Don't accept unknown kwargs 1042 expected_kwargs = [ 1043 "retry_strategy", 1044 "opc_retry_token" 1045 ] 1046 extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] 1047 if extra_kwargs: 1048 raise ValueError( 1049 "create_boot_volume_backup got unknown kwargs: {!r}".format(extra_kwargs)) 1050 1051 header_params = { 1052 "accept": "application/json", 1053 "content-type": "application/json", 1054 "opc-retry-token": kwargs.get("opc_retry_token", missing) 1055 } 1056 header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} 1057 1058 retry_strategy = self.base_client.get_preferred_retry_strategy( 1059 operation_retry_strategy=kwargs.get('retry_strategy'), 1060 client_retry_strategy=self.retry_strategy 1061 ) 1062 1063 if retry_strategy: 1064 if not isinstance(retry_strategy, retry.NoneRetryStrategy): 1065 self.base_client.add_opc_retry_token_if_needed(header_params) 1066 self.base_client.add_opc_client_retries_header(header_params) 1067 retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) 1068 return retry_strategy.make_retrying_call( 1069 self.base_client.call_api, 1070 resource_path=resource_path, 1071 method=method, 1072 header_params=header_params, 1073 body=create_boot_volume_backup_details, 1074 response_type="BootVolumeBackup") 1075 else: 1076 return self.base_client.call_api( 1077 resource_path=resource_path, 1078 method=method, 1079 header_params=header_params, 1080 body=create_boot_volume_backup_details, 1081 response_type="BootVolumeBackup") 1082 1083 def create_volume(self, create_volume_details, **kwargs): 1084 """ 1085 Creates a new volume in the specified compartment. Volumes can be created in sizes ranging from 1086 50 GB (51200 MB) to 32 TB (33554432 MB), in 1 GB (1024 MB) increments. By default, volumes are 1 TB (1048576 MB). 1087 For general information about block volumes, see 1088 `Overview of Block Volume Service`__. 1089 1090 A volume and instance can be in separate compartments but must be in the same availability domain. 1091 For information about access control and compartments, see 1092 `Overview of the IAM Service`__. For information about 1093 availability domains, see `Regions and Availability Domains`__. 1094 To get a list of availability domains, use the `ListAvailabilityDomains` operation 1095 in the Identity and Access Management Service API. 1096 1097 You may optionally specify a *display name* for the volume, which is simply a friendly name or 1098 description. It does not have to be unique, and you can change it. Avoid entering confidential information. 1099 1100 __ https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm 1101 __ https://docs.cloud.oracle.com/iaas/Content/Identity/Concepts/overview.htm 1102 __ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/regions.htm 1103 1104 1105 :param oci.core.models.CreateVolumeDetails create_volume_details: (required) 1106 Request to create a new volume. 1107 1108 :param str opc_retry_token: (optional) 1109 A token that uniquely identifies a request so it can be retried in case of a timeout or 1110 server error without risk of executing that same action again. Retry tokens expire after 24 1111 hours, but can be invalidated before then due to conflicting operations (for example, if a resource 1112 has been deleted and purged from the system, then a retry of the original creation request 1113 may be rejected). 1114 1115 :param obj retry_strategy: (optional) 1116 A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. 1117 1118 This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. 1119 The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. 1120 1121 To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. 1122 1123 :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.core.models.Volume` 1124 :rtype: :class:`~oci.response.Response` 1125 1126 :example: 1127 Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.53.1/core/create_volume.py.html>`__ to see an example of how to use create_volume API. 1128 """ 1129 resource_path = "/volumes" 1130 method = "POST" 1131 1132 # Don't accept unknown kwargs 1133 expected_kwargs = [ 1134 "retry_strategy", 1135 "opc_retry_token" 1136 ] 1137 extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] 1138 if extra_kwargs: 1139 raise ValueError( 1140 "create_volume got unknown kwargs: {!r}".format(extra_kwargs)) 1141 1142 header_params = { 1143 "accept": "application/json", 1144 "content-type": "application/json", 1145 "opc-retry-token": kwargs.get("opc_retry_token", missing) 1146 } 1147 header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} 1148 1149 retry_strategy = self.base_client.get_preferred_retry_strategy( 1150 operation_retry_strategy=kwargs.get('retry_strategy'), 1151 client_retry_strategy=self.retry_strategy 1152 ) 1153 1154 if retry_strategy: 1155 if not isinstance(retry_strategy, retry.NoneRetryStrategy): 1156 self.base_client.add_opc_retry_token_if_needed(header_params) 1157 self.base_client.add_opc_client_retries_header(header_params) 1158 retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) 1159 return retry_strategy.make_retrying_call( 1160 self.base_client.call_api, 1161 resource_path=resource_path, 1162 method=method, 1163 header_params=header_params, 1164 body=create_volume_details, 1165 response_type="Volume") 1166 else: 1167 return self.base_client.call_api( 1168 resource_path=resource_path, 1169 method=method, 1170 header_params=header_params, 1171 body=create_volume_details, 1172 response_type="Volume") 1173 1174 def create_volume_backup(self, create_volume_backup_details, **kwargs): 1175 """ 1176 Creates a new backup of the specified volume. For general information about volume backups, 1177 see `Overview of Block Volume Service Backups`__ 1178 1179 When the request is received, the backup object is in a REQUEST_RECEIVED state. 1180 When the data is imaged, it goes into a CREATING state. 1181 After the backup is fully uploaded to the cloud, it goes into an AVAILABLE state. 1182 1183 __ https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/blockvolumebackups.htm 1184 1185 1186 :param oci.core.models.CreateVolumeBackupDetails create_volume_backup_details: (required) 1187 Request to create a new backup of given volume. 1188 1189 :param str opc_retry_token: (optional) 1190 A token that uniquely identifies a request so it can be retried in case of a timeout or 1191 server error without risk of executing that same action again. Retry tokens expire after 24 1192 hours, but can be invalidated before then due to conflicting operations (for example, if a resource 1193 has been deleted and purged from the system, then a retry of the original creation request 1194 may be rejected). 1195 1196 :param obj retry_strategy: (optional) 1197 A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. 1198 1199 This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. 1200 The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. 1201 1202 To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. 1203 1204 :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.core.models.VolumeBackup` 1205 :rtype: :class:`~oci.response.Response` 1206 1207 :example: 1208 Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.53.1/core/create_volume_backup.py.html>`__ to see an example of how to use create_volume_backup API. 1209 """ 1210 resource_path = "/volumeBackups" 1211 method = "POST" 1212 1213 # Don't accept unknown kwargs 1214 expected_kwargs = [ 1215 "retry_strategy", 1216 "opc_retry_token" 1217 ] 1218 extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] 1219 if extra_kwargs: 1220 raise ValueError( 1221 "create_volume_backup got unknown kwargs: {!r}".format(extra_kwargs)) 1222 1223 header_params = { 1224 "accept": "application/json", 1225 "content-type": "application/json", 1226 "opc-retry-token": kwargs.get("opc_retry_token", missing) 1227 } 1228 header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} 1229 1230 retry_strategy = self.base_client.get_preferred_retry_strategy( 1231 operation_retry_strategy=kwargs.get('retry_strategy'), 1232 client_retry_strategy=self.retry_strategy 1233 ) 1234 1235 if retry_strategy: 1236 if not isinstance(retry_strategy, retry.NoneRetryStrategy): 1237 self.base_client.add_opc_retry_token_if_needed(header_params) 1238 self.base_client.add_opc_client_retries_header(header_params) 1239 retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) 1240 return retry_strategy.make_retrying_call( 1241 self.base_client.call_api, 1242 resource_path=resource_path, 1243 method=method, 1244 header_params=header_params, 1245 body=create_volume_backup_details, 1246 response_type="VolumeBackup") 1247 else: 1248 return self.base_client.call_api( 1249 resource_path=resource_path, 1250 method=method, 1251 header_params=header_params, 1252 body=create_volume_backup_details, 1253 response_type="VolumeBackup") 1254 1255 def create_volume_backup_policy(self, create_volume_backup_policy_details, **kwargs): 1256 """ 1257 Creates a new user defined backup policy. 1258 1259 For more information about Oracle defined backup policies and user defined backup policies, 1260 see `Policy-Based Backups`__. 1261 1262 __ https://docs.cloud.oracle.com/iaas/Content/Block/Tasks/schedulingvolumebackups.htm 1263 1264 1265 :param oci.core.models.CreateVolumeBackupPolicyDetails create_volume_backup_policy_details: (required) 1266 Request to create a new scheduled backup policy. 1267 1268 :param str opc_retry_token: (optional) 1269 A token that uniquely identifies a request so it can be retried in case of a timeout or 1270 server error without risk of executing that same action again. Retry tokens expire after 24 1271 hours, but can be invalidated before then due to conflicting operations (for example, if a resource 1272 has been deleted and purged from the system, then a retry of the original creation request 1273 may be rejected). 1274 1275 :param str opc_request_id: (optional) 1276 Unique identifier for the request. 1277 If you need to contact Oracle about a particular request, please provide the request ID. 1278 1279 :param obj retry_strategy: (optional) 1280 A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. 1281 1282 This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. 1283 The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. 1284 1285 To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. 1286 1287 :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.core.models.VolumeBackupPolicy` 1288 :rtype: :class:`~oci.response.Response` 1289 1290 :example: 1291 Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.53.1/core/create_volume_backup_policy.py.html>`__ to see an example of how to use create_volume_backup_policy API. 1292 """ 1293 resource_path = "/volumeBackupPolicies" 1294 method = "POST" 1295 1296 # Don't accept unknown kwargs 1297 expected_kwargs = [ 1298 "retry_strategy", 1299 "opc_retry_token", 1300 "opc_request_id" 1301 ] 1302 extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] 1303 if extra_kwargs: 1304 raise ValueError( 1305 "create_volume_backup_policy got unknown kwargs: {!r}".format(extra_kwargs)) 1306 1307 header_params = { 1308 "accept": "application/json", 1309 "content-type": "application/json", 1310 "opc-retry-token": kwargs.get("opc_retry_token", missing), 1311 "opc-request-id": kwargs.get("opc_request_id", missing) 1312 } 1313 header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} 1314 1315 retry_strategy = self.base_client.get_preferred_retry_strategy( 1316 operation_retry_strategy=kwargs.get('retry_strategy'), 1317 client_retry_strategy=self.retry_strategy 1318 ) 1319 1320 if retry_strategy: 1321 if not isinstance(retry_strategy, retry.NoneRetryStrategy): 1322 self.base_client.add_opc_retry_token_if_needed(header_params) 1323 self.base_client.add_opc_client_retries_header(header_params) 1324 retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) 1325 return retry_strategy.make_retrying_call( 1326 self.base_client.call_api, 1327 resource_path=resource_path, 1328 method=method, 1329 header_params=header_params, 1330 body=create_volume_backup_policy_details, 1331 response_type="VolumeBackupPolicy") 1332 else: 1333 return self.base_client.call_api( 1334 resource_path=resource_path, 1335 method=method, 1336 header_params=header_params, 1337 body=create_volume_backup_policy_details, 1338 response_type="VolumeBackupPolicy") 1339 1340 def create_volume_backup_policy_assignment(self, create_volume_backup_policy_assignment_details, **kwargs): 1341 """ 1342 Assigns a volume backup policy to the specified volume. Note that a given volume can 1343 only have one backup policy assigned to it. If this operation is used for a volume that already 1344 has a different backup policy assigned, the prior backup policy will be silently unassigned. 1345 1346 1347 :param oci.core.models.CreateVolumeBackupPolicyAssignmentDetails create_volume_backup_policy_assignment_details: (required) 1348 Request to assign a specified policy to a particular volume. 1349 1350 :param obj retry_strategy: (optional) 1351 A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. 1352 1353 This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. 1354 The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. 1355 1356 To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. 1357 1358 :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.core.models.VolumeBackupPolicyAssignment` 1359 :rtype: :class:`~oci.response.Response` 1360 1361 :example: 1362 Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.53.1/core/create_volume_backup_policy_assignment.py.html>`__ to see an example of how to use create_volume_backup_policy_assignment API. 1363 """ 1364 resource_path = "/volumeBackupPolicyAssignments" 1365 method = "POST" 1366 1367 expected_kwargs = ["retry_strategy"] 1368 extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] 1369 if extra_kwargs: 1370 raise ValueError( 1371 "create_volume_backup_policy_assignment got unknown kwargs: {!r}".format(extra_kwargs)) 1372 1373 header_params = { 1374 "accept": "application/json", 1375 "content-type": "application/json" 1376 } 1377 1378 retry_strategy = self.base_client.get_preferred_retry_strategy( 1379 operation_retry_strategy=kwargs.get('retry_strategy'), 1380 client_retry_strategy=self.retry_strategy 1381 ) 1382 1383 if retry_strategy: 1384 if not isinstance(retry_strategy, retry.NoneRetryStrategy): 1385 self.base_client.add_opc_client_retries_header(header_params) 1386 retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) 1387 return retry_strategy.make_retrying_call( 1388 self.base_client.call_api, 1389 resource_path=resource_path, 1390 method=method, 1391 header_params=header_params, 1392 body=create_volume_backup_policy_assignment_details, 1393 response_type="VolumeBackupPolicyAssignment") 1394 else: 1395 return self.base_client.call_api( 1396 resource_path=resource_path, 1397 method=method, 1398 header_params=header_params, 1399 body=create_volume_backup_policy_assignment_details, 1400 response_type="VolumeBackupPolicyAssignment") 1401 1402 def create_volume_group(self, create_volume_group_details, **kwargs): 1403 """ 1404 Creates a new volume group in the specified compartment. 1405 A volume group is a collection of volumes and may be created from a list of volumes, cloning an existing 1406 volume group, or by restoring a volume group backup. 1407 You may optionally specify a *display name* for the volume group, which is simply a friendly name or 1408 description. It does not have to be unique, and you can change it. Avoid entering confidential information. 1409 1410 For more information, see `Volume Groups`__. 1411 1412 __ https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/volumegroups.htm 1413 1414 1415 :param oci.core.models.CreateVolumeGroupDetails create_volume_group_details: (required) 1416 Request to create a new volume group. 1417 1418 :param str opc_retry_token: (optional) 1419 A token that uniquely identifies a request so it can be retried in case of a timeout or 1420 server error without risk of executing that same action again. Retry tokens expire after 24 1421 hours, but can be invalidated before then due to conflicting operations (for example, if a resource 1422 has been deleted and purged from the system, then a retry of the original creation request 1423 may be rejected). 1424 1425 :param obj retry_strategy: (optional) 1426 A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. 1427 1428 This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. 1429 The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. 1430 1431 To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. 1432 1433 :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.core.models.VolumeGroup` 1434 :rtype: :class:`~oci.response.Response` 1435 1436 :example: 1437 Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.53.1/core/create_volume_group.py.html>`__ to see an example of how to use create_volume_group API. 1438 """ 1439 resource_path = "/volumeGroups" 1440 method = "POST" 1441 1442 # Don't accept unknown kwargs 1443 expected_kwargs = [ 1444 "retry_strategy", 1445 "opc_retry_token" 1446 ] 1447 extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] 1448 if extra_kwargs: 1449 raise ValueError( 1450 "create_volume_group got unknown kwargs: {!r}".format(extra_kwargs)) 1451 1452 header_params = { 1453 "accept": "application/json", 1454 "content-type": "application/json", 1455 "opc-retry-token": kwargs.get("opc_retry_token", missing) 1456 } 1457 header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} 1458 1459 retry_strategy = self.base_client.get_preferred_retry_strategy( 1460 operation_retry_strategy=kwargs.get('retry_strategy'), 1461 client_retry_strategy=self.retry_strategy 1462 ) 1463 1464 if retry_strategy: 1465 if not isinstance(retry_strategy, retry.NoneRetryStrategy): 1466 self.base_client.add_opc_retry_token_if_needed(header_params) 1467 self.base_client.add_opc_client_retries_header(header_params) 1468 retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) 1469 return retry_strategy.make_retrying_call( 1470 self.base_client.call_api, 1471 resource_path=resource_path, 1472 method=method, 1473 header_params=header_params, 1474 body=create_volume_group_details, 1475 response_type="VolumeGroup") 1476 else: 1477 return self.base_client.call_api( 1478 resource_path=resource_path, 1479 method=method, 1480 header_params=header_params, 1481 body=create_volume_group_details, 1482 response_type="VolumeGroup") 1483 1484 def create_volume_group_backup(self, create_volume_group_backup_details, **kwargs): 1485 """ 1486 Creates a new backup volume group of the specified volume group. 1487 For more information, see `Volume Groups`__. 1488 1489 __ https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/volumegroups.htm 1490 1491 1492 :param oci.core.models.CreateVolumeGroupBackupDetails create_volume_group_backup_details: (required) 1493 Request to create a new backup group of given volume group. 1494 1495 :param str opc_retry_token: (optional) 1496 A token that uniquely identifies a request so it can be retried in case of a timeout or 1497 server error without risk of executing that same action again. Retry tokens expire after 24 1498 hours, but can be invalidated before then due to conflicting operations (for example, if a resource 1499 has been deleted and purged from the system, then a retry of the original creation request 1500 may be rejected). 1501 1502 :param obj retry_strategy: (optional) 1503 A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. 1504 1505 This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. 1506 The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. 1507 1508 To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. 1509 1510 :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.core.models.VolumeGroupBackup` 1511 :rtype: :class:`~oci.response.Response` 1512 1513 :example: 1514 Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.53.1/core/create_volume_group_backup.py.html>`__ to see an example of how to use create_volume_group_backup API. 1515 """ 1516 resource_path = "/volumeGroupBackups" 1517 method = "POST" 1518 1519 # Don't accept unknown kwargs 1520 expected_kwargs = [ 1521 "retry_strategy", 1522 "opc_retry_token" 1523 ] 1524 extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] 1525 if extra_kwargs: 1526 raise ValueError( 1527 "create_volume_group_backup got unknown kwargs: {!r}".format(extra_kwargs)) 1528 1529 header_params = { 1530 "accept": "application/json", 1531 "content-type": "application/json", 1532 "opc-retry-token": kwargs.get("opc_retry_token", missing) 1533 } 1534 header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} 1535 1536 retry_strategy = self.base_client.get_preferred_retry_strategy( 1537 operation_retry_strategy=kwargs.get('retry_strategy'), 1538 client_retry_strategy=self.retry_strategy 1539 ) 1540 1541 if retry_strategy: 1542 if not isinstance(retry_strategy, retry.NoneRetryStrategy): 1543 self.base_client.add_opc_retry_token_if_needed(header_params) 1544 self.base_client.add_opc_client_retries_header(header_params) 1545 retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) 1546 return retry_strategy.make_retrying_call( 1547 self.base_client.call_api, 1548 resource_path=resource_path, 1549 method=method, 1550 header_params=header_params, 1551 body=create_volume_group_backup_details, 1552 response_type="VolumeGroupBackup") 1553 else: 1554 return self.base_client.call_api( 1555 resource_path=resource_path, 1556 method=method, 1557 header_params=header_params, 1558 body=create_volume_group_backup_details, 1559 response_type="VolumeGroupBackup") 1560 1561 def delete_boot_volume(self, boot_volume_id, **kwargs): 1562 """ 1563 Deletes the specified boot volume. The volume cannot have an active connection to an instance. 1564 To disconnect the boot volume from a connected instance, see 1565 `Disconnecting From a Boot Volume`__. 1566 **Warning:** All data on the boot volume will be permanently lost when the boot volume is deleted. 1567 1568 __ https://docs.cloud.oracle.com/iaas/Content/Block/Tasks/deletingbootvolume.htm 1569 1570 1571 :param str boot_volume_id: (required) 1572 The OCID of the boot volume. 1573 1574 :param str if_match: (optional) 1575 For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` 1576 parameter to the value of the etag from a previous GET or POST response for that resource. The resource 1577 will be updated or deleted only if the etag you provide matches the resource's current etag value. 1578 1579 :param obj retry_strategy: (optional) 1580 A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. 1581 1582 This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. 1583 The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. 1584 1585 To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. 1586 1587 :return: A :class:`~oci.response.Response` object with data of type None 1588 :rtype: :class:`~oci.response.Response` 1589 1590 :example: 1591 Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.53.1/core/delete_boot_volume.py.html>`__ to see an example of how to use delete_boot_volume API. 1592 """ 1593 resource_path = "/bootVolumes/{bootVolumeId}" 1594 method = "DELETE" 1595 1596 # Don't accept unknown kwargs 1597 expected_kwargs = [ 1598 "retry_strategy", 1599 "if_match" 1600 ] 1601 extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] 1602 if extra_kwargs: 1603 raise ValueError( 1604 "delete_boot_volume got unknown kwargs: {!r}".format(extra_kwargs)) 1605 1606 path_params = { 1607 "bootVolumeId": boot_volume_id 1608 } 1609 1610 path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} 1611 1612 for (k, v) in six.iteritems(path_params): 1613 if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): 1614 raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k)) 1615 1616 header_params = { 1617 "accept": "application/json", 1618 "content-type": "application/json", 1619 "if-match": kwargs.get("if_match", missing) 1620 } 1621 header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} 1622 1623 retry_strategy = self.base_client.get_preferred_retry_strategy( 1624 operation_retry_strategy=kwargs.get('retry_strategy'), 1625 client_retry_strategy=self.retry_strategy 1626 ) 1627 1628 if retry_strategy: 1629 if not isinstance(retry_strategy, retry.NoneRetryStrategy): 1630 self.base_client.add_opc_client_retries_header(header_params) 1631 retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) 1632 return retry_strategy.make_retrying_call( 1633 self.base_client.call_api, 1634 resource_path=resource_path, 1635 method=method, 1636 path_params=path_params, 1637 header_params=header_params) 1638 else: 1639 return self.base_client.call_api( 1640 resource_path=resource_path, 1641 method=method, 1642 path_params=path_params, 1643 header_params=header_params) 1644 1645 def delete_boot_volume_backup(self, boot_volume_backup_id, **kwargs): 1646 """ 1647 Deletes a boot volume backup. 1648 1649 1650 :param str boot_volume_backup_id: (required) 1651 The OCID of the boot volume backup. 1652 1653 :param str if_match: (optional) 1654 For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` 1655 parameter to the value of the etag from a previous GET or POST response for that resource. The resource 1656 will be updated or deleted only if the etag you provide matches the resource's current etag value. 1657 1658 :param obj retry_strategy: (optional) 1659 A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. 1660 1661 This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. 1662 The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. 1663 1664 To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. 1665 1666 :return: A :class:`~oci.response.Response` object with data of type None 1667 :rtype: :class:`~oci.response.Response` 1668 1669 :example: 1670 Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.53.1/core/delete_boot_volume_backup.py.html>`__ to see an example of how to use delete_boot_volume_backup API. 1671 """ 1672 resource_path = "/bootVolumeBackups/{bootVolumeBackupId}" 1673 method = "DELETE" 1674 1675 # Don't accept unknown kwargs 1676 expected_kwargs = [ 1677 "retry_strategy", 1678 "if_match" 1679 ] 1680 extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] 1681 if extra_kwargs: 1682 raise ValueError( 1683 "delete_boot_volume_backup got unknown kwargs: {!r}".format(extra_kwargs)) 1684 1685 path_params = { 1686 "bootVolumeBackupId": boot_volume_backup_id 1687 } 1688 1689 path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} 1690 1691 for (k, v) in six.iteritems(path_params): 1692 if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): 1693 raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k)) 1694 1695 header_params = { 1696 "accept": "application/json", 1697 "content-type": "application/json", 1698 "if-match": kwargs.get("if_match", missing) 1699 } 1700 header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} 1701 1702 retry_strategy = self.base_client.get_preferred_retry_strategy( 1703 operation_retry_strategy=kwargs.get('retry_strategy'), 1704 client_retry_strategy=self.retry_strategy 1705 ) 1706 1707 if retry_strategy: 1708 if not isinstance(retry_strategy, retry.NoneRetryStrategy): 1709 self.base_client.add_opc_client_retries_header(header_params) 1710 retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) 1711 return retry_strategy.make_retrying_call( 1712 self.base_client.call_api, 1713 resource_path=resource_path, 1714 method=method, 1715 path_params=path_params, 1716 header_params=header_params) 1717 else: 1718 return self.base_client.call_api( 1719 resource_path=resource_path, 1720 method=method, 1721 path_params=path_params, 1722 header_params=header_params) 1723 1724 def delete_boot_volume_kms_key(self, boot_volume_id, **kwargs): 1725 """ 1726 Removes the specified boot volume's assigned Key Management encryption key. 1727 1728 1729 :param str boot_volume_id: (required) 1730 The OCID of the boot volume. 1731 1732 :param str if_match: (optional) 1733 For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` 1734 parameter to the value of the etag from a previous GET or POST response for that resource. The resource 1735 will be updated or deleted only if the etag you provide matches the resource's current etag value. 1736 1737 :param obj retry_strategy: (optional) 1738 A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. 1739 1740 This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. 1741 The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. 1742 1743 To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. 1744 1745 :return: A :class:`~oci.response.Response` object with data of type None 1746 :rtype: :class:`~oci.response.Response` 1747 1748 :example: 1749 Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.53.1/core/delete_boot_volume_kms_key.py.html>`__ to see an example of how to use delete_boot_volume_kms_key API. 1750 """ 1751 resource_path = "/bootVolumes/{bootVolumeId}/kmsKey" 1752 method = "DELETE" 1753 1754 # Don't accept unknown kwargs 1755 expected_kwargs = [ 1756 "retry_strategy", 1757 "if_match" 1758 ] 1759 extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] 1760 if extra_kwargs: 1761 raise ValueError( 1762 "delete_boot_volume_kms_key got unknown kwargs: {!r}".format(extra_kwargs)) 1763 1764 path_params = { 1765 "bootVolumeId": boot_volume_id 1766 } 1767 1768 path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} 1769 1770 for (k, v) in six.iteritems(path_params): 1771 if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): 1772 raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k)) 1773 1774 header_params = { 1775 "accept": "application/json", 1776 "content-type": "application/json", 1777 "if-match": kwargs.get("if_match", missing) 1778 } 1779 header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} 1780 1781 retry_strategy = self.base_client.get_preferred_retry_strategy( 1782 operation_retry_strategy=kwargs.get('retry_strategy'), 1783 client_retry_strategy=self.retry_strategy 1784 ) 1785 1786 if retry_strategy: 1787 if not isinstance(retry_strategy, retry.NoneRetryStrategy): 1788 self.base_client.add_opc_client_retries_header(header_params) 1789 retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) 1790 return retry_strategy.make_retrying_call( 1791 self.base_client.call_api, 1792 resource_path=resource_path, 1793 method=method, 1794 path_params=path_params, 1795 header_params=header_params) 1796 else: 1797 return self.base_client.call_api( 1798 resource_path=resource_path, 1799 method=method, 1800 path_params=path_params, 1801 header_params=header_params) 1802 1803 def delete_volume(self, volume_id, **kwargs): 1804 """ 1805 Deletes the specified volume. The volume cannot have an active connection to an instance. 1806 To disconnect the volume from a connected instance, see 1807 `Disconnecting From a Volume`__. 1808 **Warning:** All data on the volume will be permanently lost when the volume is deleted. 1809 1810 __ https://docs.cloud.oracle.com/iaas/Content/Block/Tasks/disconnectingfromavolume.htm 1811 1812 1813 :param str volume_id: (required) 1814 The OCID of the volume. 1815 1816 :param str if_match: (optional) 1817 For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` 1818 parameter to the value of the etag from a previous GET or POST response for that resource. The resource 1819 will be updated or deleted only if the etag you provide matches the resource's current etag value. 1820 1821 :param obj retry_strategy: (optional) 1822 A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. 1823 1824 This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. 1825 The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. 1826 1827 To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. 1828 1829 :return: A :class:`~oci.response.Response` object with data of type None 1830 :rtype: :class:`~oci.response.Response` 1831 1832 :example: 1833 Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.53.1/core/delete_volume.py.html>`__ to see an example of how to use delete_volume API. 1834 """ 1835 resource_path = "/volumes/{volumeId}" 1836 method = "DELETE" 1837 1838 # Don't accept unknown kwargs 1839 expected_kwargs = [ 1840 "retry_strategy", 1841 "if_match" 1842 ] 1843 extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] 1844 if extra_kwargs: 1845 raise ValueError( 1846 "delete_volume got unknown kwargs: {!r}".format(extra_kwargs)) 1847 1848 path_params = { 1849 "volumeId": volume_id 1850 } 1851 1852 path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} 1853 1854 for (k, v) in six.iteritems(path_params): 1855 if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): 1856 raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k)) 1857 1858 header_params = { 1859 "accept": "application/json", 1860 "content-type": "application/json", 1861 "if-match": kwargs.get("if_match", missing) 1862 } 1863 header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} 1864 1865 retry_strategy = self.base_client.get_preferred_retry_strategy( 1866 operation_retry_strategy=kwargs.get('retry_strategy'), 1867 client_retry_strategy=self.retry_strategy 1868 ) 1869 1870 if retry_strategy: 1871 if not isinstance(retry_strategy, retry.NoneRetryStrategy): 1872 self.base_client.add_opc_client_retries_header(header_params) 1873 retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) 1874 return retry_strategy.make_retrying_call( 1875 self.base_client.call_api, 1876 resource_path=resource_path, 1877 method=method, 1878 path_params=path_params, 1879 header_params=header_params) 1880 else: 1881 return self.base_client.call_api( 1882 resource_path=resource_path, 1883 method=method, 1884 path_params=path_params, 1885 header_params=header_params) 1886 1887 def delete_volume_backup(self, volume_backup_id, **kwargs): 1888 """ 1889 Deletes a volume backup. 1890 1891 1892 :param str volume_backup_id: (required) 1893 The OCID of the volume backup. 1894 1895 :param str if_match: (optional) 1896 For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` 1897 parameter to the value of the etag from a previous GET or POST response for that resource. The resource 1898 will be updated or deleted only if the etag you provide matches the resource's current etag value. 1899 1900 :param obj retry_strategy: (optional) 1901 A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. 1902 1903 This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. 1904 The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. 1905 1906 To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. 1907 1908 :return: A :class:`~oci.response.Response` object with data of type None 1909 :rtype: :class:`~oci.response.Response` 1910 1911 :example: 1912 Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.53.1/core/delete_volume_backup.py.html>`__ to see an example of how to use delete_volume_backup API. 1913 """ 1914 resource_path = "/volumeBackups/{volumeBackupId}" 1915 method = "DELETE" 1916 1917 # Don't accept unknown kwargs 1918 expected_kwargs = [ 1919 "retry_strategy", 1920 "if_match" 1921 ] 1922 extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] 1923 if extra_kwargs: 1924 raise ValueError( 1925 "delete_volume_backup got unknown kwargs: {!r}".format(extra_kwargs)) 1926 1927 path_params = { 1928 "volumeBackupId": volume_backup_id 1929 } 1930 1931 path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} 1932 1933 for (k, v) in six.iteritems(path_params): 1934 if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): 1935 raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k)) 1936 1937 header_params = { 1938 "accept": "application/json", 1939 "content-type": "application/json", 1940 "if-match": kwargs.get("if_match", missing) 1941 } 1942 header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} 1943 1944 retry_strategy = self.base_client.get_preferred_retry_strategy( 1945 operation_retry_strategy=kwargs.get('retry_strategy'), 1946 client_retry_strategy=self.retry_strategy 1947 ) 1948 1949 if retry_strategy: 1950 if not isinstance(retry_strategy, retry.NoneRetryStrategy): 1951 self.base_client.add_opc_client_retries_header(header_params) 1952 retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) 1953 return retry_strategy.make_retrying_call( 1954 self.base_client.call_api, 1955 resource_path=resource_path, 1956 method=method, 1957 path_params=path_params, 1958 header_params=header_params) 1959 else: 1960 return self.base_client.call_api( 1961 resource_path=resource_path, 1962 method=method, 1963 path_params=path_params, 1964 header_params=header_params) 1965 1966 def delete_volume_backup_policy(self, policy_id, **kwargs): 1967 """ 1968 Deletes a user defined backup policy. 1969 For more information about user defined backup policies, 1970 see `Policy-Based Backups`__. 1971 1972 Avoid entering confidential information. 1973 1974 __ https://docs.cloud.oracle.com/iaas/Content/Block/Tasks/schedulingvolumebackups.htm#UserDefinedBackupPolicies 1975 1976 1977 :param str policy_id: (required) 1978 The OCID of the volume backup policy. 1979 1980 :param str opc_request_id: (optional) 1981 Unique identifier for the request. 1982 If you need to contact Oracle about a particular request, please provide the request ID. 1983 1984 :param str if_match: (optional) 1985 For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` 1986 parameter to the value of the etag from a previous GET or POST response for that resource. The resource 1987 will be updated or deleted only if the etag you provide matches the resource's current etag value. 1988 1989 :param obj retry_strategy: (optional) 1990 A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. 1991 1992 This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. 1993 The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. 1994 1995 To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. 1996 1997 :return: A :class:`~oci.response.Response` object with data of type None 1998 :rtype: :class:`~oci.response.Response` 1999 2000 :example: 2001 Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.53.1/core/delete_volume_backup_policy.py.html>`__ to see an example of how to use delete_volume_backup_policy API. 2002 """ 2003 resource_path = "/volumeBackupPolicies/{policyId}" 2004 method = "DELETE" 2005 2006 # Don't accept unknown kwargs 2007 expected_kwargs = [ 2008 "retry_strategy", 2009 "opc_request_id", 2010 "if_match" 2011 ] 2012 extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] 2013 if extra_kwargs: 2014 raise ValueError( 2015 "delete_volume_backup_policy got unknown kwargs: {!r}".format(extra_kwargs)) 2016 2017 path_params = { 2018 "policyId": policy_id 2019 } 2020 2021 path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} 2022 2023 for (k, v) in six.iteritems(path_params): 2024 if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): 2025 raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k)) 2026 2027 header_params = { 2028 "accept": "application/json", 2029 "content-type": "application/json", 2030 "opc-request-id": kwargs.get("opc_request_id", missing), 2031 "if-match": kwargs.get("if_match", missing) 2032 } 2033 header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} 2034 2035 retry_strategy = self.base_client.get_preferred_retry_strategy( 2036 operation_retry_strategy=kwargs.get('retry_strategy'), 2037 client_retry_strategy=self.retry_strategy 2038 ) 2039 2040 if retry_strategy: 2041 if not isinstance(retry_strategy, retry.NoneRetryStrategy): 2042 self.base_client.add_opc_client_retries_header(header_params) 2043 retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) 2044 return retry_strategy.make_retrying_call( 2045 self.base_client.call_api, 2046 resource_path=resource_path, 2047 method=method, 2048 path_params=path_params, 2049 header_params=header_params) 2050 else: 2051 return self.base_client.call_api( 2052 resource_path=resource_path, 2053 method=method, 2054 path_params=path_params, 2055 header_params=header_params) 2056 2057 def delete_volume_backup_policy_assignment(self, policy_assignment_id, **kwargs): 2058 """ 2059 Deletes a volume backup policy assignment. 2060 2061 2062 :param str policy_assignment_id: (required) 2063 The OCID of the volume backup policy assignment. 2064 2065 :param str if_match: (optional) 2066 For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` 2067 parameter to the value of the etag from a previous GET or POST response for that resource. The resource 2068 will be updated or deleted only if the etag you provide matches the resource's current etag value. 2069 2070 :param obj retry_strategy: (optional) 2071 A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. 2072 2073 This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. 2074 The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. 2075 2076 To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. 2077 2078 :return: A :class:`~oci.response.Response` object with data of type None 2079 :rtype: :class:`~oci.response.Response` 2080 2081 :example: 2082 Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.53.1/core/delete_volume_backup_policy_assignment.py.html>`__ to see an example of how to use delete_volume_backup_policy_assignment API. 2083 """ 2084 resource_path = "/volumeBackupPolicyAssignments/{policyAssignmentId}" 2085 method = "DELETE" 2086 2087 # Don't accept unknown kwargs 2088 expected_kwargs = [ 2089 "retry_strategy", 2090 "if_match" 2091 ] 2092 extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] 2093 if extra_kwargs: 2094 raise ValueError( 2095 "delete_volume_backup_policy_assignment got unknown kwargs: {!r}".format(extra_kwargs)) 2096 2097 path_params = { 2098 "policyAssignmentId": policy_assignment_id 2099 } 2100 2101 path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} 2102 2103 for (k, v) in six.iteritems(path_params): 2104 if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): 2105 raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k)) 2106 2107 header_params = { 2108 "accept": "application/json", 2109 "content-type": "application/json", 2110 "if-match": kwargs.get("if_match", missing) 2111 } 2112 header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} 2113 2114 retry_strategy = self.base_client.get_preferred_retry_strategy( 2115 operation_retry_strategy=kwargs.get('retry_strategy'), 2116 client_retry_strategy=self.retry_strategy 2117 ) 2118 2119 if retry_strategy: 2120 if not isinstance(retry_strategy, retry.NoneRetryStrategy): 2121 self.base_client.add_opc_client_retries_header(header_params) 2122 retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) 2123 return retry_strategy.make_retrying_call( 2124 self.base_client.call_api, 2125 resource_path=resource_path, 2126 method=method, 2127 path_params=path_params, 2128 header_params=header_params) 2129 else: 2130 return self.base_client.call_api( 2131 resource_path=resource_path, 2132 method=method, 2133 path_params=path_params, 2134 header_params=header_params) 2135 2136 def delete_volume_group(self, volume_group_id, **kwargs): 2137 """ 2138 Deletes the specified volume group. Individual volumes are not deleted, only the volume group is deleted. 2139 For more information, see `Volume Groups`__. 2140 2141 __ https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/volumegroups.htm 2142 2143 2144 :param str volume_group_id: (required) 2145 The Oracle Cloud ID (OCID) that uniquely identifies the volume group. 2146 2147 :param str if_match: (optional) 2148 For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` 2149 parameter to the value of the etag from a previous GET or POST response for that resource. The resource 2150 will be updated or deleted only if the etag you provide matches the resource's current etag value. 2151 2152 :param obj retry_strategy: (optional) 2153 A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. 2154 2155 This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. 2156 The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. 2157 2158 To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. 2159 2160 :return: A :class:`~oci.response.Response` object with data of type None 2161 :rtype: :class:`~oci.response.Response` 2162 2163 :example: 2164 Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.53.1/core/delete_volume_group.py.html>`__ to see an example of how to use delete_volume_group API. 2165 """ 2166 resource_path = "/volumeGroups/{volumeGroupId}" 2167 method = "DELETE" 2168 2169 # Don't accept unknown kwargs 2170 expected_kwargs = [ 2171 "retry_strategy", 2172 "if_match" 2173 ] 2174 extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] 2175 if extra_kwargs: 2176 raise ValueError( 2177 "delete_volume_group got unknown kwargs: {!r}".format(extra_kwargs)) 2178 2179 path_params = { 2180 "volumeGroupId": volume_group_id 2181 } 2182 2183 path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} 2184 2185 for (k, v) in six.iteritems(path_params): 2186 if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): 2187 raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k)) 2188 2189 header_params = { 2190 "accept": "application/json", 2191 "content-type": "application/json", 2192 "if-match": kwargs.get("if_match", missing) 2193 } 2194 header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} 2195 2196 retry_strategy = self.base_client.get_preferred_retry_strategy( 2197 operation_retry_strategy=kwargs.get('retry_strategy'), 2198 client_retry_strategy=self.retry_strategy 2199 ) 2200 2201 if retry_strategy: 2202 if not isinstance(retry_strategy, retry.NoneRetryStrategy): 2203 self.base_client.add_opc_client_retries_header(header_params) 2204 retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) 2205 return retry_strategy.make_retrying_call( 2206 self.base_client.call_api, 2207 resource_path=resource_path, 2208 method=method, 2209 path_params=path_params, 2210 header_params=header_params) 2211 else: 2212 return self.base_client.call_api( 2213 resource_path=resource_path, 2214 method=method, 2215 path_params=path_params, 2216 header_params=header_params) 2217 2218 def delete_volume_group_backup(self, volume_group_backup_id, **kwargs): 2219 """ 2220 Deletes a volume group backup. This operation deletes all the backups in 2221 the volume group. For more information, see `Volume Groups`__. 2222 2223 __ https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/volumegroups.htm 2224 2225 2226 :param str volume_group_backup_id: (required) 2227 The Oracle Cloud ID (OCID) that uniquely identifies the volume group backup. 2228 2229 :param str if_match: (optional) 2230 For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` 2231 parameter to the value of the etag from a previous GET or POST response for that resource. The resource 2232 will be updated or deleted only if the etag you provide matches the resource's current etag value. 2233 2234 :param obj retry_strategy: (optional) 2235 A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. 2236 2237 This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. 2238 The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. 2239 2240 To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. 2241 2242 :return: A :class:`~oci.response.Response` object with data of type None 2243 :rtype: :class:`~oci.response.Response` 2244 2245 :example: 2246 Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.53.1/core/delete_volume_group_backup.py.html>`__ to see an example of how to use delete_volume_group_backup API. 2247 """ 2248 resource_path = "/volumeGroupBackups/{volumeGroupBackupId}" 2249 method = "DELETE" 2250 2251 # Don't accept unknown kwargs 2252 expected_kwargs = [ 2253 "retry_strategy", 2254 "if_match" 2255 ] 2256 extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] 2257 if extra_kwargs: 2258 raise ValueError( 2259 "delete_volume_group_backup got unknown kwargs: {!r}".format(extra_kwargs)) 2260 2261 path_params = { 2262 "volumeGroupBackupId": volume_group_backup_id 2263 } 2264 2265 path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} 2266 2267 for (k, v) in six.iteritems(path_params): 2268 if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): 2269 raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k)) 2270 2271 header_params = { 2272 "accept": "application/json", 2273 "content-type": "application/json", 2274 "if-match": kwargs.get("if_match", missing) 2275 } 2276 header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} 2277 2278 retry_strategy = self.base_client.get_preferred_retry_strategy( 2279 operation_retry_strategy=kwargs.get('retry_strategy'), 2280 client_retry_strategy=self.retry_strategy 2281 ) 2282 2283 if retry_strategy: 2284 if not isinstance(retry_strategy, retry.NoneRetryStrategy): 2285 self.base_client.add_opc_client_retries_header(header_params) 2286 retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) 2287 return retry_strategy.make_retrying_call( 2288 self.base_client.call_api, 2289 resource_path=resource_path, 2290 method=method, 2291 path_params=path_params, 2292 header_params=header_params) 2293 else: 2294 return self.base_client.call_api( 2295 resource_path=resource_path, 2296 method=method, 2297 path_params=path_params, 2298 header_params=header_params) 2299 2300 def delete_volume_kms_key(self, volume_id, **kwargs): 2301 """ 2302 Removes the specified volume's assigned Key Management encryption key. 2303 2304 2305 :param str volume_id: (required) 2306 The OCID of the volume. 2307 2308 :param str if_match: (optional) 2309 For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` 2310 parameter to the value of the etag from a previous GET or POST response for that resource. The resource 2311 will be updated or deleted only if the etag you provide matches the resource's current etag value. 2312 2313 :param obj retry_strategy: (optional) 2314 A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. 2315 2316 This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. 2317 The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. 2318 2319 To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. 2320 2321 :return: A :class:`~oci.response.Response` object with data of type None 2322 :rtype: :class:`~oci.response.Response` 2323 2324 :example: 2325 Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.53.1/core/delete_volume_kms_key.py.html>`__ to see an example of how to use delete_volume_kms_key API. 2326 """ 2327 resource_path = "/volumes/{volumeId}/kmsKey" 2328 method = "DELETE" 2329 2330 # Don't accept unknown kwargs 2331 expected_kwargs = [ 2332 "retry_strategy", 2333 "if_match" 2334 ] 2335 extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] 2336 if extra_kwargs: 2337 raise ValueError( 2338 "delete_volume_kms_key got unknown kwargs: {!r}".format(extra_kwargs)) 2339 2340 path_params = { 2341 "volumeId": volume_id 2342 } 2343 2344 path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} 2345 2346 for (k, v) in six.iteritems(path_params): 2347 if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): 2348 raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k)) 2349 2350 header_params = { 2351 "accept": "application/json", 2352 "content-type": "application/json", 2353 "if-match": kwargs.get("if_match", missing) 2354 } 2355 header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} 2356 2357 retry_strategy = self.base_client.get_preferred_retry_strategy( 2358 operation_retry_strategy=kwargs.get('retry_strategy'), 2359 client_retry_strategy=self.retry_strategy 2360 ) 2361 2362 if retry_strategy: 2363 if not isinstance(retry_strategy, retry.NoneRetryStrategy): 2364 self.base_client.add_opc_client_retries_header(header_params) 2365 retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) 2366 return retry_strategy.make_retrying_call( 2367 self.base_client.call_api, 2368 resource_path=resource_path, 2369 method=method, 2370 path_params=path_params, 2371 header_params=header_params) 2372 else: 2373 return self.base_client.call_api( 2374 resource_path=resource_path, 2375 method=method, 2376 path_params=path_params, 2377 header_params=header_params) 2378 2379 def get_block_volume_replica(self, block_volume_replica_id, **kwargs): 2380 """ 2381 Gets information for the specified block volume replica. 2382 2383 2384 :param str block_volume_replica_id: (required) 2385 The OCID of the block volume replica. 2386 2387 :param obj retry_strategy: (optional) 2388 A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. 2389 2390 This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. 2391 The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. 2392 2393 To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. 2394 2395 :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.core.models.BlockVolumeReplica` 2396 :rtype: :class:`~oci.response.Response` 2397 2398 :example: 2399 Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.53.1/core/get_block_volume_replica.py.html>`__ to see an example of how to use get_block_volume_replica API. 2400 """ 2401 resource_path = "/blockVolumeReplicas/{blockVolumeReplicaId}" 2402 method = "GET" 2403 2404 expected_kwargs = ["retry_strategy"] 2405 extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] 2406 if extra_kwargs: 2407 raise ValueError( 2408 "get_block_volume_replica got unknown kwargs: {!r}".format(extra_kwargs)) 2409 2410 path_params = { 2411 "blockVolumeReplicaId": block_volume_replica_id 2412 } 2413 2414 path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} 2415 2416 for (k, v) in six.iteritems(path_params): 2417 if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): 2418 raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k)) 2419 2420 header_params = { 2421 "accept": "application/json", 2422 "content-type": "application/json" 2423 } 2424 2425 retry_strategy = self.base_client.get_preferred_retry_strategy( 2426 operation_retry_strategy=kwargs.get('retry_strategy'), 2427 client_retry_strategy=self.retry_strategy 2428 ) 2429 2430 if retry_strategy: 2431 if not isinstance(retry_strategy, retry.NoneRetryStrategy): 2432 self.base_client.add_opc_client_retries_header(header_params) 2433 retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) 2434 return retry_strategy.make_retrying_call( 2435 self.base_client.call_api, 2436 resource_path=resource_path, 2437 method=method, 2438 path_params=path_params, 2439 header_params=header_params, 2440 response_type="BlockVolumeReplica") 2441 else: 2442 return self.base_client.call_api( 2443 resource_path=resource_path, 2444 method=method, 2445 path_params=path_params, 2446 header_params=header_params, 2447 response_type="BlockVolumeReplica") 2448 2449 def get_boot_volume(self, boot_volume_id, **kwargs): 2450 """ 2451 Gets information for the specified boot volume. 2452 2453 2454 :param str boot_volume_id: (required) 2455 The OCID of the boot volume. 2456 2457 :param obj retry_strategy: (optional) 2458 A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. 2459 2460 This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. 2461 The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. 2462 2463 To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. 2464 2465 :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.core.models.BootVolume` 2466 :rtype: :class:`~oci.response.Response` 2467 2468 :example: 2469 Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.53.1/core/get_boot_volume.py.html>`__ to see an example of how to use get_boot_volume API. 2470 """ 2471 resource_path = "/bootVolumes/{bootVolumeId}" 2472 method = "GET" 2473 2474 expected_kwargs = ["retry_strategy"] 2475 extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] 2476 if extra_kwargs: 2477 raise ValueError( 2478 "get_boot_volume got unknown kwargs: {!r}".format(extra_kwargs)) 2479 2480 path_params = { 2481 "bootVolumeId": boot_volume_id 2482 } 2483 2484 path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} 2485 2486 for (k, v) in six.iteritems(path_params): 2487 if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): 2488 raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k)) 2489 2490 header_params = { 2491 "accept": "application/json", 2492 "content-type": "application/json" 2493 } 2494 2495 retry_strategy = self.base_client.get_preferred_retry_strategy( 2496 operation_retry_strategy=kwargs.get('retry_strategy'), 2497 client_retry_strategy=self.retry_strategy 2498 ) 2499 2500 if retry_strategy: 2501 if not isinstance(retry_strategy, retry.NoneRetryStrategy): 2502 self.base_client.add_opc_client_retries_header(header_params) 2503 retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) 2504 return retry_strategy.make_retrying_call( 2505 self.base_client.call_api, 2506 resource_path=resource_path, 2507 method=method, 2508 path_params=path_params, 2509 header_params=header_params, 2510 response_type="BootVolume") 2511 else: 2512 return self.base_client.call_api( 2513 resource_path=resource_path, 2514 method=method, 2515 path_params=path_params, 2516 header_params=header_params, 2517 response_type="BootVolume") 2518 2519 def get_boot_volume_backup(self, boot_volume_backup_id, **kwargs): 2520 """ 2521 Gets information for the specified boot volume backup. 2522 2523 2524 :param str boot_volume_backup_id: (required) 2525 The OCID of the boot volume backup. 2526 2527 :param obj retry_strategy: (optional) 2528 A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. 2529 2530 This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. 2531 The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. 2532 2533 To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. 2534 2535 :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.core.models.BootVolumeBackup` 2536 :rtype: :class:`~oci.response.Response` 2537 2538 :example: 2539 Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.53.1/core/get_boot_volume_backup.py.html>`__ to see an example of how to use get_boot_volume_backup API. 2540 """ 2541 resource_path = "/bootVolumeBackups/{bootVolumeBackupId}" 2542 method = "GET" 2543 2544 expected_kwargs = ["retry_strategy"] 2545 extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] 2546 if extra_kwargs: 2547 raise ValueError( 2548 "get_boot_volume_backup got unknown kwargs: {!r}".format(extra_kwargs)) 2549 2550 path_params = { 2551 "bootVolumeBackupId": boot_volume_backup_id 2552 } 2553 2554 path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} 2555 2556 for (k, v) in six.iteritems(path_params): 2557 if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): 2558 raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k)) 2559 2560 header_params = { 2561 "accept": "application/json", 2562 "content-type": "application/json" 2563 } 2564 2565 retry_strategy = self.base_client.get_preferred_retry_strategy( 2566 operation_retry_strategy=kwargs.get('retry_strategy'), 2567 client_retry_strategy=self.retry_strategy 2568 ) 2569 2570 if retry_strategy: 2571 if not isinstance(retry_strategy, retry.NoneRetryStrategy): 2572 self.base_client.add_opc_client_retries_header(header_params) 2573 retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) 2574 return retry_strategy.make_retrying_call( 2575 self.base_client.call_api, 2576 resource_path=resource_path, 2577 method=method, 2578 path_params=path_params, 2579 header_params=header_params, 2580 response_type="BootVolumeBackup") 2581 else: 2582 return self.base_client.call_api( 2583 resource_path=resource_path, 2584 method=method, 2585 path_params=path_params, 2586 header_params=header_params, 2587 response_type="BootVolumeBackup") 2588 2589 def get_boot_volume_kms_key(self, boot_volume_id, **kwargs): 2590 """ 2591 Gets the Key Management encryption key assigned to the specified boot volume. 2592 2593 2594 :param str boot_volume_id: (required) 2595 The OCID of the boot volume. 2596 2597 :param str if_match: (optional) 2598 For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` 2599 parameter to the value of the etag from a previous GET or POST response for that resource. The resource 2600 will be updated or deleted only if the etag you provide matches the resource's current etag value. 2601 2602 :param obj retry_strategy: (optional) 2603 A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. 2604 2605 This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. 2606 The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. 2607 2608 To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. 2609 2610 :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.core.models.BootVolumeKmsKey` 2611 :rtype: :class:`~oci.response.Response` 2612 2613 :example: 2614 Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.53.1/core/get_boot_volume_kms_key.py.html>`__ to see an example of how to use get_boot_volume_kms_key API. 2615 """ 2616 resource_path = "/bootVolumes/{bootVolumeId}/kmsKey" 2617 method = "GET" 2618 2619 # Don't accept unknown kwargs 2620 expected_kwargs = [ 2621 "retry_strategy", 2622 "if_match" 2623 ] 2624 extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] 2625 if extra_kwargs: 2626 raise ValueError( 2627 "get_boot_volume_kms_key got unknown kwargs: {!r}".format(extra_kwargs)) 2628 2629 path_params = { 2630 "bootVolumeId": boot_volume_id 2631 } 2632 2633 path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} 2634 2635 for (k, v) in six.iteritems(path_params): 2636 if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): 2637 raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k)) 2638 2639 header_params = { 2640 "accept": "application/json", 2641 "content-type": "application/json", 2642 "if-match": kwargs.get("if_match", missing) 2643 } 2644 header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} 2645 2646 retry_strategy = self.base_client.get_preferred_retry_strategy( 2647 operation_retry_strategy=kwargs.get('retry_strategy'), 2648 client_retry_strategy=self.retry_strategy 2649 ) 2650 2651 if retry_strategy: 2652 if not isinstance(retry_strategy, retry.NoneRetryStrategy): 2653 self.base_client.add_opc_client_retries_header(header_params) 2654 retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) 2655 return retry_strategy.make_retrying_call( 2656 self.base_client.call_api, 2657 resource_path=resource_path, 2658 method=method, 2659 path_params=path_params, 2660 header_params=header_params, 2661 response_type="BootVolumeKmsKey") 2662 else: 2663 return self.base_client.call_api( 2664 resource_path=resource_path, 2665 method=method, 2666 path_params=path_params, 2667 header_params=header_params, 2668 response_type="BootVolumeKmsKey") 2669 2670 def get_boot_volume_replica(self, boot_volume_replica_id, **kwargs): 2671 """ 2672 Gets information for the specified boot volume replica. 2673 2674 2675 :param str boot_volume_replica_id: (required) 2676 The OCID of the boot volume replica. 2677 2678 :param obj retry_strategy: (optional) 2679 A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. 2680 2681 This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. 2682 The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. 2683 2684 To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. 2685 2686 :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.core.models.BootVolumeReplica` 2687 :rtype: :class:`~oci.response.Response` 2688 2689 :example: 2690 Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.53.1/core/get_boot_volume_replica.py.html>`__ to see an example of how to use get_boot_volume_replica API. 2691 """ 2692 resource_path = "/bootVolumeReplicas/{bootVolumeReplicaId}" 2693 method = "GET" 2694 2695 expected_kwargs = ["retry_strategy"] 2696 extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] 2697 if extra_kwargs: 2698 raise ValueError( 2699 "get_boot_volume_replica got unknown kwargs: {!r}".format(extra_kwargs)) 2700 2701 path_params = { 2702 "bootVolumeReplicaId": boot_volume_replica_id 2703 } 2704 2705 path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} 2706 2707 for (k, v) in six.iteritems(path_params): 2708 if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): 2709 raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k)) 2710 2711 header_params = { 2712 "accept": "application/json", 2713 "content-type": "application/json" 2714 } 2715 2716 retry_strategy = self.base_client.get_preferred_retry_strategy( 2717 operation_retry_strategy=kwargs.get('retry_strategy'), 2718 client_retry_strategy=self.retry_strategy 2719 ) 2720 2721 if retry_strategy: 2722 if not isinstance(retry_strategy, retry.NoneRetryStrategy): 2723 self.base_client.add_opc_client_retries_header(header_params) 2724 retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) 2725 return retry_strategy.make_retrying_call( 2726 self.base_client.call_api, 2727 resource_path=resource_path, 2728 method=method, 2729 path_params=path_params, 2730 header_params=header_params, 2731 response_type="BootVolumeReplica") 2732 else: 2733 return self.base_client.call_api( 2734 resource_path=resource_path, 2735 method=method, 2736 path_params=path_params, 2737 header_params=header_params, 2738 response_type="BootVolumeReplica") 2739 2740 def get_volume(self, volume_id, **kwargs): 2741 """ 2742 Gets information for the specified volume. 2743 2744 2745 :param str volume_id: (required) 2746 The OCID of the volume. 2747 2748 :param obj retry_strategy: (optional) 2749 A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. 2750 2751 This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. 2752 The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. 2753 2754 To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. 2755 2756 :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.core.models.Volume` 2757 :rtype: :class:`~oci.response.Response` 2758 2759 :example: 2760 Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.53.1/core/get_volume.py.html>`__ to see an example of how to use get_volume API. 2761 """ 2762 resource_path = "/volumes/{volumeId}" 2763 method = "GET" 2764 2765 expected_kwargs = ["retry_strategy"] 2766 extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] 2767 if extra_kwargs: 2768 raise ValueError( 2769 "get_volume got unknown kwargs: {!r}".format(extra_kwargs)) 2770 2771 path_params = { 2772 "volumeId": volume_id 2773 } 2774 2775 path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} 2776 2777 for (k, v) in six.iteritems(path_params): 2778 if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): 2779 raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k)) 2780 2781 header_params = { 2782 "accept": "application/json", 2783 "content-type": "application/json" 2784 } 2785 2786 retry_strategy = self.base_client.get_preferred_retry_strategy( 2787 operation_retry_strategy=kwargs.get('retry_strategy'), 2788 client_retry_strategy=self.retry_strategy 2789 ) 2790 2791 if retry_strategy: 2792 if not isinstance(retry_strategy, retry.NoneRetryStrategy): 2793 self.base_client.add_opc_client_retries_header(header_params) 2794 retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) 2795 return retry_strategy.make_retrying_call( 2796 self.base_client.call_api, 2797 resource_path=resource_path, 2798 method=method, 2799 path_params=path_params, 2800 header_params=header_params, 2801 response_type="Volume") 2802 else: 2803 return self.base_client.call_api( 2804 resource_path=resource_path, 2805 method=method, 2806 path_params=path_params, 2807 header_params=header_params, 2808 response_type="Volume") 2809 2810 def get_volume_backup(self, volume_backup_id, **kwargs): 2811 """ 2812 Gets information for the specified volume backup. 2813 2814 2815 :param str volume_backup_id: (required) 2816 The OCID of the volume backup. 2817 2818 :param obj retry_strategy: (optional) 2819 A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. 2820 2821 This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. 2822 The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. 2823 2824 To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. 2825 2826 :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.core.models.VolumeBackup` 2827 :rtype: :class:`~oci.response.Response` 2828 2829 :example: 2830 Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.53.1/core/get_volume_backup.py.html>`__ to see an example of how to use get_volume_backup API. 2831 """ 2832 resource_path = "/volumeBackups/{volumeBackupId}" 2833 method = "GET" 2834 2835 expected_kwargs = ["retry_strategy"] 2836 extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] 2837 if extra_kwargs: 2838 raise ValueError( 2839 "get_volume_backup got unknown kwargs: {!r}".format(extra_kwargs)) 2840 2841 path_params = { 2842 "volumeBackupId": volume_backup_id 2843 } 2844 2845 path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} 2846 2847 for (k, v) in six.iteritems(path_params): 2848 if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): 2849 raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k)) 2850 2851 header_params = { 2852 "accept": "application/json", 2853 "content-type": "application/json" 2854 } 2855 2856 retry_strategy = self.base_client.get_preferred_retry_strategy( 2857 operation_retry_strategy=kwargs.get('retry_strategy'), 2858 client_retry_strategy=self.retry_strategy 2859 ) 2860 2861 if retry_strategy: 2862 if not isinstance(retry_strategy, retry.NoneRetryStrategy): 2863 self.base_client.add_opc_client_retries_header(header_params) 2864 retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) 2865 return retry_strategy.make_retrying_call( 2866 self.base_client.call_api, 2867 resource_path=resource_path, 2868 method=method, 2869 path_params=path_params, 2870 header_params=header_params, 2871 response_type="VolumeBackup") 2872 else: 2873 return self.base_client.call_api( 2874 resource_path=resource_path, 2875 method=method, 2876 path_params=path_params, 2877 header_params=header_params, 2878 response_type="VolumeBackup") 2879 2880 def get_volume_backup_policy(self, policy_id, **kwargs): 2881 """ 2882 Gets information for the specified volume backup policy. 2883 2884 2885 :param str policy_id: (required) 2886 The OCID of the volume backup policy. 2887 2888 :param obj retry_strategy: (optional) 2889 A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. 2890 2891 This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. 2892 The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. 2893 2894 To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. 2895 2896 :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.core.models.VolumeBackupPolicy` 2897 :rtype: :class:`~oci.response.Response` 2898 2899 :example: 2900 Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.53.1/core/get_volume_backup_policy.py.html>`__ to see an example of how to use get_volume_backup_policy API. 2901 """ 2902 resource_path = "/volumeBackupPolicies/{policyId}" 2903 method = "GET" 2904 2905 expected_kwargs = ["retry_strategy"] 2906 extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] 2907 if extra_kwargs: 2908 raise ValueError( 2909 "get_volume_backup_policy got unknown kwargs: {!r}".format(extra_kwargs)) 2910 2911 path_params = { 2912 "policyId": policy_id 2913 } 2914 2915 path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} 2916 2917 for (k, v) in six.iteritems(path_params): 2918 if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): 2919 raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k)) 2920 2921 header_params = { 2922 "accept": "application/json", 2923 "content-type": "application/json" 2924 } 2925 2926 retry_strategy = self.base_client.get_preferred_retry_strategy( 2927 operation_retry_strategy=kwargs.get('retry_strategy'), 2928 client_retry_strategy=self.retry_strategy 2929 ) 2930 2931 if retry_strategy: 2932 if not isinstance(retry_strategy, retry.NoneRetryStrategy): 2933 self.base_client.add_opc_client_retries_header(header_params) 2934 retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) 2935 return retry_strategy.make_retrying_call( 2936 self.base_client.call_api, 2937 resource_path=resource_path, 2938 method=method, 2939 path_params=path_params, 2940 header_params=header_params, 2941 response_type="VolumeBackupPolicy") 2942 else: 2943 return self.base_client.call_api( 2944 resource_path=resource_path, 2945 method=method, 2946 path_params=path_params, 2947 header_params=header_params, 2948 response_type="VolumeBackupPolicy") 2949 2950 def get_volume_backup_policy_asset_assignment(self, asset_id, **kwargs): 2951 """ 2952 Gets the volume backup policy assignment for the specified volume. The 2953 `assetId` query parameter is required, and the returned list will contain at most 2954 one item, since volume can only have one volume backup policy assigned at a time. 2955 2956 2957 :param str asset_id: (required) 2958 The OCID of an asset (e.g. a volume). 2959 2960 :param int limit: (optional) 2961 For list pagination. The maximum number of results per page, or items to return in a paginated 2962 \"List\" call. For important details about how pagination works, see 2963 `List Pagination`__. 2964 2965 Example: `50` 2966 2967 __ https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine 2968 2969 :param str page: (optional) 2970 For list pagination. The value of the `opc-next-page` response header from the previous \"List\" 2971 call. For important details about how pagination works, see 2972 `List Pagination`__. 2973 2974 __ https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine 2975 2976 :param obj retry_strategy: (optional) 2977 A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. 2978 2979 This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. 2980 The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. 2981 2982 To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. 2983 2984 :return: A :class:`~oci.response.Response` object with data of type list of :class:`~oci.core.models.VolumeBackupPolicyAssignment` 2985 :rtype: :class:`~oci.response.Response` 2986 2987 :example: 2988 Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.53.1/core/get_volume_backup_policy_asset_assignment.py.html>`__ to see an example of how to use get_volume_backup_policy_asset_assignment API. 2989 """ 2990 resource_path = "/volumeBackupPolicyAssignments" 2991 method = "GET" 2992 2993 # Don't accept unknown kwargs 2994 expected_kwargs = [ 2995 "retry_strategy", 2996 "limit", 2997 "page" 2998 ] 2999 extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] 3000 if extra_kwargs: 3001 raise ValueError( 3002 "get_volume_backup_policy_asset_assignment got unknown kwargs: {!r}".format(extra_kwargs)) 3003 3004 query_params = { 3005 "assetId": asset_id, 3006 "limit": kwargs.get("limit", missing), 3007 "page": kwargs.get("page", missing) 3008 } 3009 query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None} 3010 3011 header_params = { 3012 "accept": "application/json", 3013 "content-type": "application/json" 3014 } 3015 3016 retry_strategy = self.base_client.get_preferred_retry_strategy( 3017 operation_retry_strategy=kwargs.get('retry_strategy'), 3018 client_retry_strategy=self.retry_strategy 3019 ) 3020 3021 if retry_strategy: 3022 if not isinstance(retry_strategy, retry.NoneRetryStrategy): 3023 self.base_client.add_opc_client_retries_header(header_params) 3024 retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) 3025 return retry_strategy.make_retrying_call( 3026 self.base_client.call_api, 3027 resource_path=resource_path, 3028 method=method, 3029 query_params=query_params, 3030 header_params=header_params, 3031 response_type="list[VolumeBackupPolicyAssignment]") 3032 else: 3033 return self.base_client.call_api( 3034 resource_path=resource_path, 3035 method=method, 3036 query_params=query_params, 3037 header_params=header_params, 3038 response_type="list[VolumeBackupPolicyAssignment]") 3039 3040 def get_volume_backup_policy_assignment(self, policy_assignment_id, **kwargs): 3041 """ 3042 Gets information for the specified volume backup policy assignment. 3043 3044 3045 :param str policy_assignment_id: (required) 3046 The OCID of the volume backup policy assignment. 3047 3048 :param obj retry_strategy: (optional) 3049 A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. 3050 3051 This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. 3052 The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. 3053 3054 To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. 3055 3056 :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.core.models.VolumeBackupPolicyAssignment` 3057 :rtype: :class:`~oci.response.Response` 3058 3059 :example: 3060 Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.53.1/core/get_volume_backup_policy_assignment.py.html>`__ to see an example of how to use get_volume_backup_policy_assignment API. 3061 """ 3062 resource_path = "/volumeBackupPolicyAssignments/{policyAssignmentId}" 3063 method = "GET" 3064 3065 expected_kwargs = ["retry_strategy"] 3066 extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] 3067 if extra_kwargs: 3068 raise ValueError( 3069 "get_volume_backup_policy_assignment got unknown kwargs: {!r}".format(extra_kwargs)) 3070 3071 path_params = { 3072 "policyAssignmentId": policy_assignment_id 3073 } 3074 3075 path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} 3076 3077 for (k, v) in six.iteritems(path_params): 3078 if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): 3079 raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k)) 3080 3081 header_params = { 3082 "accept": "application/json", 3083 "content-type": "application/json" 3084 } 3085 3086 retry_strategy = self.base_client.get_preferred_retry_strategy( 3087 operation_retry_strategy=kwargs.get('retry_strategy'), 3088 client_retry_strategy=self.retry_strategy 3089 ) 3090 3091 if retry_strategy: 3092 if not isinstance(retry_strategy, retry.NoneRetryStrategy): 3093 self.base_client.add_opc_client_retries_header(header_params) 3094 retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) 3095 return retry_strategy.make_retrying_call( 3096 self.base_client.call_api, 3097 resource_path=resource_path, 3098 method=method, 3099 path_params=path_params, 3100 header_params=header_params, 3101 response_type="VolumeBackupPolicyAssignment") 3102 else: 3103 return self.base_client.call_api( 3104 resource_path=resource_path, 3105 method=method, 3106 path_params=path_params, 3107 header_params=header_params, 3108 response_type="VolumeBackupPolicyAssignment") 3109 3110 def get_volume_group(self, volume_group_id, **kwargs): 3111 """ 3112 Gets information for the specified volume group. For more information, see `Volume Groups`__. 3113 3114 __ https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/volumegroups.htm 3115 3116 3117 :param str volume_group_id: (required) 3118 The Oracle Cloud ID (OCID) that uniquely identifies the volume group. 3119 3120 :param obj retry_strategy: (optional) 3121 A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. 3122 3123 This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. 3124 The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. 3125 3126 To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. 3127 3128 :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.core.models.VolumeGroup` 3129 :rtype: :class:`~oci.response.Response` 3130 3131 :example: 3132 Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.53.1/core/get_volume_group.py.html>`__ to see an example of how to use get_volume_group API. 3133 """ 3134 resource_path = "/volumeGroups/{volumeGroupId}" 3135 method = "GET" 3136 3137 expected_kwargs = ["retry_strategy"] 3138 extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] 3139 if extra_kwargs: 3140 raise ValueError( 3141 "get_volume_group got unknown kwargs: {!r}".format(extra_kwargs)) 3142 3143 path_params = { 3144 "volumeGroupId": volume_group_id 3145 } 3146 3147 path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} 3148 3149 for (k, v) in six.iteritems(path_params): 3150 if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): 3151 raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k)) 3152 3153 header_params = { 3154 "accept": "application/json", 3155 "content-type": "application/json" 3156 } 3157 3158 retry_strategy = self.base_client.get_preferred_retry_strategy( 3159 operation_retry_strategy=kwargs.get('retry_strategy'), 3160 client_retry_strategy=self.retry_strategy 3161 ) 3162 3163 if retry_strategy: 3164 if not isinstance(retry_strategy, retry.NoneRetryStrategy): 3165 self.base_client.add_opc_client_retries_header(header_params) 3166 retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) 3167 return retry_strategy.make_retrying_call( 3168 self.base_client.call_api, 3169 resource_path=resource_path, 3170 method=method, 3171 path_params=path_params, 3172 header_params=header_params, 3173 response_type="VolumeGroup") 3174 else: 3175 return self.base_client.call_api( 3176 resource_path=resource_path, 3177 method=method, 3178 path_params=path_params, 3179 header_params=header_params, 3180 response_type="VolumeGroup") 3181 3182 def get_volume_group_backup(self, volume_group_backup_id, **kwargs): 3183 """ 3184 Gets information for the specified volume group backup. For more information, see `Volume Groups`__. 3185 3186 __ https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/volumegroups.htm 3187 3188 3189 :param str volume_group_backup_id: (required) 3190 The Oracle Cloud ID (OCID) that uniquely identifies the volume group backup. 3191 3192 :param obj retry_strategy: (optional) 3193 A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. 3194 3195 This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. 3196 The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. 3197 3198 To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. 3199 3200 :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.core.models.VolumeGroupBackup` 3201 :rtype: :class:`~oci.response.Response` 3202 3203 :example: 3204 Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.53.1/core/get_volume_group_backup.py.html>`__ to see an example of how to use get_volume_group_backup API. 3205 """ 3206 resource_path = "/volumeGroupBackups/{volumeGroupBackupId}" 3207 method = "GET" 3208 3209 expected_kwargs = ["retry_strategy"] 3210 extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] 3211 if extra_kwargs: 3212 raise ValueError( 3213 "get_volume_group_backup got unknown kwargs: {!r}".format(extra_kwargs)) 3214 3215 path_params = { 3216 "volumeGroupBackupId": volume_group_backup_id 3217 } 3218 3219 path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} 3220 3221 for (k, v) in six.iteritems(path_params): 3222 if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): 3223 raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k)) 3224 3225 header_params = { 3226 "accept": "application/json", 3227 "content-type": "application/json" 3228 } 3229 3230 retry_strategy = self.base_client.get_preferred_retry_strategy( 3231 operation_retry_strategy=kwargs.get('retry_strategy'), 3232 client_retry_strategy=self.retry_strategy 3233 ) 3234 3235 if retry_strategy: 3236 if not isinstance(retry_strategy, retry.NoneRetryStrategy): 3237 self.base_client.add_opc_client_retries_header(header_params) 3238 retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) 3239 return retry_strategy.make_retrying_call( 3240 self.base_client.call_api, 3241 resource_path=resource_path, 3242 method=method, 3243 path_params=path_params, 3244 header_params=header_params, 3245 response_type="VolumeGroupBackup") 3246 else: 3247 return self.base_client.call_api( 3248 resource_path=resource_path, 3249 method=method, 3250 path_params=path_params, 3251 header_params=header_params, 3252 response_type="VolumeGroupBackup") 3253 3254 def get_volume_kms_key(self, volume_id, **kwargs): 3255 """ 3256 Gets the Key Management encryption key assigned to the specified volume. 3257 3258 3259 :param str volume_id: (required) 3260 The OCID of the volume. 3261 3262 :param str if_match: (optional) 3263 For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` 3264 parameter to the value of the etag from a previous GET or POST response for that resource. The resource 3265 will be updated or deleted only if the etag you provide matches the resource's current etag value. 3266 3267 :param obj retry_strategy: (optional) 3268 A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. 3269 3270 This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. 3271 The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. 3272 3273 To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. 3274 3275 :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.core.models.VolumeKmsKey` 3276 :rtype: :class:`~oci.response.Response` 3277 3278 :example: 3279 Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.53.1/core/get_volume_kms_key.py.html>`__ to see an example of how to use get_volume_kms_key API. 3280 """ 3281 resource_path = "/volumes/{volumeId}/kmsKey" 3282 method = "GET" 3283 3284 # Don't accept unknown kwargs 3285 expected_kwargs = [ 3286 "retry_strategy", 3287 "if_match" 3288 ] 3289 extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] 3290 if extra_kwargs: 3291 raise ValueError( 3292 "get_volume_kms_key got unknown kwargs: {!r}".format(extra_kwargs)) 3293 3294 path_params = { 3295 "volumeId": volume_id 3296 } 3297 3298 path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} 3299 3300 for (k, v) in six.iteritems(path_params): 3301 if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): 3302 raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k)) 3303 3304 header_params = { 3305 "accept": "application/json", 3306 "content-type": "application/json", 3307 "if-match": kwargs.get("if_match", missing) 3308 } 3309 header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} 3310 3311 retry_strategy = self.base_client.get_preferred_retry_strategy( 3312 operation_retry_strategy=kwargs.get('retry_strategy'), 3313 client_retry_strategy=self.retry_strategy 3314 ) 3315 3316 if retry_strategy: 3317 if not isinstance(retry_strategy, retry.NoneRetryStrategy): 3318 self.base_client.add_opc_client_retries_header(header_params) 3319 retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) 3320 return retry_strategy.make_retrying_call( 3321 self.base_client.call_api, 3322 resource_path=resource_path, 3323 method=method, 3324 path_params=path_params, 3325 header_params=header_params, 3326 response_type="VolumeKmsKey") 3327 else: 3328 return self.base_client.call_api( 3329 resource_path=resource_path, 3330 method=method, 3331 path_params=path_params, 3332 header_params=header_params, 3333 response_type="VolumeKmsKey") 3334 3335 def list_block_volume_replicas(self, availability_domain, compartment_id, **kwargs): 3336 """ 3337 Lists the block volume replicas in the specified compartment and availability domain. 3338 3339 3340 :param str availability_domain: (required) 3341 The name of the availability domain. 3342 3343 Example: `Uocm:PHX-AD-1` 3344 3345 :param str compartment_id: (required) 3346 The `OCID`__ of the compartment. 3347 3348 __ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm 3349 3350 :param int limit: (optional) 3351 For list pagination. The maximum number of results per page, or items to return in a paginated 3352 \"List\" call. For important details about how pagination works, see 3353 `List Pagination`__. 3354 3355 Example: `50` 3356 3357 __ https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine 3358 3359 :param str page: (optional) 3360 For list pagination. The value of the `opc-next-page` response header from the previous \"List\" 3361 call. For important details about how pagination works, see 3362 `List Pagination`__. 3363 3364 __ https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine 3365 3366 :param str display_name: (optional) 3367 A filter to return only resources that match the given display name exactly. 3368 3369 :param str sort_by: (optional) 3370 The field to sort by. You can provide one sort order (`sortOrder`). Default order for 3371 TIMECREATED is descending. Default order for DISPLAYNAME is ascending. The DISPLAYNAME 3372 sort order is case sensitive. 3373 3374 **Note:** In general, some \"List\" operations (for example, `ListInstances`) let you 3375 optionally filter by availability domain if the scope of the resource type is within a 3376 single availability domain. If you call one of these \"List\" operations without specifying 3377 an availability domain, the resources are grouped by availability domain, then sorted. 3378 3379 Allowed values are: "TIMECREATED", "DISPLAYNAME" 3380 3381 :param str sort_order: (optional) 3382 The sort order to use, either ascending (`ASC`) or descending (`DESC`). The DISPLAYNAME sort order 3383 is case sensitive. 3384 3385 Allowed values are: "ASC", "DESC" 3386 3387 :param str lifecycle_state: (optional) 3388 A filter to only return resources that match the given lifecycle state. The state value is case-insensitive. 3389 3390 Allowed values are: "PROVISIONING", "AVAILABLE", "ACTIVATING", "TERMINATING", "TERMINATED", "FAULTY" 3391 3392 :param obj retry_strategy: (optional) 3393 A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. 3394 3395 This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. 3396 The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. 3397 3398 To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. 3399 3400 :return: A :class:`~oci.response.Response` object with data of type list of :class:`~oci.core.models.BlockVolumeReplica` 3401 :rtype: :class:`~oci.response.Response` 3402 3403 :example: 3404 Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.53.1/core/list_block_volume_replicas.py.html>`__ to see an example of how to use list_block_volume_replicas API. 3405 """ 3406 resource_path = "/blockVolumeReplicas" 3407 method = "GET" 3408 3409 # Don't accept unknown kwargs 3410 expected_kwargs = [ 3411 "retry_strategy", 3412 "limit", 3413 "page", 3414 "display_name", 3415 "sort_by", 3416 "sort_order", 3417 "lifecycle_state" 3418 ] 3419 extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] 3420 if extra_kwargs: 3421 raise ValueError( 3422 "list_block_volume_replicas got unknown kwargs: {!r}".format(extra_kwargs)) 3423 3424 if 'sort_by' in kwargs: 3425 sort_by_allowed_values = ["TIMECREATED", "DISPLAYNAME"] 3426 if kwargs['sort_by'] not in sort_by_allowed_values: 3427 raise ValueError( 3428 "Invalid value for `sort_by`, must be one of {0}".format(sort_by_allowed_values) 3429 ) 3430 3431 if 'sort_order' in kwargs: 3432 sort_order_allowed_values = ["ASC", "DESC"] 3433 if kwargs['sort_order'] not in sort_order_allowed_values: 3434 raise ValueError( 3435 "Invalid value for `sort_order`, must be one of {0}".format(sort_order_allowed_values) 3436 ) 3437 3438 if 'lifecycle_state' in kwargs: 3439 lifecycle_state_allowed_values = ["PROVISIONING", "AVAILABLE", "ACTIVATING", "TERMINATING", "TERMINATED", "FAULTY"] 3440 if kwargs['lifecycle_state'] not in lifecycle_state_allowed_values: 3441 raise ValueError( 3442 "Invalid value for `lifecycle_state`, must be one of {0}".format(lifecycle_state_allowed_values) 3443 ) 3444 3445 query_params = { 3446 "availabilityDomain": availability_domain, 3447 "compartmentId": compartment_id, 3448 "limit": kwargs.get("limit", missing), 3449 "page": kwargs.get("page", missing), 3450 "displayName": kwargs.get("display_name", missing), 3451 "sortBy": kwargs.get("sort_by", missing), 3452 "sortOrder": kwargs.get("sort_order", missing), 3453 "lifecycleState": kwargs.get("lifecycle_state", missing) 3454 } 3455 query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None} 3456 3457 header_params = { 3458 "accept": "application/json", 3459 "content-type": "application/json" 3460 } 3461 3462 retry_strategy = self.base_client.get_preferred_retry_strategy( 3463 operation_retry_strategy=kwargs.get('retry_strategy'), 3464 client_retry_strategy=self.retry_strategy 3465 ) 3466 3467 if retry_strategy: 3468 if not isinstance(retry_strategy, retry.NoneRetryStrategy): 3469 self.base_client.add_opc_client_retries_header(header_params) 3470 retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) 3471 return retry_strategy.make_retrying_call( 3472 self.base_client.call_api, 3473 resource_path=resource_path, 3474 method=method, 3475 query_params=query_params, 3476 header_params=header_params, 3477 response_type="list[BlockVolumeReplica]") 3478 else: 3479 return self.base_client.call_api( 3480 resource_path=resource_path, 3481 method=method, 3482 query_params=query_params, 3483 header_params=header_params, 3484 response_type="list[BlockVolumeReplica]") 3485 3486 def list_boot_volume_backups(self, compartment_id, **kwargs): 3487 """ 3488 Lists the boot volume backups in the specified compartment. You can filter the results by boot volume. 3489 3490 3491 :param str compartment_id: (required) 3492 The `OCID`__ of the compartment. 3493 3494 __ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm 3495 3496 :param str boot_volume_id: (optional) 3497 The OCID of the boot volume. 3498 3499 :param int limit: (optional) 3500 For list pagination. The maximum number of results per page, or items to return in a paginated 3501 \"List\" call. For important details about how pagination works, see 3502 `List Pagination`__. 3503 3504 Example: `50` 3505 3506 __ https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine 3507 3508 :param str page: (optional) 3509 For list pagination. The value of the `opc-next-page` response header from the previous \"List\" 3510 call. For important details about how pagination works, see 3511 `List Pagination`__. 3512 3513 __ https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine 3514 3515 :param str display_name: (optional) 3516 A filter to return only resources that match the given display name exactly. 3517 3518 :param str source_boot_volume_backup_id: (optional) 3519 A filter to return only resources that originated from the given source boot volume backup. 3520 3521 :param str sort_by: (optional) 3522 The field to sort by. You can provide one sort order (`sortOrder`). Default order for 3523 TIMECREATED is descending. Default order for DISPLAYNAME is ascending. The DISPLAYNAME 3524 sort order is case sensitive. 3525 3526 **Note:** In general, some \"List\" operations (for example, `ListInstances`) let you 3527 optionally filter by availability domain if the scope of the resource type is within a 3528 single availability domain. If you call one of these \"List\" operations without specifying 3529 an availability domain, the resources are grouped by availability domain, then sorted. 3530 3531 Allowed values are: "TIMECREATED", "DISPLAYNAME" 3532 3533 :param str sort_order: (optional) 3534 The sort order to use, either ascending (`ASC`) or descending (`DESC`). The DISPLAYNAME sort order 3535 is case sensitive. 3536 3537 Allowed values are: "ASC", "DESC" 3538 3539 :param str lifecycle_state: (optional) 3540 A filter to only return resources that match the given lifecycle state. The state value is 3541 case-insensitive. 3542 3543 Allowed values are: "CREATING", "AVAILABLE", "TERMINATING", "TERMINATED", "FAULTY", "REQUEST_RECEIVED" 3544 3545 :param obj retry_strategy: (optional) 3546 A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. 3547 3548 This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. 3549 The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. 3550 3551 To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. 3552 3553 :return: A :class:`~oci.response.Response` object with data of type list of :class:`~oci.core.models.BootVolumeBackup` 3554 :rtype: :class:`~oci.response.Response` 3555 3556 :example: 3557 Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.53.1/core/list_boot_volume_backups.py.html>`__ to see an example of how to use list_boot_volume_backups API. 3558 """ 3559 resource_path = "/bootVolumeBackups" 3560 method = "GET" 3561 3562 # Don't accept unknown kwargs 3563 expected_kwargs = [ 3564 "retry_strategy", 3565 "boot_volume_id", 3566 "limit", 3567 "page", 3568 "display_name", 3569 "source_boot_volume_backup_id", 3570 "sort_by", 3571 "sort_order", 3572 "lifecycle_state" 3573 ] 3574 extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] 3575 if extra_kwargs: 3576 raise ValueError( 3577 "list_boot_volume_backups got unknown kwargs: {!r}".format(extra_kwargs)) 3578 3579 if 'sort_by' in kwargs: 3580 sort_by_allowed_values = ["TIMECREATED", "DISPLAYNAME"] 3581 if kwargs['sort_by'] not in sort_by_allowed_values: 3582 raise ValueError( 3583 "Invalid value for `sort_by`, must be one of {0}".format(sort_by_allowed_values) 3584 ) 3585 3586 if 'sort_order' in kwargs: 3587 sort_order_allowed_values = ["ASC", "DESC"] 3588 if kwargs['sort_order'] not in sort_order_allowed_values: 3589 raise ValueError( 3590 "Invalid value for `sort_order`, must be one of {0}".format(sort_order_allowed_values) 3591 ) 3592 3593 if 'lifecycle_state' in kwargs: 3594 lifecycle_state_allowed_values = ["CREATING", "AVAILABLE", "TERMINATING", "TERMINATED", "FAULTY", "REQUEST_RECEIVED"] 3595 if kwargs['lifecycle_state'] not in lifecycle_state_allowed_values: 3596 raise ValueError( 3597 "Invalid value for `lifecycle_state`, must be one of {0}".format(lifecycle_state_allowed_values) 3598 ) 3599 3600 query_params = { 3601 "compartmentId": compartment_id, 3602 "bootVolumeId": kwargs.get("boot_volume_id", missing), 3603 "limit": kwargs.get("limit", missing), 3604 "page": kwargs.get("page", missing), 3605 "displayName": kwargs.get("display_name", missing), 3606 "sourceBootVolumeBackupId": kwargs.get("source_boot_volume_backup_id", missing), 3607 "sortBy": kwargs.get("sort_by", missing), 3608 "sortOrder": kwargs.get("sort_order", missing), 3609 "lifecycleState": kwargs.get("lifecycle_state", missing) 3610 } 3611 query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None} 3612 3613 header_params = { 3614 "accept": "application/json", 3615 "content-type": "application/json" 3616 } 3617 3618 retry_strategy = self.base_client.get_preferred_retry_strategy( 3619 operation_retry_strategy=kwargs.get('retry_strategy'), 3620 client_retry_strategy=self.retry_strategy 3621 ) 3622 3623 if retry_strategy: 3624 if not isinstance(retry_strategy, retry.NoneRetryStrategy): 3625 self.base_client.add_opc_client_retries_header(header_params) 3626 retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) 3627 return retry_strategy.make_retrying_call( 3628 self.base_client.call_api, 3629 resource_path=resource_path, 3630 method=method, 3631 query_params=query_params, 3632 header_params=header_params, 3633 response_type="list[BootVolumeBackup]") 3634 else: 3635 return self.base_client.call_api( 3636 resource_path=resource_path, 3637 method=method, 3638 query_params=query_params, 3639 header_params=header_params, 3640 response_type="list[BootVolumeBackup]") 3641 3642 def list_boot_volume_replicas(self, availability_domain, compartment_id, **kwargs): 3643 """ 3644 Lists the boot volume replicas in the specified compartment and availability domain. 3645 3646 3647 :param str availability_domain: (required) 3648 The name of the availability domain. 3649 3650 Example: `Uocm:PHX-AD-1` 3651 3652 :param str compartment_id: (required) 3653 The `OCID`__ of the compartment. 3654 3655 __ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm 3656 3657 :param int limit: (optional) 3658 For list pagination. The maximum number of results per page, or items to return in a paginated 3659 \"List\" call. For important details about how pagination works, see 3660 `List Pagination`__. 3661 3662 Example: `50` 3663 3664 __ https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine 3665 3666 :param str page: (optional) 3667 For list pagination. The value of the `opc-next-page` response header from the previous \"List\" 3668 call. For important details about how pagination works, see 3669 `List Pagination`__. 3670 3671 __ https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine 3672 3673 :param str display_name: (optional) 3674 A filter to return only resources that match the given display name exactly. 3675 3676 :param str sort_by: (optional) 3677 The field to sort by. You can provide one sort order (`sortOrder`). Default order for 3678 TIMECREATED is descending. Default order for DISPLAYNAME is ascending. The DISPLAYNAME 3679 sort order is case sensitive. 3680 3681 **Note:** In general, some \"List\" operations (for example, `ListInstances`) let you 3682 optionally filter by availability domain if the scope of the resource type is within a 3683 single availability domain. If you call one of these \"List\" operations without specifying 3684 an availability domain, the resources are grouped by availability domain, then sorted. 3685 3686 Allowed values are: "TIMECREATED", "DISPLAYNAME" 3687 3688 :param str sort_order: (optional) 3689 The sort order to use, either ascending (`ASC`) or descending (`DESC`). The DISPLAYNAME sort order 3690 is case sensitive. 3691 3692 Allowed values are: "ASC", "DESC" 3693 3694 :param str lifecycle_state: (optional) 3695 A filter to only return resources that match the given lifecycle state. The state value is case-insensitive. 3696 3697 Allowed values are: "PROVISIONING", "AVAILABLE", "ACTIVATING", "TERMINATING", "TERMINATED", "FAULTY" 3698 3699 :param obj retry_strategy: (optional) 3700 A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. 3701 3702 This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. 3703 The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. 3704 3705 To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. 3706 3707 :return: A :class:`~oci.response.Response` object with data of type list of :class:`~oci.core.models.BootVolumeReplica` 3708 :rtype: :class:`~oci.response.Response` 3709 3710 :example: 3711 Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.53.1/core/list_boot_volume_replicas.py.html>`__ to see an example of how to use list_boot_volume_replicas API. 3712 """ 3713 resource_path = "/bootVolumeReplicas" 3714 method = "GET" 3715 3716 # Don't accept unknown kwargs 3717 expected_kwargs = [ 3718 "retry_strategy", 3719 "limit", 3720 "page", 3721 "display_name", 3722 "sort_by", 3723 "sort_order", 3724 "lifecycle_state" 3725 ] 3726 extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] 3727 if extra_kwargs: 3728 raise ValueError( 3729 "list_boot_volume_replicas got unknown kwargs: {!r}".format(extra_kwargs)) 3730 3731 if 'sort_by' in kwargs: 3732 sort_by_allowed_values = ["TIMECREATED", "DISPLAYNAME"] 3733 if kwargs['sort_by'] not in sort_by_allowed_values: 3734 raise ValueError( 3735 "Invalid value for `sort_by`, must be one of {0}".format(sort_by_allowed_values) 3736 ) 3737 3738 if 'sort_order' in kwargs: 3739 sort_order_allowed_values = ["ASC", "DESC"] 3740 if kwargs['sort_order'] not in sort_order_allowed_values: 3741 raise ValueError( 3742 "Invalid value for `sort_order`, must be one of {0}".format(sort_order_allowed_values) 3743 ) 3744 3745 if 'lifecycle_state' in kwargs: 3746 lifecycle_state_allowed_values = ["PROVISIONING", "AVAILABLE", "ACTIVATING", "TERMINATING", "TERMINATED", "FAULTY"] 3747 if kwargs['lifecycle_state'] not in lifecycle_state_allowed_values: 3748 raise ValueError( 3749 "Invalid value for `lifecycle_state`, must be one of {0}".format(lifecycle_state_allowed_values) 3750 ) 3751 3752 query_params = { 3753 "availabilityDomain": availability_domain, 3754 "compartmentId": compartment_id, 3755 "limit": kwargs.get("limit", missing), 3756 "page": kwargs.get("page", missing), 3757 "displayName": kwargs.get("display_name", missing), 3758 "sortBy": kwargs.get("sort_by", missing), 3759 "sortOrder": kwargs.get("sort_order", missing), 3760 "lifecycleState": kwargs.get("lifecycle_state", missing) 3761 } 3762 query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None} 3763 3764 header_params = { 3765 "accept": "application/json", 3766 "content-type": "application/json" 3767 } 3768 3769 retry_strategy = self.base_client.get_preferred_retry_strategy( 3770 operation_retry_strategy=kwargs.get('retry_strategy'), 3771 client_retry_strategy=self.retry_strategy 3772 ) 3773 3774 if retry_strategy: 3775 if not isinstance(retry_strategy, retry.NoneRetryStrategy): 3776 self.base_client.add_opc_client_retries_header(header_params) 3777 retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) 3778 return retry_strategy.make_retrying_call( 3779 self.base_client.call_api, 3780 resource_path=resource_path, 3781 method=method, 3782 query_params=query_params, 3783 header_params=header_params, 3784 response_type="list[BootVolumeReplica]") 3785 else: 3786 return self.base_client.call_api( 3787 resource_path=resource_path, 3788 method=method, 3789 query_params=query_params, 3790 header_params=header_params, 3791 response_type="list[BootVolumeReplica]") 3792 3793 def list_boot_volumes(self, availability_domain, compartment_id, **kwargs): 3794 """ 3795 Lists the boot volumes in the specified compartment and availability domain. 3796 3797 3798 :param str availability_domain: (required) 3799 The name of the availability domain. 3800 3801 Example: `Uocm:PHX-AD-1` 3802 3803 :param str compartment_id: (required) 3804 The `OCID`__ of the compartment. 3805 3806 __ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm 3807 3808 :param int limit: (optional) 3809 For list pagination. The maximum number of results per page, or items to return in a paginated 3810 \"List\" call. For important details about how pagination works, see 3811 `List Pagination`__. 3812 3813 Example: `50` 3814 3815 __ https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine 3816 3817 :param str page: (optional) 3818 For list pagination. The value of the `opc-next-page` response header from the previous \"List\" 3819 call. For important details about how pagination works, see 3820 `List Pagination`__. 3821 3822 __ https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine 3823 3824 :param str volume_group_id: (optional) 3825 The OCID of the volume group. 3826 3827 :param obj retry_strategy: (optional) 3828 A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. 3829 3830 This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. 3831 The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. 3832 3833 To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. 3834 3835 :return: A :class:`~oci.response.Response` object with data of type list of :class:`~oci.core.models.BootVolume` 3836 :rtype: :class:`~oci.response.Response` 3837 3838 :example: 3839 Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.53.1/core/list_boot_volumes.py.html>`__ to see an example of how to use list_boot_volumes API. 3840 """ 3841 resource_path = "/bootVolumes" 3842 method = "GET" 3843 3844 # Don't accept unknown kwargs 3845 expected_kwargs = [ 3846 "retry_strategy", 3847 "limit", 3848 "page", 3849 "volume_group_id" 3850 ] 3851 extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] 3852 if extra_kwargs: 3853 raise ValueError( 3854 "list_boot_volumes got unknown kwargs: {!r}".format(extra_kwargs)) 3855 3856 query_params = { 3857 "availabilityDomain": availability_domain, 3858 "compartmentId": compartment_id, 3859 "limit": kwargs.get("limit", missing), 3860 "page": kwargs.get("page", missing), 3861 "volumeGroupId": kwargs.get("volume_group_id", missing) 3862 } 3863 query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None} 3864 3865 header_params = { 3866 "accept": "application/json", 3867 "content-type": "application/json" 3868 } 3869 3870 retry_strategy = self.base_client.get_preferred_retry_strategy( 3871 operation_retry_strategy=kwargs.get('retry_strategy'), 3872 client_retry_strategy=self.retry_strategy 3873 ) 3874 3875 if retry_strategy: 3876 if not isinstance(retry_strategy, retry.NoneRetryStrategy): 3877 self.base_client.add_opc_client_retries_header(header_params) 3878 retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) 3879 return retry_strategy.make_retrying_call( 3880 self.base_client.call_api, 3881 resource_path=resource_path, 3882 method=method, 3883 query_params=query_params, 3884 header_params=header_params, 3885 response_type="list[BootVolume]") 3886 else: 3887 return self.base_client.call_api( 3888 resource_path=resource_path, 3889 method=method, 3890 query_params=query_params, 3891 header_params=header_params, 3892 response_type="list[BootVolume]") 3893 3894 def list_volume_backup_policies(self, **kwargs): 3895 """ 3896 Lists all the volume backup policies available in the specified compartment. 3897 3898 For more information about Oracle defined backup policies and user defined backup policies, 3899 see `Policy-Based Backups`__. 3900 3901 __ https://docs.cloud.oracle.com/iaas/Content/Block/Tasks/schedulingvolumebackups.htm 3902 3903 3904 :param int limit: (optional) 3905 For list pagination. The maximum number of results per page, or items to return in a paginated 3906 \"List\" call. For important details about how pagination works, see 3907 `List Pagination`__. 3908 3909 Example: `50` 3910 3911 __ https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine 3912 3913 :param str page: (optional) 3914 For list pagination. The value of the `opc-next-page` response header from the previous \"List\" 3915 call. For important details about how pagination works, see 3916 `List Pagination`__. 3917 3918 __ https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine 3919 3920 :param str compartment_id: (optional) 3921 The OCID of the compartment. 3922 If no compartment is specified, the Oracle defined backup policies are listed. 3923 3924 :param obj retry_strategy: (optional) 3925 A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. 3926 3927 This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. 3928 The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. 3929 3930 To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. 3931 3932 :return: A :class:`~oci.response.Response` object with data of type list of :class:`~oci.core.models.VolumeBackupPolicy` 3933 :rtype: :class:`~oci.response.Response` 3934 3935 :example: 3936 Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.53.1/core/list_volume_backup_policies.py.html>`__ to see an example of how to use list_volume_backup_policies API. 3937 """ 3938 resource_path = "/volumeBackupPolicies" 3939 method = "GET" 3940 3941 # Don't accept unknown kwargs 3942 expected_kwargs = [ 3943 "retry_strategy", 3944 "limit", 3945 "page", 3946 "compartment_id" 3947 ] 3948 extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] 3949 if extra_kwargs: 3950 raise ValueError( 3951 "list_volume_backup_policies got unknown kwargs: {!r}".format(extra_kwargs)) 3952 3953 query_params = { 3954 "limit": kwargs.get("limit", missing), 3955 "page": kwargs.get("page", missing), 3956 "compartmentId": kwargs.get("compartment_id", missing) 3957 } 3958 query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None} 3959 3960 header_params = { 3961 "accept": "application/json", 3962 "content-type": "application/json" 3963 } 3964 3965 retry_strategy = self.base_client.get_preferred_retry_strategy( 3966 operation_retry_strategy=kwargs.get('retry_strategy'), 3967 client_retry_strategy=self.retry_strategy 3968 ) 3969 3970 if retry_strategy: 3971 if not isinstance(retry_strategy, retry.NoneRetryStrategy): 3972 self.base_client.add_opc_client_retries_header(header_params) 3973 retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) 3974 return retry_strategy.make_retrying_call( 3975 self.base_client.call_api, 3976 resource_path=resource_path, 3977 method=method, 3978 query_params=query_params, 3979 header_params=header_params, 3980 response_type="list[VolumeBackupPolicy]") 3981 else: 3982 return self.base_client.call_api( 3983 resource_path=resource_path, 3984 method=method, 3985 query_params=query_params, 3986 header_params=header_params, 3987 response_type="list[VolumeBackupPolicy]") 3988 3989 def list_volume_backups(self, compartment_id, **kwargs): 3990 """ 3991 Lists the volume backups in the specified compartment. You can filter the results by volume. 3992 3993 3994 :param str compartment_id: (required) 3995 The `OCID`__ of the compartment. 3996 3997 __ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm 3998 3999 :param str volume_id: (optional) 4000 The OCID of the volume. 4001 4002 :param int limit: (optional) 4003 For list pagination. The maximum number of results per page, or items to return in a paginated 4004 \"List\" call. For important details about how pagination works, see 4005 `List Pagination`__. 4006 4007 Example: `50` 4008 4009 __ https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine 4010 4011 :param str page: (optional) 4012 For list pagination. The value of the `opc-next-page` response header from the previous \"List\" 4013 call. For important details about how pagination works, see 4014 `List Pagination`__. 4015 4016 __ https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine 4017 4018 :param str display_name: (optional) 4019 A filter to return only resources that match the given display name exactly. 4020 4021 :param str source_volume_backup_id: (optional) 4022 A filter to return only resources that originated from the given source volume backup. 4023 4024 :param str sort_by: (optional) 4025 The field to sort by. You can provide one sort order (`sortOrder`). Default order for 4026 TIMECREATED is descending. Default order for DISPLAYNAME is ascending. The DISPLAYNAME 4027 sort order is case sensitive. 4028 4029 **Note:** In general, some \"List\" operations (for example, `ListInstances`) let you 4030 optionally filter by availability domain if the scope of the resource type is within a 4031 single availability domain. If you call one of these \"List\" operations without specifying 4032 an availability domain, the resources are grouped by availability domain, then sorted. 4033 4034 Allowed values are: "TIMECREATED", "DISPLAYNAME" 4035 4036 :param str sort_order: (optional) 4037 The sort order to use, either ascending (`ASC`) or descending (`DESC`). The DISPLAYNAME sort order 4038 is case sensitive. 4039 4040 Allowed values are: "ASC", "DESC" 4041 4042 :param str lifecycle_state: (optional) 4043 A filter to only return resources that match the given lifecycle state. The state 4044 value is case-insensitive. 4045 4046 Allowed values are: "CREATING", "AVAILABLE", "TERMINATING", "TERMINATED", "FAULTY", "REQUEST_RECEIVED" 4047 4048 :param obj retry_strategy: (optional) 4049 A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. 4050 4051 This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. 4052 The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. 4053 4054 To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. 4055 4056 :return: A :class:`~oci.response.Response` object with data of type list of :class:`~oci.core.models.VolumeBackup` 4057 :rtype: :class:`~oci.response.Response` 4058 4059 :example: 4060 Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.53.1/core/list_volume_backups.py.html>`__ to see an example of how to use list_volume_backups API. 4061 """ 4062 resource_path = "/volumeBackups" 4063 method = "GET" 4064 4065 # Don't accept unknown kwargs 4066 expected_kwargs = [ 4067 "retry_strategy", 4068 "volume_id", 4069 "limit", 4070 "page", 4071 "display_name", 4072 "source_volume_backup_id", 4073 "sort_by", 4074 "sort_order", 4075 "lifecycle_state" 4076 ] 4077 extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] 4078 if extra_kwargs: 4079 raise ValueError( 4080 "list_volume_backups got unknown kwargs: {!r}".format(extra_kwargs)) 4081 4082 if 'sort_by' in kwargs: 4083 sort_by_allowed_values = ["TIMECREATED", "DISPLAYNAME"] 4084 if kwargs['sort_by'] not in sort_by_allowed_values: 4085 raise ValueError( 4086 "Invalid value for `sort_by`, must be one of {0}".format(sort_by_allowed_values) 4087 ) 4088 4089 if 'sort_order' in kwargs: 4090 sort_order_allowed_values = ["ASC", "DESC"] 4091 if kwargs['sort_order'] not in sort_order_allowed_values: 4092 raise ValueError( 4093 "Invalid value for `sort_order`, must be one of {0}".format(sort_order_allowed_values) 4094 ) 4095 4096 if 'lifecycle_state' in kwargs: 4097 lifecycle_state_allowed_values = ["CREATING", "AVAILABLE", "TERMINATING", "TERMINATED", "FAULTY", "REQUEST_RECEIVED"] 4098 if kwargs['lifecycle_state'] not in lifecycle_state_allowed_values: 4099 raise ValueError( 4100 "Invalid value for `lifecycle_state`, must be one of {0}".format(lifecycle_state_allowed_values) 4101 ) 4102 4103 query_params = { 4104 "compartmentId": compartment_id, 4105 "volumeId": kwargs.get("volume_id", missing), 4106 "limit": kwargs.get("limit", missing), 4107 "page": kwargs.get("page", missing), 4108 "displayName": kwargs.get("display_name", missing), 4109 "sourceVolumeBackupId": kwargs.get("source_volume_backup_id", missing), 4110 "sortBy": kwargs.get("sort_by", missing), 4111 "sortOrder": kwargs.get("sort_order", missing), 4112 "lifecycleState": kwargs.get("lifecycle_state", missing) 4113 } 4114 query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None} 4115 4116 header_params = { 4117 "accept": "application/json", 4118 "content-type": "application/json" 4119 } 4120 4121 retry_strategy = self.base_client.get_preferred_retry_strategy( 4122 operation_retry_strategy=kwargs.get('retry_strategy'), 4123 client_retry_strategy=self.retry_strategy 4124 ) 4125 4126 if retry_strategy: 4127 if not isinstance(retry_strategy, retry.NoneRetryStrategy): 4128 self.base_client.add_opc_client_retries_header(header_params) 4129 retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) 4130 return retry_strategy.make_retrying_call( 4131 self.base_client.call_api, 4132 resource_path=resource_path, 4133 method=method, 4134 query_params=query_params, 4135 header_params=header_params, 4136 response_type="list[VolumeBackup]") 4137 else: 4138 return self.base_client.call_api( 4139 resource_path=resource_path, 4140 method=method, 4141 query_params=query_params, 4142 header_params=header_params, 4143 response_type="list[VolumeBackup]") 4144 4145 def list_volume_group_backups(self, compartment_id, **kwargs): 4146 """ 4147 Lists the volume group backups in the specified compartment. You can filter the results by volume group. 4148 For more information, see `Volume Groups`__. 4149 4150 __ https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/volumegroups.htm 4151 4152 4153 :param str compartment_id: (required) 4154 The `OCID`__ of the compartment. 4155 4156 __ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm 4157 4158 :param str volume_group_id: (optional) 4159 The OCID of the volume group. 4160 4161 :param int limit: (optional) 4162 For list pagination. The maximum number of results per page, or items to return in a paginated 4163 \"List\" call. For important details about how pagination works, see 4164 `List Pagination`__. 4165 4166 Example: `50` 4167 4168 __ https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine 4169 4170 :param str page: (optional) 4171 For list pagination. The value of the `opc-next-page` response header from the previous \"List\" 4172 call. For important details about how pagination works, see 4173 `List Pagination`__. 4174 4175 __ https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine 4176 4177 :param str display_name: (optional) 4178 A filter to return only resources that match the given display name exactly. 4179 4180 :param str sort_by: (optional) 4181 The field to sort by. You can provide one sort order (`sortOrder`). Default order for 4182 TIMECREATED is descending. Default order for DISPLAYNAME is ascending. The DISPLAYNAME 4183 sort order is case sensitive. 4184 4185 **Note:** In general, some \"List\" operations (for example, `ListInstances`) let you 4186 optionally filter by availability domain if the scope of the resource type is within a 4187 single availability domain. If you call one of these \"List\" operations without specifying 4188 an availability domain, the resources are grouped by availability domain, then sorted. 4189 4190 Allowed values are: "TIMECREATED", "DISPLAYNAME" 4191 4192 :param str sort_order: (optional) 4193 The sort order to use, either ascending (`ASC`) or descending (`DESC`). The DISPLAYNAME sort order 4194 is case sensitive. 4195 4196 Allowed values are: "ASC", "DESC" 4197 4198 :param obj retry_strategy: (optional) 4199 A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. 4200 4201 This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. 4202 The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. 4203 4204 To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. 4205 4206 :return: A :class:`~oci.response.Response` object with data of type list of :class:`~oci.core.models.VolumeGroupBackup` 4207 :rtype: :class:`~oci.response.Response` 4208 4209 :example: 4210 Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.53.1/core/list_volume_group_backups.py.html>`__ to see an example of how to use list_volume_group_backups API. 4211 """ 4212 resource_path = "/volumeGroupBackups" 4213 method = "GET" 4214 4215 # Don't accept unknown kwargs 4216 expected_kwargs = [ 4217 "retry_strategy", 4218 "volume_group_id", 4219 "limit", 4220 "page", 4221 "display_name", 4222 "sort_by", 4223 "sort_order" 4224 ] 4225 extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] 4226 if extra_kwargs: 4227 raise ValueError( 4228 "list_volume_group_backups got unknown kwargs: {!r}".format(extra_kwargs)) 4229 4230 if 'sort_by' in kwargs: 4231 sort_by_allowed_values = ["TIMECREATED", "DISPLAYNAME"] 4232 if kwargs['sort_by'] not in sort_by_allowed_values: 4233 raise ValueError( 4234 "Invalid value for `sort_by`, must be one of {0}".format(sort_by_allowed_values) 4235 ) 4236 4237 if 'sort_order' in kwargs: 4238 sort_order_allowed_values = ["ASC", "DESC"] 4239 if kwargs['sort_order'] not in sort_order_allowed_values: 4240 raise ValueError( 4241 "Invalid value for `sort_order`, must be one of {0}".format(sort_order_allowed_values) 4242 ) 4243 4244 query_params = { 4245 "compartmentId": compartment_id, 4246 "volumeGroupId": kwargs.get("volume_group_id", missing), 4247 "limit": kwargs.get("limit", missing), 4248 "page": kwargs.get("page", missing), 4249 "displayName": kwargs.get("display_name", missing), 4250 "sortBy": kwargs.get("sort_by", missing), 4251 "sortOrder": kwargs.get("sort_order", missing) 4252 } 4253 query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None} 4254 4255 header_params = { 4256 "accept": "application/json", 4257 "content-type": "application/json" 4258 } 4259 4260 retry_strategy = self.base_client.get_preferred_retry_strategy( 4261 operation_retry_strategy=kwargs.get('retry_strategy'), 4262 client_retry_strategy=self.retry_strategy 4263 ) 4264 4265 if retry_strategy: 4266 if not isinstance(retry_strategy, retry.NoneRetryStrategy): 4267 self.base_client.add_opc_client_retries_header(header_params) 4268 retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) 4269 return retry_strategy.make_retrying_call( 4270 self.base_client.call_api, 4271 resource_path=resource_path, 4272 method=method, 4273 query_params=query_params, 4274 header_params=header_params, 4275 response_type="list[VolumeGroupBackup]") 4276 else: 4277 return self.base_client.call_api( 4278 resource_path=resource_path, 4279 method=method, 4280 query_params=query_params, 4281 header_params=header_params, 4282 response_type="list[VolumeGroupBackup]") 4283 4284 def list_volume_groups(self, compartment_id, **kwargs): 4285 """ 4286 Lists the volume groups in the specified compartment and availability domain. 4287 For more information, see `Volume Groups`__. 4288 4289 __ https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/volumegroups.htm 4290 4291 4292 :param str compartment_id: (required) 4293 The `OCID`__ of the compartment. 4294 4295 __ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm 4296 4297 :param str availability_domain: (optional) 4298 The name of the availability domain. 4299 4300 Example: `Uocm:PHX-AD-1` 4301 4302 :param int limit: (optional) 4303 For list pagination. The maximum number of results per page, or items to return in a paginated 4304 \"List\" call. For important details about how pagination works, see 4305 `List Pagination`__. 4306 4307 Example: `50` 4308 4309 __ https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine 4310 4311 :param str page: (optional) 4312 For list pagination. The value of the `opc-next-page` response header from the previous \"List\" 4313 call. For important details about how pagination works, see 4314 `List Pagination`__. 4315 4316 __ https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine 4317 4318 :param str display_name: (optional) 4319 A filter to return only resources that match the given display name exactly. 4320 4321 :param str sort_by: (optional) 4322 The field to sort by. You can provide one sort order (`sortOrder`). Default order for 4323 TIMECREATED is descending. Default order for DISPLAYNAME is ascending. The DISPLAYNAME 4324 sort order is case sensitive. 4325 4326 **Note:** In general, some \"List\" operations (for example, `ListInstances`) let you 4327 optionally filter by availability domain if the scope of the resource type is within a 4328 single availability domain. If you call one of these \"List\" operations without specifying 4329 an availability domain, the resources are grouped by availability domain, then sorted. 4330 4331 Allowed values are: "TIMECREATED", "DISPLAYNAME" 4332 4333 :param str sort_order: (optional) 4334 The sort order to use, either ascending (`ASC`) or descending (`DESC`). The DISPLAYNAME sort order 4335 is case sensitive. 4336 4337 Allowed values are: "ASC", "DESC" 4338 4339 :param str lifecycle_state: (optional) 4340 A filter to only return resources that match the given lifecycle 4341 state. The state value is case-insensitive. 4342 4343 Allowed values are: "PROVISIONING", "AVAILABLE", "TERMINATING", "TERMINATED", "FAULTY" 4344 4345 :param obj retry_strategy: (optional) 4346 A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. 4347 4348 This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. 4349 The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. 4350 4351 To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. 4352 4353 :return: A :class:`~oci.response.Response` object with data of type list of :class:`~oci.core.models.VolumeGroup` 4354 :rtype: :class:`~oci.response.Response` 4355 4356 :example: 4357 Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.53.1/core/list_volume_groups.py.html>`__ to see an example of how to use list_volume_groups API. 4358 """ 4359 resource_path = "/volumeGroups" 4360 method = "GET" 4361 4362 # Don't accept unknown kwargs 4363 expected_kwargs = [ 4364 "retry_strategy", 4365 "availability_domain", 4366 "limit", 4367 "page", 4368 "display_name", 4369 "sort_by", 4370 "sort_order", 4371 "lifecycle_state" 4372 ] 4373 extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] 4374 if extra_kwargs: 4375 raise ValueError( 4376 "list_volume_groups got unknown kwargs: {!r}".format(extra_kwargs)) 4377 4378 if 'sort_by' in kwargs: 4379 sort_by_allowed_values = ["TIMECREATED", "DISPLAYNAME"] 4380 if kwargs['sort_by'] not in sort_by_allowed_values: 4381 raise ValueError( 4382 "Invalid value for `sort_by`, must be one of {0}".format(sort_by_allowed_values) 4383 ) 4384 4385 if 'sort_order' in kwargs: 4386 sort_order_allowed_values = ["ASC", "DESC"] 4387 if kwargs['sort_order'] not in sort_order_allowed_values: 4388 raise ValueError( 4389 "Invalid value for `sort_order`, must be one of {0}".format(sort_order_allowed_values) 4390 ) 4391 4392 if 'lifecycle_state' in kwargs: 4393 lifecycle_state_allowed_values = ["PROVISIONING", "AVAILABLE", "TERMINATING", "TERMINATED", "FAULTY"] 4394 if kwargs['lifecycle_state'] not in lifecycle_state_allowed_values: 4395 raise ValueError( 4396 "Invalid value for `lifecycle_state`, must be one of {0}".format(lifecycle_state_allowed_values) 4397 ) 4398 4399 query_params = { 4400 "availabilityDomain": kwargs.get("availability_domain", missing), 4401 "compartmentId": compartment_id, 4402 "limit": kwargs.get("limit", missing), 4403 "page": kwargs.get("page", missing), 4404 "displayName": kwargs.get("display_name", missing), 4405 "sortBy": kwargs.get("sort_by", missing), 4406 "sortOrder": kwargs.get("sort_order", missing), 4407 "lifecycleState": kwargs.get("lifecycle_state", missing) 4408 } 4409 query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None} 4410 4411 header_params = { 4412 "accept": "application/json", 4413 "content-type": "application/json" 4414 } 4415 4416 retry_strategy = self.base_client.get_preferred_retry_strategy( 4417 operation_retry_strategy=kwargs.get('retry_strategy'), 4418 client_retry_strategy=self.retry_strategy 4419 ) 4420 4421 if retry_strategy: 4422 if not isinstance(retry_strategy, retry.NoneRetryStrategy): 4423 self.base_client.add_opc_client_retries_header(header_params) 4424 retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) 4425 return retry_strategy.make_retrying_call( 4426 self.base_client.call_api, 4427 resource_path=resource_path, 4428 method=method, 4429 query_params=query_params, 4430 header_params=header_params, 4431 response_type="list[VolumeGroup]") 4432 else: 4433 return self.base_client.call_api( 4434 resource_path=resource_path, 4435 method=method, 4436 query_params=query_params, 4437 header_params=header_params, 4438 response_type="list[VolumeGroup]") 4439 4440 def list_volumes(self, compartment_id, **kwargs): 4441 """ 4442 Lists the volumes in the specified compartment and availability domain. 4443 4444 4445 :param str compartment_id: (required) 4446 The `OCID`__ of the compartment. 4447 4448 __ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm 4449 4450 :param str availability_domain: (optional) 4451 The name of the availability domain. 4452 4453 Example: `Uocm:PHX-AD-1` 4454 4455 :param int limit: (optional) 4456 For list pagination. The maximum number of results per page, or items to return in a paginated 4457 \"List\" call. For important details about how pagination works, see 4458 `List Pagination`__. 4459 4460 Example: `50` 4461 4462 __ https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine 4463 4464 :param str page: (optional) 4465 For list pagination. The value of the `opc-next-page` response header from the previous \"List\" 4466 call. For important details about how pagination works, see 4467 `List Pagination`__. 4468 4469 __ https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine 4470 4471 :param str display_name: (optional) 4472 A filter to return only resources that match the given display name exactly. 4473 4474 :param str sort_by: (optional) 4475 The field to sort by. You can provide one sort order (`sortOrder`). Default order for 4476 TIMECREATED is descending. Default order for DISPLAYNAME is ascending. The DISPLAYNAME 4477 sort order is case sensitive. 4478 4479 **Note:** In general, some \"List\" operations (for example, `ListInstances`) let you 4480 optionally filter by availability domain if the scope of the resource type is within a 4481 single availability domain. If you call one of these \"List\" operations without specifying 4482 an availability domain, the resources are grouped by availability domain, then sorted. 4483 4484 Allowed values are: "TIMECREATED", "DISPLAYNAME" 4485 4486 :param str sort_order: (optional) 4487 The sort order to use, either ascending (`ASC`) or descending (`DESC`). The DISPLAYNAME sort order 4488 is case sensitive. 4489 4490 Allowed values are: "ASC", "DESC" 4491 4492 :param str volume_group_id: (optional) 4493 The OCID of the volume group. 4494 4495 :param str lifecycle_state: (optional) 4496 A filter to only return resources that match the given lifecycle state. The state 4497 value is case-insensitive. 4498 4499 Allowed values are: "PROVISIONING", "RESTORING", "AVAILABLE", "TERMINATING", "TERMINATED", "FAULTY" 4500 4501 :param obj retry_strategy: (optional) 4502 A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. 4503 4504 This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. 4505 The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. 4506 4507 To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. 4508 4509 :return: A :class:`~oci.response.Response` object with data of type list of :class:`~oci.core.models.Volume` 4510 :rtype: :class:`~oci.response.Response` 4511 4512 :example: 4513 Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.53.1/core/list_volumes.py.html>`__ to see an example of how to use list_volumes API. 4514 """ 4515 resource_path = "/volumes" 4516 method = "GET" 4517 4518 # Don't accept unknown kwargs 4519 expected_kwargs = [ 4520 "retry_strategy", 4521 "availability_domain", 4522 "limit", 4523 "page", 4524 "display_name", 4525 "sort_by", 4526 "sort_order", 4527 "volume_group_id", 4528 "lifecycle_state" 4529 ] 4530 extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] 4531 if extra_kwargs: 4532 raise ValueError( 4533 "list_volumes got unknown kwargs: {!r}".format(extra_kwargs)) 4534 4535 if 'sort_by' in kwargs: 4536 sort_by_allowed_values = ["TIMECREATED", "DISPLAYNAME"] 4537 if kwargs['sort_by'] not in sort_by_allowed_values: 4538 raise ValueError( 4539 "Invalid value for `sort_by`, must be one of {0}".format(sort_by_allowed_values) 4540 ) 4541 4542 if 'sort_order' in kwargs: 4543 sort_order_allowed_values = ["ASC", "DESC"] 4544 if kwargs['sort_order'] not in sort_order_allowed_values: 4545 raise ValueError( 4546 "Invalid value for `sort_order`, must be one of {0}".format(sort_order_allowed_values) 4547 ) 4548 4549 if 'lifecycle_state' in kwargs: 4550 lifecycle_state_allowed_values = ["PROVISIONING", "RESTORING", "AVAILABLE", "TERMINATING", "TERMINATED", "FAULTY"] 4551 if kwargs['lifecycle_state'] not in lifecycle_state_allowed_values: 4552 raise ValueError( 4553 "Invalid value for `lifecycle_state`, must be one of {0}".format(lifecycle_state_allowed_values) 4554 ) 4555 4556 query_params = { 4557 "availabilityDomain": kwargs.get("availability_domain", missing), 4558 "compartmentId": compartment_id, 4559 "limit": kwargs.get("limit", missing), 4560 "page": kwargs.get("page", missing), 4561 "displayName": kwargs.get("display_name", missing), 4562 "sortBy": kwargs.get("sort_by", missing), 4563 "sortOrder": kwargs.get("sort_order", missing), 4564 "volumeGroupId": kwargs.get("volume_group_id", missing), 4565 "lifecycleState": kwargs.get("lifecycle_state", missing) 4566 } 4567 query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None} 4568 4569 header_params = { 4570 "accept": "application/json", 4571 "content-type": "application/json" 4572 } 4573 4574 retry_strategy = self.base_client.get_preferred_retry_strategy( 4575 operation_retry_strategy=kwargs.get('retry_strategy'), 4576 client_retry_strategy=self.retry_strategy 4577 ) 4578 4579 if retry_strategy: 4580 if not isinstance(retry_strategy, retry.NoneRetryStrategy): 4581 self.base_client.add_opc_client_retries_header(header_params) 4582 retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) 4583 return retry_strategy.make_retrying_call( 4584 self.base_client.call_api, 4585 resource_path=resource_path, 4586 method=method, 4587 query_params=query_params, 4588 header_params=header_params, 4589 response_type="list[Volume]") 4590 else: 4591 return self.base_client.call_api( 4592 resource_path=resource_path, 4593 method=method, 4594 query_params=query_params, 4595 header_params=header_params, 4596 response_type="list[Volume]") 4597 4598 def update_boot_volume(self, boot_volume_id, update_boot_volume_details, **kwargs): 4599 """ 4600 Updates the specified boot volume's display name, defined tags, and free-form tags. 4601 4602 4603 :param str boot_volume_id: (required) 4604 The OCID of the boot volume. 4605 4606 :param oci.core.models.UpdateBootVolumeDetails update_boot_volume_details: (required) 4607 Update boot volume's display name. 4608 4609 :param str if_match: (optional) 4610 For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` 4611 parameter to the value of the etag from a previous GET or POST response for that resource. The resource 4612 will be updated or deleted only if the etag you provide matches the resource's current etag value. 4613 4614 :param obj retry_strategy: (optional) 4615 A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. 4616 4617 This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. 4618 The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. 4619 4620 To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. 4621 4622 :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.core.models.BootVolume` 4623 :rtype: :class:`~oci.response.Response` 4624 4625 :example: 4626 Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.53.1/core/update_boot_volume.py.html>`__ to see an example of how to use update_boot_volume API. 4627 """ 4628 resource_path = "/bootVolumes/{bootVolumeId}" 4629 method = "PUT" 4630 4631 # Don't accept unknown kwargs 4632 expected_kwargs = [ 4633 "retry_strategy", 4634 "if_match" 4635 ] 4636 extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] 4637 if extra_kwargs: 4638 raise ValueError( 4639 "update_boot_volume got unknown kwargs: {!r}".format(extra_kwargs)) 4640 4641 path_params = { 4642 "bootVolumeId": boot_volume_id 4643 } 4644 4645 path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} 4646 4647 for (k, v) in six.iteritems(path_params): 4648 if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): 4649 raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k)) 4650 4651 header_params = { 4652 "accept": "application/json", 4653 "content-type": "application/json", 4654 "if-match": kwargs.get("if_match", missing) 4655 } 4656 header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} 4657 4658 retry_strategy = self.base_client.get_preferred_retry_strategy( 4659 operation_retry_strategy=kwargs.get('retry_strategy'), 4660 client_retry_strategy=self.retry_strategy 4661 ) 4662 4663 if retry_strategy: 4664 if not isinstance(retry_strategy, retry.NoneRetryStrategy): 4665 self.base_client.add_opc_client_retries_header(header_params) 4666 retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) 4667 return retry_strategy.make_retrying_call( 4668 self.base_client.call_api, 4669 resource_path=resource_path, 4670 method=method, 4671 path_params=path_params, 4672 header_params=header_params, 4673 body=update_boot_volume_details, 4674 response_type="BootVolume") 4675 else: 4676 return self.base_client.call_api( 4677 resource_path=resource_path, 4678 method=method, 4679 path_params=path_params, 4680 header_params=header_params, 4681 body=update_boot_volume_details, 4682 response_type="BootVolume") 4683 4684 def update_boot_volume_backup(self, boot_volume_backup_id, update_boot_volume_backup_details, **kwargs): 4685 """ 4686 Updates the display name for the specified boot volume backup. 4687 Avoid entering confidential information. 4688 4689 4690 :param str boot_volume_backup_id: (required) 4691 The OCID of the boot volume backup. 4692 4693 :param oci.core.models.UpdateBootVolumeBackupDetails update_boot_volume_backup_details: (required) 4694 Update boot volume backup fields 4695 4696 :param str if_match: (optional) 4697 For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` 4698 parameter to the value of the etag from a previous GET or POST response for that resource. The resource 4699 will be updated or deleted only if the etag you provide matches the resource's current etag value. 4700 4701 :param obj retry_strategy: (optional) 4702 A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. 4703 4704 This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. 4705 The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. 4706 4707 To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. 4708 4709 :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.core.models.BootVolumeBackup` 4710 :rtype: :class:`~oci.response.Response` 4711 4712 :example: 4713 Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.53.1/core/update_boot_volume_backup.py.html>`__ to see an example of how to use update_boot_volume_backup API. 4714 """ 4715 resource_path = "/bootVolumeBackups/{bootVolumeBackupId}" 4716 method = "PUT" 4717 4718 # Don't accept unknown kwargs 4719 expected_kwargs = [ 4720 "retry_strategy", 4721 "if_match" 4722 ] 4723 extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] 4724 if extra_kwargs: 4725 raise ValueError( 4726 "update_boot_volume_backup got unknown kwargs: {!r}".format(extra_kwargs)) 4727 4728 path_params = { 4729 "bootVolumeBackupId": boot_volume_backup_id 4730 } 4731 4732 path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} 4733 4734 for (k, v) in six.iteritems(path_params): 4735 if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): 4736 raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k)) 4737 4738 header_params = { 4739 "accept": "application/json", 4740 "content-type": "application/json", 4741 "if-match": kwargs.get("if_match", missing) 4742 } 4743 header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} 4744 4745 retry_strategy = self.base_client.get_preferred_retry_strategy( 4746 operation_retry_strategy=kwargs.get('retry_strategy'), 4747 client_retry_strategy=self.retry_strategy 4748 ) 4749 4750 if retry_strategy: 4751 if not isinstance(retry_strategy, retry.NoneRetryStrategy): 4752 self.base_client.add_opc_client_retries_header(header_params) 4753 retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) 4754 return retry_strategy.make_retrying_call( 4755 self.base_client.call_api, 4756 resource_path=resource_path, 4757 method=method, 4758 path_params=path_params, 4759 header_params=header_params, 4760 body=update_boot_volume_backup_details, 4761 response_type="BootVolumeBackup") 4762 else: 4763 return self.base_client.call_api( 4764 resource_path=resource_path, 4765 method=method, 4766 path_params=path_params, 4767 header_params=header_params, 4768 body=update_boot_volume_backup_details, 4769 response_type="BootVolumeBackup") 4770 4771 def update_boot_volume_kms_key(self, boot_volume_id, update_boot_volume_kms_key_details, **kwargs): 4772 """ 4773 Updates the specified volume with a new Key Management master encryption key. 4774 4775 4776 :param str boot_volume_id: (required) 4777 The OCID of the boot volume. 4778 4779 :param oci.core.models.UpdateBootVolumeKmsKeyDetails update_boot_volume_kms_key_details: (required) 4780 Updates the Key Management master encryption key assigned to the specified boot volume. 4781 4782 :param str if_match: (optional) 4783 For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` 4784 parameter to the value of the etag from a previous GET or POST response for that resource. The resource 4785 will be updated or deleted only if the etag you provide matches the resource's current etag value. 4786 4787 :param obj retry_strategy: (optional) 4788 A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. 4789 4790 This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. 4791 The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. 4792 4793 To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. 4794 4795 :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.core.models.BootVolumeKmsKey` 4796 :rtype: :class:`~oci.response.Response` 4797 4798 :example: 4799 Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.53.1/core/update_boot_volume_kms_key.py.html>`__ to see an example of how to use update_boot_volume_kms_key API. 4800 """ 4801 resource_path = "/bootVolumes/{bootVolumeId}/kmsKey" 4802 method = "PUT" 4803 4804 # Don't accept unknown kwargs 4805 expected_kwargs = [ 4806 "retry_strategy", 4807 "if_match" 4808 ] 4809 extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] 4810 if extra_kwargs: 4811 raise ValueError( 4812 "update_boot_volume_kms_key got unknown kwargs: {!r}".format(extra_kwargs)) 4813 4814 path_params = { 4815 "bootVolumeId": boot_volume_id 4816 } 4817 4818 path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} 4819 4820 for (k, v) in six.iteritems(path_params): 4821 if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): 4822 raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k)) 4823 4824 header_params = { 4825 "accept": "application/json", 4826 "content-type": "application/json", 4827 "if-match": kwargs.get("if_match", missing) 4828 } 4829 header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} 4830 4831 retry_strategy = self.base_client.get_preferred_retry_strategy( 4832 operation_retry_strategy=kwargs.get('retry_strategy'), 4833 client_retry_strategy=self.retry_strategy 4834 ) 4835 4836 if retry_strategy: 4837 if not isinstance(retry_strategy, retry.NoneRetryStrategy): 4838 self.base_client.add_opc_client_retries_header(header_params) 4839 retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) 4840 return retry_strategy.make_retrying_call( 4841 self.base_client.call_api, 4842 resource_path=resource_path, 4843 method=method, 4844 path_params=path_params, 4845 header_params=header_params, 4846 body=update_boot_volume_kms_key_details, 4847 response_type="BootVolumeKmsKey") 4848 else: 4849 return self.base_client.call_api( 4850 resource_path=resource_path, 4851 method=method, 4852 path_params=path_params, 4853 header_params=header_params, 4854 body=update_boot_volume_kms_key_details, 4855 response_type="BootVolumeKmsKey") 4856 4857 def update_volume(self, volume_id, update_volume_details, **kwargs): 4858 """ 4859 Updates the specified volume's display name. 4860 Avoid entering confidential information. 4861 4862 4863 :param str volume_id: (required) 4864 The OCID of the volume. 4865 4866 :param oci.core.models.UpdateVolumeDetails update_volume_details: (required) 4867 Update volume's display name. Avoid entering confidential information. 4868 4869 :param str if_match: (optional) 4870 For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` 4871 parameter to the value of the etag from a previous GET or POST response for that resource. The resource 4872 will be updated or deleted only if the etag you provide matches the resource's current etag value. 4873 4874 :param obj retry_strategy: (optional) 4875 A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. 4876 4877 This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. 4878 The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. 4879 4880 To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. 4881 4882 :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.core.models.Volume` 4883 :rtype: :class:`~oci.response.Response` 4884 4885 :example: 4886 Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.53.1/core/update_volume.py.html>`__ to see an example of how to use update_volume API. 4887 """ 4888 resource_path = "/volumes/{volumeId}" 4889 method = "PUT" 4890 4891 # Don't accept unknown kwargs 4892 expected_kwargs = [ 4893 "retry_strategy", 4894 "if_match" 4895 ] 4896 extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] 4897 if extra_kwargs: 4898 raise ValueError( 4899 "update_volume got unknown kwargs: {!r}".format(extra_kwargs)) 4900 4901 path_params = { 4902 "volumeId": volume_id 4903 } 4904 4905 path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} 4906 4907 for (k, v) in six.iteritems(path_params): 4908 if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): 4909 raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k)) 4910 4911 header_params = { 4912 "accept": "application/json", 4913 "content-type": "application/json", 4914 "if-match": kwargs.get("if_match", missing) 4915 } 4916 header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} 4917 4918 retry_strategy = self.base_client.get_preferred_retry_strategy( 4919 operation_retry_strategy=kwargs.get('retry_strategy'), 4920 client_retry_strategy=self.retry_strategy 4921 ) 4922 4923 if retry_strategy: 4924 if not isinstance(retry_strategy, retry.NoneRetryStrategy): 4925 self.base_client.add_opc_client_retries_header(header_params) 4926 retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) 4927 return retry_strategy.make_retrying_call( 4928 self.base_client.call_api, 4929 resource_path=resource_path, 4930 method=method, 4931 path_params=path_params, 4932 header_params=header_params, 4933 body=update_volume_details, 4934 response_type="Volume") 4935 else: 4936 return self.base_client.call_api( 4937 resource_path=resource_path, 4938 method=method, 4939 path_params=path_params, 4940 header_params=header_params, 4941 body=update_volume_details, 4942 response_type="Volume") 4943 4944 def update_volume_backup(self, volume_backup_id, update_volume_backup_details, **kwargs): 4945 """ 4946 Updates the display name for the specified volume backup. 4947 Avoid entering confidential information. 4948 4949 4950 :param str volume_backup_id: (required) 4951 The OCID of the volume backup. 4952 4953 :param oci.core.models.UpdateVolumeBackupDetails update_volume_backup_details: (required) 4954 Update volume backup fields 4955 4956 :param str if_match: (optional) 4957 For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` 4958 parameter to the value of the etag from a previous GET or POST response for that resource. The resource 4959 will be updated or deleted only if the etag you provide matches the resource's current etag value. 4960 4961 :param obj retry_strategy: (optional) 4962 A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. 4963 4964 This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. 4965 The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. 4966 4967 To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. 4968 4969 :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.core.models.VolumeBackup` 4970 :rtype: :class:`~oci.response.Response` 4971 4972 :example: 4973 Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.53.1/core/update_volume_backup.py.html>`__ to see an example of how to use update_volume_backup API. 4974 """ 4975 resource_path = "/volumeBackups/{volumeBackupId}" 4976 method = "PUT" 4977 4978 # Don't accept unknown kwargs 4979 expected_kwargs = [ 4980 "retry_strategy", 4981 "if_match" 4982 ] 4983 extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] 4984 if extra_kwargs: 4985 raise ValueError( 4986 "update_volume_backup got unknown kwargs: {!r}".format(extra_kwargs)) 4987 4988 path_params = { 4989 "volumeBackupId": volume_backup_id 4990 } 4991 4992 path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} 4993 4994 for (k, v) in six.iteritems(path_params): 4995 if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): 4996 raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k)) 4997 4998 header_params = { 4999 "accept": "application/json", 5000 "content-type": "application/json", 5001 "if-match": kwargs.get("if_match", missing) 5002 } 5003 header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} 5004 5005 retry_strategy = self.base_client.get_preferred_retry_strategy( 5006 operation_retry_strategy=kwargs.get('retry_strategy'), 5007 client_retry_strategy=self.retry_strategy 5008 ) 5009 5010 if retry_strategy: 5011 if not isinstance(retry_strategy, retry.NoneRetryStrategy): 5012 self.base_client.add_opc_client_retries_header(header_params) 5013 retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) 5014 return retry_strategy.make_retrying_call( 5015 self.base_client.call_api, 5016 resource_path=resource_path, 5017 method=method, 5018 path_params=path_params, 5019 header_params=header_params, 5020 body=update_volume_backup_details, 5021 response_type="VolumeBackup") 5022 else: 5023 return self.base_client.call_api( 5024 resource_path=resource_path, 5025 method=method, 5026 path_params=path_params, 5027 header_params=header_params, 5028 body=update_volume_backup_details, 5029 response_type="VolumeBackup") 5030 5031 def update_volume_backup_policy(self, policy_id, update_volume_backup_policy_details, **kwargs): 5032 """ 5033 Updates a user defined backup policy. 5034 For more information about user defined backup policies, 5035 see `Policy-Based Backups`__. 5036 5037 Avoid entering confidential information. 5038 5039 __ https://docs.cloud.oracle.com/iaas/Content/Block/Tasks/schedulingvolumebackups.htm#UserDefinedBackupPolicies 5040 5041 5042 :param str policy_id: (required) 5043 The OCID of the volume backup policy. 5044 5045 :param oci.core.models.UpdateVolumeBackupPolicyDetails update_volume_backup_policy_details: (required) 5046 Update volume backup policy fields 5047 5048 :param str if_match: (optional) 5049 For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` 5050 parameter to the value of the etag from a previous GET or POST response for that resource. The resource 5051 will be updated or deleted only if the etag you provide matches the resource's current etag value. 5052 5053 :param str opc_request_id: (optional) 5054 Unique identifier for the request. 5055 If you need to contact Oracle about a particular request, please provide the request ID. 5056 5057 :param str opc_retry_token: (optional) 5058 A token that uniquely identifies a request so it can be retried in case of a timeout or 5059 server error without risk of executing that same action again. Retry tokens expire after 24 5060 hours, but can be invalidated before then due to conflicting operations (for example, if a resource 5061 has been deleted and purged from the system, then a retry of the original creation request 5062 may be rejected). 5063 5064 :param obj retry_strategy: (optional) 5065 A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. 5066 5067 This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. 5068 The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. 5069 5070 To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. 5071 5072 :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.core.models.VolumeBackupPolicy` 5073 :rtype: :class:`~oci.response.Response` 5074 5075 :example: 5076 Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.53.1/core/update_volume_backup_policy.py.html>`__ to see an example of how to use update_volume_backup_policy API. 5077 """ 5078 resource_path = "/volumeBackupPolicies/{policyId}" 5079 method = "PUT" 5080 5081 # Don't accept unknown kwargs 5082 expected_kwargs = [ 5083 "retry_strategy", 5084 "if_match", 5085 "opc_request_id", 5086 "opc_retry_token" 5087 ] 5088 extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] 5089 if extra_kwargs: 5090 raise ValueError( 5091 "update_volume_backup_policy got unknown kwargs: {!r}".format(extra_kwargs)) 5092 5093 path_params = { 5094 "policyId": policy_id 5095 } 5096 5097 path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} 5098 5099 for (k, v) in six.iteritems(path_params): 5100 if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): 5101 raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k)) 5102 5103 header_params = { 5104 "accept": "application/json", 5105 "content-type": "application/json", 5106 "if-match": kwargs.get("if_match", missing), 5107 "opc-request-id": kwargs.get("opc_request_id", missing), 5108 "opc-retry-token": kwargs.get("opc_retry_token", missing) 5109 } 5110 header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} 5111 5112 retry_strategy = self.base_client.get_preferred_retry_strategy( 5113 operation_retry_strategy=kwargs.get('retry_strategy'), 5114 client_retry_strategy=self.retry_strategy 5115 ) 5116 5117 if retry_strategy: 5118 if not isinstance(retry_strategy, retry.NoneRetryStrategy): 5119 self.base_client.add_opc_retry_token_if_needed(header_params) 5120 self.base_client.add_opc_client_retries_header(header_params) 5121 retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) 5122 return retry_strategy.make_retrying_call( 5123 self.base_client.call_api, 5124 resource_path=resource_path, 5125 method=method, 5126 path_params=path_params, 5127 header_params=header_params, 5128 body=update_volume_backup_policy_details, 5129 response_type="VolumeBackupPolicy") 5130 else: 5131 return self.base_client.call_api( 5132 resource_path=resource_path, 5133 method=method, 5134 path_params=path_params, 5135 header_params=header_params, 5136 body=update_volume_backup_policy_details, 5137 response_type="VolumeBackupPolicy") 5138 5139 def update_volume_group(self, volume_group_id, update_volume_group_details, **kwargs): 5140 """ 5141 Updates the set of volumes in a volume group along with the display name. Use this operation 5142 to add or remove volumes in a volume group. Specify the full list of volume IDs to include in the 5143 volume group. If the volume ID is not specified in the call, it will be removed from the volume group. 5144 Avoid entering confidential information. 5145 5146 For more information, see `Volume Groups`__. 5147 5148 __ https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/volumegroups.htm 5149 5150 5151 :param str volume_group_id: (required) 5152 The Oracle Cloud ID (OCID) that uniquely identifies the volume group. 5153 5154 :param oci.core.models.UpdateVolumeGroupDetails update_volume_group_details: (required) 5155 Update volume group's set of volumes and/or display name 5156 5157 :param str if_match: (optional) 5158 For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` 5159 parameter to the value of the etag from a previous GET or POST response for that resource. The resource 5160 will be updated or deleted only if the etag you provide matches the resource's current etag value. 5161 5162 :param obj retry_strategy: (optional) 5163 A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. 5164 5165 This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. 5166 The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. 5167 5168 To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. 5169 5170 :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.core.models.VolumeGroup` 5171 :rtype: :class:`~oci.response.Response` 5172 5173 :example: 5174 Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.53.1/core/update_volume_group.py.html>`__ to see an example of how to use update_volume_group API. 5175 """ 5176 resource_path = "/volumeGroups/{volumeGroupId}" 5177 method = "PUT" 5178 5179 # Don't accept unknown kwargs 5180 expected_kwargs = [ 5181 "retry_strategy", 5182 "if_match" 5183 ] 5184 extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] 5185 if extra_kwargs: 5186 raise ValueError( 5187 "update_volume_group got unknown kwargs: {!r}".format(extra_kwargs)) 5188 5189 path_params = { 5190 "volumeGroupId": volume_group_id 5191 } 5192 5193 path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} 5194 5195 for (k, v) in six.iteritems(path_params): 5196 if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): 5197 raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k)) 5198 5199 header_params = { 5200 "accept": "application/json", 5201 "content-type": "application/json", 5202 "if-match": kwargs.get("if_match", missing) 5203 } 5204 header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} 5205 5206 retry_strategy = self.base_client.get_preferred_retry_strategy( 5207 operation_retry_strategy=kwargs.get('retry_strategy'), 5208 client_retry_strategy=self.retry_strategy 5209 ) 5210 5211 if retry_strategy: 5212 if not isinstance(retry_strategy, retry.NoneRetryStrategy): 5213 self.base_client.add_opc_client_retries_header(header_params) 5214 retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) 5215 return retry_strategy.make_retrying_call( 5216 self.base_client.call_api, 5217 resource_path=resource_path, 5218 method=method, 5219 path_params=path_params, 5220 header_params=header_params, 5221 body=update_volume_group_details, 5222 response_type="VolumeGroup") 5223 else: 5224 return self.base_client.call_api( 5225 resource_path=resource_path, 5226 method=method, 5227 path_params=path_params, 5228 header_params=header_params, 5229 body=update_volume_group_details, 5230 response_type="VolumeGroup") 5231 5232 def update_volume_group_backup(self, volume_group_backup_id, update_volume_group_backup_details, **kwargs): 5233 """ 5234 Updates the display name for the specified volume group backup. For more information, see `Volume Groups`__. 5235 5236 __ https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/volumegroups.htm 5237 5238 5239 :param str volume_group_backup_id: (required) 5240 The Oracle Cloud ID (OCID) that uniquely identifies the volume group backup. 5241 5242 :param oci.core.models.UpdateVolumeGroupBackupDetails update_volume_group_backup_details: (required) 5243 Update volume group backup fields 5244 5245 :param str if_match: (optional) 5246 For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` 5247 parameter to the value of the etag from a previous GET or POST response for that resource. The resource 5248 will be updated or deleted only if the etag you provide matches the resource's current etag value. 5249 5250 :param obj retry_strategy: (optional) 5251 A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. 5252 5253 This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. 5254 The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. 5255 5256 To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. 5257 5258 :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.core.models.VolumeGroupBackup` 5259 :rtype: :class:`~oci.response.Response` 5260 5261 :example: 5262 Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.53.1/core/update_volume_group_backup.py.html>`__ to see an example of how to use update_volume_group_backup API. 5263 """ 5264 resource_path = "/volumeGroupBackups/{volumeGroupBackupId}" 5265 method = "PUT" 5266 5267 # Don't accept unknown kwargs 5268 expected_kwargs = [ 5269 "retry_strategy", 5270 "if_match" 5271 ] 5272 extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] 5273 if extra_kwargs: 5274 raise ValueError( 5275 "update_volume_group_backup got unknown kwargs: {!r}".format(extra_kwargs)) 5276 5277 path_params = { 5278 "volumeGroupBackupId": volume_group_backup_id 5279 } 5280 5281 path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} 5282 5283 for (k, v) in six.iteritems(path_params): 5284 if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): 5285 raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k)) 5286 5287 header_params = { 5288 "accept": "application/json", 5289 "content-type": "application/json", 5290 "if-match": kwargs.get("if_match", missing) 5291 } 5292 header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} 5293 5294 retry_strategy = self.base_client.get_preferred_retry_strategy( 5295 operation_retry_strategy=kwargs.get('retry_strategy'), 5296 client_retry_strategy=self.retry_strategy 5297 ) 5298 5299 if retry_strategy: 5300 if not isinstance(retry_strategy, retry.NoneRetryStrategy): 5301 self.base_client.add_opc_client_retries_header(header_params) 5302 retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) 5303 return retry_strategy.make_retrying_call( 5304 self.base_client.call_api, 5305 resource_path=resource_path, 5306 method=method, 5307 path_params=path_params, 5308 header_params=header_params, 5309 body=update_volume_group_backup_details, 5310 response_type="VolumeGroupBackup") 5311 else: 5312 return self.base_client.call_api( 5313 resource_path=resource_path, 5314 method=method, 5315 path_params=path_params, 5316 header_params=header_params, 5317 body=update_volume_group_backup_details, 5318 response_type="VolumeGroupBackup") 5319 5320 def update_volume_kms_key(self, volume_id, update_volume_kms_key_details, **kwargs): 5321 """ 5322 Updates the specified volume with a new Key Management master encryption key. 5323 5324 5325 :param str volume_id: (required) 5326 The OCID of the volume. 5327 5328 :param oci.core.models.UpdateVolumeKmsKeyDetails update_volume_kms_key_details: (required) 5329 Updates the Key Management master encryption key assigned to the specified volume. 5330 5331 :param str if_match: (optional) 5332 For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` 5333 parameter to the value of the etag from a previous GET or POST response for that resource. The resource 5334 will be updated or deleted only if the etag you provide matches the resource's current etag value. 5335 5336 :param obj retry_strategy: (optional) 5337 A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. 5338 5339 This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. 5340 The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. 5341 5342 To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. 5343 5344 :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.core.models.VolumeKmsKey` 5345 :rtype: :class:`~oci.response.Response` 5346 5347 :example: 5348 Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.53.1/core/update_volume_kms_key.py.html>`__ to see an example of how to use update_volume_kms_key API. 5349 """ 5350 resource_path = "/volumes/{volumeId}/kmsKey" 5351 method = "PUT" 5352 5353 # Don't accept unknown kwargs 5354 expected_kwargs = [ 5355 "retry_strategy", 5356 "if_match" 5357 ] 5358 extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] 5359 if extra_kwargs: 5360 raise ValueError( 5361 "update_volume_kms_key got unknown kwargs: {!r}".format(extra_kwargs)) 5362 5363 path_params = { 5364 "volumeId": volume_id 5365 } 5366 5367 path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} 5368 5369 for (k, v) in six.iteritems(path_params): 5370 if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): 5371 raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k)) 5372 5373 header_params = { 5374 "accept": "application/json", 5375 "content-type": "application/json", 5376 "if-match": kwargs.get("if_match", missing) 5377 } 5378 header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} 5379 5380 retry_strategy = self.base_client.get_preferred_retry_strategy( 5381 operation_retry_strategy=kwargs.get('retry_strategy'), 5382 client_retry_strategy=self.retry_strategy 5383 ) 5384 5385 if retry_strategy: 5386 if not isinstance(retry_strategy, retry.NoneRetryStrategy): 5387 self.base_client.add_opc_client_retries_header(header_params) 5388 retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) 5389 return retry_strategy.make_retrying_call( 5390 self.base_client.call_api, 5391 resource_path=resource_path, 5392 method=method, 5393 path_params=path_params, 5394 header_params=header_params, 5395 body=update_volume_kms_key_details, 5396 response_type="VolumeKmsKey") 5397 else: 5398 return self.base_client.call_api( 5399 resource_path=resource_path, 5400 method=method, 5401 path_params=path_params, 5402 header_params=header_params, 5403 body=update_volume_kms_key_details, 5404 response_type="VolumeKmsKey") 5405