File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import aas_core3 .types as aas
2+ import aas_core3 .jsonization as jsonization
3+ import requests
4+
5+ property = aas .Property (
6+ id_short = "temperature" ,
7+ value_type = aas .DataTypeDefXSD .DOUBLE ,
8+ value = "22.3"
9+ )
10+
11+ submodel = aas .Submodel (
12+ id = "urn:example:submodel:test" ,
13+ id_short = "TestSubmodel" ,
14+ submodel_elements = [property ]
15+ )
16+
17+ aas_obj = aas .AssetAdministrationShell (
18+ id = "urn:example:aas:test" ,
19+ id_short = "TestAAS" ,
20+ asset_information = aas .AssetInformation (
21+ asset_kind = aas .AssetKind .INSTANCE
22+ ),
23+ submodels = [aas .Reference (
24+ type = aas .ReferenceTypes .EXTERNAL_REFERENCE ,
25+ keys = [aas .Key (
26+ type = aas .KeyTypes .SUBMODEL ,
27+ value = submodel .id
28+ )]
29+ )]
30+ )
31+
32+ submodel_json = jsonization .to_jsonable (submodel )
33+ aas_json = jsonization .to_jsonable (aas_obj )
34+
35+ BASE = "http://localhost:8000/shells"
36+
37+ resp1 = requests .post (BASE , json = aas_json )
38+ print (f"AAS upload: { resp1 .status_code } " )
You can’t perform that action at this time.
0 commit comments