Skip to content

Commit cab81de

Browse files
Releasing version 2.164.1
Releasing version 2.164.1
2 parents 2b77d1d + f7636c8 commit cab81de

19 files changed

+1089
-23
lines changed

CHANGELOG.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,16 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on `Keep a Changelog <http://keepachangelog.com/>`_.
66

7+
====================
8+
2.164.1 - 2025-12-09
9+
====================
10+
11+
Added
12+
-----
13+
* Support for listing elastic pool cost savings in the Database service
14+
* Support for OpenAI GPT-OSS model in the Generative AI Inference service
15+
* Support for distributed tracing via opc-request-id
16+
717
====================
818
2.164.0 - 2025-11-18
919
====================

docs/api/database.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,8 @@ Database
308308
oci.database.models.EnableExternalPluggableDatabaseStackMonitoringDetails
309309
oci.database.models.EnablePluggableDatabaseManagementDetails
310310
oci.database.models.EncryptionKeyLocationDetails
311+
oci.database.models.EstimateCostSavingSummary
312+
oci.database.models.EstimateCostSavingsSummaryCollection
311313
oci.database.models.EstimatedPatchingTime
312314
oci.database.models.ExadataDbSystemMigration
313315
oci.database.models.ExadataDbSystemMigrationSummary
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
EstimateCostSavingSummary
2+
=========================
3+
4+
.. currentmodule:: oci.database.models
5+
6+
.. autoclass:: EstimateCostSavingSummary
7+
:show-inheritance:
8+
:special-members: __init__
9+
:members:
10+
:undoc-members:
11+
:inherited-members:
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
EstimateCostSavingsSummaryCollection
2+
====================================
3+
4+
.. currentmodule:: oci.database.models
5+
6+
.. autoclass:: EstimateCostSavingsSummaryCollection
7+
:show-inheritance:
8+
:special-members: __init__
9+
:members:
10+
:undoc-members:
11+
:inherited-members:
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# coding: utf-8
2+
# Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
3+
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.
4+
5+
# This script gives an example on passing in a request model for an API to the pagination call.
6+
7+
# !!! THIS EXAMPLE HAS INFORMATION ABOUT R1 AND IS INTENDED FOR INTERNAL CUSTOMERS. MASK DETAILS FOR PUBLIC VERSION !!!
8+
9+
from datetime import datetime, timedelta, timezone
10+
11+
from oci.auth.signers import InstancePrincipalsSecurityTokenSigner, OauthExchangeTokenSigner
12+
from oci.monitoring import MonitoringClient, models
13+
14+
metrics_endpoint = "https://telemetry-ingestion.us-ashburn-1.oraclecloud.com"
15+
16+
target_compartment = ""
17+
root_cert_path = ""
18+
19+
instance_principal_signer = InstancePrincipalsSecurityTokenSigner(
20+
federation_endpoint='https://auth.us-ashburn-1.oraclecloud.com/v1/x509')
21+
22+
oauth_exchange_signer = OauthExchangeTokenSigner(instance_principal_signer,
23+
scope=f"monitoring_write_urn-{target_compartment}:instance",
24+
cert_bundle_verify=root_cert_path,
25+
target_compartment=target_compartment,
26+
oauth_token_endpoint="https://auth.region.oraclecloud.com}/v1/oauth2/scoped")
27+
28+
monitoring = MonitoringClient({}, service_endpoint=metrics_endpoint, signer=oauth_exchange_signer)
29+
30+
metric_data = [models.MetricDataDetails(
31+
namespace="",
32+
resource_group="",
33+
compartment_id=target_compartment,
34+
name="SDKTestMetric",
35+
dimensions={
36+
"resourceId": "exampleDimensionResource"
37+
},
38+
metadata={
39+
"unit": "count",
40+
},
41+
datapoints=[
42+
{
43+
"timestamp": (
44+
datetime.now(timezone.utc) - timedelta(minutes=5)
45+
).strftime('%Y-%m-%dT%H:%M:%S.000Z'),
46+
"value": 15,
47+
"count": 1
48+
}
49+
]
50+
) for i in range(4)]
51+
print("Posting metric data....")
52+
53+
post_metric_data_details = models.PostMetricDataDetails(
54+
metric_data=metric_data,
55+
batch_atomicity=models.PostMetricDataDetails.BATCH_ATOMICITY_ATOMIC
56+
)
57+
post_metric_result = monitoring.post_metric_data(post_metric_data_details)
58+
59+
print("post metrics response status: ", post_metric_result.status)
60+
print("post metrics response data: ", post_metric_result.data)

examples/workload_identity_federation_signer_example.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111

1212
# -----------------------------------------------------------------------------
1313
# Script usage:
14-
# python workload_identity_federation_signer_example.py <region> <resource_ocid> <oci_domain_id> <oci_client_id> <oci_client_secret>
14+
# python workload_identity_federation_signer_example.py <region> <resource_ocid> <oci_domain_url> <oci_client_id> <oci_client_secret>
1515
#
1616
# Example:
17-
# python workload_identity_federation_signer_example.py us-ashburn-1 ocid1.vaultsecret.oc1.iad.xxxxx domain_id client_id client_secret
17+
# python workload_identity_federation_signer_example.py us-ashburn-1 ocid1.vaultsecret.oc1.iad.xxxxx https://idcs-xxxxx.identity.oraclecloud.com client_id client_secret
1818
#
1919
# Notes:
2020
# - The second argument (<resource_ocid>) is shown as a secret OCID in the example,
@@ -24,12 +24,12 @@
2424

2525
if len(sys.argv) != 6:
2626
raise RuntimeError(
27-
"Usage: python workload_identity_federation_signer_example.py <region> <resource_ocid> <oci_domain_id> <oci_client_id> <oci_client_secret>"
27+
"Usage: python workload_identity_federation_signer_example.py <region> <resource_ocid> <oci_domain_url> <oci_client_id> <oci_client_secret>"
2828
)
2929

3030
region = sys.argv[1]
3131
resource_ocid = sys.argv[2] # Can be secret_id, bucket_id, etc.
32-
oci_domain_id = sys.argv[3]
32+
oci_domain_url = sys.argv[3]
3333
oci_client_id = sys.argv[4]
3434
oci_client_secret = sys.argv[5]
3535

@@ -62,7 +62,7 @@ def get_jwt():
6262
# -----------------------------------------------------------------------------
6363
# TokenExchangeSigner
6464
# -----------------------------------------------------------------------------
65-
signer = oci.auth.signers.TokenExchangeSigner(get_jwt, oci_domain_id, oci_client_id, oci_client_secret)
65+
signer = oci.auth.signers.TokenExchangeSigner(get_jwt, oci_domain_url, oci_client_id, oci_client_secret)
6666

6767
# -----------------------------------------------------------------------------
6868
# Example: Use the resource OCID with SecretsClient

src/oci/auth/auth_utils.py

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@
44

55
import random
66
import warnings
7-
from oci._vendor import six
7+
import oci
8+
from oci._vendor import six, requests
9+
from oci._vendor.requests import HTTPError
10+
from oci.regions import GET_REGION_URL, METADATA_AUTH_HEADERS
811

912

1013
def get_tenancy_id_from_certificate(cert):
@@ -50,3 +53,21 @@ def generate_unique_id():
5053
b = [random.randrange(256) for i in range(16)]
5154
hex_string = ''.join(format(x, '02x') for x in b)
5255
return hex_string
56+
57+
58+
def get_region_data_from_imds():
59+
"""
60+
Response is of format
61+
{
62+
"realmdomaincomponent": "oraclecloud.com",
63+
"realmkey": "oc1",
64+
"regionidentifier": "us-phoenix-1",
65+
"regionkey": "phx"
66+
}
67+
"""
68+
response = requests.get(GET_REGION_URL, timeout=(10, 60), headers=METADATA_AUTH_HEADERS)
69+
try:
70+
response.raise_for_status()
71+
except HTTPError as e:
72+
raise oci.exceptions.ServiceError(e.response.status_code, e.errno, e.response.headers, str(e))
73+
return response.json()

src/oci/auth/signers/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,5 @@
1414
from .ephemeral_resource_principals_v21_signer import EphemeralResourcePrincipalV21Signer # noqa: F401
1515
from .key_pair_signer import KeyPairSigner # noqa: F401
1616
from .nested_resource_principals_signer import NestedResourcePrincipals # noqa: F401
17+
from .oauth_exhange_token_signer import OauthExchangeTokenSigner # noqa: F401
1718
from .token_exchange_signer import TokenExchangeSigner # noqa: F401

0 commit comments

Comments
 (0)