-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest.py
More file actions
27 lines (22 loc) · 1 KB
/
test.py
File metadata and controls
27 lines (22 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/env python
import logging
import time
from pbi_rest_client.capacities import Capacities
from pbi_rest_client.rest_client import RestClient
from pbi_rest_client.workspaces import Workspaces
from pbi_rest_client.pipelines import Pipelines
from pbi_rest_client.dataflows import Dataflows
logging.basicConfig(level=logging.INFO)
client = RestClient()
capacities = Capacities(client)
workspaces = Workspaces(client)
pipelines = Pipelines(client)
dataflows = Dataflows(client)
print (workspaces.create_workspace('Testing Environment [Test]'))
print (capacities.set_workspace_capacity('Testing Environment [Test]', '4846741C-9AC0-456B-A0F2-6BA8C4D1D720'))
print (pipelines.create_pipeline('Testing Environment'))
print (pipelines.assign_pipeline_workspace('Testing Environment', 'Testing Environment [Test]', 'test'))
print (dataflows.delete_dataflow('Testing Environment [Test]', 'SQLDataFlow'))
time.sleep(10)
print (pipelines.pipeline_stage_deploy_selective('Testing Environment', 'promote', 'Dev'))
time.sleep(10)