# This is an automatically generated code sample.
# To make this code sample work in your Oracle Cloud tenancy,
# please replace the values for any parameters whose current values do not fit
# your use case (such as resource IDs, strings containing ‘EXAMPLE’ or ‘unique_id’, and
# boolean, number, and enum parameters with values not fitting your use case).
from datetime import datetime
import oci
# Create a default config using DEFAULT profile in default location
# Refer to
# https://docs.cloud.oracle.com/en-us/iaas/Content/API/Concepts/sdkconfig.htm#SDK_and_CLI_Configuration_File
# for more info
config = oci.config.from_file()
# Initialize service client with default config file
ccd_offers_client = oci.ccd_offers.CcdCommitmentsClient(config)
# Send the request to service, some parameters are not required, see API
# doc for more info
create_ccd_commitment_response = ccd_offers_client.create_ccd_commitment(
ccd_offer_id="ocid1.test.oc1..<unique_ID>EXAMPLE-ccdOfferId-Value",
create_ccd_commitment_details=oci.ccd_offers.models.CreateCcdCommitmentDetails(
quantity=809,
display_name="EXAMPLE-displayName-Value",
subscription_id="ocid1.test.oc1..<unique_ID>EXAMPLE-subscriptionId-Value",
compartment_id="ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value",
time_ccd_commitment_starts=datetime.strptime(
"2019-09-06T23:19:14.783Z",
"%Y-%m-%dT%H:%M:%S.%fZ"),
filler_tenancy_id="ocid1.test.oc1..<unique_ID>EXAMPLE-fillerTenancyId-Value",
usage_eligibility=oci.ccd_offers.models.UsageEligibility(
compartment_ids=["EXAMPLE--Value"],
region="EXAMPLE-region-Value",
availability_domain="EXAMPLE-availabilityDomain-Value",
tenancy_ids=["EXAMPLE--Value"]),
secondary_skus=[
oci.ccd_offers.models.SecondarySkus(
sku="EXAMPLE-sku-Value",
sku_display_name="EXAMPLE-skuDisplayName-Value",
sku_metric="EXAMPLE-skuMetric-Value",
quantity=382)],
time_ccd_commitment_ends=datetime.strptime(
"2003-08-11T17:57:10.159Z",
"%Y-%m-%dT%H:%M:%S.%fZ"),
freeform_tags={
'EXAMPLE_KEY_wqL7x': 'EXAMPLE_VALUE_VS62V6IIeD7EhWyfinNG'},
defined_tags={
'EXAMPLE_KEY_tBD8m': {
'EXAMPLE_KEY_XLV2h': 'EXAMPLE--Value'}}),
opc_retry_token="EXAMPLE-opcRetryToken-Value",
opc_request_id="G74THHCTALO3RHHLC5TX<unique_ID>")
# Get the data from response
print(create_ccd_commitment_response.data)