# 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
update_patch_response = fleet_apps_management_client.update_patch(
    patch_id="ocid1.test.oc1..<unique_ID>EXAMPLE-patchId-Value",
    update_patch_details=oci.fleet_apps_management.models.UpdatePatchDetails(
        description="EXAMPLE-description-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(
            "2042-05-23T03:09:19.575Z",
            "%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"),
        dependent_patches=[
            oci.fleet_apps_management.models.DependentPatchDetails(
                id="ocid1.test.oc1..<unique_ID>EXAMPLE-id-Value")],
        compartment_id="ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value",
        freeform_tags={
            'EXAMPLE_KEY_rS4lD': 'EXAMPLE_VALUE_8FDgu5ECvqgIbInNTz8R'},
        defined_tags={
            'EXAMPLE_KEY_CxEG4': {
                'EXAMPLE_KEY_IjSEb': 'EXAMPLE--Value'}}),
    if_match="EXAMPLE-ifMatch-Value",
    opc_request_id="AKX5SL2FVQSWREURKWKT<unique_ID>")

# Get the data from response
print(update_patch_response.headers)

Was this article helpful?