# 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

# 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.FleetAppsManagementClient(
    config)


# Send the request to service, some parameters are not required, see API
# doc for more info
create_fleet_response = fleet_apps_management_client.create_fleet(
    create_fleet_details=oci.fleet_apps_management.models.CreateFleetDetails(
        display_name="EXAMPLE-displayName-Value",
        compartment_id="ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value",
        resource_selection=oci.fleet_apps_management.models.ManualResourceSelection(
            resource_selection_type="MANUAL"),
        description="EXAMPLE-description-Value",
        details=oci.fleet_apps_management.models.GroupFleetDetails(
            fleet_type="GROUP"),
        products=["EXAMPLE--Value"],
        environment_type="EXAMPLE-environmentType-Value",
        notification_preferences=[
            oci.fleet_apps_management.models.NotificationPreference(
                topic_id="ocid1.test.oc1..<unique_ID>EXAMPLE-topicId-Value",
                compartment_id="ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value",
                preferences=oci.fleet_apps_management.models.Preferences(
                    upcoming_schedule=oci.fleet_apps_management.models.UpcomingSchedule(
                        on_upcoming_schedule=False,
                        notify_before="EXAMPLE-notifyBefore-Value"),
                    on_job_failure=False,
                    on_topology_modification=True,
                    on_task_pause=True,
                    on_task_failure=False,
                    on_task_success=True,
                    on_resource_non_compliance=True,
                    on_runbook_newer_version=True,
                    on_job_success=True,
                    on_job_start=False,
                    on_job_canceled=True,
                    on_job_schedule_change=True))],
        resources=[
            oci.fleet_apps_management.models.AssociatedFleetResourceDetails(
                resource_id="ocid1.test.oc1..<unique_ID>EXAMPLE-resourceId-Value",
                compartment_id="ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value",
                tenancy_id="ocid1.test.oc1..<unique_ID>EXAMPLE-tenancyId-Value",
                fleet_resource_type="EXAMPLE-fleetResourceType-Value")],
        credentials=[
            oci.fleet_apps_management.models.AssociatedFleetCredentialDetails(
                display_name="EXAMPLE-displayName-Value",
                compartment_id="ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value",
                entity_specifics=oci.fleet_apps_management.models.FleetCredentialEntitySpecificDetails(
                    credential_level="FLEET",
                    variables=[
                        oci.fleet_apps_management.models.Variable(
                            name="EXAMPLE-name-Value",
                            value="EXAMPLE-value-Value")]),
                user=oci.fleet_apps_management.models.VaultSecretCredentialDetails(
                    credential_type="VAULT_SECRET",
                    secret_id="ocid1.test.oc1..<unique_ID>EXAMPLE-secretId-Value",
                    secret_version="EXAMPLE-secretVersion-Value"))],
        properties=[
            oci.fleet_apps_management.models.AssociatedFleetPropertyDetails(
                compartment_id="ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value",
                fleet_property_type="STRING",
                display_name="EXAMPLE-displayName-Value",
                value="EXAMPLE-value-Value",
                is_required=True)],
        parent_fleet_id="ocid1.test.oc1..<unique_ID>EXAMPLE-parentFleetId-Value",
        is_target_auto_confirm=True,
        freeform_tags={
            'EXAMPLE_KEY_oxTF5': 'EXAMPLE_VALUE_OjkWljO5XfUnKX31rDP1'},
        defined_tags={
            'EXAMPLE_KEY_kjV63': {
                'EXAMPLE_KEY_6fAMh': 'EXAMPLE--Value'}}),
    opc_retry_token="EXAMPLE-opcRetryToken-Value",
    opc_request_id="HAGCZID8ETSVO9H4I1CX<unique_ID>")

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