Skip to content

Commit 7352d2d

Browse files
Format
1 parent 4ccd06d commit 7352d2d

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

samples/authX-pro/create.ipynb

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -72,21 +72,21 @@
7272
"pol_hr_post = utils.read_policy_xml('hr_post.xml', sample_name = sample_folder)\n",
7373
"\n",
7474
"# Employees (HR)\n",
75-
"hremployees_api_path = f'/{api_prefix}employees'\n",
76-
"hremployees_get = GET_APIOperation('Gets the employees', pol_hr_get,)\n",
77-
"hremployees_post = POST_APIOperation('Creates a new employee', pol_hr_post)\n",
78-
"hremployees = API(f'{api_prefix}Employees', 'Employees Pro', hremployees_api_path, 'This is a Human Resources API for employee information', \n",
79-
" operations = [hremployees_get, hremployees_post], tags = tags, productNames = [hr_product_name], subscriptionRequired = False)\n",
75+
"hr_employees_api_path = f'/{api_prefix}employees'\n",
76+
"hr_employees_get = GET_APIOperation('Gets the employees', pol_hr_get,)\n",
77+
"hr_employees_post = POST_APIOperation('Creates a new employee', pol_hr_post)\n",
78+
"hr_employees = API(f'{api_prefix}Employees', 'Employees Pro', hr_employees_api_path, 'This is a Human Resources API for employee information', \n",
79+
" operations = [hr_employees_get, hr_employees_post], tags = tags, productNames = [hr_product_name], subscriptionRequired = False)\n",
8080
"\n",
8181
"# Benefits (HR)\n",
82-
"hrbenefits_api_path = f'/{api_prefix}benefits'\n",
83-
"hrbenefits_get = GET_APIOperation('Gets employee benefits', pol_hr_get)\n",
84-
"hrbenefits_post = POST_APIOperation('Creates employee benefits', pol_hr_post)\n",
85-
"hrbenefits = API(f'{api_prefix}Benefits', 'Benefits Pro', hrbenefits_api_path, 'This is a Human Resources API for employee benefits',\n",
86-
" operations = [hrbenefits_get, hrbenefits_post], tags = tags, productNames = [hr_product_name], subscriptionRequired = False)\n",
82+
"hr_benefits_api_path = f'/{api_prefix}benefits'\n",
83+
"hr_benefits_get = GET_APIOperation('Gets employee benefits', pol_hr_get)\n",
84+
"hr_benefits_post = POST_APIOperation('Creates employee benefits', pol_hr_post)\n",
85+
"hr_benefits = API(f'{api_prefix}Benefits', 'Benefits Pro', hr_benefits_api_path, 'This is a Human Resources API for employee benefits',\n",
86+
" operations = [hr_benefits_get, hr_benefits_post], tags = tags, productNames = [hr_product_name], subscriptionRequired = False)\n",
8787
"\n",
8888
"# APIs Array\n",
89-
"apis: List[API] = [hremployees, hrbenefits]\n",
89+
"apis: List[API] = [hr_employees, hr_benefits]\n",
9090
"\n",
9191
"utils.print_ok('Notebook initialized')"
9292
]
@@ -165,16 +165,16 @@
165165
"reqsApimAdmin.headers['Authorization'] = f'Bearer {encoded_jwt_token_hr_admin}'\n",
166166
"\n",
167167
"# Call APIM\n",
168-
"output = reqsApimAdmin.singleGet(hremployees_api_path, msg = 'Calling GET Employees API via API Management Gateway URL. Expect 200.')\n",
168+
"output = reqsApimAdmin.singleGet(hr_employees_api_path, msg = 'Calling GET Employees API via API Management Gateway URL. Expect 200.')\n",
169169
"tests.verify(output, 'Successful GET')\n",
170170
"\n",
171-
"output = reqsApimAdmin.singlePost(hremployees_api_path, msg = 'Calling POST Employees API via API Management Gateway URL. Expect 200.')\n",
171+
"output = reqsApimAdmin.singlePost(hr_employees_api_path, msg = 'Calling POST Employees API via API Management Gateway URL. Expect 200.')\n",
172172
"tests.verify(output, 'Successful POST')\n",
173173
"\n",
174-
"output = reqsApimAdmin.singleGet(hrbenefits_api_path, msg = 'Calling GET Benefits API via API Management Gateway URL. Expect 200.')\n",
174+
"output = reqsApimAdmin.singleGet(hr_benefits_api_path, msg = 'Calling GET Benefits API via API Management Gateway URL. Expect 200.')\n",
175175
"tests.verify(output, 'Successful GET')\n",
176176
"\n",
177-
"output = reqsApimAdmin.singlePost(hrbenefits_api_path, msg = 'Calling POST Benefits API via API Management Gateway URL. Expect 200.')\n",
177+
"output = reqsApimAdmin.singlePost(hr_benefits_api_path, msg = 'Calling POST Benefits API via API Management Gateway URL. Expect 200.')\n",
178178
"tests.verify(output, 'Successful POST')\n",
179179
"\n",
180180
"# 2) HR Associate\n",
@@ -187,16 +187,16 @@
187187
"reqsApimAssociate.headers['Authorization'] = f'Bearer {encoded_jwt_token_hr_associate}'\n",
188188
"\n",
189189
"# Call APIM\n",
190-
"output = reqsApimAssociate.singleGet(hremployees_api_path, msg = 'Calling GET Employees API via API Management Gateway URL. Expect 200.')\n",
190+
"output = reqsApimAssociate.singleGet(hr_employees_api_path, msg = 'Calling GET Employees API via API Management Gateway URL. Expect 200.')\n",
191191
"tests.verify(output, 'Successful GET')\n",
192192
"\n",
193-
"output = reqsApimAssociate.singlePost(hremployees_api_path, msg = 'Calling POST Employees API via API Management Gateway URL. Expect 403.')\n",
193+
"output = reqsApimAssociate.singlePost(hr_employees_api_path, msg = 'Calling POST Employees API via API Management Gateway URL. Expect 403.')\n",
194194
"tests.verify(output, 'Access denied - no matching roles found')\n",
195195
"\n",
196-
"output = reqsApimAssociate.singleGet(hrbenefits_api_path, msg = 'Calling GET Benefits API via API Management Gateway URL. Expect 200.')\n",
196+
"output = reqsApimAssociate.singleGet(hr_benefits_api_path, msg = 'Calling GET Benefits API via API Management Gateway URL. Expect 200.')\n",
197197
"tests.verify(output, 'Successful GET')\n",
198198
"\n",
199-
"output = reqsApimAssociate.singlePost(hrbenefits_api_path, msg = 'Calling POST Benefits API via API Management Gateway URL. Expect 403.')\n",
199+
"output = reqsApimAssociate.singlePost(hr_benefits_api_path, msg = 'Calling POST Benefits API via API Management Gateway URL. Expect 403.')\n",
200200
"tests.verify(output, 'Access denied - no matching roles found')\n",
201201
"\n",
202202
"tests.print_summary()\n",

0 commit comments

Comments
 (0)