# 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).

import oci
from datetime import datetime

# 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(
            "2003-10-29T03:32:30.849Z",
            "%Y-%m-%dT%H:%M:%S.%fZ"),
        artifact_details=oci.fleet_apps_management.models.GenericArtifactDetails(
            category="GENERIC",
            artifact=oci.fleet_apps_management.models.GenericArtifact(
                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"))),
        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_WkHIJ': 'EXAMPLE_VALUE_bKhrycKbnZbxIoZ1Mp9d'},
        defined_tags={
            'EXAMPLE_KEY_5t7EZ': {
                'EXAMPLE_KEY_hQaaf': 'EXAMPLE--Value'}}),
    opc_retry_token="EXAMPLE-opcRetryToken-Value",
    opc_request_id="1WL8KBIST7T6ZPHDBFRL<unique_ID>")

# Get the data from response
print(create_patch_response.data)

Was this article helpful?