Skip to content

Commit 4cc21dd

Browse files
Merge pull request #8 from geosiris-technologies/sample-09-25
more samples
2 parents edd1f9e + dbcdb80 commit 4cc21dd

2 files changed

Lines changed: 51 additions & 2 deletions

File tree

.env.sample

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
ETP_CONFIG_LIST_FILE_PATH=configs/all_server_configs.json
2+
ETP_CONFIG_ID=azure
3+
4+
5+
6+
# --------------------------------------- AZURE
7+
SERVER_AUTH_METHOD=azure_ad
8+
SERVER_NAME=azure
9+
SERVER_URL=wss://*****
10+
SERVER_TIMEOUT=30
11+
SERVER_MAX_WEB_SOCKET_FRAME_PAYLOAD_SIZE=500000000
12+
SERVER_MAX_WEB_SOCKET_MESSAGE_PAYLOAD_SIZE=500000000
13+
SERVER_VERIFY_SSL=True
14+
SERVER_AUTO_RECONNECT=True
15+
SERVER_USE_TRANSACTIONS=True
16+
SERVER_TOKEN_EXPIRES_AT=0.0
17+
SERVER_SUPPORTED_DATA_OBJECTS=[]
18+
SERVER_SUPPORTED_PROTOCOLS=[]
19+
SERVER_ADDITIONAL_HEADERS={"data-partition-id": "opendes"}
20+
SERVER_ACL_OWNERS=["data.default.owners@opendes.dataservices.energy"]
21+
SERVER_ACL_VIEWERS=["data.default.viewers@opendes.dataservices.energy"]
22+
SERVER_LEGAL_TAGS=["opendes-public-usa-dataset"]
23+
SERVER_DATA_COUNTRIES=["US"]
24+
BASIC_TOKEN_EXPIRES_AT=0.0
25+
OAUTH2_TOKEN_EXPIRES_AT=0.0
26+
AZUREAD_TOKEN_EXPIRES_AT=0.0
27+
AZUREAD_TENANT_ID=*****
28+
AZUREAD_CLIENT_ID=*****
29+
AZUREAD_CLIENT_SECRET=*****
30+
AZUREAD_SCOPE=*****/.default openid profile offline_access
31+
AWSCOGNITO_TOKEN_EXPIRES_AT=0.0
32+
GCPO_TOKEN_EXPIRES_AT=0.0
33+
BEARERTOKEN_TOKEN_EXPIRES_AT=0.0
34+
35+
# --------------------------------------- AWS
36+
37+
38+
DEBUG=true

example/py_etp_client_example/main.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import numpy as np
1111

1212
from py_etp_client.etpclient import ETPClient
13-
from py_etp_client.etpconfig import ETPConfig
13+
from py_etp_client.etpconfig import ETPConfig, ServerConfig
1414
from etpproto.client_info import ClientInfo
1515
from etpproto.connection import ConnectionType
1616
from etpproto.connection import (
@@ -32,7 +32,7 @@
3232
from py_etp_client.etpclient import start_client
3333

3434

35-
def main():
35+
def main_deprecated():
3636
config = ETPConfig()
3737

3838
short_url = ".".join(config.URL.split(".")[-2:]).split("/")[0] or "localhost"
@@ -77,5 +77,16 @@ def main():
7777
client.close()
7878

7979

80+
def main():
81+
config = ServerConfig.from_env()
82+
83+
client = start_client(config)
84+
print("Client started")
85+
86+
print(client.get_dataspaces())
87+
88+
client.close()
89+
90+
8091
if __name__ == "__main__":
8192
main()

0 commit comments

Comments
 (0)