Skip to content

Commit 37c7a70

Browse files
committed
add new lines in each section
1 parent 9ebfb2b commit 37c7a70

1 file changed

Lines changed: 33 additions & 33 deletions

File tree

README.md

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -6,60 +6,61 @@ This API wrapper is designed to work with [Split](https://www.split.io), the pla
66

77
For specific instructions on how to use this API refer to our [official API documentation](https://docs.split.io/reference).
88

9-
Install the split-admin-api:
9+
Install the split-admin-api:\
1010
`pip install split-admin-api`
1111

12-
Import the client object and initialize connection using an Admin API Key:
13-
`from splitapiclient.main import get_client
12+
Import the client object and initialize connection using an Admin API Key:\
13+
`from splitapiclient.main import get_client  
1414
client = get_client({'apikey': 'ADMIN API KEY'})
1515
`
1616

17-
Enable optional logging:
17+
Enable optional logging:\
1818
`import logging
1919
logging.basicConfig(level=logging.DEBUG)
2020
`
2121

22-
**Workspaces**
23-
Fetch all workspaces:
22+
**Workspaces**\
23+
Fetch all workspaces:\
2424
`for ws in client.workspaces.list():
2525
print ("\nWorkspace:"+ws.name+", Id: "+ws.id)
2626
`
2727

28-
Find a specific workspaces:
28+
Find a specific workspaces:\
2929
`ws = client.workspaces.find("Defaults")
3030
print ("\nWorkspace:"+ws.name+", Id: "+ws.id)
3131
`
3232

33-
**Environments**
34-
Fetch all Environments:
33+
**Environments**\
34+
Fetch all Environments:\
3535
`ws = client.workspaces.find("Defaults")
3636
for env in client.environments.list(ws.id):
3737
print ("\nEnvironment: "+env.name+", Id: "+env.id)
38-
Add new environment:
38+
`
39+
40+
Add new environment:\
3941
`ws = client.workspaces.find("Defaults")
4042
env = ws.add_environment({'name':'new_environment', 'production':False})
4143
`
4244

43-
**Splits**
44-
45-
Fetch all Splits:
45+
**Splits**\
46+
Fetch all Splits:\
4647
`ws = client.workspaces.find("Defaults")
4748
for split in client.splits.list(ws.id):
4849
print ("\nSplit: "+split.name+", "+split._workspace_id)
4950
`
5051

51-
Add new Split:
52+
Add new Split:\
5253
`
5354
split = ws.add_split({'name':'split_name', 'description':'new UI feature'}, "user")
5455
print(split.name)
5556
`
5657

57-
Add tags:
58+
Add tags:\
5859
`
5960
split.associate_tags(['my_new_tag', 'another_new_tag'])
6061
`
6162

62-
Add Split to environment:
63+
Add Split to environment:\
6364
`
6465
ws = client.workspaces.find("Defaults")
6566
split = client.splits.find("new_feature", ws.id)
@@ -76,28 +77,28 @@ data={"treatments":[tr1.export_dict() ,tr2.export_dict()],"defaultTreatment":"of
7677
splitdef = split.add_to_environment(env.id, data)
7778
`
7879

79-
Kill Split:
80+
Kill Split:\
8081
`
8182
ws = client.workspaces.find("Defaults")
8283
env = client.environments.find("Production", ws.id)
8384
splitDef = client.split_definitions.find("new_feature", env.id, ws.id)
8485
splitDef.kill()
8586
`
8687

87-
Restore Split:
88+
Restore Split:\
8889
`
8990
splitDef.restore()
9091
`
9192

92-
Fetch all Splits in an Environment:
93+
Fetch all Splits in an Environment:\
9394
`
9495
ws = client.workspaces.find("Defaults")
9596
env = client.environments.find("Production", ws.id)
9697
for spDef in client.split_definitions.list(env.id, ws.id):
9798
print(spDef.name+str(spDef._default_rule))
9899
`
99100

100-
Submit a Change request to update a Split definition:
101+
Submit a Change request to update a Split definition:\
101102
`
102103
splitDef = client.split_definitions.find("new_feature", env.id, ws.id)
103104
definition= {"treatments":[ {"name":"on"},{"name":"off"}],
@@ -108,7 +109,7 @@ definition= {"treatments":[ {"name":"on"},{"name":"off"}],
108109
splitDef.submit_change_request(definition, 'UPDATE', 'updating default rule', 'comment', ['user@email.com'], '')
109110
`
110111

111-
List all change requests:
112+
List all change requests:\
112113
`
113114
for cr in client.change_requests.list():
114115
if cr._split is not None:
@@ -117,62 +118,61 @@ for cr in client.change_requests.list():
117118
print (cr._id+", "+cr._segment['name']+", "+cr._title)
118119
`
119120

120-
Approve specific change request:
121+
Approve specific change request:\
121122
`
122123
for cr in client.change_requests.list():
123124
if cr._split['name']=='new_feature':
124125
cr.update_status("APPROVED", "done")
125126
`
126127

127-
**Users and Groups**
128-
129-
Fetch all Active users:
128+
**Users and Groups**\
129+
Fetch all Active users:\
130130
`
131131
for user in client.users.list('ACTIVE'):
132132
print(user.email+", "+user._id)
133133
`
134134

135-
Invite new user:
135+
Invite new user:\
136136
`
137137
group = client.groups.find('Administrators')
138138
userData = {'email':'user@email.com', 'groups':[{'id':'', 'type':'group'}]}
139139
userData['groups'][0]['id'] = group._id
140140
client.users.invite_user(userData)
141141
`
142142

143-
Delete a pending invite:
143+
Delete a pending invite:\
144144
`
145145
for user in client.users.list('PENDING'):
146146
print(user.email+", "+user._id+", "+user._status)
147147
if user.email == 'user@email.com':
148148
client.users.delete(user._id)
149149
`
150150

151-
Update user info:
151+
Update user info:\
152152
`
153153
data = {'name':'new_name', 'email':'user@email.com', '2fa':False, 'status':'ACTIVE'}
154154
user = client.users.find('user@email.com')
155155
user.update_user(user._id, data)
156156
`
157157

158-
Fetch all Groups:
158+
Fetch all Groups:\
159159
`
160160
for group in client.groups.list():
161161
print (group._id+", "+group._name)
162162
`
163163

164-
Create Group:
164+
Create Group:\
165165
`
166166
client.groups.create_group({'name':'new_group', 'description':''})
167167
`
168168

169-
Delete Group:
169+
Delete Group:\
170170
`
171171
group = client.groups.find('new_group')
172172
client.groups.delete_group(group._id)
173173
`
174174

175-
Replace existing user group:
175+
Replace existing user group:\
176176
`
177177
user = client.users.find('user@email.com')
178178
group = client.groups.find('Administrators')
@@ -181,7 +181,7 @@ data[0]['value']['id'] = group._id
181181
user.update_user_group(data)
182182
`
183183

184-
Add user to new group
184+
Add user to new group\
185185
`
186186
user = client.users.find('user@email.com')
187187
group = client.groups.find('Administrators')

0 commit comments

Comments
 (0)