# 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
data_integration_client = oci.data_integration.DataIntegrationClient(config)


# Send the request to service, some parameters are not required, see API
# doc for more info
create_task_response = data_integration_client.create_task(
    workspace_id="ocid1.test.oc1..<unique_ID>EXAMPLE-workspaceId-Value",
    create_task_details=oci.data_integration.models.CreateTaskFromRestTask(
        model_type="REST_TASK",
        name="EXAMPLE-name-Value",
        identifier="EXAMPLE-identifier-Value",
        registry_metadata=oci.data_integration.models.RegistryMetadata(
            aggregator_key="EXAMPLE-aggregatorKey-Value",
            labels=["EXAMPLE--Value"],
            registry_version=304,
            key="EXAMPLE-key-Value",
            is_favorite=False),
        key="EXAMPLE-key-Value",
        model_version="EXAMPLE-modelVersion-Value",
        parent_ref=oci.data_integration.models.ParentReference(
            parent="EXAMPLE-parent-Value",
            root_doc_id="ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"),
        description="EXAMPLE-description-Value",
        object_status=640,
        input_ports=[
                    oci.data_integration.models.InputPort(
                        model_type="INPUT_PORT",
                        key="EXAMPLE-key-Value",
                        model_version="EXAMPLE-modelVersion-Value",
                        parent_ref=oci.data_integration.models.ParentReference(
                            parent="EXAMPLE-parent-Value",
                            root_doc_id="ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"),
                        config_values=oci.data_integration.models.ConfigValues(
                            config_param_values={
                                'EXAMPLE_KEY_UtZGD': {
                                    'stringValue': 'EXAMPLE-stringValue-Value',
                                    'intValue': 150,
                                    'objectValue': 'EXAMPLE-objectValue-Value',
                                    'refValue': 'EXAMPLE-refValue-Value',
                                    'parameterValue': 'EXAMPLE-parameterValue-Value',
                                    'rootObjectValue': 'EXAMPLE-rootObjectValue-Value'}},
                            parent_ref=oci.data_integration.models.ParentReference(
                                parent="EXAMPLE-parent-Value",
                                root_doc_id="ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")),
                        object_status=188,
                        name="EXAMPLE-name-Value",
                        description="EXAMPLE-description-Value",
                        port_type="CONTROL")],
        output_ports=[
            oci.data_integration.models.OutputPort(
                model_type="OUTPUT_PORT",
                key="EXAMPLE-key-Value",
                model_version="EXAMPLE-modelVersion-Value",
                parent_ref=oci.data_integration.models.ParentReference(
                    parent="EXAMPLE-parent-Value",
                    root_doc_id="ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"),
                config_values=oci.data_integration.models.ConfigValues(
                    config_param_values={
                        'EXAMPLE_KEY_2eovB': {
                            'stringValue': 'EXAMPLE-stringValue-Value',
                            'intValue': 5,
                            'objectValue': 'EXAMPLE-objectValue-Value',
                            'refValue': 'EXAMPLE-refValue-Value',
                            'parameterValue': 'EXAMPLE-parameterValue-Value',
                            'rootObjectValue': 'EXAMPLE-rootObjectValue-Value'}},
                    parent_ref=oci.data_integration.models.ParentReference(
                        parent="EXAMPLE-parent-Value",
                        root_doc_id="ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")),
                object_status=648,
                name="EXAMPLE-name-Value",
                description="EXAMPLE-description-Value",
                port_type="DATA",
                fields=[
                    oci.data_integration.models.AbstractField(
                        model_type="FIELD",
                        key="EXAMPLE-key-Value",
                        model_version="EXAMPLE-modelVersion-Value",
                        parent_ref=oci.data_integration.models.ParentReference(
                            parent="EXAMPLE-parent-Value",
                            root_doc_id="ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"),
                        config_values=oci.data_integration.models.ConfigValues(
                            config_param_values={
                                'EXAMPLE_KEY_6qKpA': {
                                    'stringValue': 'EXAMPLE-stringValue-Value',
                                    'intValue': 546,
                                    'objectValue': 'EXAMPLE-objectValue-Value',
                                    'refValue': 'EXAMPLE-refValue-Value',
                                    'parameterValue': 'EXAMPLE-parameterValue-Value',
                                    'rootObjectValue': 'EXAMPLE-rootObjectValue-Value'}},
                            parent_ref=oci.data_integration.models.ParentReference(
                                parent="EXAMPLE-parent-Value",
                                root_doc_id="ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")),
                        object_status=298,
                        name="EXAMPLE-name-Value",
                        description="EXAMPLE-description-Value")])],
        parameters=[
            oci.data_integration.models.Parameter(
                model_type="PARAMETER",
                key="EXAMPLE-key-Value",
                model_version="EXAMPLE-modelVersion-Value",
                parent_ref=oci.data_integration.models.ParentReference(
                    parent="EXAMPLE-parent-Value",
                    root_doc_id="ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"),
                config_values=oci.data_integration.models.ConfigValues(
                    config_param_values={
                        'EXAMPLE_KEY_6zVDv': {
                            'stringValue': 'EXAMPLE-stringValue-Value',
                            'intValue': 66,
                            'objectValue': 'EXAMPLE-objectValue-Value',
                            'refValue': 'EXAMPLE-refValue-Value',
                            'parameterValue': 'EXAMPLE-parameterValue-Value',
                            'rootObjectValue': 'EXAMPLE-rootObjectValue-Value'}},
                    parent_ref=oci.data_integration.models.ParentReference(
                        parent="EXAMPLE-parent-Value",
                        root_doc_id="ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")),
                object_status=65,
                name="EXAMPLE-name-Value",
                description="EXAMPLE-description-Value",
                type="EXAMPLE-type-Value",
                default_value="EXAMPLE-defaultValue-Value",
                root_object_default_value="EXAMPLE-rootObjectDefaultValue-Value",
                is_input=True,
                is_output=True,
                output_aggregation_type="SUM",
                type_name="EXAMPLE-typeName-Value",
                used_for="EXAMPLE-usedFor-Value")],
        op_config_values=oci.data_integration.models.ConfigValues(
            config_param_values={
                'EXAMPLE_KEY_ZZ95l': {
                    'stringValue': 'EXAMPLE-stringValue-Value',
                    'intValue': 116,
                    'objectValue': 'EXAMPLE-objectValue-Value',
                    'refValue': 'EXAMPLE-refValue-Value',
                    'parameterValue': 'EXAMPLE-parameterValue-Value',
                    'rootObjectValue': 'EXAMPLE-rootObjectValue-Value'}},
            parent_ref=oci.data_integration.models.ParentReference(
                parent="EXAMPLE-parent-Value",
                root_doc_id="ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")),
        config_provider_delegate=oci.data_integration.models.CreateConfigProvider(
            bindings={
                'EXAMPLE_KEY_JuAnB': {
                    'simpleValue': 'EXAMPLE-simpleValue-Value',
                    'rootObjectValue': 'EXAMPLE-rootObjectValue-Value'}}),
        is_concurrent_allowed=True,
        auth_details=oci.data_integration.models.AuthDetails(
            key="EXAMPLE-key-Value",
            model_version="EXAMPLE-modelVersion-Value",
            parent_ref=oci.data_integration.models.ParentReference(
                parent="EXAMPLE-parent-Value",
                root_doc_id="ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"),
            model_type="RESOURCE_PRINCIPAL_AUTH_DETAILS"),
        auth_config=oci.data_integration.models.ResourcePrincipalAuthConfig(
            model_type="OCI_RESOURCE_AUTH_CONFIG",
            key="EXAMPLE-key-Value",
            model_version="EXAMPLE-modelVersion-Value",
            parent_ref=oci.data_integration.models.ParentReference(
                parent="EXAMPLE-parent-Value",
                root_doc_id="ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"),
            resource_principal_source="APPLICATION"),
        endpoint=oci.data_integration.models.Expression(
            key="EXAMPLE-key-Value",
            model_type="EXAMPLE-modelType-Value",
            model_version="EXAMPLE-modelVersion-Value",
            parent_ref=oci.data_integration.models.ParentReference(
                parent="EXAMPLE-parent-Value",
                root_doc_id="ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"),
            expr_string="EXAMPLE-exprString-Value",
            config_values=oci.data_integration.models.ConfigValues(
                config_param_values={
                    'EXAMPLE_KEY_4bkzd': {
                        'stringValue': 'EXAMPLE-stringValue-Value',
                        'intValue': 167,
                        'objectValue': 'EXAMPLE-objectValue-Value',
                        'refValue': 'EXAMPLE-refValue-Value',
                        'parameterValue': 'EXAMPLE-parameterValue-Value',
                        'rootObjectValue': 'EXAMPLE-rootObjectValue-Value'}},
                parent_ref=oci.data_integration.models.ParentReference(
                    parent="EXAMPLE-parent-Value",
                    root_doc_id="ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")),
            object_status=583),
        method_type="POST",
        headers="EXAMPLE-headers-Value",
        json_data="EXAMPLE-jsonData-Value",
        api_call_mode="ASYNC_GENERIC",
        cancel_endpoint=oci.data_integration.models.Expression(
            key="EXAMPLE-key-Value",
            model_type="EXAMPLE-modelType-Value",
            model_version="EXAMPLE-modelVersion-Value",
            parent_ref=oci.data_integration.models.ParentReference(
                parent="EXAMPLE-parent-Value",
                root_doc_id="ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"),
            expr_string="EXAMPLE-exprString-Value",
            config_values=oci.data_integration.models.ConfigValues(
                config_param_values={
                    'EXAMPLE_KEY_UXdVv': {
                        'stringValue': 'EXAMPLE-stringValue-Value',
                        'intValue': 83,
                        'objectValue': 'EXAMPLE-objectValue-Value',
                        'refValue': 'EXAMPLE-refValue-Value',
                        'parameterValue': 'EXAMPLE-parameterValue-Value',
                        'rootObjectValue': 'EXAMPLE-rootObjectValue-Value'}},
                parent_ref=oci.data_integration.models.ParentReference(
                    parent="EXAMPLE-parent-Value",
                    root_doc_id="ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")),
            object_status=787),
        cancel_method_type="PUT",
        execute_rest_call_config=oci.data_integration.models.ExecuteRestCallConfig(
            method_type="PATCH",
            request_headers={
                'EXAMPLE_KEY_Tw5mC': 'EXAMPLE_VALUE_vTig6M3vkkZXIqaJptc1'},
            config_values=oci.data_integration.models.ConfigValues(
                config_param_values={
                    'EXAMPLE_KEY_S4Hre': {
                        'stringValue': 'EXAMPLE-stringValue-Value',
                        'intValue': 631,
                        'objectValue': 'EXAMPLE-objectValue-Value',
                        'refValue': 'EXAMPLE-refValue-Value',
                        'parameterValue': 'EXAMPLE-parameterValue-Value',
                        'rootObjectValue': 'EXAMPLE-rootObjectValue-Value'}},
                parent_ref=oci.data_integration.models.ParentReference(
                    parent="EXAMPLE-parent-Value",
                    root_doc_id="ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"))),
        cancel_rest_call_config=oci.data_integration.models.CancelRestCallConfig(
            method_type="PATCH",
            request_headers={
                'EXAMPLE_KEY_ykkN0': 'EXAMPLE_VALUE_opa0g0MVR2ZfwCz9ZOBs'},
            config_values=oci.data_integration.models.ConfigValues(
                config_param_values={
                    'EXAMPLE_KEY_zGmpc': {
                        'stringValue': 'EXAMPLE-stringValue-Value',
                        'intValue': 380,
                        'objectValue': 'EXAMPLE-objectValue-Value',
                        'refValue': 'EXAMPLE-refValue-Value',
                        'parameterValue': 'EXAMPLE-parameterValue-Value',
                        'rootObjectValue': 'EXAMPLE-rootObjectValue-Value'}},
                parent_ref=oci.data_integration.models.ParentReference(
                    parent="EXAMPLE-parent-Value",
                    root_doc_id="ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"))),
        poll_rest_call_config=oci.data_integration.models.PollRestCallConfig(
            method_type="PATCH",
            request_headers={
                'EXAMPLE_KEY_YXwYy': 'EXAMPLE_VALUE_pBI44BEM0Ls9v2vOPPB5'},
            config_values=oci.data_integration.models.ConfigValues(
                config_param_values={
                    'EXAMPLE_KEY_eZhld': {
                        'stringValue': 'EXAMPLE-stringValue-Value',
                        'intValue': 111,
                        'objectValue': 'EXAMPLE-objectValue-Value',
                        'refValue': 'EXAMPLE-refValue-Value',
                        'parameterValue': 'EXAMPLE-parameterValue-Value',
                        'rootObjectValue': 'EXAMPLE-rootObjectValue-Value'}},
                parent_ref=oci.data_integration.models.ParentReference(
                    parent="EXAMPLE-parent-Value",
                    root_doc_id="ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"))),
        typed_expressions=[
            oci.data_integration.models.TypedExpression(
                model_type="TYPED_EXPRESSION",
                key="EXAMPLE-key-Value",
                model_version="EXAMPLE-modelVersion-Value",
                parent_ref=oci.data_integration.models.ParentReference(
                    parent="EXAMPLE-parent-Value",
                    root_doc_id="ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"),
                config_values=oci.data_integration.models.ConfigValues(
                    config_param_values={
                        'EXAMPLE_KEY_ZnyW7': {
                            'stringValue': 'EXAMPLE-stringValue-Value',
                            'intValue': 266,
                            'objectValue': 'EXAMPLE-objectValue-Value',
                            'refValue': 'EXAMPLE-refValue-Value',
                            'parameterValue': 'EXAMPLE-parameterValue-Value',
                            'rootObjectValue': 'EXAMPLE-rootObjectValue-Value'}},
                    parent_ref=oci.data_integration.models.ParentReference(
                        parent="EXAMPLE-parent-Value",
                        root_doc_id="ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")),
                object_status=872,
                name="EXAMPLE-name-Value",
                description="EXAMPLE-description-Value",
                expression="EXAMPLE-expression-Value",
                type="EXAMPLE-type-Value")]),
    opc_retry_token="EXAMPLE-opcRetryToken-Value",
    opc_request_id="CXBGLU5SBDCYINHCX5XB<unique_ID>")

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

Was this article helpful?