# 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(
compartment_id="ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value",
fleet_type="PRODUCT",
display_name="EXAMPLE-displayName-Value",
description="EXAMPLE-description-Value",
products=["EXAMPLE--Value"],
application_type="EXAMPLE-applicationType-Value",
environment_type="EXAMPLE-environmentType-Value",
group_type="ENVIRONMENT",
resource_selection_type="DYNAMIC",
rule_selection_criteria=oci.fleet_apps_management.models.SelectionCriteria(
match_condition="MATCH_ALL",
rules=[
oci.fleet_apps_management.models.Rule(
compartment_id="ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value",
resource_compartment_id="ocid1.test.oc1..<unique_ID>EXAMPLE-resourceCompartmentId-Value",
conditions=[
oci.fleet_apps_management.models.Condition(
attr_group="EXAMPLE-attrGroup-Value",
attr_key="EXAMPLE-attrKey-Value",
attr_value="EXAMPLE-attrValue-Value")],
basis="EXAMPLE-basis-Value")]),
notification_preferences=oci.fleet_apps_management.models.NotificationPreferences(
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(
on_upcoming_schedule=False,
on_job_failure=False,
on_topology_modification=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.KeyEncryptionCredentialDetails(
credential_type="KEY_ENCRYPTION",
value="EXAMPLE-value-Value",
key_id="ocid1.test.oc1..<unique_ID>EXAMPLE-keyId-Value",
vault_id="ocid1.test.oc1..<unique_ID>EXAMPLE-vaultId-Value",
key_version="EXAMPLE-keyVersion-Value"))],
is_target_auto_confirm=False,
freeform_tags={
'EXAMPLE_KEY_AataG': 'EXAMPLE_VALUE_uKpnPxJJInw42N2VY64M'},
defined_tags={
'EXAMPLE_KEY_869i3': {
'EXAMPLE_KEY_2wsnU': 'EXAMPLE--Value'}}),
opc_retry_token="EXAMPLE-opcRetryToken-Value",
opc_request_id="5X1RTD6BMOUI4CRDDZ7E<unique_ID>")
# Get the data from response
print(create_fleet_response.data)