# 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
fleet_apps_management_client = oci.fleet_apps_management.FleetAppsManagementOperationsClient(
config)
# Send the request to service, some parameters are not required, see API
# doc for more info
create_patch_response = fleet_apps_management_client.create_patch(
create_patch_details=oci.fleet_apps_management.models.CreatePatchDetails(
name="EXAMPLE-name-Value",
patch_type=oci.fleet_apps_management.models.PatchType(
platform_configuration_id="ocid1.test.oc1..<unique_ID>EXAMPLE-platformConfigurationId-Value"),
severity="CRITICAL",
time_released=datetime.strptime(
"2040-10-06T09:34:24.927Z",
"%Y-%m-%dT%H:%M:%S.%fZ"),
artifact_details=oci.fleet_apps_management.models.PlatformSpecificArtifactDetails(
category="PLATFORM_SPECIFIC",
artifacts=[
oci.fleet_apps_management.models.PlatformSpecificArtifact(
content=oci.fleet_apps_management.models.ObjectStorageBucketContentDetails(
source_type="OBJECT_STORAGE_BUCKET",
namespace_name="EXAMPLE-namespaceName-Value",
bucket_name="EXAMPLE-bucketName-Value",
object_name="EXAMPLE-objectName-Value",
checksum="EXAMPLE-checksum-Value"),
os_type="LINUX",
architecture="X64")]),
product=oci.fleet_apps_management.models.PatchProduct(
platform_configuration_id="ocid1.test.oc1..<unique_ID>EXAMPLE-platformConfigurationId-Value",
version="EXAMPLE-version-Value"),
compartment_id="ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value",
description="EXAMPLE-description-Value",
dependent_patches=[
oci.fleet_apps_management.models.DependentPatchDetails(
id="ocid1.test.oc1..<unique_ID>EXAMPLE-id-Value")],
freeform_tags={
'EXAMPLE_KEY_sbrHq': 'EXAMPLE_VALUE_57rcuZzus4Og1SBTedzC'},
defined_tags={
'EXAMPLE_KEY_aoS9P': {
'EXAMPLE_KEY_nBIbg': 'EXAMPLE--Value'}}),
opc_retry_token="EXAMPLE-opcRetryToken-Value",
opc_request_id="NVH7VWQGGR9WHZ7ZG2SN<unique_ID>")
# Get the data from response
print(create_patch_response.data)