cognite-toolkit 0.7.30__py3-none-any.whl → 0.7.51__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- cognite_toolkit/_cdf.py +5 -6
- cognite_toolkit/_cdf_tk/apps/__init__.py +2 -0
- cognite_toolkit/_cdf_tk/apps/_core_app.py +7 -1
- cognite_toolkit/_cdf_tk/apps/_download_app.py +2 -2
- cognite_toolkit/_cdf_tk/apps/_dump_app.py +1 -1
- cognite_toolkit/_cdf_tk/apps/_import_app.py +41 -0
- cognite_toolkit/_cdf_tk/apps/_migrate_app.py +183 -8
- cognite_toolkit/_cdf_tk/builders/_function.py +81 -9
- cognite_toolkit/_cdf_tk/builders/_raw.py +1 -1
- cognite_toolkit/_cdf_tk/client/_resource_base.py +187 -0
- cognite_toolkit/_cdf_tk/client/_toolkit_client.py +44 -12
- cognite_toolkit/_cdf_tk/client/api/agents.py +107 -0
- cognite_toolkit/_cdf_tk/client/api/annotations.py +129 -0
- cognite_toolkit/_cdf_tk/client/api/assets.py +130 -0
- cognite_toolkit/_cdf_tk/client/api/containers.py +132 -0
- cognite_toolkit/_cdf_tk/client/api/data_models.py +137 -0
- cognite_toolkit/_cdf_tk/client/api/datasets.py +141 -0
- cognite_toolkit/_cdf_tk/client/api/events.py +129 -0
- cognite_toolkit/_cdf_tk/client/api/extraction_pipelines.py +148 -0
- cognite_toolkit/_cdf_tk/client/api/filemetadata.py +176 -0
- cognite_toolkit/_cdf_tk/client/api/function_schedules.py +115 -0
- cognite_toolkit/_cdf_tk/client/api/functions.py +113 -0
- cognite_toolkit/_cdf_tk/client/api/graphql_data_models.py +167 -0
- cognite_toolkit/_cdf_tk/client/api/groups.py +121 -0
- cognite_toolkit/_cdf_tk/client/api/hosted_extractor_destinations.py +131 -0
- cognite_toolkit/_cdf_tk/client/api/hosted_extractor_jobs.py +122 -0
- cognite_toolkit/_cdf_tk/client/api/hosted_extractor_mappings.py +129 -0
- cognite_toolkit/_cdf_tk/client/api/hosted_extractor_sources.py +136 -0
- cognite_toolkit/_cdf_tk/client/api/hosted_extractors.py +23 -0
- cognite_toolkit/_cdf_tk/client/api/infield.py +40 -35
- cognite_toolkit/_cdf_tk/client/api/instances.py +139 -0
- cognite_toolkit/_cdf_tk/client/api/labels.py +125 -0
- cognite_toolkit/_cdf_tk/client/api/{canvas.py → legacy/canvas.py} +16 -8
- cognite_toolkit/_cdf_tk/client/api/{charts.py → legacy/charts.py} +1 -1
- cognite_toolkit/_cdf_tk/client/api/{extended_data_modeling.py → legacy/extended_data_modeling.py} +1 -1
- cognite_toolkit/_cdf_tk/client/api/{extended_files.py → legacy/extended_files.py} +2 -2
- cognite_toolkit/_cdf_tk/client/api/{extended_functions.py → legacy/extended_functions.py} +9 -9
- cognite_toolkit/_cdf_tk/client/api/{extended_raw.py → legacy/extended_raw.py} +1 -1
- cognite_toolkit/_cdf_tk/client/api/{extended_timeseries.py → legacy/extended_timeseries.py} +5 -2
- cognite_toolkit/_cdf_tk/client/api/legacy/location_filters.py +112 -0
- cognite_toolkit/_cdf_tk/client/api/legacy/robotics/__init__.py +8 -0
- cognite_toolkit/_cdf_tk/client/api/{robotics → legacy/robotics}/capabilities.py +1 -1
- cognite_toolkit/_cdf_tk/client/api/{robotics → legacy/robotics}/data_postprocessing.py +1 -1
- cognite_toolkit/_cdf_tk/client/api/{robotics → legacy/robotics}/frames.py +1 -1
- cognite_toolkit/_cdf_tk/client/api/{robotics → legacy/robotics}/locations.py +1 -1
- cognite_toolkit/_cdf_tk/client/api/{robotics → legacy/robotics}/maps.py +1 -1
- cognite_toolkit/_cdf_tk/client/api/{robotics → legacy/robotics}/robots.py +2 -2
- cognite_toolkit/_cdf_tk/client/api/legacy/search_config.py +53 -0
- cognite_toolkit/_cdf_tk/client/api/location_filters.py +140 -75
- cognite_toolkit/_cdf_tk/client/api/migration.py +2 -3
- cognite_toolkit/_cdf_tk/client/api/project.py +9 -8
- cognite_toolkit/_cdf_tk/client/api/raw.py +204 -0
- cognite_toolkit/_cdf_tk/client/api/relationships.py +133 -0
- cognite_toolkit/_cdf_tk/client/api/robotics.py +19 -0
- cognite_toolkit/_cdf_tk/client/api/robotics_capabilities.py +127 -0
- cognite_toolkit/_cdf_tk/client/api/robotics_data_postprocessing.py +138 -0
- cognite_toolkit/_cdf_tk/client/api/robotics_frames.py +122 -0
- cognite_toolkit/_cdf_tk/client/api/robotics_locations.py +127 -0
- cognite_toolkit/_cdf_tk/client/api/robotics_maps.py +122 -0
- cognite_toolkit/_cdf_tk/client/api/robotics_robots.py +122 -0
- cognite_toolkit/_cdf_tk/client/api/search.py +2 -2
- cognite_toolkit/_cdf_tk/client/api/search_config.py +83 -31
- cognite_toolkit/_cdf_tk/client/api/security_categories.py +94 -0
- cognite_toolkit/_cdf_tk/client/api/sequences.py +133 -0
- cognite_toolkit/_cdf_tk/client/api/simulator_models.py +154 -0
- cognite_toolkit/_cdf_tk/client/api/simulators.py +8 -0
- cognite_toolkit/_cdf_tk/client/api/spaces.py +117 -0
- cognite_toolkit/_cdf_tk/client/api/streams.py +68 -56
- cognite_toolkit/_cdf_tk/client/api/three_d.py +385 -34
- cognite_toolkit/_cdf_tk/client/api/timeseries.py +137 -0
- cognite_toolkit/_cdf_tk/client/api/token.py +1 -1
- cognite_toolkit/_cdf_tk/client/api/transformations.py +146 -0
- cognite_toolkit/_cdf_tk/client/api/views.py +139 -0
- cognite_toolkit/_cdf_tk/client/api/workflow_triggers.py +128 -0
- cognite_toolkit/_cdf_tk/client/api/workflow_versions.py +138 -0
- cognite_toolkit/_cdf_tk/client/api/workflows.py +119 -0
- cognite_toolkit/_cdf_tk/client/cdf_client/__init__.py +10 -0
- cognite_toolkit/_cdf_tk/client/cdf_client/api.py +358 -0
- cognite_toolkit/_cdf_tk/client/cdf_client/responses.py +38 -0
- cognite_toolkit/_cdf_tk/{utils → client}/http_client/__init__.py +30 -0
- cognite_toolkit/_cdf_tk/{utils → client}/http_client/_client.py +26 -16
- cognite_toolkit/_cdf_tk/{utils → client}/http_client/_data_classes.py +18 -2
- cognite_toolkit/_cdf_tk/client/http_client/_data_classes2.py +151 -0
- cognite_toolkit/_cdf_tk/client/http_client/_exception.py +13 -0
- cognite_toolkit/_cdf_tk/client/http_client/_item_classes.py +118 -0
- cognite_toolkit/_cdf_tk/{utils → client}/http_client/_tracker.py +5 -2
- cognite_toolkit/_cdf_tk/client/request_classes/base.py +19 -0
- cognite_toolkit/_cdf_tk/client/request_classes/filters.py +113 -0
- cognite_toolkit/_cdf_tk/client/request_classes/graphql.py +28 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/__init__.py +0 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/agent.py +130 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/annotation.py +79 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/apm_config.py +128 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/asset.py +47 -0
- cognite_toolkit/_cdf_tk/client/{data_classes → resource_classes}/charts_data.py +1 -1
- cognite_toolkit/_cdf_tk/client/resource_classes/cognite_file.py +53 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/data_modeling/__init__.py +168 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/data_modeling/_constraints.py +37 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/data_modeling/_container.py +50 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/data_modeling/_data_model.py +73 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/data_modeling/_data_types.py +116 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/data_modeling/_indexes.py +26 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/data_modeling/_instance.py +154 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/data_modeling/_references.py +86 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/data_modeling/_space.py +26 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/data_modeling/_view.py +143 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/data_modeling/_view_property.py +152 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/dataset.py +35 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/event.py +40 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/extraction_pipeline.py +59 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/filemetadata.py +52 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/function.py +53 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/function_schedule.py +65 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/graphql_data_model.py +40 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/group/__init__.py +187 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/group/_constants.py +2 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/group/acls.py +653 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/group/capability.py +56 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/group/group.py +63 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/group/scopes.py +166 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/hosted_extractor_destination.py +34 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/hosted_extractor_job.py +134 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/hosted_extractor_mapping.py +72 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/hosted_extractor_source/__init__.py +63 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/hosted_extractor_source/_auth.py +63 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/hosted_extractor_source/_base.py +26 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/hosted_extractor_source/_certificate.py +20 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/hosted_extractor_source/_eventhub.py +31 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/hosted_extractor_source/_kafka.py +53 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/hosted_extractor_source/_mqtt.py +36 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/hosted_extractor_source/_rest.py +49 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/identifiers.py +59 -0
- cognite_toolkit/_cdf_tk/client/{data_classes → resource_classes}/infield.py +1 -1
- cognite_toolkit/_cdf_tk/client/{data_classes → resource_classes}/instance_api.py +53 -14
- cognite_toolkit/_cdf_tk/client/resource_classes/label.py +27 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/legacy/__init__.py +0 -0
- cognite_toolkit/_cdf_tk/client/{data_classes → resource_classes/legacy}/canvas.py +48 -15
- cognite_toolkit/_cdf_tk/client/{data_classes → resource_classes/legacy}/charts.py +1 -1
- cognite_toolkit/_cdf_tk/client/resource_classes/location_filter.py +84 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/raw.py +44 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/relationship.py +49 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/resource_view_mapping.py +38 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/robotics/__init__.py +37 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/robotics/_capability.py +53 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/robotics/_common.py +34 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/robotics/_data_post_processing.py +49 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/robotics/_frame.py +46 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/robotics/_location.py +36 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/robotics/_map.py +65 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/robotics/_robot.py +58 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/search_config.py +54 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/securitycategory.py +24 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/sequence.py +45 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/sequence_rows.py +56 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/simulator_model.py +50 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/streamlit_.py +71 -0
- cognite_toolkit/_cdf_tk/client/{data_classes → resource_classes}/streams.py +9 -26
- cognite_toolkit/_cdf_tk/client/resource_classes/three_d.py +135 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/timeseries.py +52 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/transformation.py +140 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/workflow.py +27 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/workflow_trigger.py +63 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/workflow_version.py +155 -0
- cognite_toolkit/_cdf_tk/client/testing.py +54 -17
- cognite_toolkit/_cdf_tk/commands/__init__.py +1 -0
- cognite_toolkit/_cdf_tk/commands/_migrate/command.py +103 -108
- cognite_toolkit/_cdf_tk/commands/_migrate/conversion.py +29 -16
- cognite_toolkit/_cdf_tk/commands/_migrate/creators.py +1 -1
- cognite_toolkit/_cdf_tk/commands/_migrate/data_classes.py +38 -6
- cognite_toolkit/_cdf_tk/commands/_migrate/data_mapper.py +262 -36
- cognite_toolkit/_cdf_tk/commands/_migrate/data_model.py +1 -0
- cognite_toolkit/_cdf_tk/commands/_migrate/default_mappings.py +1 -1
- cognite_toolkit/_cdf_tk/commands/_migrate/issues.py +39 -38
- cognite_toolkit/_cdf_tk/commands/_migrate/migration_io.py +227 -8
- cognite_toolkit/_cdf_tk/commands/_profile.py +1 -1
- cognite_toolkit/_cdf_tk/commands/_purge.py +14 -16
- cognite_toolkit/_cdf_tk/commands/_upload.py +1 -1
- cognite_toolkit/_cdf_tk/commands/build_cmd.py +12 -2
- cognite_toolkit/_cdf_tk/commands/build_v2/__init__.py +0 -0
- cognite_toolkit/_cdf_tk/commands/build_v2/_module_parser.py +138 -0
- cognite_toolkit/_cdf_tk/commands/build_v2/_modules_parser.py +163 -0
- cognite_toolkit/_cdf_tk/commands/build_v2/build_cmd.py +228 -0
- cognite_toolkit/_cdf_tk/commands/build_v2/build_parameters.py +71 -0
- cognite_toolkit/_cdf_tk/commands/build_v2/data_classes/_modules.py +27 -0
- cognite_toolkit/_cdf_tk/commands/build_v2/data_classes/_resource.py +22 -0
- cognite_toolkit/_cdf_tk/commands/dump_resource.py +4 -4
- cognite_toolkit/_cdf_tk/commands/pull.py +97 -2
- cognite_toolkit/_cdf_tk/commands/run.py +1 -1
- cognite_toolkit/_cdf_tk/cruds/__init__.py +16 -6
- cognite_toolkit/_cdf_tk/cruds/_data_cruds.py +9 -5
- cognite_toolkit/_cdf_tk/cruds/_resource_cruds/__init__.py +2 -0
- cognite_toolkit/_cdf_tk/cruds/_resource_cruds/auth.py +6 -2
- cognite_toolkit/_cdf_tk/cruds/_resource_cruds/classic.py +70 -89
- cognite_toolkit/_cdf_tk/cruds/_resource_cruds/configuration.py +1 -1
- cognite_toolkit/_cdf_tk/cruds/_resource_cruds/datamodel.py +1 -1
- cognite_toolkit/_cdf_tk/cruds/_resource_cruds/extraction_pipeline.py +1 -1
- cognite_toolkit/_cdf_tk/cruds/_resource_cruds/fieldops.py +34 -25
- cognite_toolkit/_cdf_tk/cruds/_resource_cruds/file.py +50 -59
- cognite_toolkit/_cdf_tk/cruds/_resource_cruds/function.py +14 -2
- cognite_toolkit/_cdf_tk/cruds/_resource_cruds/industrial_tool.py +1 -1
- cognite_toolkit/_cdf_tk/cruds/_resource_cruds/location.py +4 -3
- cognite_toolkit/_cdf_tk/cruds/_resource_cruds/migration.py +1 -1
- cognite_toolkit/_cdf_tk/cruds/_resource_cruds/raw.py +6 -1
- cognite_toolkit/_cdf_tk/cruds/_resource_cruds/relationship.py +5 -4
- cognite_toolkit/_cdf_tk/cruds/_resource_cruds/robotics.py +1 -1
- cognite_toolkit/_cdf_tk/cruds/_resource_cruds/simulators.py +122 -0
- cognite_toolkit/_cdf_tk/cruds/_resource_cruds/streams.py +15 -31
- cognite_toolkit/_cdf_tk/cruds/_resource_cruds/timeseries.py +42 -47
- cognite_toolkit/_cdf_tk/cruds/_resource_cruds/transformation.py +49 -14
- cognite_toolkit/_cdf_tk/data_classes/__init__.py +3 -0
- cognite_toolkit/_cdf_tk/data_classes/_issues.py +36 -0
- cognite_toolkit/_cdf_tk/data_classes/_module_directories.py +2 -1
- cognite_toolkit/_cdf_tk/data_classes/_module_toml.py +1 -0
- cognite_toolkit/_cdf_tk/data_classes/_tracking_info.py +4 -0
- cognite_toolkit/_cdf_tk/feature_flags.py +8 -0
- cognite_toolkit/_cdf_tk/resource_classes/__init__.py +2 -0
- cognite_toolkit/_cdf_tk/resource_classes/capabilities.py +6 -0
- cognite_toolkit/_cdf_tk/resource_classes/search_config.py +1 -1
- cognite_toolkit/_cdf_tk/resource_classes/simulator_model.py +17 -0
- cognite_toolkit/_cdf_tk/resource_classes/workflow_version.py +173 -5
- cognite_toolkit/_cdf_tk/storageio/_applications.py +53 -15
- cognite_toolkit/_cdf_tk/storageio/_asset_centric.py +117 -107
- cognite_toolkit/_cdf_tk/storageio/_base.py +3 -1
- cognite_toolkit/_cdf_tk/storageio/_datapoints.py +7 -7
- cognite_toolkit/_cdf_tk/storageio/_file_content.py +65 -56
- cognite_toolkit/_cdf_tk/storageio/_instances.py +1 -1
- cognite_toolkit/_cdf_tk/storageio/_raw.py +1 -1
- cognite_toolkit/_cdf_tk/storageio/logger.py +162 -0
- cognite_toolkit/_cdf_tk/storageio/selectors/__init__.py +10 -1
- cognite_toolkit/_cdf_tk/storageio/selectors/_three_d.py +34 -0
- cognite_toolkit/_cdf_tk/tk_warnings/__init__.py +2 -0
- cognite_toolkit/_cdf_tk/tk_warnings/fileread.py +20 -0
- cognite_toolkit/_cdf_tk/utils/__init__.py +11 -1
- cognite_toolkit/_cdf_tk/utils/cdf.py +1 -1
- cognite_toolkit/_cdf_tk/utils/interactive_select.py +53 -4
- cognite_toolkit/_cdf_tk/utils/modules.py +7 -0
- cognite_toolkit/_cdf_tk/utils/pip_validator.py +96 -0
- cognite_toolkit/_cdf_tk/utils/useful_types.py +4 -7
- cognite_toolkit/_cdf_tk/utils/useful_types2.py +14 -0
- cognite_toolkit/_cdf_tk/validation.py +4 -0
- cognite_toolkit/_repo_files/GitHub/.github/workflows/deploy.yaml +1 -1
- cognite_toolkit/_repo_files/GitHub/.github/workflows/dry-run.yaml +1 -1
- cognite_toolkit/_resources/cdf.toml +1 -1
- cognite_toolkit/_version.py +1 -1
- {cognite_toolkit-0.7.30.dist-info → cognite_toolkit-0.7.51.dist-info}/METADATA +13 -3
- cognite_toolkit-0.7.51.dist-info/RECORD +445 -0
- {cognite_toolkit-0.7.30.dist-info → cognite_toolkit-0.7.51.dist-info}/WHEEL +2 -2
- cognite_toolkit/_cdf_tk/client/api/robotics/__init__.py +0 -3
- cognite_toolkit/_cdf_tk/client/data_classes/api_classes.py +0 -17
- cognite_toolkit/_cdf_tk/client/data_classes/base.py +0 -87
- cognite_toolkit/_cdf_tk/client/data_classes/three_d.py +0 -47
- cognite_toolkit/_cdf_tk/prototypes/import_app.py +0 -41
- cognite_toolkit/_cdf_tk/utils/http_client/_data_classes2.py +0 -187
- cognite_toolkit/_cdf_tk/utils/http_client/_exception.py +0 -4
- cognite_toolkit-0.7.30.dist-info/RECORD +0 -316
- /cognite_toolkit/_cdf_tk/client/{data_classes → api/legacy}/__init__.py +0 -0
- /cognite_toolkit/_cdf_tk/client/api/{dml.py → legacy/dml.py} +0 -0
- /cognite_toolkit/_cdf_tk/client/api/{fixed_transformations.py → legacy/fixed_transformations.py} +0 -0
- /cognite_toolkit/_cdf_tk/client/api/{robotics → legacy/robotics}/api.py +0 -0
- /cognite_toolkit/_cdf_tk/client/api/{robotics → legacy/robotics}/utlis.py +0 -0
- /cognite_toolkit/_cdf_tk/{prototypes/commands → client/request_classes}/__init__.py +0 -0
- /cognite_toolkit/_cdf_tk/client/{data_classes → resource_classes}/capabilities.py +0 -0
- /cognite_toolkit/_cdf_tk/client/{data_classes → resource_classes/legacy}/apm_config_v1.py +0 -0
- /cognite_toolkit/_cdf_tk/client/{data_classes → resource_classes/legacy}/extendable_cognite_file.py +0 -0
- /cognite_toolkit/_cdf_tk/client/{data_classes → resource_classes/legacy}/extended_filemetadata.py +0 -0
- /cognite_toolkit/_cdf_tk/client/{data_classes → resource_classes/legacy}/extended_filemetdata.py +0 -0
- /cognite_toolkit/_cdf_tk/client/{data_classes → resource_classes/legacy}/extended_timeseries.py +0 -0
- /cognite_toolkit/_cdf_tk/client/{data_classes → resource_classes/legacy}/functions.py +0 -0
- /cognite_toolkit/_cdf_tk/client/{data_classes → resource_classes/legacy}/graphql_data_models.py +0 -0
- /cognite_toolkit/_cdf_tk/client/{data_classes → resource_classes/legacy}/instances.py +0 -0
- /cognite_toolkit/_cdf_tk/client/{data_classes → resource_classes/legacy}/location_filters.py +0 -0
- /cognite_toolkit/_cdf_tk/client/{data_classes → resource_classes/legacy}/migration.py +0 -0
- /cognite_toolkit/_cdf_tk/client/{data_classes → resource_classes/legacy}/pending_instances_ids.py +0 -0
- /cognite_toolkit/_cdf_tk/client/{data_classes → resource_classes/legacy}/project.py +0 -0
- /cognite_toolkit/_cdf_tk/client/{data_classes → resource_classes/legacy}/raw.py +0 -0
- /cognite_toolkit/_cdf_tk/client/{data_classes → resource_classes/legacy}/robotics.py +0 -0
- /cognite_toolkit/_cdf_tk/client/{data_classes → resource_classes/legacy}/search_config.py +0 -0
- /cognite_toolkit/_cdf_tk/client/{data_classes → resource_classes/legacy}/sequences.py +0 -0
- /cognite_toolkit/_cdf_tk/client/{data_classes → resource_classes/legacy}/streamlit_.py +0 -0
- /cognite_toolkit/_cdf_tk/{prototypes/commands/import_.py → commands/_import_cmd.py} +0 -0
- {cognite_toolkit-0.7.30.dist-info → cognite_toolkit-0.7.51.dist-info}/entry_points.txt +0 -0
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
from
|
|
1
|
+
from abc import ABC
|
|
2
|
+
from typing import Annotated, Literal
|
|
2
3
|
|
|
3
4
|
from cognite.client.data_classes import WorkflowVersionUpsert
|
|
4
5
|
from pydantic import Field, JsonValue
|
|
@@ -6,18 +7,150 @@ from pydantic import Field, JsonValue
|
|
|
6
7
|
from .base import BaseModelResource, ToolkitResource
|
|
7
8
|
|
|
8
9
|
|
|
10
|
+
class WorkflowVersionId(BaseModelResource):
|
|
11
|
+
workflow_external_id: str = Field(
|
|
12
|
+
max_length=255,
|
|
13
|
+
description="Identifier for a workflow. Must be unique for the project. No trailing or leading whitespace and no null characters allowed.",
|
|
14
|
+
)
|
|
15
|
+
version: str = Field(
|
|
16
|
+
max_length=255,
|
|
17
|
+
description="Identifier for a version. Must be unique for the workflow. No trailing or leading whitespace and no null characters allowed.",
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class CogniteFunctionRef(BaseModelResource):
|
|
22
|
+
external_id: str = Field(
|
|
23
|
+
description="The external id of the Cognite Function in the project. This can be either a function external ID or a reference like ${myTaskExternalId.output.someKey}"
|
|
24
|
+
)
|
|
25
|
+
data: str | JsonValue | None = Field(
|
|
26
|
+
None, description="Input data that will be passed to the Cognite Function. Limited to 100KB in size."
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
class FunctionTaskParameters(BaseModelResource):
|
|
31
|
+
function: CogniteFunctionRef
|
|
32
|
+
is_async_complete: bool = Field(
|
|
33
|
+
False, description="Defines if the execution of the task should be completed asynchronously."
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
class TransformationRef(BaseModelResource):
|
|
38
|
+
external_id: str = Field(
|
|
39
|
+
description="The external id of the Transformation in the project. This can be either a transformation external ID or a reference like ${myTaskExternalId.output.someKey}"
|
|
40
|
+
)
|
|
41
|
+
concurrency_policy: Literal["fail", "waitForCurrent", "restartAfterCurrent"] = Field(
|
|
42
|
+
"fail",
|
|
43
|
+
description="""Determines the behavior of the task if the Transformation is already running.
|
|
44
|
+
|
|
45
|
+
fail: The task fails if another instance of the Transformation is currently running.
|
|
46
|
+
waitForCurrent: The task will pause and wait for the already running Transformation to complete. Once completed, the task is completed. This mode is useful for preventing redundant Transformation runs.
|
|
47
|
+
restartAfterCurrent: The task waits for the ongoing Transformation to finish. After completion, the task restarts the Transformation. This mode ensures that the most recent data can be used by following tasks.""",
|
|
48
|
+
)
|
|
49
|
+
use_transformation_credentials: bool = Field(
|
|
50
|
+
False,
|
|
51
|
+
description="If set to true, the transformation will run using the client credentials configured on the transformation. If set to false, the transformation will run using the client credentials used to trigger the workflow.",
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
class TransformationTaskParameters(BaseModelResource):
|
|
56
|
+
transformation: TransformationRef
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
class CDFRequest(BaseModelResource):
|
|
60
|
+
resource_path: str = Field(
|
|
61
|
+
description="The path of the request. The path should be prefixed by {cluster}.cognitedata.com/api/v1/project/{project} based on the relevant cluster and project. It can also contain references like ${myTaskExternalId.output.someKey}"
|
|
62
|
+
)
|
|
63
|
+
method: Literal["POST", "GET", "PUT"] | str = Field(
|
|
64
|
+
description="The HTTP method of the request. It can also be a reference like ${myTaskExternalId.output.someKey}"
|
|
65
|
+
)
|
|
66
|
+
query_parameters: dict[str, JsonValue] | str | None = Field(
|
|
67
|
+
None,
|
|
68
|
+
description="The query parameters of the request. It can also be a reference like ${myTaskExternalId.output.someKey}",
|
|
69
|
+
)
|
|
70
|
+
body: JsonValue | str | None = Field(
|
|
71
|
+
None, description="The body of the request. It can also be a reference like ${myTaskExternalId.output.someKey}"
|
|
72
|
+
)
|
|
73
|
+
request_timeout_in_millis: float | str | None = Field(
|
|
74
|
+
None,
|
|
75
|
+
description="The timeout for the request in milliseconds. It can also be a reference like ${myTaskExternalId.output.someKey}",
|
|
76
|
+
)
|
|
77
|
+
cdf_version_header: Literal["alpha", "beta"] | str | None = Field(
|
|
78
|
+
None, description="The Cognite Data Fusion version header to use for the request."
|
|
79
|
+
)
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
class CDFTaskParameters(BaseModelResource):
|
|
83
|
+
cdf_request: CDFRequest
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
class DynamicRef(BaseModelResource):
|
|
87
|
+
tasks: str = Field(
|
|
88
|
+
description="A Reference is an expression that allows dynamically injecting input to a task during execution. References can be used to reference the input of the Workflow, the output of a previous task in the Workflow, or the input of a previous task in the Workflow. Note that the injected value must be valid in the context of the property it is injected into. Example Task reference: ${myTaskExternalId.output.someKey} Example Workflow input reference: ${workflow.input.myKey}"
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
class DynamicTaskParameters(BaseModelResource):
|
|
93
|
+
dynamic: DynamicRef = Field(description="Reference to another task to use as the definition for this task.")
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
class SubworkflowInlineTasks(BaseModelResource):
|
|
97
|
+
"""Inline definition of tasks for a subworkflow."""
|
|
98
|
+
|
|
99
|
+
tasks: "list[Task]" = Field(description="Inline definition of tasks for the subworkflow.")
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
# SubworkflowRef can be either a reference to an existing workflow version OR an inline definition of tasks
|
|
103
|
+
SubworkflowRef = Annotated[
|
|
104
|
+
WorkflowVersionId | SubworkflowInlineTasks,
|
|
105
|
+
Field(
|
|
106
|
+
description="Reference to the subworkflow to execute. This can be either a reference to an existing workflow version (with workflowExternalId and version) or an inline definition of tasks."
|
|
107
|
+
),
|
|
108
|
+
]
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
class SubworkflowTaskParameters(BaseModelResource):
|
|
112
|
+
subworkflow: SubworkflowRef = Field(description="Reference to the subworkflow to execute.")
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
class SimulatorInputUnit(BaseModelResource):
|
|
116
|
+
name: str = Field(description="Name of the unit.")
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
class SimulatorInput(BaseModelResource):
|
|
120
|
+
reference_id: str = Field(description="Reference id of the value to override.")
|
|
121
|
+
value: str | int | float | list[str] | list[int] | list[float] = Field(
|
|
122
|
+
description="Override the value used for a simulation run."
|
|
123
|
+
)
|
|
124
|
+
unit: SimulatorInputUnit | None = Field(None, description="Override the unit of the value")
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
class SimulationRef(BaseModelResource):
|
|
128
|
+
routine_external_id: str = Field(description="The external id of the routine to be executed.")
|
|
129
|
+
run_time: int | None = Field(
|
|
130
|
+
None,
|
|
131
|
+
description="Run time in milliseconds. Reference timestamp used for data pre-processing and data sampling.",
|
|
132
|
+
)
|
|
133
|
+
inputs: list[SimulatorInput] | None = Field(
|
|
134
|
+
None, description="List of inputs to be provided to the simulation.", max_length=200
|
|
135
|
+
)
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
class SimulationTaskParameters(BaseModelResource):
|
|
139
|
+
simulation: SimulationRef = Field(description="Reference to the simulation to execute.")
|
|
140
|
+
|
|
141
|
+
|
|
9
142
|
class TaskId(BaseModelResource):
|
|
10
143
|
external_id: str = Field(
|
|
11
144
|
max_length=255, description="The external ID provided by the client. Must be unique for the resource type."
|
|
12
145
|
)
|
|
13
146
|
|
|
14
147
|
|
|
15
|
-
class TaskDefinition(BaseModelResource):
|
|
148
|
+
class TaskDefinition(BaseModelResource, ABC):
|
|
16
149
|
external_id: str = Field(
|
|
17
150
|
max_length=255,
|
|
18
151
|
description="Identifier for the task. Must be unique within the version. No trailing or leading whitespace and no null characters allowed.",
|
|
19
152
|
)
|
|
20
|
-
type:
|
|
153
|
+
type: str
|
|
21
154
|
name: str | None = Field(
|
|
22
155
|
default=None,
|
|
23
156
|
max_length=255,
|
|
@@ -28,7 +161,6 @@ class TaskDefinition(BaseModelResource):
|
|
|
28
161
|
max_length=500,
|
|
29
162
|
description="Description of the intention of the task",
|
|
30
163
|
)
|
|
31
|
-
parameters: JsonValue = Field()
|
|
32
164
|
retries: int = Field(
|
|
33
165
|
3,
|
|
34
166
|
ge=0,
|
|
@@ -52,13 +184,49 @@ class TaskDefinition(BaseModelResource):
|
|
|
52
184
|
)
|
|
53
185
|
|
|
54
186
|
|
|
187
|
+
class FunctionTask(TaskDefinition):
|
|
188
|
+
type: Literal["function"] = "function"
|
|
189
|
+
parameters: FunctionTaskParameters
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
class TransformationTask(TaskDefinition):
|
|
193
|
+
type: Literal["transformation"] = "transformation"
|
|
194
|
+
parameters: TransformationTaskParameters
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
class CDFTask(TaskDefinition):
|
|
198
|
+
type: Literal["cdfRequest"] = "cdfRequest"
|
|
199
|
+
parameters: CDFTaskParameters
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
class DynamicTask(TaskDefinition):
|
|
203
|
+
type: Literal["dynamic"] = "dynamic"
|
|
204
|
+
parameters: DynamicTaskParameters
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
class SubworkflowTask(TaskDefinition):
|
|
208
|
+
type: Literal["subworkflow"] = "subworkflow"
|
|
209
|
+
parameters: SubworkflowTaskParameters
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
class SimulationTask(TaskDefinition):
|
|
213
|
+
type: Literal["simulation"] = "simulation"
|
|
214
|
+
parameters: SimulationTaskParameters
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
Task = Annotated[
|
|
218
|
+
FunctionTask | TransformationTask | CDFTask | DynamicTask | SubworkflowTask | SimulationTask,
|
|
219
|
+
Field(discriminator="type"),
|
|
220
|
+
]
|
|
221
|
+
|
|
222
|
+
|
|
55
223
|
class WorkflowDefinition(BaseModelResource):
|
|
56
224
|
description: str | None = Field(
|
|
57
225
|
default=None,
|
|
58
226
|
max_length=500,
|
|
59
227
|
description="The description of the workflow version.",
|
|
60
228
|
)
|
|
61
|
-
tasks: list[
|
|
229
|
+
tasks: list[Task]
|
|
62
230
|
|
|
63
231
|
|
|
64
232
|
class WorkflowVersionYAML(ToolkitResource):
|
|
@@ -1,16 +1,25 @@
|
|
|
1
1
|
from collections.abc import Iterable, Sequence
|
|
2
|
+
from itertools import zip_longest
|
|
2
3
|
from typing import Any
|
|
3
4
|
|
|
5
|
+
from pydantic import JsonValue
|
|
6
|
+
|
|
4
7
|
from cognite_toolkit._cdf_tk.client import ToolkitClient
|
|
5
|
-
from cognite_toolkit._cdf_tk.client.
|
|
8
|
+
from cognite_toolkit._cdf_tk.client.http_client import (
|
|
9
|
+
HTTPClient,
|
|
10
|
+
HTTPMessage,
|
|
11
|
+
HTTPResult2,
|
|
12
|
+
RequestMessage2,
|
|
13
|
+
SuccessResponse2,
|
|
14
|
+
)
|
|
15
|
+
from cognite_toolkit._cdf_tk.client.resource_classes.legacy.canvas import (
|
|
6
16
|
IndustrialCanvas,
|
|
7
17
|
IndustrialCanvasApply,
|
|
8
18
|
)
|
|
9
|
-
from cognite_toolkit._cdf_tk.client.
|
|
19
|
+
from cognite_toolkit._cdf_tk.client.resource_classes.legacy.charts import Chart, ChartList, ChartWrite
|
|
10
20
|
from cognite_toolkit._cdf_tk.exceptions import ToolkitNotImplementedError
|
|
11
21
|
from cognite_toolkit._cdf_tk.tk_warnings import HighSeverityWarning, MediumSeverityWarning
|
|
12
22
|
from cognite_toolkit._cdf_tk.utils.collection import chunker_sequence
|
|
13
|
-
from cognite_toolkit._cdf_tk.utils.http_client import HTTPClient, HTTPMessage, SimpleBodyRequest
|
|
14
23
|
from cognite_toolkit._cdf_tk.utils.useful_types import JsonVal
|
|
15
24
|
|
|
16
25
|
from ._base import Page, UploadableStorageIO, UploadItem
|
|
@@ -185,23 +194,52 @@ class CanvasIO(UploadableStorageIO[CanvasSelector, IndustrialCanvas, IndustrialC
|
|
|
185
194
|
results: list[HTTPMessage] = []
|
|
186
195
|
for item in data_chunk:
|
|
187
196
|
instances = item.item.as_instances()
|
|
188
|
-
|
|
197
|
+
upsert_items: list[dict[str, JsonValue]] = []
|
|
189
198
|
for instance in instances:
|
|
190
199
|
dumped = instance.dump()
|
|
191
200
|
if self.exclude_existing_version:
|
|
192
201
|
dumped.pop("existingVersion", None)
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
202
|
+
upsert_items.append(dumped)
|
|
203
|
+
|
|
204
|
+
canvas = item.item.canvas
|
|
205
|
+
existing = self.client.canvas.industrial.retrieve(canvas.external_id)
|
|
206
|
+
if existing is not None:
|
|
207
|
+
existing_instance_ids = existing.as_write().as_instance_ids(include_solution_tags=False)
|
|
208
|
+
delete_set = set(existing_instance_ids) - set(item.item.as_instance_ids())
|
|
209
|
+
to_delete: list[Any] = [
|
|
210
|
+
{
|
|
211
|
+
"space": instance_id.space,
|
|
212
|
+
"externalId": instance_id.external_id,
|
|
213
|
+
"instanceType": instance_id.instance_type,
|
|
214
|
+
}
|
|
215
|
+
for instance_id in delete_set
|
|
216
|
+
]
|
|
217
|
+
else:
|
|
218
|
+
to_delete = []
|
|
204
219
|
|
|
220
|
+
last_response: HTTPResult2 | None = None
|
|
221
|
+
for upsert_chunk, delete_chunk in zip_longest(
|
|
222
|
+
chunker_sequence(upsert_items, 1000), chunker_sequence(to_delete, 1000), fillvalue=None
|
|
223
|
+
):
|
|
224
|
+
body_content: dict[str, JsonValue] = {}
|
|
225
|
+
if upsert_chunk:
|
|
226
|
+
# MyPy fails do understand that list[dict[str, JsonValue]] is a subtype of JsonValue
|
|
227
|
+
body_content["items"] = upsert_chunk # type: ignore[assignment]
|
|
228
|
+
if delete_chunk:
|
|
229
|
+
body_content["delete"] = delete_chunk
|
|
230
|
+
|
|
231
|
+
response = http_client.request_single_retries(
|
|
232
|
+
message=RequestMessage2(
|
|
233
|
+
endpoint_url=config.create_api_url("/models/instances"),
|
|
234
|
+
method="POST",
|
|
235
|
+
body_content=body_content,
|
|
236
|
+
)
|
|
237
|
+
)
|
|
238
|
+
if not isinstance(response, SuccessResponse2):
|
|
239
|
+
results.append(response.as_item_response(item.source_id))
|
|
240
|
+
last_response = response
|
|
241
|
+
if last_response is not None:
|
|
242
|
+
results.append(last_response.as_item_response(item.source_id))
|
|
205
243
|
return results
|
|
206
244
|
|
|
207
245
|
def data_to_json_chunk(
|