diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 2c2cc9455..d1fdb02cb 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -6,6 +6,50 @@ All notable changes to this project will be documented in this file. The format is based on `Keep a Changelog `__. +3.89.0 - 2026-06-30 +------------------- +Added +~~~~~ +* Data Science service + + * Support for configurable randomization windows for schedules + + * ``oci data-science schedule create --trigger-initial-jitter-in-minutes`` + * ``oci data-science schedule update --trigger-initial-jitter-in-minutes`` + +* Object Storage Service + + * Support for KMS Bucket Key in Object Storage + + * ``oci os bucket create --is-bucket-key-enabled`` + * ``oci os bucket update --is-bucket-key-enabled`` + * ``oci os bucket reencrypt --is-reencrypt-bucket-key-only`` + +* PGSQL Control Plane service + + * Support for Point-in-Time Recovery (PITR) in PostgreSQL database systems + + * ``oci psql db-system create-db-system-point-in-time-db-system-source-details`` + * ``oci psql pitr-details get`` + * ``oci psql backup-collection list-backups --backup-source-type`` + * ``oci psql db-system restore --time-to-restore`` + +* Resource Manager service + + * Support for Bitbucket Cloud email/API token configuration source providers + + * ``oci resource-manager configuration-source-provider create-configuration-source-provider-create-bitbucket-cloud-email-api-token-configuration-source-provider-details --api-endpoint --email --secret-id`` + * ``oci resource-manager configuration-source-provider update-configuration-source-provider-update-bitbucket-cloud-email-api-token-configuration-source-provider-details --api-endpoint --email --secret-id`` + +Changed +~~~~~~~ +* Resource Manager service + + * [BREAKING] Removal of deprecated Bitbucket Cloud username/app-password configuration source provider commands + + * ``oci resource-manager configuration-source-provider create-configuration-source-provider-create-bitbucket-cloud-username-app-password-configuration-source-provider-details`` + * ``oci resource-manager configuration-source-provider update-configuration-source-provider-update-bitbucket-cloud-username-app-password-configuration-source-provider-details`` + 3.88.0 - 2026-06-23 ------------------- Added diff --git a/requirements.txt b/requirements.txt index 2ca405f3d..54f77b150 100644 --- a/requirements.txt +++ b/requirements.txt @@ -15,7 +15,7 @@ Jinja2>=3.1.5,<4.0.0; python_version >= '3.7' jmespath>=0.10.0,<=1.0.1 ndg-httpsclient==0.4.2 mock==2.0.0 -oci==2.180.0 +oci==2.181.0 packaging>=22.0,<25.0; python_version > '3.8' packaging==20.2; python_version <= '3.8' pluggy==0.13.0 diff --git a/scripts/install/install.ps1 b/scripts/install/install.ps1 index 902d7a3f1..6005acd99 100644 --- a/scripts/install/install.ps1 +++ b/scripts/install/install.ps1 @@ -85,7 +85,7 @@ function VersionMeetsMinimumRequirements($Version, $MinVersion) { $VersionArray = @($Version.split('.')) $MinVersionArray = @($MinVersion.split('.')) - For ($i=0; $i -le $VersionArray.Length; $i++) { + For ($i=0; $i -lt $VersionArray.Length; $i++) { # if we have reached the end of the MinVersion and we still have digits on the system version then the version is sufficient if ($i -ge $MinVersionArray.Length) { return $true @@ -124,27 +124,18 @@ function VerifyPythonExecutableMeetsMinimumRequirements { return $false } - # need to escape spaces in the path for Invoke-Expression - $EscapedExecutable = $PythonExecutable - $PythonVersion = Invoke-Expression "& `"$EscapedExecutable`" -c 'import platform;print(platform.python_version())'" $MinVersionToCheck = $MinValidPython3Version + Try { + $PythonVersion = & $PythonExecutable -c 'import platform;print(platform.python_version())' + if ($LastExitCode -ne 0) { + throw "Python version check failed with exit code $LastExitCode" + } + } Catch { + LogOutput "Ignoring Python registry entry because the Python executable could not be run: $PythonExecutable. Uninstall or repair this Python installation manually. If re-installing, please check that you install a python version above $MinVersionToCheck" + return $false + } if (VersionMeetsMinimumRequirements $PythonVersion $MinVersionToCheck) { - # If there is a valid python and it is not python 3 - if ( (-Not $AcceptAllDefaults) -And $PythonVersion.StartsWith("2") -And ($MinVersionToCheck -ne $MinValidPython3Version)){ - $message = 'OCI-CLI requires python 3. Do you want to install Python 3?' - $question = 'Install Python 3 now? (Entering "n" will install OCI CLI using existing Python)' - - $choices = New-Object Collections.ObjectModel.Collection[Management.Automation.Host.ChoiceDescription] - $choices.Add((New-Object Management.Automation.Host.ChoiceDescription -ArgumentList '&Yes')) - $choices.Add((New-Object Management.Automation.Host.ChoiceDescription -ArgumentList '&No')) - - $decision = $Host.UI.PromptForChoice($message, $question, $choices, 0) - if ($decision -eq 0) { - LogOutput 'Upgrading Python to Python 3...' - return $false - } - } return $true } @@ -152,32 +143,51 @@ function VerifyPythonExecutableMeetsMinimumRequirements { return $false } -# Finds the most recent version of Python installed in the registry and returns -# the path for python.exe for that install (or $null if no install exists). -# Documentation on the registry structure: https://www.python.org/dev/peps/pep-0514/ -function FindLatestPythonExecutableInRegistry { +# Finds the most recent usable version of Python installed in the registry and returns +# the path for python.exe for that install, or $null if no usable install exists. +# Documentation on the registry structure: https://www.python.org/dev/peps/pep-0514/ +function FindLatestUsablePythonExecutableInRegistry { Param( [Parameter(Mandatory=$true)] [string]$RootRegistryLocation ) - $PythonExecutable = $null $PythonCoreRegistryLocation = "${RootRegistryLocation}:\Software\Python\PythonCore" if (Test-Path $PythonCoreRegistryLocation) { - LogOutput "Python found in registry: $PythonCoreRegistryLocation" - $PythonInstallations = (Get-ChildItem -recurse $PythonCoreRegistryLocation) | Sort-Object -Descending - if ($PythonInstallations) { - ForEach ($Installation in $PythonInstallations) { - # we are sorting by descending so this will grab the greatest installed version of python - If ($installation.Name.EndsWith("\InstallPath")) { - $PythonInstallLocation = (Get-ItemProperty -LiteralPath $Installation.PSPath).'(default)' - return Join-Path $PythonInstallLocation "python.exe" - } - } - } - } - - return $PythonExecutable + LogOutput "Python found in registry: $PythonCoreRegistryLocation" + $PythonInstallations = (Get-ChildItem -recurse $PythonCoreRegistryLocation) | Sort-Object -Descending + if ($PythonInstallations) { + ForEach ($PythonInstallation in $PythonInstallations) { + $Installation = $PythonInstallation + Try { + $InstallPathProperties = Get-ItemProperty -LiteralPath $Installation.PSPath -ErrorAction Stop + } Catch { + LogOutput "Ignoring Python registry entry because it could not be read: $($Installation.Name). Error: $($_.Exception.Message)" + Continue + } + + $PythonInstallLocation = $InstallPathProperties.'(default)' + if (-Not $PythonInstallLocation) { + LogOutput "Ignoring Python registry entry with missing InstallPath default value: $($Installation.Name)" + Continue + } + $PythonExecutable = $InstallPathProperties.ExecutablePath + if (-Not $PythonExecutable) { + $PythonExecutable = Join-Path $PythonInstallLocation "python.exe" + } + if (-Not (Test-Path -LiteralPath $PythonExecutable -PathType Leaf)) { + LogOutput "Ignoring stale Python registry entry. Executable does not exist: $PythonExecutable. Uninstall or repair this Python installation manually." + Continue + } + # Runtime validation of the executable is done by checking if the minimum requirements from the + # python executable is satisfied. + if (VerifyPythonExecutableMeetsMinimumRequirements -PythonExecutable $PythonExecutable) { + return $PythonExecutable + } + } + } + } + return $null } function DownloadFile($Uri, $OutFile) { @@ -307,24 +317,15 @@ Try { # check if Python is installed, and is greater than MinValidPythonVersion $PythonExecutable = $null - $CurrentUserPythonExecutable = FindLatestPythonExecutableInRegistry "HKCU" - $LocalMachinePythonExecutable = FindLatestPythonExecutableInRegistry "HKLM" - - # if python is installed in the registry but the corresponding python.exe doesn't exist - # then the user will need to repair or uninstall python and re-run the script - $PythonInstallationCorruptErrorMessage = "Error: Python executable referenced in registry does not exist. Uninstall or repair your Python installation manually and then re-run this script." - $CurrentUserPythonInstallationExeMissing = $LocalMachinePythonExecutable -And (-Not (Test-Path $LocalMachinePythonExecutable)) - $LocalMachinePythonInstallationExeMissing = $CurrentUserPythonExecutable -And (-Not (Test-Path $CurrentUserPythonExecutable)) - If ($CurrentUserPythonInstallationExeMissing -Or $LocalMachinePythonInstallationExeMissing) { - Write-Error $PythonInstallationCorruptErrorMessage - } - - If (VerifyPythonExecutableMeetsMinimumRequirements -PythonExecutable $LocalMachinePythonExecutable) { - $PythonExecutable = $LocalMachinePythonExecutable - } - ElseIf (VerifyPythonExecutableMeetsMinimumRequirements -PythonExecutable $CurrentUserPythonExecutable) { - $PythonExecutable = $CurrentUserPythonExecutable - } + $CurrentUserPythonExecutable = FindLatestUsablePythonExecutableInRegistry "HKCU" + $LocalMachinePythonExecutable = FindLatestUsablePythonExecutableInRegistry "HKLM" + + If ($LocalMachinePythonExecutable) { + $PythonExecutable = $LocalMachinePythonExecutable + } + ElseIf ($CurrentUserPythonExecutable) { + $PythonExecutable = $CurrentUserPythonExecutable + } Else { LogOutput "No valid Python installation found." diff --git a/services/data_science/src/oci_cli_data_science/generated/datascience_cli.py b/services/data_science/src/oci_cli_data_science/generated/datascience_cli.py index f54b4ede8..ba9671a76 100644 --- a/services/data_science/src/oci_cli_data_science/generated/datascience_cli.py +++ b/services/data_science/src/oci_cli_data_science/generated/datascience_cli.py @@ -5618,7 +5618,8 @@ def create_schedule_schedule_i_cal_trigger(ctx, from_json, wait_for_state, max_w @cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. See [Resource Tags]. Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) @cli_util.option('--trigger-time-start', type=custom_types.CLI_DATETIME, help=u"""The schedule starting date time, if null, System set the time when schedule is created. Format is defined by [RFC3339].""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE) @cli_util.option('--trigger-time-end', type=custom_types.CLI_DATETIME, help=u"""The schedule end date time, if null, the schedule will never expire. Format is defined by [RFC3339].""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE) -@cli_util.option('--trigger-is-random-start-time', type=click.BOOL, help=u"""when true and timeStart is null, system generate a random start time between now and now + interval; isRandomStartTime can be true if timeStart is null.""") +@cli_util.option('--trigger-initial-jitter-in-minutes', type=click.INT, help=u"""Maximum number of minutes after timeStart that the scheduler may use to randomly select the first execution time. This value is considered only when isRandomStartTime is true. This value applies only to the initial execution; subsequent executions remain deterministic based on the resolved first trigger time. If timeStart is null, the service resolves the effective start time using the current time. The initial jitter window is then applied once to that resolved start time to determine the first execution time. If not provided and isRandomStartTime is true, the service defaults the jitter window to half of the configured interval duration. The value must not exceed the configured interval duration.""") +@cli_util.option('--trigger-is-random-start-time', type=click.BOOL, help=u"""when true, system generates a randomized first start time between timeStart and timeStart + initialJitterInMinutes. if timeStart is null, the current time is used as the base start time.""") @cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED"]), multiple=True, help="""This operation asynchronously creates, modifies or deletes a resource and uses a work request to track the progress of the operation. Specify this option to perform the action and then wait until the work request reaches a certain state. Multiple states can be specified, returning on the first state. For example, --wait-for-state ACCEPTED --wait-for-state CANCELED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""") @cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""") @cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""") @@ -5627,7 +5628,7 @@ def create_schedule_schedule_i_cal_trigger(ctx, from_json, wait_for_state, max_w @click.pass_context @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'action': {'module': 'data_science', 'class': 'ScheduleAction'}, 'log-details': {'module': 'data_science', 'class': 'ScheduleLogDetails'}, 'freeform-tags': {'module': 'data_science', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_science', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'data_science', 'class': 'Schedule'}) @cli_util.wrap_exceptions -def create_schedule_schedule_interval_trigger(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, display_name, project_id, compartment_id, action, trigger_frequency, trigger_interval, description, log_details, freeform_tags, defined_tags, trigger_time_start, trigger_time_end, trigger_is_random_start_time): +def create_schedule_schedule_interval_trigger(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, display_name, project_id, compartment_id, action, trigger_frequency, trigger_interval, description, log_details, freeform_tags, defined_tags, trigger_time_start, trigger_time_end, trigger_initial_jitter_in_minutes, trigger_is_random_start_time): kwargs = {} kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) @@ -5659,6 +5660,9 @@ def create_schedule_schedule_interval_trigger(ctx, from_json, wait_for_state, ma if trigger_time_end is not None: _details['trigger']['timeEnd'] = trigger_time_end + if trigger_initial_jitter_in_minutes is not None: + _details['trigger']['initialJitterInMinutes'] = trigger_initial_jitter_in_minutes + if trigger_is_random_start_time is not None: _details['trigger']['isRandomStartTime'] = trigger_is_random_start_time @@ -13795,7 +13799,8 @@ def update_schedule_schedule_i_cal_trigger(ctx, from_json, force, wait_for_state @cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource is updated or deleted only if the `etag` you provide matches the resource's current `etag` value.""") @cli_util.option('--trigger-time-start', type=custom_types.CLI_DATETIME, help=u"""The schedule starting date time, if null, System set the time when schedule is created. Format is defined by [RFC3339].""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE) @cli_util.option('--trigger-time-end', type=custom_types.CLI_DATETIME, help=u"""The schedule end date time, if null, the schedule will never expire. Format is defined by [RFC3339].""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE) -@cli_util.option('--trigger-is-random-start-time', type=click.BOOL, help=u"""when true and timeStart is null, system generate a random start time between now and now + interval; isRandomStartTime can be true if timeStart is null.""") +@cli_util.option('--trigger-initial-jitter-in-minutes', type=click.INT, help=u"""Maximum number of minutes after timeStart that the scheduler may use to randomly select the first execution time. This value is considered only when isRandomStartTime is true. This value applies only to the initial execution; subsequent executions remain deterministic based on the resolved first trigger time. If timeStart is null, the service resolves the effective start time using the current time. The initial jitter window is then applied once to that resolved start time to determine the first execution time. If not provided and isRandomStartTime is true, the service defaults the jitter window to half of the configured interval duration. The value must not exceed the configured interval duration.""") +@cli_util.option('--trigger-is-random-start-time', type=click.BOOL, help=u"""when true, system generates a randomized first start time between timeStart and timeStart + initialJitterInMinutes. if timeStart is null, the current time is used as the base start time.""") @cli_util.option('--force', help="""Perform update without prompting for confirmation.""", is_flag=True) @cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED"]), multiple=True, help="""This operation asynchronously creates, modifies or deletes a resource and uses a work request to track the progress of the operation. Specify this option to perform the action and then wait until the work request reaches a certain state. Multiple states can be specified, returning on the first state. For example, --wait-for-state ACCEPTED --wait-for-state CANCELED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""") @cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""") @@ -13805,7 +13810,7 @@ def update_schedule_schedule_i_cal_trigger(ctx, from_json, force, wait_for_state @click.pass_context @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'action': {'module': 'data_science', 'class': 'ScheduleAction'}, 'log-details': {'module': 'data_science', 'class': 'ScheduleLogDetails'}, 'freeform-tags': {'module': 'data_science', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_science', 'class': 'dict(str, dict(str, object))'}}) @cli_util.wrap_exceptions -def update_schedule_schedule_interval_trigger(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, schedule_id, trigger_frequency, trigger_interval, display_name, description, action, log_details, freeform_tags, defined_tags, if_match, trigger_time_start, trigger_time_end, trigger_is_random_start_time): +def update_schedule_schedule_interval_trigger(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, schedule_id, trigger_frequency, trigger_interval, display_name, description, action, log_details, freeform_tags, defined_tags, if_match, trigger_time_start, trigger_time_end, trigger_initial_jitter_in_minutes, trigger_is_random_start_time): if isinstance(schedule_id, six.string_types) and len(schedule_id.strip()) == 0: raise click.UsageError('Parameter --schedule-id cannot be whitespace or empty string') @@ -13848,6 +13853,9 @@ def update_schedule_schedule_interval_trigger(ctx, from_json, force, wait_for_st if trigger_time_end is not None: _details['trigger']['timeEnd'] = trigger_time_end + if trigger_initial_jitter_in_minutes is not None: + _details['trigger']['initialJitterInMinutes'] = trigger_initial_jitter_in_minutes + if trigger_is_random_start_time is not None: _details['trigger']['isRandomStartTime'] = trigger_is_random_start_time diff --git a/services/object_storage/src/oci_cli_object_storage/generated/objectstorage_cli.py b/services/object_storage/src/oci_cli_object_storage/generated/objectstorage_cli.py index 93de5500c..f60895a8f 100644 --- a/services/object_storage/src/oci_cli_object_storage/generated/objectstorage_cli.py +++ b/services/object_storage/src/oci_cli_object_storage/generated/objectstorage_cli.py @@ -390,6 +390,7 @@ def copy_object(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_ @cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags]. Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) @cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags]. Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) @cli_util.option('--kms-key-id', help=u"""The [OCID] of a master encryption key used to call the Key Management service to generate a data encryption key or to encrypt or decrypt a data encryption key.""") +@cli_util.option('--is-bucket-key-enabled', type=click.BOOL, help=u"""Specifies whether Object Storage should use intermediate cached Bucket Encryption Keys with server-side encryption using KMS (SSE-KMS) for new objects in the bucket. This reduces calls to OCI Vault Key Management Service (KMS). Existing objects are not affected.""") @cli_util.option('--versioning', type=custom_types.CliCaseInsensitiveChoice(["Enabled", "Disabled"]), help=u"""Set the versioning status on the bucket. By default, a bucket is created with versioning `Disabled`. Use this option to enable versioning during bucket creation. Objects in a version enabled bucket are protected from overwrites and deletions. Previous versions of the same object will be available in the bucket.""") @cli_util.option('--auto-tiering', help=u"""Set the auto tiering status on the bucket. By default, a bucket is created with auto tiering `Disabled`. Use this option to enable auto tiering during bucket creation. Objects in a bucket with auto tiering set to `InfrequentAccess` are transitioned automatically between the 'Standard' and 'InfrequentAccess' tiers based on the access pattern of the objects.""") @cli_util.option('--bucket-scope', help=u"""Scope in which the bucket is unique. Default value is NAMESPACE. Bucket scope as NAMESPACE means that the bucket is unique only in the owning namespace/tenancy. Other tenancies can have a bucket with same name in their namespace. Bucket scope as REGION means that the bucket is regionally unique. No other tenancy can have a bucket with same name and scope REGION.""") @@ -398,7 +399,7 @@ def copy_object(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_ @click.pass_context @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'metadata': {'module': 'object_storage', 'class': 'dict(str, string)'}, 'freeform-tags': {'module': 'object_storage', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'object_storage', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'object_storage', 'class': 'Bucket'}) @cli_util.wrap_exceptions -def create_bucket(ctx, from_json, namespace_name, name, compartment_id, metadata, public_access_type, storage_tier, object_events_enabled, freeform_tags, defined_tags, kms_key_id, versioning, auto_tiering, bucket_scope): +def create_bucket(ctx, from_json, namespace_name, name, compartment_id, metadata, public_access_type, storage_tier, object_events_enabled, freeform_tags, defined_tags, kms_key_id, is_bucket_key_enabled, versioning, auto_tiering, bucket_scope): if isinstance(namespace_name, six.string_types) and len(namespace_name.strip()) == 0: raise click.UsageError('Parameter --namespace-name cannot be whitespace or empty string') @@ -431,6 +432,9 @@ def create_bucket(ctx, from_json, namespace_name, name, compartment_id, metadata if kms_key_id is not None: _details['kmsKeyId'] = kms_key_id + if is_bucket_key_enabled is not None: + _details['isBucketKeyEnabled'] = is_bucket_key_enabled + if versioning is not None: _details['versioning'] = versioning @@ -2395,11 +2399,12 @@ def put_object_lifecycle_policy(ctx, from_json, force, namespace_name, bucket_na cli_util.render_response(result, ctx) -@bucket_group.command(name=cli_util.override('os.reencrypt_bucket.command_name', 'reencrypt'), help=u"""Re-encrypts the unique data encryption key that encrypts each object written to the bucket by using the most recent version of the master encryption key assigned to the bucket. (All data encryption keys are encrypted by a master encryption key. Master encryption keys are assigned to buckets and managed by Oracle by default, but you can assign a key that you created and control through the Oracle Cloud Infrastructure Key Management service.) The kmsKeyId property of the bucket determines which master encryption key is assigned to the bucket. If you assigned a different Key Management master encryption key to the bucket, you can call this API to re-encrypt all data encryption keys with the newly assigned key. Similarly, you might want to re-encrypt all data encryption keys if the assigned key has been rotated to a new key version since objects were last added to the bucket. If you call this API and there is no kmsKeyId associated with the bucket, the call will fail. +@bucket_group.command(name=cli_util.override('os.reencrypt_bucket.command_name', 'reencrypt'), help=u"""Re-encrypts the unique data encryption key that encrypts each object written to the bucket by using the most recent version of the master encryption key assigned to the bucket. (All data encryption keys are encrypted by a master encryption key. Master encryption keys are assigned to buckets and managed by Oracle by default, but you can assign a key that you created and control through the Oracle Cloud Infrastructure Key Management service.) The kmsKeyId property of the bucket determines which master encryption key is assigned to the bucket. If you assigned a different Key Management master encryption key to the bucket, you can call this API to re-encrypt all data encryption keys with the newly assigned key. Similarly, you might want to re-encrypt all data encryption keys if the assigned key has been rotated to a new key version since objects were last added to the bucket. If you call this API and there is no kmsKeyId associated with the bucket, the call will fail. Also, if you set isBucketKeyEnabled, you might want to re-encrypt all data encryption keys using the bucket key. This will help reduce calls to OCI Vault KMS when older objects are downloaded. Calling this API starts a work request task to re-encrypt the data encryption key of all objects in the bucket. Only objects created before the time of the API call will be re-encrypted. The call can take a long time, depending on how many objects are in the bucket and how big they are. This API returns a work request ID that you can use to retrieve the status of the work request task. All the versions of objects will be re-encrypted whether versioning is enabled or suspended at the bucket. \n[Command Reference](reencryptBucket)""") @cli_util.option('--namespace-name', required=True, help=u"""The Object Storage namespace used for the request.""") @cli_util.option('--bucket-name', required=True, help=u"""The name of the bucket. Avoid entering confidential information. Example: `my-new-bucket1`""") +@cli_util.option('--is-reencrypt-bucket-key-only', type=click.BOOL, help=u"""If true, reencrypt only the intermediate bucket keys and skip everything else in the bucket.""") @cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "COMPLETED", "CANCELING", "CANCELED"]), multiple=True, help="""This operation asynchronously creates, modifies or deletes a resource and uses a work request to track the progress of the operation. Specify this option to perform the action and then wait until the work request reaches a certain state. Multiple states can be specified, returning on the first state. For example, --wait-for-state ACCEPTED --wait-for-state CANCELED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""") @cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""") @cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""") @@ -2408,7 +2413,7 @@ def put_object_lifecycle_policy(ctx, from_json, force, namespace_name, bucket_na @click.pass_context @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}) @cli_util.wrap_exceptions -def reencrypt_bucket(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, namespace_name, bucket_name): +def reencrypt_bucket(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, namespace_name, bucket_name, is_reencrypt_bucket_key_only): if isinstance(namespace_name, six.string_types) and len(namespace_name.strip()) == 0: raise click.UsageError('Parameter --namespace-name cannot be whitespace or empty string') @@ -2417,6 +2422,8 @@ def reencrypt_bucket(ctx, from_json, wait_for_state, max_wait_seconds, wait_inte raise click.UsageError('Parameter --bucket-name cannot be whitespace or empty string') kwargs = {} + if is_reencrypt_bucket_key_only is not None: + kwargs['is_reencrypt_bucket_key_only'] = is_reencrypt_bucket_key_only kwargs['opc_client_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) client = cli_util.build_client('object_storage', 'object_storage', ctx) result = client.reencrypt_bucket( @@ -2613,6 +2620,7 @@ def restore_objects(ctx, from_json, namespace_name, bucket_name, object_name, ho @cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags]. Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) @cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags]. Example: `{\"Operations\": {\"CostCenter\": \"42\"}}""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) @cli_util.option('--kms-key-id', help=u"""The [OCID] of the Key Management master encryption key to associate with the specified bucket. If this value is empty, the Update operation will remove the associated key, if there is one, from the bucket. (The bucket will continue to be encrypted, but with an encryption key managed by Oracle.)""") +@cli_util.option('--is-bucket-key-enabled', type=click.BOOL, help=u"""Specifies whether Object Storage should use intermediate cached Bucket Encryption Keys with server-side encryption using KMS (SSE-KMS) for new objects in the bucket. This reduces calls to OCI Vault Key Management Service (KMS). Existing objects are not affected.""") @cli_util.option('--versioning', type=custom_types.CliCaseInsensitiveChoice(["Enabled", "Suspended"]), help=u"""The versioning status on the bucket. If in state `Enabled`, multiple versions of the same object can be kept in the bucket. When the object is overwritten or deleted, previous versions will still be available. When versioning is `Suspended`, the previous versions will still remain but new versions will no longer be created when overwitten or deleted. Versioning cannot be disabled on a bucket once enabled.""") @cli_util.option('--auto-tiering', help=u"""The auto tiering status on the bucket. If in state `InfrequentAccess`, objects are transitioned automatically between the 'Standard' and 'InfrequentAccess' tiers based on the access pattern of the objects. When auto tiering is `Disabled`, there will be no automatic transitions between storage tiers.""") @cli_util.option('--bucket-scope', help=u"""Scope in which the bucket is unique. Default value is NAMESPACE. Bucket scope as NAMESPACE means that the bucket is unique only in the owning namespace/tenancy. Other tenancies can have a bucket with same name in their namespace. Bucket scope as REGION means that the bucket is regionally unique. No other tenancy can have a bucket with same name and scope REGION. BucketScope can only be updated from NAMESPACE to REGION, it cannot be updated from REGION to NAMESPACE. Updating bucket scope is possible only if the bucket name is valid and there is no existing regionally unique bucket with the same name.""") @@ -2622,7 +2630,7 @@ def restore_objects(ctx, from_json, namespace_name, bucket_name, object_name, ho @click.pass_context @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'metadata': {'module': 'object_storage', 'class': 'dict(str, string)'}, 'freeform-tags': {'module': 'object_storage', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'object_storage', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'object_storage', 'class': 'Bucket'}) @cli_util.wrap_exceptions -def update_bucket(ctx, from_json, namespace_name, bucket_name, compartment_id, metadata, public_access_type, object_events_enabled, freeform_tags, defined_tags, kms_key_id, versioning, auto_tiering, bucket_scope, if_match): +def update_bucket(ctx, from_json, namespace_name, bucket_name, compartment_id, metadata, public_access_type, object_events_enabled, freeform_tags, defined_tags, kms_key_id, is_bucket_key_enabled, versioning, auto_tiering, bucket_scope, if_match): if isinstance(namespace_name, six.string_types) and len(namespace_name.strip()) == 0: raise click.UsageError('Parameter --namespace-name cannot be whitespace or empty string') @@ -2661,6 +2669,9 @@ def update_bucket(ctx, from_json, namespace_name, bucket_name, compartment_id, m if kms_key_id is not None: _details['kmsKeyId'] = kms_key_id + if is_bucket_key_enabled is not None: + _details['isBucketKeyEnabled'] = is_bucket_key_enabled + if versioning is not None: _details['versioning'] = versioning diff --git a/services/psql/src/oci_cli_postgresql/generated/postgresql_cli.py b/services/psql/src/oci_cli_postgresql/generated/postgresql_cli.py index af43777a6..f8e3cc1cd 100644 --- a/services/psql/src/oci_cli_postgresql/generated/postgresql_cli.py +++ b/services/psql/src/oci_cli_postgresql/generated/postgresql_cli.py @@ -101,6 +101,12 @@ def db_system_replica_collection_group(): pass +@click.command(cli_util.override('psql.pitr_details_group.command_name', 'pitr-details'), cls=CommandGroupWithAlias, help="""Point-in-time recovery details""") +@cli_util.help_option_group +def pitr_details_group(): + pass + + @click.command(cli_util.override('psql.work_request_error_group.command_name', 'work-request-error'), cls=CommandGroupWithAlias, help="""An error encountered while executing a work request.""") @cli_util.help_option_group def work_request_error_group(): @@ -126,6 +132,7 @@ def backup_collection_group(): psql_root_group.add_command(default_configuration_collection_group) psql_root_group.add_command(shape_summary_group) psql_root_group.add_command(db_system_replica_collection_group) +psql_root_group.add_command(pitr_details_group) psql_root_group.add_command(work_request_error_group) psql_root_group.add_command(backup_collection_group) @@ -1263,6 +1270,132 @@ def create_db_system_none_source_details(ctx, from_json, wait_for_state, max_wai cli_util.render_response(result, ctx) +@db_system_group.command(name=cli_util.override('psql.create_db_system_point_in_time_db_system_source_details.command_name', 'create-db-system-point-in-time-db-system-source-details'), help=u"""Creates a new database system. \n[Command Reference](createDbSystem)""") +@cli_util.option('--display-name', required=True, help=u"""A user-friendly display name for the database system. Avoid entering confidential information.""") +@cli_util.option('--compartment-id', required=True, help=u"""The [OCID] of the compartment that contains the database system.""") +@cli_util.option('--db-version', required=True, help=u"""Version of database system software.""") +@cli_util.option('--storage-details', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--shape', required=True, help=u"""The name of the shape for the database instance node. Use the /shapes API for accepted shapes. Example: `VM.Standard.E4.Flex`""") +@cli_util.option('--network-details', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--source-db-system-id', required=True, help=u"""The [OCID] of the source database system which will be used to perform point-in-time recovery.""") +@cli_util.option('--source-time-to-restore', required=True, type=custom_types.CLI_DATETIME, help=u"""The target point-in-time of the source database system that will be restored, expressed in [RFC 3339] timestamp format. + +Point-in-time recovery can only performed in granularity of seconds. Example: `2016-08-25T21:10:29Z`""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE) +@cli_util.option('--description', help=u"""A user-provided description of a database system.""") +@cli_util.option('--system-type', help=u"""Type of the database system.""") +@cli_util.option('--config-id', help=u"""The [OCID] of the configuration associated with the database system.""") +@cli_util.option('--instance-ocpu-count', type=click.INT, help=u"""The total number of OCPUs available to each database instance node.""") +@cli_util.option('--instance-memory-size-in-gbs', type=click.INT, help=u"""The total amount of memory available to each database instance node, in gigabytes.""") +@cli_util.option('--instance-count', type=click.INT, help=u"""Count of database instances nodes to be created in the database system.""") +@cli_util.option('--instances-details', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Details of database instances nodes to be created. This parameter is optional. If specified, its size must match `instanceCount`. + +This option is a JSON list with items of type CreateDbInstanceDetails. For documentation on CreateDbInstanceDetails please see our API reference: https://docs.oracle.com/en-us/iaas/api/#/en/postgresql/20220915/datatypes/CreateDbInstanceDetails.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--credentials', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--management-policy', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--replication-config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--odsp-insight-details', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: `{\"bar-key\": \"value\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: `{\"foo-namespace\": {\"bar-key\": \"value\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "WAITING", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED"]), multiple=True, help="""This operation asynchronously creates, modifies or deletes a resource and uses a work request to track the progress of the operation. Specify this option to perform the action and then wait until the work request reaches a certain state. Multiple states can be specified, returning on the first state. For example, --wait-for-state ACCEPTED --wait-for-state CANCELED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""") +@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""") +@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""") +@json_skeleton_utils.get_cli_json_input_option({'storage-details': {'module': 'psql', 'class': 'StorageDetails'}, 'instances-details': {'module': 'psql', 'class': 'list[CreateDbInstanceDetails]'}, 'credentials': {'module': 'psql', 'class': 'Credentials'}, 'network-details': {'module': 'psql', 'class': 'NetworkDetails'}, 'management-policy': {'module': 'psql', 'class': 'ManagementPolicyDetails'}, 'replication-config': {'module': 'psql', 'class': 'CreateReplicationConfigDetails'}, 'odsp-insight-details': {'module': 'psql', 'class': 'OdspInsightDetails'}, 'freeform-tags': {'module': 'psql', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'psql', 'class': 'dict(str, dict(str, object))'}}) +@cli_util.help_option +@click.pass_context +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'storage-details': {'module': 'psql', 'class': 'StorageDetails'}, 'instances-details': {'module': 'psql', 'class': 'list[CreateDbInstanceDetails]'}, 'credentials': {'module': 'psql', 'class': 'Credentials'}, 'network-details': {'module': 'psql', 'class': 'NetworkDetails'}, 'management-policy': {'module': 'psql', 'class': 'ManagementPolicyDetails'}, 'replication-config': {'module': 'psql', 'class': 'CreateReplicationConfigDetails'}, 'odsp-insight-details': {'module': 'psql', 'class': 'OdspInsightDetails'}, 'freeform-tags': {'module': 'psql', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'psql', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'psql', 'class': 'DbSystem'}) +@cli_util.wrap_exceptions +def create_db_system_point_in_time_db_system_source_details(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, display_name, compartment_id, db_version, storage_details, shape, network_details, source_db_system_id, source_time_to_restore, description, system_type, config_id, instance_ocpu_count, instance_memory_size_in_gbs, instance_count, instances_details, credentials, management_policy, replication_config, odsp_insight_details, freeform_tags, defined_tags): + + kwargs = {} + kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) + + _details = {} + _details['source'] = {} + _details['displayName'] = display_name + _details['compartmentId'] = compartment_id + _details['dbVersion'] = db_version + _details['storageDetails'] = cli_util.parse_json_parameter("storage_details", storage_details) + _details['shape'] = shape + _details['networkDetails'] = cli_util.parse_json_parameter("network_details", network_details) + _details['source']['dbSystemId'] = source_db_system_id + _details['source']['timeToRestore'] = source_time_to_restore + + if description is not None: + _details['description'] = description + + if system_type is not None: + _details['systemType'] = system_type + + if config_id is not None: + _details['configId'] = config_id + + if instance_ocpu_count is not None: + _details['instanceOcpuCount'] = instance_ocpu_count + + if instance_memory_size_in_gbs is not None: + _details['instanceMemorySizeInGBs'] = instance_memory_size_in_gbs + + if instance_count is not None: + _details['instanceCount'] = instance_count + + if instances_details is not None: + _details['instancesDetails'] = cli_util.parse_json_parameter("instances_details", instances_details) + + if credentials is not None: + _details['credentials'] = cli_util.parse_json_parameter("credentials", credentials) + + if management_policy is not None: + _details['managementPolicy'] = cli_util.parse_json_parameter("management_policy", management_policy) + + if replication_config is not None: + _details['replicationConfig'] = cli_util.parse_json_parameter("replication_config", replication_config) + + if odsp_insight_details is not None: + _details['odspInsightDetails'] = cli_util.parse_json_parameter("odsp_insight_details", odsp_insight_details) + + if freeform_tags is not None: + _details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags) + + if defined_tags is not None: + _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags) + + _details['source']['sourceType'] = 'POINT_IN_TIME_DB_SYSTEM' + + client = cli_util.build_client('psql', 'postgresql', ctx) + result = client.create_db_system( + create_db_system_details=_details, + **kwargs + ) + if wait_for_state: + + if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')): + try: + wait_period_kwargs = {} + if max_wait_seconds is not None: + wait_period_kwargs['max_wait_seconds'] = max_wait_seconds + if wait_interval_seconds is not None: + wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds + if 'opc-work-request-id' not in result.headers: + click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state') + cli_util.render_response(result, ctx) + return + + click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr) + result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs) + except oci.exceptions.MaximumWaitTimeExceeded as e: + # If we fail, we should show an error, but we should still provide the information to the customer + click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr) + cli_util.render_response(result, ctx) + sys.exit(2) + except Exception: + click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr) + cli_util.render_response(result, ctx) + raise + else: + click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr) + cli_util.render_response(result, ctx) + + @db_system_group.command(name=cli_util.override('psql.create_db_system_disabled_insight_details.command_name', 'create-db-system-disabled-insight-details'), help=u"""Creates a new database system. \n[Command Reference](createDbSystem)""") @cli_util.option('--display-name', required=True, help=u"""A user-friendly display name for the database system. Avoid entering confidential information.""") @cli_util.option('--compartment-id', required=True, help=u"""The [OCID] of the compartment that contains the database system.""") @@ -1861,6 +1994,28 @@ def get_default_configuration(ctx, from_json, default_configuration_id): cli_util.render_response(result, ctx) +@pitr_details_group.command(name=cli_util.override('psql.get_pitr_details.command_name', 'get'), help=u"""Gets the database system PITR details. \n[Command Reference](getPitrDetails)""") +@cli_util.option('--db-system-id', required=True, help=u"""A unique identifier for the database system.""") +@json_skeleton_utils.get_cli_json_input_option({}) +@cli_util.help_option +@click.pass_context +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'psql', 'class': 'PitrDetails'}) +@cli_util.wrap_exceptions +def get_pitr_details(ctx, from_json, db_system_id): + + if isinstance(db_system_id, six.string_types) and len(db_system_id.strip()) == 0: + raise click.UsageError('Parameter --db-system-id cannot be whitespace or empty string') + + kwargs = {} + kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) + client = cli_util.build_client('psql', 'postgresql', ctx) + result = client.get_pitr_details( + db_system_id=db_system_id, + **kwargs + ) + cli_util.render_response(result, ctx) + + @db_system_group.command(name=cli_util.override('psql.get_primary_db_instance.command_name', 'get-primary-db-instance'), help=u"""Gets the primary database instance node details. \n[Command Reference](getPrimaryDbInstance)""") @cli_util.option('--db-system-id', required=True, help=u"""A unique identifier for the database system.""") @json_skeleton_utils.get_cli_json_input_option({}) @@ -1917,6 +2072,7 @@ def get_work_request(ctx, from_json, work_request_id): @cli_util.option('--page', help=u"""A token representing the position at which to start retrieving results. This must come from the `opc-next-page` header field of a previous response.""") @cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either 'ASC' or 'DESC'.""") @cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["timeCreated", "displayName"]), help=u"""The field to sort by. Only one sort order may be provided. Default order for timeCreated is descending. Default order for displayName is ascending.""") +@cli_util.option('--backup-source-type', help=u"""A filter to return only backups whose backupSourceType matches the given backupSourceType""") @cli_util.option('--all', 'all_pages', is_flag=True, help="""Fetches all pages of results. If you provide this option, then you cannot provide the --limit option.""") @cli_util.option('--page-size', type=click.INT, help="""When fetching results, the number of results to fetch per call. Only valid when used with --all or --limit, and ignored otherwise.""") @json_skeleton_utils.get_cli_json_input_option({}) @@ -1924,7 +2080,7 @@ def get_work_request(ctx, from_json, work_request_id): @click.pass_context @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'psql', 'class': 'BackupCollection'}) @cli_util.wrap_exceptions -def list_backups(ctx, from_json, all_pages, page_size, compartment_id, time_started, time_ended, lifecycle_state, display_name, backup_id, id, limit, page, sort_order, sort_by): +def list_backups(ctx, from_json, all_pages, page_size, compartment_id, time_started, time_ended, lifecycle_state, display_name, backup_id, id, limit, page, sort_order, sort_by, backup_source_type): if all_pages and limit: raise click.UsageError('If you provide the --all option you cannot provide the --limit option') @@ -1952,6 +2108,8 @@ def list_backups(ctx, from_json, all_pages, page_size, compartment_id, time_star kwargs['sort_order'] = sort_order if sort_by is not None: kwargs['sort_by'] = sort_by + if backup_source_type is not None: + kwargs['backup_source_type'] = backup_source_type kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) client = cli_util.build_client('psql', 'postgresql', ctx) if all_pages: @@ -2837,8 +2995,11 @@ def restart_db_instance_in_db_system(ctx, from_json, wait_for_state, max_wait_se @db_system_group.command(name=cli_util.override('psql.restore_db_system.command_name', 'restore'), help=u"""Restore the database system. \n[Command Reference](restoreDbSystem)""") @cli_util.option('--db-system-id', required=True, help=u"""A unique identifier for the database system.""") -@cli_util.option('--backup-id', required=True, help=u"""The [OCID] of the database system backup.""") +@cli_util.option('--backup-id', help=u"""The [OCID] of the database system backup.""") @cli_util.option('--ad', help=u"""The desired AD for regions with three ADs. This parameter is optional. If not set, the AD is chosen based on the database system's current AD.""") +@cli_util.option('--time-to-restore', type=custom_types.CLI_DATETIME, help=u"""The target point-in-time that the database system restore can get started from, expressed in [RFC 3339] timestamp format. + +Example: `2016-08-25T21:10:29.600Z`""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE) @cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""") @cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "WAITING", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED"]), multiple=True, help="""This operation asynchronously creates, modifies or deletes a resource and uses a work request to track the progress of the operation. Specify this option to perform the action and then wait until the work request reaches a certain state. Multiple states can be specified, returning on the first state. For example, --wait-for-state ACCEPTED --wait-for-state CANCELED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""") @cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""") @@ -2848,7 +3009,7 @@ def restart_db_instance_in_db_system(ctx, from_json, wait_for_state, max_wait_se @click.pass_context @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}) @cli_util.wrap_exceptions -def restore_db_system(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, db_system_id, backup_id, ad, if_match): +def restore_db_system(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, db_system_id, backup_id, ad, time_to_restore, if_match): if isinstance(db_system_id, six.string_types) and len(db_system_id.strip()) == 0: raise click.UsageError('Parameter --db-system-id cannot be whitespace or empty string') @@ -2859,11 +3020,16 @@ def restore_db_system(ctx, from_json, wait_for_state, max_wait_seconds, wait_int kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) _details = {} - _details['backupId'] = backup_id + + if backup_id is not None: + _details['backupId'] = backup_id if ad is not None: _details['ad'] = ad + if time_to_restore is not None: + _details['timeToRestore'] = time_to_restore + client = cli_util.build_client('psql', 'postgresql', ctx) result = client.restore_db_system( db_system_id=db_system_id, diff --git a/services/psql/tests/util/generated/command_to_api.py b/services/psql/tests/util/generated/command_to_api.py index 35aa71fd1..4e9c7879c 100644 --- a/services/psql/tests/util/generated/command_to_api.py +++ b/services/psql/tests/util/generated/command_to_api.py @@ -20,6 +20,7 @@ "psql.get_connection_details": "oci.psql.PostgresqlClient.get_connection_details", "psql.get_db_system": "oci.psql.PostgresqlClient.get_db_system", "psql.get_default_configuration": "oci.psql.PostgresqlClient.get_default_configuration", + "psql.get_pitr_details": "oci.psql.PostgresqlClient.get_pitr_details", "psql.get_primary_db_instance": "oci.psql.PostgresqlClient.get_primary_db_instance", "psql.get_work_request": "oci.psql.PostgresqlClient.get_work_request", "psql.list_backups": "oci.psql.PostgresqlClient.list_backups", diff --git a/services/resource_manager/src/oci_cli_resource_manager/generated/resourcemanager_cli.py b/services/resource_manager/src/oci_cli_resource_manager/generated/resourcemanager_cli.py index 81fe6e72c..76d26d6b5 100644 --- a/services/resource_manager/src/oci_cli_resource_manager/generated/resourcemanager_cli.py +++ b/services/resource_manager/src/oci_cli_resource_manager/generated/resourcemanager_cli.py @@ -340,7 +340,7 @@ def change_template_compartment(ctx, from_json, template_id, compartment_id, if_ @configuration_source_provider_group.command(name=cli_util.override('resource_manager.create_configuration_source_provider.command_name', 'create'), help=u"""Creates a configuration source provider in the specified compartment. For more information, see [Creating a Configuration Source Provider]. \n[Command Reference](createConfigurationSourceProvider)""") -@cli_util.option('--config-source-provider-type', required=True, help=u"""The type of configuration source provider. The `GITLAB_ACCESS_TOKEN` type corresponds to GitLab. The `GITHUB_ACCESS_TOKEN` type corresponds to GitHub. The `BITBUCKET_CLOUD_USERNAME_APPPASSWORD` type corresponds to Bitbucket Cloud. The `BITBUCKET_SERVER_ACCESS_TOKEN` type corresponds to Bitbucket Server.""") +@cli_util.option('--config-source-provider-type', required=True, help=u"""The type of configuration source provider. The `GITLAB_ACCESS_TOKEN` type corresponds to GitLab. The `GITHUB_ACCESS_TOKEN` type corresponds to GitHub. The `BITBUCKET_CLOUD_ACCESS_TOKEN` type corresponds to Bitbucket Cloud. For Bitbucket Cloud, create requests must provide Atlassian account `email` and `secretId` containing an API token. The `BITBUCKET_SERVER_ACCESS_TOKEN` type corresponds to Bitbucket Server.""") @cli_util.option('--compartment-id', help=u"""The [OCID] of the compartment where you want to create the configuration source provider.""") @cli_util.option('--display-name', help=u"""A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.""") @cli_util.option('--description', help=u"""Description of the configuration source provider. Avoid entering confidential information.""") @@ -489,9 +489,9 @@ def create_configuration_source_provider_create_gitlab_access_token_configuratio cli_util.render_response(result, ctx) -@configuration_source_provider_group.command(name=cli_util.override('resource_manager.create_configuration_source_provider_create_bitbucket_cloud_username_app_password_configuration_source_provider_details.command_name', 'create-configuration-source-provider-create-bitbucket-cloud-username-app-password-configuration-source-provider-details'), help=u"""Creates a configuration source provider in the specified compartment. For more information, see [Creating a Configuration Source Provider]. \n[Command Reference](createConfigurationSourceProvider)""") +@configuration_source_provider_group.command(name=cli_util.override('resource_manager.create_configuration_source_provider_create_bitbucket_cloud_email_api_token_configuration_source_provider_details.command_name', 'create-configuration-source-provider-create-bitbucket-cloud-email-api-token-configuration-source-provider-details'), help=u"""Creates a configuration source provider in the specified compartment. For more information, see [Creating a Configuration Source Provider]. \n[Command Reference](createConfigurationSourceProvider)""") @cli_util.option('--api-endpoint', required=True, help=u"""The Bitbucket cloud service endpoint. Example: `https://bitbucket.org/`""") -@cli_util.option('--username', required=True, help=u"""The username for the user of the Bitbucket cloud repository.""") +@cli_util.option('--email', required=True, help=u"""Atlassian account email used for Bitbucket Cloud API token authentication.""") @cli_util.option('--secret-id', required=True, help=u"""The secret ocid which is used to authorize the user.""") @cli_util.option('--compartment-id', help=u"""The [OCID] of the compartment where you want to create the configuration source provider.""") @cli_util.option('--display-name', help=u"""A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.""") @@ -507,14 +507,14 @@ def create_configuration_source_provider_create_gitlab_access_token_configuratio @click.pass_context @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'private-server-config-details': {'module': 'resource_manager', 'class': 'PrivateServerConfigDetails'}, 'freeform-tags': {'module': 'resource_manager', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'resource_manager', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'resource_manager', 'class': 'ConfigurationSourceProvider'}) @cli_util.wrap_exceptions -def create_configuration_source_provider_create_bitbucket_cloud_username_app_password_configuration_source_provider_details(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, api_endpoint, username, secret_id, compartment_id, display_name, description, private_server_config_details, freeform_tags, defined_tags): +def create_configuration_source_provider_create_bitbucket_cloud_email_api_token_configuration_source_provider_details(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, api_endpoint, email, secret_id, compartment_id, display_name, description, private_server_config_details, freeform_tags, defined_tags): kwargs = {} kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) _details = {} _details['apiEndpoint'] = api_endpoint - _details['username'] = username + _details['email'] = email _details['secretId'] = secret_id if compartment_id is not None: @@ -535,7 +535,7 @@ def create_configuration_source_provider_create_bitbucket_cloud_username_app_pas if defined_tags is not None: _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags) - _details['configSourceProviderType'] = 'BITBUCKET_CLOUD_USERNAME_APPPASSWORD' + _details['configSourceProviderType'] = 'BITBUCKET_CLOUD_ACCESS_TOKEN' client = cli_util.build_client('resource_manager', 'resource_manager', ctx) result = client.create_configuration_source_provider( @@ -4023,7 +4023,7 @@ def list_work_requests(ctx, from_json, all_pages, page_size, compartment_id, res @cli_util.option('--configuration-source-provider-id', required=True, help=u"""The [OCID] of the configuration source provider.""") @cli_util.option('--display-name', help=u"""A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.""") @cli_util.option('--description', help=u"""Description of the configuration source provider. Avoid entering confidential information.""") -@cli_util.option('--config-source-provider-type', help=u"""The type of configuration source provider. The `BITBUCKET_CLOUD_USERNAME_APPPASSWORD` type corresponds to Bitbucket Cloud. The `BITBUCKET_SERVER_ACCESS_TOKEN` type corresponds to Bitbucket Server. The `GITLAB_ACCESS_TOKEN` type corresponds to GitLab. The `GITHUB_ACCESS_TOKEN` type corresponds to GitHub.""") +@cli_util.option('--config-source-provider-type', help=u"""The type of configuration source provider. The `BITBUCKET_CLOUD_ACCESS_TOKEN` type corresponds to Bitbucket Cloud. For Bitbucket Cloud, update requests must provide Atlassian account `email` and `secretId` containing an API token. The `BITBUCKET_SERVER_ACCESS_TOKEN` type corresponds to Bitbucket Server. The `GITLAB_ACCESS_TOKEN` type corresponds to GitLab. The `GITHUB_ACCESS_TOKEN` type corresponds to GitHub.""") @cli_util.option('--private-server-config-details', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) @cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Free-form tags associated with the resource. Each tag is a key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags]. Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) @cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags]. Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) @@ -4103,16 +4103,15 @@ def update_configuration_source_provider(ctx, from_json, force, wait_for_state, cli_util.render_response(result, ctx) -@configuration_source_provider_group.command(name=cli_util.override('resource_manager.update_configuration_source_provider_update_bitbucket_cloud_username_app_password_configuration_source_provider_details.command_name', 'update-configuration-source-provider-update-bitbucket-cloud-username-app-password-configuration-source-provider-details'), help=u"""Updates the properties of the specified configuration source provider. For more information, see [Updating a Configuration Source Provider]. \n[Command Reference](updateConfigurationSourceProvider)""") +@configuration_source_provider_group.command(name=cli_util.override('resource_manager.update_configuration_source_provider_update_bitbucket_server_access_token_configuration_source_provider_details.command_name', 'update-configuration-source-provider-update-bitbucket-server-access-token-configuration-source-provider-details'), help=u"""Updates the properties of the specified configuration source provider. For more information, see [Updating a Configuration Source Provider]. \n[Command Reference](updateConfigurationSourceProvider)""") @cli_util.option('--configuration-source-provider-id', required=True, help=u"""The [OCID] of the configuration source provider.""") @cli_util.option('--display-name', help=u"""A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.""") @cli_util.option('--description', help=u"""Description of the configuration source provider. Avoid entering confidential information.""") @cli_util.option('--private-server-config-details', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) @cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Free-form tags associated with the resource. Each tag is a key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags]. Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) @cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags]. Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) -@cli_util.option('--api-endpoint', help=u"""The Bitbucket service endpoint. Example: `https://bitbucket.org/`""") -@cli_util.option('--username', help=u"""The username for the user of the Bitbucket cloud repository.""") @cli_util.option('--secret-id', help=u"""The secret ocid which is used to authorize the user.""") +@cli_util.option('--api-endpoint', help=u"""The Bitbucket server service endpoint Example: `https://bitbucket.org/`""") @cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the `PUT` or `DELETE` call for a resource, set the `if-match` parameter to the value of the etag from a previous `GET` or `POST` response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""") @cli_util.option('--force', help="""Perform update without prompting for confirmation.""", is_flag=True) @cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACTIVE"]), multiple=True, help="""This operation creates, modifies or deletes a resource that has a defined lifecycle state. Specify this option to perform the action and then wait until the resource reaches a given lifecycle state. Multiple states can be specified, returning on the first state. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""") @@ -4123,7 +4122,7 @@ def update_configuration_source_provider(ctx, from_json, force, wait_for_state, @click.pass_context @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'private-server-config-details': {'module': 'resource_manager', 'class': 'PrivateServerConfigDetails'}, 'freeform-tags': {'module': 'resource_manager', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'resource_manager', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'resource_manager', 'class': 'ConfigurationSourceProvider'}) @cli_util.wrap_exceptions -def update_configuration_source_provider_update_bitbucket_cloud_username_app_password_configuration_source_provider_details(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, configuration_source_provider_id, display_name, description, private_server_config_details, freeform_tags, defined_tags, api_endpoint, username, secret_id, if_match): +def update_configuration_source_provider_update_bitbucket_server_access_token_configuration_source_provider_details(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, configuration_source_provider_id, display_name, description, private_server_config_details, freeform_tags, defined_tags, secret_id, api_endpoint, if_match): if isinstance(configuration_source_provider_id, six.string_types) and len(configuration_source_provider_id.strip()) == 0: raise click.UsageError('Parameter --configuration-source-provider-id cannot be whitespace or empty string') @@ -4154,16 +4153,13 @@ def update_configuration_source_provider_update_bitbucket_cloud_username_app_pas if defined_tags is not None: _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags) - if api_endpoint is not None: - _details['apiEndpoint'] = api_endpoint - - if username is not None: - _details['username'] = username - if secret_id is not None: _details['secretId'] = secret_id - _details['configSourceProviderType'] = 'BITBUCKET_CLOUD_USERNAME_APPPASSWORD' + if api_endpoint is not None: + _details['apiEndpoint'] = api_endpoint + + _details['configSourceProviderType'] = 'BITBUCKET_SERVER_ACCESS_TOKEN' client = cli_util.build_client('resource_manager', 'resource_manager', ctx) result = client.update_configuration_source_provider( @@ -4197,15 +4193,15 @@ def update_configuration_source_provider_update_bitbucket_cloud_username_app_pas cli_util.render_response(result, ctx) -@configuration_source_provider_group.command(name=cli_util.override('resource_manager.update_configuration_source_provider_update_bitbucket_server_access_token_configuration_source_provider_details.command_name', 'update-configuration-source-provider-update-bitbucket-server-access-token-configuration-source-provider-details'), help=u"""Updates the properties of the specified configuration source provider. For more information, see [Updating a Configuration Source Provider]. \n[Command Reference](updateConfigurationSourceProvider)""") +@configuration_source_provider_group.command(name=cli_util.override('resource_manager.update_configuration_source_provider_update_gitlab_access_token_configuration_source_provider_details.command_name', 'update-configuration-source-provider-update-gitlab-access-token-configuration-source-provider-details'), help=u"""Updates the properties of the specified configuration source provider. For more information, see [Updating a Configuration Source Provider]. \n[Command Reference](updateConfigurationSourceProvider)""") @cli_util.option('--configuration-source-provider-id', required=True, help=u"""The [OCID] of the configuration source provider.""") @cli_util.option('--display-name', help=u"""A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.""") @cli_util.option('--description', help=u"""Description of the configuration source provider. Avoid entering confidential information.""") @cli_util.option('--private-server-config-details', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) @cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Free-form tags associated with the resource. Each tag is a key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags]. Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) @cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags]. Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) -@cli_util.option('--secret-id', help=u"""The secret ocid which is used to authorize the user.""") -@cli_util.option('--api-endpoint', help=u"""The Bitbucket server service endpoint Example: `https://bitbucket.org/`""") +@cli_util.option('--api-endpoint', help=u"""The Git service endpoint. Example: `https://gitlab.com`""") +@cli_util.option('--access-token', help=u"""The personal access token to be configured on the GitLab repository.""") @cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the `PUT` or `DELETE` call for a resource, set the `if-match` parameter to the value of the etag from a previous `GET` or `POST` response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""") @cli_util.option('--force', help="""Perform update without prompting for confirmation.""", is_flag=True) @cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACTIVE"]), multiple=True, help="""This operation creates, modifies or deletes a resource that has a defined lifecycle state. Specify this option to perform the action and then wait until the resource reaches a given lifecycle state. Multiple states can be specified, returning on the first state. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""") @@ -4216,7 +4212,7 @@ def update_configuration_source_provider_update_bitbucket_cloud_username_app_pas @click.pass_context @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'private-server-config-details': {'module': 'resource_manager', 'class': 'PrivateServerConfigDetails'}, 'freeform-tags': {'module': 'resource_manager', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'resource_manager', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'resource_manager', 'class': 'ConfigurationSourceProvider'}) @cli_util.wrap_exceptions -def update_configuration_source_provider_update_bitbucket_server_access_token_configuration_source_provider_details(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, configuration_source_provider_id, display_name, description, private_server_config_details, freeform_tags, defined_tags, secret_id, api_endpoint, if_match): +def update_configuration_source_provider_update_gitlab_access_token_configuration_source_provider_details(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, configuration_source_provider_id, display_name, description, private_server_config_details, freeform_tags, defined_tags, api_endpoint, access_token, if_match): if isinstance(configuration_source_provider_id, six.string_types) and len(configuration_source_provider_id.strip()) == 0: raise click.UsageError('Parameter --configuration-source-provider-id cannot be whitespace or empty string') @@ -4247,13 +4243,13 @@ def update_configuration_source_provider_update_bitbucket_server_access_token_co if defined_tags is not None: _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags) - if secret_id is not None: - _details['secretId'] = secret_id - if api_endpoint is not None: _details['apiEndpoint'] = api_endpoint - _details['configSourceProviderType'] = 'BITBUCKET_SERVER_ACCESS_TOKEN' + if access_token is not None: + _details['accessToken'] = access_token + + _details['configSourceProviderType'] = 'GITLAB_ACCESS_TOKEN' client = cli_util.build_client('resource_manager', 'resource_manager', ctx) result = client.update_configuration_source_provider( @@ -4287,15 +4283,16 @@ def update_configuration_source_provider_update_bitbucket_server_access_token_co cli_util.render_response(result, ctx) -@configuration_source_provider_group.command(name=cli_util.override('resource_manager.update_configuration_source_provider_update_gitlab_access_token_configuration_source_provider_details.command_name', 'update-configuration-source-provider-update-gitlab-access-token-configuration-source-provider-details'), help=u"""Updates the properties of the specified configuration source provider. For more information, see [Updating a Configuration Source Provider]. \n[Command Reference](updateConfigurationSourceProvider)""") +@configuration_source_provider_group.command(name=cli_util.override('resource_manager.update_configuration_source_provider_update_bitbucket_cloud_email_api_token_configuration_source_provider_details.command_name', 'update-configuration-source-provider-update-bitbucket-cloud-email-api-token-configuration-source-provider-details'), help=u"""Updates the properties of the specified configuration source provider. For more information, see [Updating a Configuration Source Provider]. \n[Command Reference](updateConfigurationSourceProvider)""") @cli_util.option('--configuration-source-provider-id', required=True, help=u"""The [OCID] of the configuration source provider.""") @cli_util.option('--display-name', help=u"""A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.""") @cli_util.option('--description', help=u"""Description of the configuration source provider. Avoid entering confidential information.""") @cli_util.option('--private-server-config-details', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) @cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Free-form tags associated with the resource. Each tag is a key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags]. Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) @cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags]. Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) -@cli_util.option('--api-endpoint', help=u"""The Git service endpoint. Example: `https://gitlab.com`""") -@cli_util.option('--access-token', help=u"""The personal access token to be configured on the GitLab repository.""") +@cli_util.option('--api-endpoint', help=u"""The Bitbucket service endpoint. Example: `https://bitbucket.org/`""") +@cli_util.option('--email', help=u"""Atlassian account email used for Bitbucket Cloud API token authentication.""") +@cli_util.option('--secret-id', help=u"""The secret OCID containing an Atlassian API token.""") @cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the `PUT` or `DELETE` call for a resource, set the `if-match` parameter to the value of the etag from a previous `GET` or `POST` response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""") @cli_util.option('--force', help="""Perform update without prompting for confirmation.""", is_flag=True) @cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACTIVE"]), multiple=True, help="""This operation creates, modifies or deletes a resource that has a defined lifecycle state. Specify this option to perform the action and then wait until the resource reaches a given lifecycle state. Multiple states can be specified, returning on the first state. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""") @@ -4306,7 +4303,7 @@ def update_configuration_source_provider_update_bitbucket_server_access_token_co @click.pass_context @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'private-server-config-details': {'module': 'resource_manager', 'class': 'PrivateServerConfigDetails'}, 'freeform-tags': {'module': 'resource_manager', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'resource_manager', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'resource_manager', 'class': 'ConfigurationSourceProvider'}) @cli_util.wrap_exceptions -def update_configuration_source_provider_update_gitlab_access_token_configuration_source_provider_details(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, configuration_source_provider_id, display_name, description, private_server_config_details, freeform_tags, defined_tags, api_endpoint, access_token, if_match): +def update_configuration_source_provider_update_bitbucket_cloud_email_api_token_configuration_source_provider_details(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, configuration_source_provider_id, display_name, description, private_server_config_details, freeform_tags, defined_tags, api_endpoint, email, secret_id, if_match): if isinstance(configuration_source_provider_id, six.string_types) and len(configuration_source_provider_id.strip()) == 0: raise click.UsageError('Parameter --configuration-source-provider-id cannot be whitespace or empty string') @@ -4340,10 +4337,13 @@ def update_configuration_source_provider_update_gitlab_access_token_configuratio if api_endpoint is not None: _details['apiEndpoint'] = api_endpoint - if access_token is not None: - _details['accessToken'] = access_token + if email is not None: + _details['email'] = email - _details['configSourceProviderType'] = 'GITLAB_ACCESS_TOKEN' + if secret_id is not None: + _details['secretId'] = secret_id + + _details['configSourceProviderType'] = 'BITBUCKET_CLOUD_ACCESS_TOKEN' client = cli_util.build_client('resource_manager', 'resource_manager', ctx) result = client.update_configuration_source_provider( diff --git a/services/resource_manager/src/oci_cli_resource_manager/resourcemanager_cli_extended.py b/services/resource_manager/src/oci_cli_resource_manager/resourcemanager_cli_extended.py index 37d8678ab..29259665e 100644 --- a/services/resource_manager/src/oci_cli_resource_manager/resourcemanager_cli_extended.py +++ b/services/resource_manager/src/oci_cli_resource_manager/resourcemanager_cli_extended.py @@ -829,3 +829,11 @@ def create_job_create_plan_rollback_job_operation_details_extended(ctx, **kwargs # oci resource-manager stack update-stack-update-bitbucket-server-config-source-details -> oci resource-manager stack code cli_util.rename_command(resourcemanager_cli, resourcemanager_cli.stack_group, resourcemanager_cli.update_stack_update_bitbucket_server_config_source_details, "code") + + +# oci resource-manager configuration-source-provider create-configuration-source-provider-create-bitbucket-cloud-email-api-token-configuration-source-provider-details -> oci resource-manager configuration-source-provider create-bitbucket-cloud-email-api-token-provider +cli_util.rename_command(resourcemanager_cli, resourcemanager_cli.configuration_source_provider_group, resourcemanager_cli.create_configuration_source_provider_create_bitbucket_cloud_email_api_token_configuration_source_provider_details, "create-bitbucket-cloud-email-api-token-provider") + + +# oci resource-manager configuration-source-provider update-configuration-source-provider-update-bitbucket-cloud-email-api-token-configuration-source-provider-details -> oci resource-manager configuration-source-provider update-bitbucket-cloud-email-api-token-provider +cli_util.rename_command(resourcemanager_cli, resourcemanager_cli.configuration_source_provider_group, resourcemanager_cli.update_configuration_source_provider_update_bitbucket_cloud_email_api_token_configuration_source_provider_details, "update-bitbucket-cloud-email-api-token-provider") diff --git a/setup.py b/setup.py index f46c32cd3..a38b828d1 100644 --- a/setup.py +++ b/setup.py @@ -30,7 +30,7 @@ def open_relative(*path): readme = f.read() requires = [ - 'oci==2.180.0', + 'oci==2.181.0', 'arrow>=1.0.0,<2.0.0', 'certifi>=2025.1.31,<2026.0.0', 'click<=8.1.2', diff --git a/src/oci_cli/version.py b/src/oci_cli/version.py index b911c6e8b..8fbc01e62 100644 --- a/src/oci_cli/version.py +++ b/src/oci_cli/version.py @@ -2,4 +2,4 @@ # Copyright (c) 2016, 2026, Oracle and/or its affiliates. All rights reserved. # This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. -__version__ = '3.88.0' +__version__ = '3.89.0' diff --git a/tests/resources/json_ignore_command_list.txt b/tests/resources/json_ignore_command_list.txt index ba3a766dc..5d128c8cd 100644 --- a/tests/resources/json_ignore_command_list.txt +++ b/tests/resources/json_ignore_command_list.txt @@ -610,4 +610,4 @@ dbtools-runtime, database-api-gateway-config-pool-auto-api-spec, create, default dbtools-runtime, database-api-gateway-config-pool-auto-api-spec, update, default db, cloud-exa-infra, update opsi, opsi-private-endpoint, update -db, database, create-from-backup \ No newline at end of file +db, database, create-from-backup