# 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
file_storage_client = oci.file_storage.FileStorageClient(config)


# Send the request to service, some parameters are not required, see API
# doc for more info
create_file_system_response = file_storage_client.create_file_system(
    create_file_system_details=oci.file_storage.models.CreateFileSystemDetails(
        availability_domain="EXAMPLE-availabilityDomain-Value",
        compartment_id="ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value",
        display_name="EXAMPLE-displayName-Value",
        freeform_tags={
            'EXAMPLE_KEY_zL8tu': 'EXAMPLE_VALUE_iy60a7jatMrI0w64YZaX'},
        defined_tags={
            'EXAMPLE_KEY_8nFMd': {
                'EXAMPLE_KEY_SlkEJ': 'EXAMPLE--Value'}},
        locks=[
            oci.file_storage.models.ResourceLock(
                type="FULL",
                related_resource_id="ocid1.test.oc1..<unique_ID>EXAMPLE-relatedResourceId-Value",
                message="EXAMPLE-message-Value",
                time_created=datetime.strptime(
                    "2005-08-01T13:36:53.827Z",
                    "%Y-%m-%dT%H:%M:%S.%fZ"))],
        kms_key_id="ocid1.test.oc1..<unique_ID>EXAMPLE-kmsKeyId-Value",
        source_snapshot_id="ocid1.test.oc1..<unique_ID>EXAMPLE-sourceSnapshotId-Value",
        clone_attach_status="DETACH",
        filesystem_snapshot_policy_id="ocid1.test.oc1..<unique_ID>EXAMPLE-filesystemSnapshotPolicyId-Value"),
    opc_retry_token="EXAMPLE-opcRetryToken-Value",
    opc_request_id="GTMNEU9EQJ7K7PAXQL4Y<unique_ID>")

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

Was this article helpful?