cognite-toolkit 0.6.88__py3-none-any.whl → 0.6.90__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.
Potentially problematic release.
This version of cognite-toolkit might be problematic. Click here for more details.
- cognite_toolkit/_cdf_tk/commands/_migrate/canvas.py +60 -5
- cognite_toolkit/_cdf_tk/commands/_migrate/command.py +4 -2
- cognite_toolkit/_cdf_tk/commands/_migrate/conversion.py +161 -44
- cognite_toolkit/_cdf_tk/commands/_migrate/data_classes.py +10 -10
- cognite_toolkit/_cdf_tk/commands/_migrate/data_mapper.py +7 -3
- cognite_toolkit/_cdf_tk/commands/_migrate/migration_io.py +8 -10
- cognite_toolkit/_cdf_tk/commands/build_cmd.py +1 -1
- cognite_toolkit/_cdf_tk/commands/pull.py +6 -5
- cognite_toolkit/_cdf_tk/data_classes/_build_variables.py +120 -14
- cognite_toolkit/_cdf_tk/data_classes/_built_resources.py +1 -1
- cognite_toolkit/_cdf_tk/resource_classes/agent.py +1 -0
- cognite_toolkit/_cdf_tk/resource_classes/infield_cdmv1.py +92 -0
- cognite_toolkit/_cdf_tk/storageio/__init__.py +2 -0
- cognite_toolkit/_cdf_tk/storageio/_annotations.py +102 -0
- cognite_toolkit/_cdf_tk/tracker.py +6 -6
- cognite_toolkit/_cdf_tk/utils/fileio/_readers.py +90 -44
- cognite_toolkit/_cdf_tk/utils/http_client/_client.py +6 -4
- cognite_toolkit/_cdf_tk/utils/http_client/_data_classes.py +2 -0
- cognite_toolkit/_cdf_tk/utils/useful_types.py +7 -4
- 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.6.88.dist-info → cognite_toolkit-0.6.90.dist-info}/METADATA +1 -1
- {cognite_toolkit-0.6.88.dist-info → cognite_toolkit-0.6.90.dist-info}/RECORD +28 -27
- cognite_toolkit/_cdf_tk/commands/_migrate/base.py +0 -106
- {cognite_toolkit-0.6.88.dist-info → cognite_toolkit-0.6.90.dist-info}/WHEEL +0 -0
- {cognite_toolkit-0.6.88.dist-info → cognite_toolkit-0.6.90.dist-info}/entry_points.txt +0 -0
- {cognite_toolkit-0.6.88.dist-info → cognite_toolkit-0.6.90.dist-info}/licenses/LICENSE +0 -0
|
@@ -147,13 +147,15 @@ class HTTPClient:
|
|
|
147
147
|
timeout=self.config.timeout,
|
|
148
148
|
)
|
|
149
149
|
|
|
150
|
-
def _create_headers(
|
|
150
|
+
def _create_headers(
|
|
151
|
+
self, api_version: str | None = None, content_type: str = "application/json", accept: str = "application/json"
|
|
152
|
+
) -> MutableMapping[str, str]:
|
|
151
153
|
headers: MutableMapping[str, str] = {}
|
|
152
154
|
headers["User-Agent"] = f"httpx/{httpx.__version__} {get_user_agent()}"
|
|
153
155
|
auth_name, auth_value = self.config.credentials.authorization_header()
|
|
154
156
|
headers[auth_name] = auth_value
|
|
155
|
-
headers["content-type"] =
|
|
156
|
-
headers["accept"] =
|
|
157
|
+
headers["content-type"] = content_type
|
|
158
|
+
headers["accept"] = accept
|
|
157
159
|
headers["x-cdp-sdk"] = f"CogniteToolkit:{get_current_toolkit_version()}"
|
|
158
160
|
headers["x-cdp-app"] = self.config.client_name
|
|
159
161
|
headers["cdf-version"] = api_version or self.config.api_subversion
|
|
@@ -162,7 +164,7 @@ class HTTPClient:
|
|
|
162
164
|
return headers
|
|
163
165
|
|
|
164
166
|
def _make_request(self, item: RequestMessage) -> httpx.Response:
|
|
165
|
-
headers = self._create_headers(item.api_version)
|
|
167
|
+
headers = self._create_headers(item.api_version, item.content_type, item.accept)
|
|
166
168
|
params: dict[str, PrimitiveType] | None = None
|
|
167
169
|
if isinstance(item, ParamRequest):
|
|
168
170
|
params = item.parameters
|
|
@@ -2,15 +2,17 @@ from collections.abc import Hashable
|
|
|
2
2
|
from datetime import date, datetime
|
|
3
3
|
from typing import Any, Literal, TypeAlias, TypeVar, get_args
|
|
4
4
|
|
|
5
|
-
from cognite.client.data_classes import Asset, Event, FileMetadata,
|
|
5
|
+
from cognite.client.data_classes import Annotation, Asset, Event, FileMetadata, TimeSeries
|
|
6
6
|
from cognite.client.data_classes._base import CogniteObject, WriteableCogniteResourceList
|
|
7
7
|
|
|
8
8
|
JsonVal: TypeAlias = None | str | int | float | bool | dict[str, "JsonVal"] | list["JsonVal"]
|
|
9
9
|
|
|
10
10
|
AssetCentricDestinationType: TypeAlias = Literal["assets", "files", "events", "timeseries", "sequences"]
|
|
11
|
-
AssetCentricType: TypeAlias = Literal["asset", "file", "event", "timeseries", "sequence"]
|
|
12
|
-
AssetCentricResource: TypeAlias = Asset | FileMetadata | Event | TimeSeries
|
|
13
|
-
|
|
11
|
+
AssetCentricType: TypeAlias = Literal["asset", "file", "event", "timeseries", "sequence", "fileAnnotation"]
|
|
12
|
+
AssetCentricResource: TypeAlias = Asset | FileMetadata | Event | TimeSeries
|
|
13
|
+
AssetCentricResourceExtended: TypeAlias = Asset | FileMetadata | Event | TimeSeries | Annotation
|
|
14
|
+
AssetCentricKind: TypeAlias = Literal["Assets", "Events", "TimeSeries", "FileMetadata", "FileAnnotations"]
|
|
15
|
+
|
|
14
16
|
DataType: TypeAlias = Literal["string", "integer", "float", "boolean", "json", "date", "timestamp"]
|
|
15
17
|
PythonTypes: TypeAlias = str | int | float | bool | datetime | date | dict[str, Any] | list[Any]
|
|
16
18
|
|
|
@@ -22,3 +24,4 @@ T_Value = TypeVar("T_Value")
|
|
|
22
24
|
PrimitiveType: TypeAlias = str | int | float | bool
|
|
23
25
|
|
|
24
26
|
T_WriteCogniteResource = TypeVar("T_WriteCogniteResource", bound=CogniteObject)
|
|
27
|
+
T_AssetCentricResource = TypeVar("T_AssetCentricResource", bound=AssetCentricResource)
|
|
@@ -4,7 +4,7 @@ default_env = "<DEFAULT_ENV_PLACEHOLDER>"
|
|
|
4
4
|
[modules]
|
|
5
5
|
# This is the version of the modules. It should not be changed manually.
|
|
6
6
|
# It will be updated by the 'cdf modules upgrade' command.
|
|
7
|
-
version = "0.6.
|
|
7
|
+
version = "0.6.90"
|
|
8
8
|
|
|
9
9
|
[alpha_flags]
|
|
10
10
|
external-libraries = true
|
cognite_toolkit/_version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "0.6.
|
|
1
|
+
__version__ = "0.6.90"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cognite_toolkit
|
|
3
|
-
Version: 0.6.
|
|
3
|
+
Version: 0.6.90
|
|
4
4
|
Summary: Official Cognite Data Fusion tool for project templates and configuration deployment
|
|
5
5
|
Project-URL: Homepage, https://docs.cognite.com/cdf/deploy/cdf_toolkit/
|
|
6
6
|
Project-URL: Changelog, https://github.com/cognitedata/toolkit/releases
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
cognite_toolkit/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
2
|
cognite_toolkit/_cdf.py,sha256=1OSAvbOeuIrnsczEG2BtGqRP3L3sq0VMPthmugnqCUw,5821
|
|
3
|
-
cognite_toolkit/_version.py,sha256=
|
|
3
|
+
cognite_toolkit/_version.py,sha256=8C5NBvUzoGO4v6lGEp7BL0OTYykj0dHZjnWDHft7icE,23
|
|
4
4
|
cognite_toolkit/_cdf_tk/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
5
|
cognite_toolkit/_cdf_tk/cdf_toml.py,sha256=IjmzNVLxsOV6tsMDgmJmXsy-LQru-8IEQdFzGW5DxVk,8117
|
|
6
6
|
cognite_toolkit/_cdf_tk/constants.py,sha256=e9XmGvQCqGq7zYQrNoopU5e2KnYZYBPyUC5raGShK7k,6364
|
|
@@ -8,7 +8,7 @@ cognite_toolkit/_cdf_tk/exceptions.py,sha256=xG0jMwi5A20nvPvyo6sCyz_cyKycynPyIzp
|
|
|
8
8
|
cognite_toolkit/_cdf_tk/feature_flags.py,sha256=oKvUHcNTtt8zp31eZ1eSCxfSIelm0L5B0xAQOskr1hc,2892
|
|
9
9
|
cognite_toolkit/_cdf_tk/hints.py,sha256=UI1ymi2T5wCcYOpEbKbVaDnlyFReFy8TDtMVt-5E1h8,6493
|
|
10
10
|
cognite_toolkit/_cdf_tk/plugins.py,sha256=yL7Q4k9UGnoHP9Ucrno02_qi1L3DrE6ggBiQI-wQKiU,783
|
|
11
|
-
cognite_toolkit/_cdf_tk/tracker.py,sha256=
|
|
11
|
+
cognite_toolkit/_cdf_tk/tracker.py,sha256=ybazaYDMgrtmAaCEb1nlKAQzjcN352-U-om4NBGV328,5965
|
|
12
12
|
cognite_toolkit/_cdf_tk/validation.py,sha256=KFdPgnNIbVM0yjFF0cqmpBB8MI8e-U-YbBYrP4IiClE,8441
|
|
13
13
|
cognite_toolkit/_cdf_tk/apps/__init__.py,sha256=nNQymHhwxjXNpY9N9xDmnvSPLCMwQkn_t9oRkgDWofI,659
|
|
14
14
|
cognite_toolkit/_cdf_tk/apps/_auth_app.py,sha256=ER7uYb3ViwsHMXiQEZpyhwU6TIjKaB9aEy32VI4MPpg,3397
|
|
@@ -102,7 +102,7 @@ cognite_toolkit/_cdf_tk/commands/_upload.py,sha256=Y0k0q4Iu4F7g3Ax3slSrpll3AHxmO
|
|
|
102
102
|
cognite_toolkit/_cdf_tk/commands/_utils.py,sha256=ARlbqA_5ZWlgN3-xF-zanzSx4B0-9ULnguA5QgHmKGA,1225
|
|
103
103
|
cognite_toolkit/_cdf_tk/commands/_virtual_env.py,sha256=GFAid4hplixmj9_HkcXqU5yCLj-fTXm4cloGD6U2swY,2180
|
|
104
104
|
cognite_toolkit/_cdf_tk/commands/auth.py,sha256=N6JgtF0_Qoh-xM8VlBb_IK1n0Lo5I7bIkIHmXm1l7ug,31638
|
|
105
|
-
cognite_toolkit/_cdf_tk/commands/build_cmd.py,sha256=
|
|
105
|
+
cognite_toolkit/_cdf_tk/commands/build_cmd.py,sha256=k2_BhmTJRXuB640-g4hFsN2tD58b-aujk6kFn400qsc,30516
|
|
106
106
|
cognite_toolkit/_cdf_tk/commands/clean.py,sha256=2VWZKp_AZ49AaUCCpvc1kezFA_je6y--zjglccqxsjQ,14346
|
|
107
107
|
cognite_toolkit/_cdf_tk/commands/collect.py,sha256=zBMKhhvjOpuASMnwP0eeHRI02tANcvFEZgv0CQO1ECc,627
|
|
108
108
|
cognite_toolkit/_cdf_tk/commands/deploy.py,sha256=QkPe3AGWIYKA-ju1rOyv9WWdwCGWyZFW5M_jc12Apxo,23083
|
|
@@ -111,21 +111,20 @@ cognite_toolkit/_cdf_tk/commands/dump_resource.py,sha256=ylAFST3GgkWT1Qa-JIzmQXb
|
|
|
111
111
|
cognite_toolkit/_cdf_tk/commands/featureflag.py,sha256=lgLMwuNIwFjvvKn1sNMunkq4VTwdNqXtrZfdGFTrNcI,968
|
|
112
112
|
cognite_toolkit/_cdf_tk/commands/init.py,sha256=OuAVPI_tAJrwFO81EwzKXAA8m6ne44wXsJ0KZyKwPAE,239
|
|
113
113
|
cognite_toolkit/_cdf_tk/commands/modules.py,sha256=gR4pLje6tSiWeW0glto0pb7BhlLee4jOv6YBNFsL_0g,42537
|
|
114
|
-
cognite_toolkit/_cdf_tk/commands/pull.py,sha256=
|
|
114
|
+
cognite_toolkit/_cdf_tk/commands/pull.py,sha256=AF5us8xz5ACeHcmXIiggoZ1GQrNhKXJXARnNdd2gFlc,39325
|
|
115
115
|
cognite_toolkit/_cdf_tk/commands/repo.py,sha256=MNy8MWphTklIZHvQOROCweq8_SYxGv6BaqnLpkFFnuk,3845
|
|
116
116
|
cognite_toolkit/_cdf_tk/commands/run.py,sha256=JyX9jLEQej9eRrHVCCNlw4GuF80qETSol3-T5CCofgw,37331
|
|
117
117
|
cognite_toolkit/_cdf_tk/commands/_migrate/__init__.py,sha256=i5ldcTah59K0E4fH5gHTV0GRvtDCEvVses9WQzn9Lno,226
|
|
118
|
-
cognite_toolkit/_cdf_tk/commands/_migrate/
|
|
119
|
-
cognite_toolkit/_cdf_tk/commands/_migrate/
|
|
120
|
-
cognite_toolkit/_cdf_tk/commands/_migrate/
|
|
121
|
-
cognite_toolkit/_cdf_tk/commands/_migrate/conversion.py,sha256=Eol-0ruQ14fwS-bx2pEmbXdICodfknSJ_OsAASa6jkY,9592
|
|
118
|
+
cognite_toolkit/_cdf_tk/commands/_migrate/canvas.py,sha256=R-z0yfOFcJZj-zRLhN-7z_-SLxqzSmONMgrbzNF9dGs,8843
|
|
119
|
+
cognite_toolkit/_cdf_tk/commands/_migrate/command.py,sha256=059GfizsxZzsO7CJP3uEtyvfbeKt2F5eYnvq9GvHxNE,14212
|
|
120
|
+
cognite_toolkit/_cdf_tk/commands/_migrate/conversion.py,sha256=ElsZeZNRPkxBm2VdTe0nCvyq75qfGLOLFY54fCuaxFY,14333
|
|
122
121
|
cognite_toolkit/_cdf_tk/commands/_migrate/creators.py,sha256=FTu7w3G8KyPY8pagG3KdPpOmpLcjehaAg2auEy6iM7A,9605
|
|
123
|
-
cognite_toolkit/_cdf_tk/commands/_migrate/data_classes.py,sha256=
|
|
124
|
-
cognite_toolkit/_cdf_tk/commands/_migrate/data_mapper.py,sha256=
|
|
122
|
+
cognite_toolkit/_cdf_tk/commands/_migrate/data_classes.py,sha256=S5MWfkaYAHfV6rc6RA4KR7WRETdcAKdpe6s4ZdwB0F0,8562
|
|
123
|
+
cognite_toolkit/_cdf_tk/commands/_migrate/data_mapper.py,sha256=7m9uj_W11iokGmbWD979z5UK5KwOYv7L9HiY5PcpIN4,6231
|
|
125
124
|
cognite_toolkit/_cdf_tk/commands/_migrate/data_model.py,sha256=i1eUsNX6Dueol9STIEwyksBnBsWUk13O8qHIjW964pM,7860
|
|
126
125
|
cognite_toolkit/_cdf_tk/commands/_migrate/default_mappings.py,sha256=KkSq_4R6hQ15ccG-jHy7vVgPwC5IDd5OaXZLvz5mIZs,5547
|
|
127
126
|
cognite_toolkit/_cdf_tk/commands/_migrate/issues.py,sha256=lWSnuS3CfRDbA7i1g12gJ2reJnQcLmZWxHDK19-Wxkk,5772
|
|
128
|
-
cognite_toolkit/_cdf_tk/commands/_migrate/migration_io.py,sha256=
|
|
127
|
+
cognite_toolkit/_cdf_tk/commands/_migrate/migration_io.py,sha256=obtdne1XqzOhlWuw2QnFs7vub5_FTaYOf086INB5d4I,9813
|
|
129
128
|
cognite_toolkit/_cdf_tk/commands/_migrate/prepare.py,sha256=RfqaNoso5CyBwc-p6ckwcYqBfZXKhdJgdGIyd0TATaI,2635
|
|
130
129
|
cognite_toolkit/_cdf_tk/commands/_migrate/selectors.py,sha256=CYle1Gz69HHnKF4onTIFxrpiOoDApvVK01SFuQuHzP0,2130
|
|
131
130
|
cognite_toolkit/_cdf_tk/cruds/__init__.py,sha256=j0yxDCwd4Cl9KG7SvGTDQg4Y2bHfYVEDv8CBxbFTWUM,6070
|
|
@@ -158,9 +157,9 @@ cognite_toolkit/_cdf_tk/cruds/_resource_cruds/workflow.py,sha256=OMHOxFY2ZLi0RTw
|
|
|
158
157
|
cognite_toolkit/_cdf_tk/data_classes/__init__.py,sha256=4zL-zR3lgQTCWfcy28LK0HEcukQOndPEFXVqfYfdKHU,1720
|
|
159
158
|
cognite_toolkit/_cdf_tk/data_classes/_base.py,sha256=0jy9VrYIO6iRgOZIcRASv-xIQjU3QbMICffEEIqzx6A,2673
|
|
160
159
|
cognite_toolkit/_cdf_tk/data_classes/_build_files.py,sha256=ARZpzcpmcbtG5Jg391d7A-7MJCFeUqqiDfJlO14cvvI,953
|
|
161
|
-
cognite_toolkit/_cdf_tk/data_classes/_build_variables.py,sha256=
|
|
160
|
+
cognite_toolkit/_cdf_tk/data_classes/_build_variables.py,sha256=R44AN5-TLRuveVaFO2i_pc8dtlwD2zm9HVYiFlw7drk,13844
|
|
162
161
|
cognite_toolkit/_cdf_tk/data_classes/_built_modules.py,sha256=Rak0-f0GgyQp_BwEW84YJ3N00F5_Be3twHuWb17Buq8,4724
|
|
163
|
-
cognite_toolkit/_cdf_tk/data_classes/_built_resources.py,sha256=
|
|
162
|
+
cognite_toolkit/_cdf_tk/data_classes/_built_resources.py,sha256=2lr_oNThS04O4XxzQKKvM08kudvMDCYke5jalv7Lc64,8533
|
|
164
163
|
cognite_toolkit/_cdf_tk/data_classes/_config_yaml.py,sha256=XIFFvW-7SdFPSoD0J2fhcr6gSo9B2CF90G-76A-MsSM,31566
|
|
165
164
|
cognite_toolkit/_cdf_tk/data_classes/_deploy_results.py,sha256=NKxJFHiLlKW-5odWs_fQcyHmsysd6VzZHtJXJ3JlOQA,8693
|
|
166
165
|
cognite_toolkit/_cdf_tk/data_classes/_module_directories.py,sha256=7XB0vdvMSJq7MyXjzNwlbv2Zd3i-OyyvgcOvoO4_GFQ,12259
|
|
@@ -173,7 +172,7 @@ cognite_toolkit/_cdf_tk/prototypes/import_app.py,sha256=7dy852cBlHI2RQF1MidSmxl0
|
|
|
173
172
|
cognite_toolkit/_cdf_tk/prototypes/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
174
173
|
cognite_toolkit/_cdf_tk/prototypes/commands/import_.py,sha256=RkJ7RZI6zxe0_1xrPB-iJhCVchurmIAChilx0_XMR6k,11141
|
|
175
174
|
cognite_toolkit/_cdf_tk/resource_classes/__init__.py,sha256=pTLYYBc0qImwf_yreoJdSc0LZQK6XQNVmbJFgrdxv-o,3754
|
|
176
|
-
cognite_toolkit/_cdf_tk/resource_classes/agent.py,sha256=
|
|
175
|
+
cognite_toolkit/_cdf_tk/resource_classes/agent.py,sha256=5rglrj551Z-0eT53S_UmSA3wz4m4Y494QxleWVs0ECE,1786
|
|
177
176
|
cognite_toolkit/_cdf_tk/resource_classes/agent_tools.py,sha256=oNkpPCQF3CyV9zcD6NTuEAnATLXzslw2GOyFz58ZGZg,2891
|
|
178
177
|
cognite_toolkit/_cdf_tk/resource_classes/asset.py,sha256=bFneWvGrEO0QsCJfSjfVDnJtIp9YCYIU7LYESldUSMs,1179
|
|
179
178
|
cognite_toolkit/_cdf_tk/resource_classes/authentication.py,sha256=RTLjFXWhpg2tLoJ-xTUH0kPMapuCacrgc-RXHVPJ0QQ,630
|
|
@@ -197,6 +196,7 @@ cognite_toolkit/_cdf_tk/resource_classes/hosted_extractor_destination.py,sha256=
|
|
|
197
196
|
cognite_toolkit/_cdf_tk/resource_classes/hosted_extractor_job.py,sha256=vLD28RByQBM9L0H9YsmzJnaNBaCY3Uoi45c1H0fzHds,10750
|
|
198
197
|
cognite_toolkit/_cdf_tk/resource_classes/hosted_extractor_mapping.py,sha256=5gicORcW1vyz6eaO2dtYlhb2J69BuMh6lrWQDjjanuo,4558
|
|
199
198
|
cognite_toolkit/_cdf_tk/resource_classes/hosted_extractor_source.py,sha256=Mma8B5GtxUalE7XDNcmeJx3pHc_v8vzHNqZgYnoDKmw,14663
|
|
199
|
+
cognite_toolkit/_cdf_tk/resource_classes/infield_cdmv1.py,sha256=qARcSa8B-56mMvGt26W9BHi9vzyy-gdG6eK5dYFwuqY,3431
|
|
200
200
|
cognite_toolkit/_cdf_tk/resource_classes/infield_v1.py,sha256=XtstgUuhYhWgsxSoQ9BhG5d2ySZxyus_TOiJDWGLs0w,3564
|
|
201
201
|
cognite_toolkit/_cdf_tk/resource_classes/instance.py,sha256=FdPCDz4LlKZ2SDBGH2-z-JiPN0V53Gg3FrxxjcjrJZc,2935
|
|
202
202
|
cognite_toolkit/_cdf_tk/resource_classes/labels.py,sha256=rh4SV_MBEiS9cjpz1g4_0SAnKGwiIepThD_wR1_bMkY,649
|
|
@@ -226,7 +226,8 @@ cognite_toolkit/_cdf_tk/resource_classes/robotics/data_postprocessing.py,sha256=
|
|
|
226
226
|
cognite_toolkit/_cdf_tk/resource_classes/robotics/frame.py,sha256=XmDqJ0pAxe_vAP0Dhktba1f9o2zg_ORCJ3Hz8cyJMrk,899
|
|
227
227
|
cognite_toolkit/_cdf_tk/resource_classes/robotics/location.py,sha256=dbc9HT-bc2Qt15hHoR63SM7pg321BhNuTNjI7HHCwSA,468
|
|
228
228
|
cognite_toolkit/_cdf_tk/resource_classes/robotics/map.py,sha256=j77z7CzCMiMj8r94BdUKCum9EuZRUjaSlUAy9K9DL_Q,942
|
|
229
|
-
cognite_toolkit/_cdf_tk/storageio/__init__.py,sha256
|
|
229
|
+
cognite_toolkit/_cdf_tk/storageio/__init__.py,sha256=-OhPPhl9z1ynYcFlRVYfOPD246HhQydmn4VzByJh7C0,2355
|
|
230
|
+
cognite_toolkit/_cdf_tk/storageio/_annotations.py,sha256=wAMkgM-IpgXuY7_1KbtiTv8VdA555ywKjntD_boOBPk,4647
|
|
230
231
|
cognite_toolkit/_cdf_tk/storageio/_applications.py,sha256=bhyG1d2_9duPkX-otC2brVcpChvdXSPkYhBHS5T_72g,4343
|
|
231
232
|
cognite_toolkit/_cdf_tk/storageio/_asset_centric.py,sha256=Rhy64zUW4oxacq_vYomDeTRPmF6Vx-1mkYAFAqJE9vk,28312
|
|
232
233
|
cognite_toolkit/_cdf_tk/storageio/_base.py,sha256=NWXPdgzUnpBiav5Hi8XGHkWU9QiMjNzBQTxMcuxF-LA,11017
|
|
@@ -268,16 +269,16 @@ cognite_toolkit/_cdf_tk/utils/sql_parser.py,sha256=jernu2amPQ54cQZ4vFZm1gEhFZfGc
|
|
|
268
269
|
cognite_toolkit/_cdf_tk/utils/table_writers.py,sha256=Rxp_CZDDWrNPERNq6u1xsAX1OvzownwMMnpwNu8KdH0,17861
|
|
269
270
|
cognite_toolkit/_cdf_tk/utils/text.py,sha256=EpIXjaQ5C5q5fjbUjAW7tncXpdJfiQeV7CYSbr70Bl0,3106
|
|
270
271
|
cognite_toolkit/_cdf_tk/utils/thread_safe_dict.py,sha256=NbRHcZvWpF9xHP5OkOMGFpxrPNbi0Q3Eea6PUNbGlt4,3426
|
|
271
|
-
cognite_toolkit/_cdf_tk/utils/useful_types.py,sha256=
|
|
272
|
+
cognite_toolkit/_cdf_tk/utils/useful_types.py,sha256=ITiaJYcJrQZTR-CejtnSRPdseg86TxtWv8TqIkLi09c,1565
|
|
272
273
|
cognite_toolkit/_cdf_tk/utils/validate_access.py,sha256=1puswcpgEDNCwdk91dhLqCBSu_aaUAd3Hsw21d-YVFs,21955
|
|
273
274
|
cognite_toolkit/_cdf_tk/utils/fileio/__init__.py,sha256=ts5kYu_1Ks7xjnM6pIrVUrZe0nkYI6euYXeE4ox34xk,1199
|
|
274
275
|
cognite_toolkit/_cdf_tk/utils/fileio/_base.py,sha256=MpWaD3lR9vrJ-kGzTiDOtChXhvFD7-xrP-Pzp7vjnLY,756
|
|
275
276
|
cognite_toolkit/_cdf_tk/utils/fileio/_compression.py,sha256=8BAPgg5OKc3vkEEkqOvYsuyh12iXVNuEmC0omWwyJNQ,2355
|
|
276
|
-
cognite_toolkit/_cdf_tk/utils/fileio/_readers.py,sha256=
|
|
277
|
+
cognite_toolkit/_cdf_tk/utils/fileio/_readers.py,sha256=nGfsSfpXDYUncncsFuJD9-xYPJ5635mSFUJfuCyQ3no,13724
|
|
277
278
|
cognite_toolkit/_cdf_tk/utils/fileio/_writers.py,sha256=ghNGBZjkISAlbxe8o5YWWloLXG9QKOtF_qGA9JkvYss,17712
|
|
278
279
|
cognite_toolkit/_cdf_tk/utils/http_client/__init__.py,sha256=H1T-cyIoVaPL4MvN1IuG-cHgj-cqB7eszu2kIN939lw,813
|
|
279
|
-
cognite_toolkit/_cdf_tk/utils/http_client/_client.py,sha256=
|
|
280
|
-
cognite_toolkit/_cdf_tk/utils/http_client/_data_classes.py,sha256=
|
|
280
|
+
cognite_toolkit/_cdf_tk/utils/http_client/_client.py,sha256=sN1Sizxv_rAcOSRd-2lKSs0p-SO1rA4eHL8pHMTBx54,11018
|
|
281
|
+
cognite_toolkit/_cdf_tk/utils/http_client/_data_classes.py,sha256=7mr1goZKx5oR877EVu5MWu1qplm-lfCKCAMVZZ5Tvm0,12611
|
|
281
282
|
cognite_toolkit/_cdf_tk/utils/http_client/_exception.py,sha256=fC9oW6BN0HbUe2AkYABMP7Kj0-9dNYXVFBY5RQztq2c,126
|
|
282
283
|
cognite_toolkit/_cdf_tk/utils/http_client/_tracker.py,sha256=EBBnd-JZ7nc_jYNFJokCHN2UZ9sx0McFLZvlceUYYic,1215
|
|
283
284
|
cognite_toolkit/_repo_files/.env.tmpl,sha256=UmgKZVvIp-OzD8oOcYuwb_6c7vSJsqkLhuFaiVgK7RI,972
|
|
@@ -285,13 +286,13 @@ cognite_toolkit/_repo_files/.gitignore,sha256=ip9kf9tcC5OguF4YF4JFEApnKYw0nG0vPi
|
|
|
285
286
|
cognite_toolkit/_repo_files/AzureDevOps/.devops/README.md,sha256=OLA0D7yCX2tACpzvkA0IfkgQ4_swSd-OlJ1tYcTBpsA,240
|
|
286
287
|
cognite_toolkit/_repo_files/AzureDevOps/.devops/deploy-pipeline.yml,sha256=brULcs8joAeBC_w_aoWjDDUHs3JheLMIR9ajPUK96nc,693
|
|
287
288
|
cognite_toolkit/_repo_files/AzureDevOps/.devops/dry-run-pipeline.yml,sha256=OBFDhFWK1mlT4Dc6mDUE2Es834l8sAlYG50-5RxRtHk,723
|
|
288
|
-
cognite_toolkit/_repo_files/GitHub/.github/workflows/deploy.yaml,sha256=
|
|
289
|
-
cognite_toolkit/_repo_files/GitHub/.github/workflows/dry-run.yaml,sha256=
|
|
290
|
-
cognite_toolkit/_resources/cdf.toml,sha256=
|
|
289
|
+
cognite_toolkit/_repo_files/GitHub/.github/workflows/deploy.yaml,sha256=SCxzt7VNwZd1w3WfU5yq2l7LMhu1_MMRshZoupjFVe0,667
|
|
290
|
+
cognite_toolkit/_repo_files/GitHub/.github/workflows/dry-run.yaml,sha256=33A3FwMmfVDB0iuKb6US6T2trx4w3-oI8Iouc3GQn_s,2430
|
|
291
|
+
cognite_toolkit/_resources/cdf.toml,sha256=pGBcYc-a1_FL7Xy1rB_QfeBkMvEt567P23mAh_CCeCg,487
|
|
291
292
|
cognite_toolkit/demo/__init__.py,sha256=-m1JoUiwRhNCL18eJ6t7fZOL7RPfowhCuqhYFtLgrss,72
|
|
292
293
|
cognite_toolkit/demo/_base.py,sha256=6xKBUQpXZXGQ3fJ5f7nj7oT0s2n7OTAGIa17ZlKHZ5U,8052
|
|
293
|
-
cognite_toolkit-0.6.
|
|
294
|
-
cognite_toolkit-0.6.
|
|
295
|
-
cognite_toolkit-0.6.
|
|
296
|
-
cognite_toolkit-0.6.
|
|
297
|
-
cognite_toolkit-0.6.
|
|
294
|
+
cognite_toolkit-0.6.90.dist-info/METADATA,sha256=L8Y9o5nwCO9cZOaOAxO5H5TC1y-hz8jXp6-7Zsv7Jes,4501
|
|
295
|
+
cognite_toolkit-0.6.90.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
296
|
+
cognite_toolkit-0.6.90.dist-info/entry_points.txt,sha256=JlR7MH1_UMogC3QOyN4-1l36VbrCX9xUdQoHGkuJ6-4,83
|
|
297
|
+
cognite_toolkit-0.6.90.dist-info/licenses/LICENSE,sha256=CW0DRcx5tL-pCxLEN7ts2S9g2sLRAsWgHVEX4SN9_Mc,752
|
|
298
|
+
cognite_toolkit-0.6.90.dist-info/RECORD,,
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
from abc import ABC
|
|
2
|
-
from typing import TypeVar
|
|
3
|
-
|
|
4
|
-
from cognite.client.data_classes import Asset, Event, FileMetadata, Sequence, TimeSeries
|
|
5
|
-
from cognite.client.data_classes.capabilities import (
|
|
6
|
-
Capability,
|
|
7
|
-
DataModelInstancesAcl,
|
|
8
|
-
DataModelsAcl,
|
|
9
|
-
SpaceIDScope,
|
|
10
|
-
)
|
|
11
|
-
|
|
12
|
-
from cognite_toolkit._cdf_tk.client import ToolkitClient
|
|
13
|
-
from cognite_toolkit._cdf_tk.commands._base import ToolkitCommand
|
|
14
|
-
from cognite_toolkit._cdf_tk.constants import DMS_INSTANCE_LIMIT_MARGIN
|
|
15
|
-
from cognite_toolkit._cdf_tk.exceptions import (
|
|
16
|
-
AuthenticationError,
|
|
17
|
-
ToolkitMigrationError,
|
|
18
|
-
ToolkitValueError,
|
|
19
|
-
)
|
|
20
|
-
from cognite_toolkit._cdf_tk.utils import humanize_collection
|
|
21
|
-
|
|
22
|
-
from .data_model import INSTANCE_SOURCE_VIEW_ID, MODEL_ID, RESOURCE_VIEW_MAPPING_VIEW_ID
|
|
23
|
-
|
|
24
|
-
T_AssetCentricResource = TypeVar("T_AssetCentricResource", bound=Asset | Event | FileMetadata | TimeSeries | Sequence)
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
class BaseMigrateCommand(ToolkitCommand, ABC):
|
|
28
|
-
def source_acl(self, data_set_id: list[int]) -> Capability:
|
|
29
|
-
"""Return the source ACL for the given data set IDs."""
|
|
30
|
-
# This method should be implemented in subclasses that needs access to a specific source ACL.
|
|
31
|
-
# such as TimeSeries, Files, Assets, and so on.
|
|
32
|
-
raise ValueError(
|
|
33
|
-
"Bug in Toolkit: the source ACL is not defined for this migration command. "
|
|
34
|
-
"Please implement the source_acl method."
|
|
35
|
-
)
|
|
36
|
-
|
|
37
|
-
def validate_access(
|
|
38
|
-
self,
|
|
39
|
-
client: ToolkitClient,
|
|
40
|
-
instance_spaces: list[str] | None = None,
|
|
41
|
-
schema_spaces: list[str] | None = None,
|
|
42
|
-
data_set_ids: list[int] | None = None,
|
|
43
|
-
) -> None:
|
|
44
|
-
required_capabilities: list[Capability] = []
|
|
45
|
-
if instance_spaces is not None:
|
|
46
|
-
required_capabilities.append(
|
|
47
|
-
DataModelInstancesAcl(
|
|
48
|
-
actions=[
|
|
49
|
-
DataModelInstancesAcl.Action.Read,
|
|
50
|
-
DataModelInstancesAcl.Action.Write,
|
|
51
|
-
DataModelInstancesAcl.Action.Write_Properties,
|
|
52
|
-
],
|
|
53
|
-
scope=SpaceIDScope(instance_spaces),
|
|
54
|
-
)
|
|
55
|
-
)
|
|
56
|
-
if schema_spaces is not None:
|
|
57
|
-
required_capabilities.append(
|
|
58
|
-
DataModelsAcl(actions=[DataModelsAcl.Action.Read], scope=SpaceIDScope(schema_spaces)),
|
|
59
|
-
)
|
|
60
|
-
|
|
61
|
-
if data_set_ids is not None:
|
|
62
|
-
source_acl = self.source_acl(data_set_ids)
|
|
63
|
-
required_capabilities.append(source_acl)
|
|
64
|
-
if missing := client.iam.verify_capabilities(required_capabilities):
|
|
65
|
-
raise AuthenticationError(f"Missing required capabilities: {humanize_collection(missing)}.", missing)
|
|
66
|
-
|
|
67
|
-
@staticmethod
|
|
68
|
-
def validate_migration_model_available(client: ToolkitClient) -> None:
|
|
69
|
-
models = client.data_modeling.data_models.retrieve([MODEL_ID], inline_views=False)
|
|
70
|
-
if not models:
|
|
71
|
-
raise ToolkitMigrationError(
|
|
72
|
-
f"The migration data model {MODEL_ID!r} does not exist. "
|
|
73
|
-
"Please run the `cdf migrate prepare` command to deploy the migration data model."
|
|
74
|
-
)
|
|
75
|
-
elif len(models) > 1:
|
|
76
|
-
raise ToolkitMigrationError(
|
|
77
|
-
f"Multiple migration models {MODEL_ID!r}. "
|
|
78
|
-
"Please delete the duplicate models before proceeding with the migration."
|
|
79
|
-
)
|
|
80
|
-
model = models[0]
|
|
81
|
-
missing_views = {INSTANCE_SOURCE_VIEW_ID, RESOURCE_VIEW_MAPPING_VIEW_ID} - set(model.views or [])
|
|
82
|
-
if missing_views:
|
|
83
|
-
raise ToolkitMigrationError(
|
|
84
|
-
f"Invalid migration model. Missing views {humanize_collection(missing_views)}. "
|
|
85
|
-
f"Please run the `cdf migrate prepare` command to deploy the migration data model."
|
|
86
|
-
)
|
|
87
|
-
|
|
88
|
-
def validate_available_capacity(self, client: ToolkitClient, instance_count: int) -> None:
|
|
89
|
-
"""Validate that the project has enough capacity to accommodate the migration."""
|
|
90
|
-
|
|
91
|
-
stats = client.data_modeling.statistics.project()
|
|
92
|
-
|
|
93
|
-
available_capacity = stats.instances.instances_limit - stats.instances.instances
|
|
94
|
-
available_capacity_after = available_capacity - instance_count
|
|
95
|
-
|
|
96
|
-
if available_capacity_after < DMS_INSTANCE_LIMIT_MARGIN:
|
|
97
|
-
raise ToolkitValueError(
|
|
98
|
-
"Cannot proceed with migration, not enough instance capacity available. Total capacity after migration"
|
|
99
|
-
f" would be {available_capacity_after:,} instances, which is less than the required margin of"
|
|
100
|
-
f" {DMS_INSTANCE_LIMIT_MARGIN:,} instances. Please increase the instance capacity in your CDF project"
|
|
101
|
-
f" or delete some existing instances before proceeding with the migration of {instance_count:,} assets."
|
|
102
|
-
)
|
|
103
|
-
total_instances = stats.instances.instances + instance_count
|
|
104
|
-
self.console(
|
|
105
|
-
f"Project has enough capacity for migration. Total instances after migration: {total_instances:,}."
|
|
106
|
-
)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|