{ "info": { "_postman_id": "24129e4d-c972-416b-ab35-33b9019ad520", "name": "Entitlement API CI/CD v1.1", "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" }, "item": [ { "name": "Configure collection", "item": [ { "name": "Refresh Token", "event": [ { "listen": "test", "script": { "id": "a20a0186-5480-4ba4-af18-79f16551f0f4", "exec": [ "// this snippet extracts the new access and id tokens", "// and puts them to environment variables", "cp = pm.environment.get(\"cloud_platform\");", "", "var data = JSON.parse(responseBody)", "pm.environment.set(\"access_token\", data.access_token);", "if (cp == \"AWS\" || cp == \"IBM\") {", " pm.environment.set(\"id_token\", data.id_token);", "}", "// Uncomment if server returns a new refresh_token,", "// otherwise comment out to prevent overwriting it with null", "if (cp == \"Azure\") {", " pm.environment.set(\"refresh_token\", data.refresh_token);", "}" ], "type": "text/javascript" } }, { "listen": "prerequest", "script": { "id": "66756e80-8924-42bd-ae98-c558e381cb3f", "exec": [ "" ], "type": "text/javascript" } } ], "request": { "auth": { "type": "noauth" }, "method": "POST", "header": [ { "key": "Content-Type", "name": "Content-Type", "type": "text", "value": "application/x-www-form-urlencoded" }, { "key": "Ocp-Apim-Subscription-Key", "type": "text", "value": "xxxxxxxx", "disabled": true } ], "body": { "mode": "urlencoded", "urlencoded": [ { "key": "grant_type", "value": "refresh_token", "type": "text" }, { "key": "client_id", "value": "{{CLIENT_ID}}", "description": "Supply your client id as an environment variable", "type": "text" }, { "key": "client_secret", "value": "{{CLIENT_SECRET}}", "description": "Supply your client secret as an environment variable", "type": "text" }, { "key": "refresh_token", "value": "{{refresh_token}}", "type": "text" }, { "key": "scope", "value": "{{Scope}}", "type": "text" } ] }, "url": { "raw": "{{Token_Fetch_URL}}", "host": [ "{{Token_Fetch_URL}}" ] } }, "response": [] } ], "protocolProfileBehavior": {} }, { "name": "Entitlements", "item": [ { "name": "Create group", "item": [ { "name": "01 Entitlements - Create new data group success scenario (for Viewer access)", "event": [ { "listen": "test", "script": { "id": "7e9dcc97-7750-4122-ae7f-659314c2f853", "exec": [ "// Check for a successful HTTP response", "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", "});", "pm.test(\"Status description - OK\", function () {", " pm.response.to.have.status(\"OK\");", "});", "", "// Check that the API call returned the new group information", "pm.test(\"API call returned the newly created group details\", function () {", " var jsonData = pm.response.json();", " var groupName = pm.variables.get(\"New_ViewerDataGroup\");", " var data_partition = pm.variables.get(\"data-partition-id\");", " var domainName = pm.variables.get(\"domain\");", " ", " pm.expect(jsonData.name).to.equal(groupName);", " pm.expect(jsonData.groupEmail).to.equal(groupName + \"@\" + data_partition + domainName);", "});" ], "type": "text/javascript" } }, { "listen": "prerequest", "script": { "id": "b53d3a33-518f-410e-b2c1-babd285c99ed", "exec": [ "var newGroup = \"data.certification\" + _.random(1,99999) + \".viewers\";", "pm.environment.set(\"New_ViewerDataGroup\", newGroup);" ], "type": "text/javascript" } } ], "request": { "method": "POST", "header": [ { "key": "Content-Type", "type": "text", "value": "application/json" }, { "description": "This value should be the desired data partition id.", "key": "data-partition-id", "type": "text", "value": "{{data-partition-id}}" } ], "body": { "mode": "raw", "raw": "{\r\n \"name\" :\"{{New_ViewerDataGroup}}\",\r\n \"description\" : \"Certification Test Data group with Viewer access\"\r\n}", "options": { "raw": {} } }, "url": { "raw": "https://{{ENTITLEMENTS_HOST}}/groups", "protocol": "https", "host": [ "{{ENTITLEMENTS_HOST}}" ], "path": [ "groups" ] } }, "response": [] }, { "name": "02 Entitlements - Create new data group success scenario (for Owner access)", "event": [ { "listen": "test", "script": { "id": "a95221df-aaa4-4409-a082-228754fe2c79", "exec": [ "// Check for a successful HTTP response", "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", "});", "pm.test(\"Status description - OK\", function () {", " pm.response.to.have.status(\"OK\");", "});", "", "// Check that the API call returned the new group information", "pm.test(\"API call returned the newly created group details\", function () {", " var jsonData = pm.response.json();", " var groupName = pm.variables.get(\"New_OwnerDataGroup\");", " var data_partition = pm.variables.get(\"data-partition-id\");", " var domainName = pm.variables.get(\"domain\");", " ", " pm.expect(jsonData.name).to.equal(groupName);", " pm.expect(jsonData.groupEmail).to.equal(groupName + \"@\" + data_partition + domainName);", "});" ], "type": "text/javascript" } }, { "listen": "prerequest", "script": { "id": "c173d751-1ece-414c-8f1c-ae7a97ea11d5", "exec": [ "var newGroup = \"data.certification\" + _.random(1,99999) + \".owners\";", "pm.environment.set(\"New_OwnerDataGroup\", newGroup);" ], "type": "text/javascript" } } ], "request": { "method": "POST", "header": [ { "key": "Content-Type", "type": "text", "value": "application/json" }, { "description": "This value should be the desired data partition id.", "key": "data-partition-id", "type": "text", "value": "{{data-partition-id}}" } ], "body": { "mode": "raw", "raw": "{\r\n \"name\" :\"{{New_OwnerDataGroup}}\",\r\n \"description\" : \"Certification Test Data group with Owner access\"\r\n}", "options": { "raw": {} } }, "url": { "raw": "https://{{ENTITLEMENTS_HOST}}/groups", "protocol": "https", "host": [ "{{ENTITLEMENTS_HOST}}" ], "path": [ "groups" ] } }, "response": [] }, { "name": "03 Entitlements - Create service group success scenario (for User access)", "event": [ { "listen": "test", "script": { "id": "d1c9e2f2-9c2e-4bc2-ba36-8c0e63b5b311", "exec": [ "// Check for a successful HTTP response", "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", "});", "pm.test(\"Status description - OK\", function () {", " pm.response.to.have.status(\"OK\");", "});", "", "// Check that the API call returned the new group information", "pm.test(\"API call returned the newly created group details\", function () {", " var jsonData = pm.response.json();", " var groupName = pm.variables.get(\"New_UserServiceGroup\");", " var data_partition = pm.variables.get(\"data-partition-id\");", " var domainName = pm.variables.get(\"domain\");", " ", " pm.expect(jsonData.name).to.equal(groupName);", " pm.expect(jsonData.groupEmail).to.equal(groupName + \"@\" + data_partition + domainName);", "});" ], "type": "text/javascript" } }, { "listen": "prerequest", "script": { "id": "d029ff03-7c62-4180-b399-9474cbceb252", "exec": [ "var newGroup = \"service.storage\" + _.random(1,99999) + \".user\";", "pm.environment.set(\"New_UserServiceGroup\", newGroup);", "" ], "type": "text/javascript" } } ], "request": { "method": "POST", "header": [ { "key": "Content-Type", "type": "text", "value": "application/json" }, { "description": "This value should be the desired data partition id.", "key": "data-partition-id", "type": "text", "value": "{{data-partition-id}}" } ], "body": { "mode": "raw", "raw": "{\r\n \"name\" : \"{{New_UserServiceGroup}}\",\r\n \"description\" : \"This is an Service group for example user.\"\r\n}", "options": { "raw": {} } }, "url": { "raw": "https://{{ENTITLEMENTS_HOST}}/groups", "protocol": "https", "host": [ "{{ENTITLEMENTS_HOST}}" ], "path": [ "groups" ] } }, "response": [] }, { "name": "04 Entitlements - Create service group success scenario (for Admin access)", "event": [ { "listen": "test", "script": { "id": "91f35061-0e26-49ae-83e2-3c71e66d49e9", "exec": [ "// Check for a successful HTTP response", "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", "});", "pm.test(\"Status description - OK\", function () {", " pm.response.to.have.status(\"OK\");", "});", "", "// Check that the API call returned the new group information", "pm.test(\"API call returned the newly created group details\", function () {", " var jsonData = pm.response.json();", " var groupName = pm.variables.get(\"New_AdminServiceGroup\");", " var data_partition = pm.variables.get(\"data-partition-id\");", " var domainName = pm.variables.get(\"domain\");", " ", " pm.expect(jsonData.name).to.equal(groupName);", " pm.expect(jsonData.groupEmail).to.equal(groupName + \"@\" + data_partition + domainName);", "});" ], "type": "text/javascript" } }, { "listen": "prerequest", "script": { "id": "7cc3a7a2-9582-4167-931a-2605cdd814e6", "exec": [ "var newGroup = \"service.storage\" + _.random(1,99999) + \".admin\";", "pm.environment.set(\"New_AdminServiceGroup\", newGroup);", "" ], "type": "text/javascript" } } ], "request": { "method": "POST", "header": [ { "key": "Content-Type", "type": "text", "value": "application/json" }, { "description": "This value should be the desired data partition id.", "key": "data-partition-id", "type": "text", "value": "{{data-partition-id}}" } ], "body": { "mode": "raw", "raw": "{\r\n \"name\" : \"{{New_AdminServiceGroup}}\",\r\n \"description\" : \"This is an Service group for example admin.\"\r\n}", "options": { "raw": {} } }, "url": { "raw": "https://{{ENTITLEMENTS_HOST}}/groups", "protocol": "https", "host": [ "{{ENTITLEMENTS_HOST}}" ], "path": [ "groups" ] } }, "response": [] }, { "name": "05 Entitlements - Create user group success scenario (for Viewer access)", "event": [ { "listen": "test", "script": { "id": "b6649e48-60de-4e89-88a7-7b8be38a8c7f", "exec": [ "// Check for a successful HTTP response", "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", "});", "pm.test(\"Status description - OK\", function () {", " pm.response.to.have.status(\"OK\");", "});", "", "// Check that the API call returned the new group information", "pm.test(\"API call returned the newly created group details\", function () {", " var jsonData = pm.response.json();", " var groupName = pm.variables.get(\"New_ViewerUserGroup\");", " var data_partition = pm.variables.get(\"data-partition-id\");", " var domainName = pm.variables.get(\"domain\");", " ", " pm.expect(jsonData.name).to.equal(groupName);", " pm.expect(jsonData.groupEmail).to.equal(groupName + \"@\" + data_partition + domainName);", "});" ], "type": "text/javascript" } }, { "listen": "prerequest", "script": { "id": "79a5923f-9ff6-4c34-b59c-390f69e7adce", "exec": [ "var newGroup = \"users.datalake\" + _.random(1,99999) + \".viewers\";", "pm.environment.set(\"New_ViewerUserGroup\", newGroup);", "", "" ], "type": "text/javascript" } } ], "request": { "method": "POST", "header": [ { "key": "Content-Type", "type": "text", "value": "application/json" }, { "description": "This value should be the desired data partition id.", "key": "data-partition-id", "type": "text", "value": "{{data-partition-id}}" } ], "body": { "mode": "raw", "raw": "{\r\n \"name\" : \"{{New_ViewerUserGroup}}\",\r\n \"description\" : \"This is an user group for example viewers.\"\r\n}", "options": { "raw": {} } }, "url": { "raw": "https://{{ENTITLEMENTS_HOST}}/groups", "protocol": "https", "host": [ "{{ENTITLEMENTS_HOST}}" ], "path": [ "groups" ] } }, "response": [] }, { "name": "06 Entitlements - Create user group success scenario (for Editors access)", "event": [ { "listen": "test", "script": { "id": "16c851ba-ada4-4d37-a3f2-ed6eaa30fe2c", "exec": [ "// Check for a successful HTTP response", "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", "});", "pm.test(\"Status description - OK\", function () {", " pm.response.to.have.status(\"OK\");", "});", "", "// Check that the API call returned the new group information", "pm.test(\"API call returned the newly created group details\", function () {", " var jsonData = pm.response.json();", " var groupName = pm.variables.get(\"New_EditorUserGroup\");", " var data_partition = pm.variables.get(\"data-partition-id\");", " var domainName = pm.variables.get(\"domain\");", " ", " pm.expect(jsonData.name).to.equal(groupName);", " pm.expect(jsonData.groupEmail).to.equal(groupName + \"@\" + data_partition + domainName);", "});" ], "type": "text/javascript" } }, { "listen": "prerequest", "script": { "id": "d7071454-063d-467b-a660-22da8071776f", "exec": [ "var newGroup = \"users.datalake\" + _.random(1,99999) + \".editors\";", "pm.environment.set(\"New_EditorUserGroup\", newGroup);", "", "" ], "type": "text/javascript" } } ], "request": { "method": "POST", "header": [ { "key": "Content-Type", "type": "text", "value": "application/json" }, { "description": "This value should be the desired data partition id.", "key": "data-partition-id", "type": "text", "value": "{{data-partition-id}}" } ], "body": { "mode": "raw", "raw": "{\r\n \"name\" : \"{{New_EditorUserGroup}}\",\r\n \"description\" : \"This is an user group for example viewers.\"\r\n}", "options": { "raw": {} } }, "url": { "raw": "https://{{ENTITLEMENTS_HOST}}/groups", "protocol": "https", "host": [ "{{ENTITLEMENTS_HOST}}" ], "path": [ "groups" ] } }, "response": [] }, { "name": "07 Entitlements - Create group invalid parameters[no error message]", "event": [ { "listen": "test", "script": { "id": "1b392096-615a-4114-ad52-32f19affd78a", "exec": [ "// Validate the status code and description", "pm.test(\"Status code is 400\", function () {", " pm.response.to.have.status(400);", "});", "pm.test(\"Status description - Bad Request\", function () {", " pm.response.to.have.status(\"Bad Request\");", "});" ], "type": "text/javascript" } } ], "request": { "method": "POST", "header": [ { "key": "Content-Type", "type": "text", "value": "application/json" }, { "description": "This value should be the desired data partition id.", "key": "data-partition-id", "type": "text", "value": "{{data-partition-id}}" } ], "body": { "mode": "raw", "raw": "{\r\n \"nameinvalid\" : \"users.example.viewers\",\r\n \"description\" : \"This is an user group for example viewers.\"\r\n}", "options": { "raw": {} } }, "url": { "raw": "https://{{ENTITLEMENTS_HOST}}/groups", "protocol": "https", "host": [ "{{ENTITLEMENTS_HOST}}" ], "path": [ "groups" ] } }, "response": [] }, { "name": "08 Entitlements - Create group without correct permission to access the API", "event": [ { "listen": "test", "script": { "id": "8b336d27-7bae-49d3-ba44-4d82442258b9", "exec": [ "// Validate the status code and description", "pm.test(\"Status code to be 401 or 403\", function () {", " pm.expect(pm.response.code).to.be.oneOf([401,403]);", "});", "try {", " let resBody = pm.response.json();", " if (resBody != null) {", " pm.test(\"Response has not authorized string\", function () {", " pm.expect(pm.response.text()).to.include(\"not authorized\");", " });", " }", "}", "catch (e) {", " console.log(e.message);", "}", "" ], "type": "text/javascript" } } ], "request": { "method": "POST", "header": [ { "key": "Content-Type", "type": "text", "value": "application/json" }, { "description": "This value should be the desired data partition id.", "key": "slb-data-partition-id", "type": "text", "value": "{{data-partition-id}}" } ], "body": { "mode": "raw", "raw": "{\r\n \"name\" : \"users.example.viewers\",\r\n \"description\" : \"This is an user group for example viewers.\"\r\n}", "options": { "raw": {} } }, "url": { "raw": "https://{{ENTITLEMENTS_HOST}}/groups", "protocol": "https", "host": [ "{{ENTITLEMENTS_HOST}}" ], "path": [ "groups" ] } }, "response": [] }, { "name": "09 Entitlements - Create group which is already created", "event": [ { "listen": "test", "script": { "id": "d24d343b-f906-4c59-a522-7a5ab2efd6f2", "exec": [ "// Validate the status code and description", "pm.test(\"Status code is 409\", function () {", " pm.response.to.have.status(409);", "});", "pm.test(\"Status description - Conflict. Failed to insert group. Entity already exists.\", function () {", " pm.response.to.have.status(\"Conflict\");", "});" ], "type": "text/javascript" } } ], "request": { "method": "POST", "header": [ { "key": "Content-Type", "type": "text", "value": "application/json" }, { "description": "This value should be the desired data partition id.", "key": "data-partition-id", "type": "text", "value": "{{data-partition-id}}" } ], "body": { "mode": "raw", "raw": "{\r\n \"name\" : \"{{New_ViewerDataGroup}}\",\r\n \"description\" : \"This is an data group for example viewers.\"\r\n}", "options": { "raw": {} } }, "url": { "raw": "https://{{ENTITLEMENTS_HOST}}/groups", "protocol": "https", "host": [ "{{ENTITLEMENTS_HOST}}" ], "path": [ "groups" ] } }, "response": [] } ], "description": "Creates a new group with the original caller becoming the OWNER of the group being created. This API requires caller to have the service.entitlements.admin permission", "event": [ { "listen": "prerequest", "script": { "id": "01352ddd-ca6b-46e4-9140-9ff6409cc764", "type": "text/javascript", "exec": [ "" ] } }, { "listen": "test", "script": { "id": "508b029e-0a3f-43fd-b6f8-464539e1e2af", "type": "text/javascript", "exec": [ "" ] } } ], "protocolProfileBehavior": {}, "_postman_isSubFolder": true }, { "name": "Get groups", "item": [ { "name": "10 Entitlements - Get groups success scenario", "event": [ { "listen": "test", "script": { "id": "45b3ee04-2710-4664-bb9c-6d995cb34353", "exec": [ "// Check for a successful HTTP response", "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", "});", "pm.test(\"Status description - OK\", function () {", " pm.response.to.have.status(\"OK\");", "});" ], "type": "text/javascript" } } ], "request": { "method": "GET", "header": [ { "description": "This value should be the desired data partition id.", "key": "data-partition-id", "type": "text", "value": "{{data-partition-id}}" } ], "url": { "raw": "https://{{ENTITLEMENTS_HOST}}/groups", "protocol": "https", "host": [ "{{ENTITLEMENTS_HOST}}" ], "path": [ "groups" ] } }, "response": [] }, { "name": "11 Entitlements - Get groups with invalid parameters[no error message]", "event": [ { "listen": "test", "script": { "id": "52aa7e61-7ce8-4d5b-ae49-a153336b2194", "exec": [ "// Validate the status code and description", "pm.test(\"Status code is 401\", function () {", " pm.expect(pm.response.code).to.equal(401);", "});", "pm.test(\"Status description - Unauthorized\", function () {", " pm.response.to.have.status(\"Unauthorized\");", "});" ], "type": "text/javascript" } } ], "request": { "method": "GET", "header": [ { "description": "This value should be the desired data partition id.", "key": "data-partition-idinvalid", "type": "text", "value": "{{data-partition-id}}" } ], "url": { "raw": "https://{{ENTITLEMENTS_HOST}}/groups", "protocol": "https", "host": [ "{{ENTITLEMENTS_HOST}}" ], "path": [ "groups" ] } }, "response": [] }, { "name": "12 Entitlements - Get groups without correct permission to access the API", "event": [ { "listen": "test", "script": { "id": "7c7e9569-8555-4bf5-838d-daf46fc625a6", "exec": [ "// Validate the status code and description", "pm.test(\"Status code to be 401 or 403\", function () {", " pm.expect(pm.response.code).to.be.oneOf([401,403]);", "});", "try {", " let resBody = pm.response.json();", " if (resBody != null) {", " pm.test(\"Response has not authorized string\", function () {", " pm.expect(pm.response.text()).to.include(\"not authorized\");", " });", " }", "}", "catch (e) {", " console.log(e.message);", "}", "" ], "type": "text/javascript" } } ], "request": { "method": "GET", "header": [ { "description": "This value should be the desired data partition id.", "key": "slb-data-partition-id", "type": "text", "value": "{{data-partition-id}}" } ], "url": { "raw": "https://{{ENTITLEMENTS_HOST}}/groups", "protocol": "https", "host": [ "{{ENTITLEMENTS_HOST}}" ], "path": [ "groups" ] } }, "response": [] } ], "description": "Lists all the groups that the user belongs to in the given data partition. This API requires caller to have the service.entitlements.user permission", "event": [ { "listen": "prerequest", "script": { "id": "d9d9a9ec-8ade-47e0-969e-e7182453b738", "type": "text/javascript", "exec": [ "" ] } }, { "listen": "test", "script": { "id": "b94b135e-718b-4bed-86c7-ad0d93669c98", "type": "text/javascript", "exec": [ "" ] } } ], "protocolProfileBehavior": {}, "_postman_isSubFolder": true }, { "name": "Add members as Owner user role", "item": [ { "name": "13 Entitlements - Add member to a viewer data group", "event": [ { "listen": "prerequest", "script": { "id": "92498b79-8d24-4590-a02e-472b5df966d9", "exec": [ "var data_partition_id = pm.variables.get(\"data-partition-id\");", "var URLdomain = pm.variables.get(\"domain\");", "postman.setEnvironmentVariable(\"NewOwner\", \"user_\" + _.random(1,9999999) + \"@\" + data_partition_id + URLdomain);", "" ], "type": "text/javascript" } }, { "listen": "test", "script": { "id": "d599e3d8-d03b-4f86-aad8-f2a7afa9219c", "exec": [ "//Ensure there were no error codes in the API response", "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", "});", "pm.test(\"Status description - OK\", function () {", " pm.response.to.have.status(\"OK\");", "});", "", "// Ensure the API response from the member addition was correct and successful ", "pm.test(\"User group addition submitted successfully? :\", function () {", " var jsonData = pm.response.json();", " var userGroupEmail = pm.environment.get(\"NewOwner\");", " pm.expect(jsonData.email).to.equal(userGroupEmail);", "});" ], "type": "text/javascript" } } ], "request": { "method": "POST", "header": [ { "key": "Content-Type", "type": "text", "value": "application/json" }, { "description": "This value should be the desired data partition id.", "key": "data-partition-id", "type": "text", "value": "{{data-partition-id}}" } ], "body": { "mode": "raw", "raw": "{\r\n \"email\" : \"{{NewOwner}}\",\r\n \"role\" : \"OWNER\"\r\n}", "options": { "raw": {} } }, "url": { "raw": "https://{{ENTITLEMENTS_HOST}}/groups/:group_email/members", "protocol": "https", "host": [ "{{ENTITLEMENTS_HOST}}" ], "path": [ "groups", ":group_email", "members" ], "variable": [ { "key": "group_email", "value": "{{New_ViewerDataGroup}}@{{data-partition-id}}{{domain}}", "description": "group_email must be data group which has prefix 'data.'" } ] } }, "response": [] }, { "name": "14 Entitlements - Add member to a Owner data group", "event": [ { "listen": "test", "script": { "id": "9bbee2d5-a5df-4cca-b17d-f9ef7cd68fab", "exec": [ "//Ensure there were no error codes in the API response", "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", "});", "pm.test(\"Status description - OK\", function () {", " pm.response.to.have.status(\"OK\");", "});", "", "// Ensure the API response from the member addition was correct and successful ", "pm.test(\"User group addition submitted successfully? :\", function () {", " var jsonData = pm.response.json();", " var userGroupEmail = pm.environment.get(\"NewOwner\");", " pm.expect(jsonData.email).to.equal(userGroupEmail);", "});" ], "type": "text/javascript" } }, { "listen": "prerequest", "script": { "id": "7c618b9f-c4a5-4fbf-be77-53ad94353bf6", "exec": [ "var data_partition_id = pm.variables.get(\"data-partition-id\");", "var URLdomain = pm.variables.get(\"domain\");", "postman.setEnvironmentVariable(\"NewOwner\", \"user_\" + _.random(1,9999999) + \"@\" + data_partition_id + URLdomain);", "" ], "type": "text/javascript" } } ], "request": { "method": "POST", "header": [ { "key": "Content-Type", "type": "text", "value": "application/json" }, { "description": "This value should be the desired data partition id.", "key": "data-partition-id", "type": "text", "value": "{{data-partition-id}}" } ], "body": { "mode": "raw", "raw": "{\r\n \"email\" : \"{{NewOwner}}\",\r\n \"role\" : \"OWNER\"\r\n}", "options": { "raw": {} } }, "url": { "raw": "https://{{ENTITLEMENTS_HOST}}/groups/:group_email/members", "protocol": "https", "host": [ "{{ENTITLEMENTS_HOST}}" ], "path": [ "groups", ":group_email", "members" ], "variable": [ { "key": "group_email", "value": "{{New_OwnerDataGroup}}@{{data-partition-id}}{{domain}}" } ] } }, "response": [] }, { "name": "15 Entitlements - Add member to a user service group", "event": [ { "listen": "test", "script": { "id": "a55430cb-33f7-4236-ad2c-6655cf167c6f", "exec": [ "//Ensure there were no error codes in the API response", "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", "});", "pm.test(\"Status description - OK\", function () {", " pm.response.to.have.status(\"OK\");", "});", "", "// Ensure the API response from the member addition was correct and successful ", "pm.test(\"User group addition submitted successfully? :\", function () {", " var jsonData = pm.response.json();", " var userGroupEmail = pm.environment.get(\"NewOwner\");", " pm.expect(jsonData.email).to.equal(userGroupEmail);", "});" ], "type": "text/javascript" } }, { "listen": "prerequest", "script": { "id": "cb00b879-f634-43a2-839a-ab5a27dfd39d", "exec": [ "var data_partition_id = pm.variables.get(\"data-partition-id\");", "var URLdomain = pm.variables.get(\"domain\");", "postman.setEnvironmentVariable(\"NewOwner\", \"user_\" + _.random(1,9999999) + \"@\" + data_partition_id + URLdomain);", "" ], "type": "text/javascript" } } ], "request": { "method": "POST", "header": [ { "key": "Content-Type", "type": "text", "value": "application/json" }, { "description": "This value should be the desired data partition id.", "key": "data-partition-id", "type": "text", "value": "{{data-partition-id}}" } ], "body": { "mode": "raw", "raw": "{\r\n \"email\" : \"{{NewOwner}}\",\r\n \"role\" : \"OWNER\"\r\n}", "options": { "raw": {} } }, "url": { "raw": "https://{{ENTITLEMENTS_HOST}}/groups/:group_email/members", "protocol": "https", "host": [ "{{ENTITLEMENTS_HOST}}" ], "path": [ "groups", ":group_email", "members" ], "variable": [ { "key": "group_email", "value": "{{New_UserServiceGroup}}@{{data-partition-id}}{{domain}}" } ] } }, "response": [] }, { "name": "16 Entitlements - Add member to a admin service group", "event": [ { "listen": "test", "script": { "id": "ae6b0c06-2e57-4689-880c-34291de604c1", "exec": [ "//Ensure there were no error codes in the API response", "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", "});", "pm.test(\"Status description - OK\", function () {", " pm.response.to.have.status(\"OK\");", "});", "", "// Ensure the API response from the member addition was correct and successful ", "pm.test(\"User group addition submitted successfully? :\", function () {", " var jsonData = pm.response.json();", " var userGroupEmail = pm.environment.get(\"NewOwner\");", " pm.expect(jsonData.email).to.equal(userGroupEmail);", "});" ], "type": "text/javascript" } }, { "listen": "prerequest", "script": { "id": "97444931-8808-4a05-95fb-0b4758dfc007", "exec": [ "var data_partition_id = pm.variables.get(\"data-partition-id\");", "var URLdomain = pm.variables.get(\"domain\");", "postman.setEnvironmentVariable(\"NewOwner\", \"user_\" + _.random(1,9999999) + \"@\" + data_partition_id + URLdomain);", "" ], "type": "text/javascript" } } ], "request": { "method": "POST", "header": [ { "key": "Content-Type", "type": "text", "value": "application/json" }, { "description": "This value should be the desired data partition id.", "key": "data-partition-id", "type": "text", "value": "{{data-partition-id}}" } ], "body": { "mode": "raw", "raw": "{\r\n \"email\" : \"{{NewOwner}}\",\r\n \"role\" : \"OWNER\"\r\n}", "options": { "raw": {} } }, "url": { "raw": "https://{{ENTITLEMENTS_HOST}}/groups/:group_email/members", "protocol": "https", "host": [ "{{ENTITLEMENTS_HOST}}" ], "path": [ "groups", ":group_email", "members" ], "variable": [ { "key": "group_email", "value": "{{New_AdminServiceGroup}}@{{data-partition-id}}{{domain}}" } ] } }, "response": [] }, { "name": "17 Entitlements - Add member to a viewer user group", "event": [ { "listen": "test", "script": { "id": "01bb584d-8d0e-4955-bd80-8c4447a1c28f", "exec": [ "//Ensure there were no error codes in the API response", "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", "});", "pm.test(\"Status description - OK\", function () {", " pm.response.to.have.status(\"OK\");", "});", "", "// Ensure the API response from the member addition was correct and successful ", "pm.test(\"User group addition submitted successfully? :\", function () {", " var jsonData = pm.response.json();", " var userGroupEmail = pm.environment.get(\"NewOwner\");", " pm.expect(jsonData.email).to.equal(userGroupEmail);", "});", "" ], "type": "text/javascript" } }, { "listen": "prerequest", "script": { "id": "c339ad57-3333-47ca-9026-d403865b7bd8", "exec": [ "var data_partition_id = pm.variables.get(\"data-partition-id\");", "var URLdomain = pm.variables.get(\"domain\");", "postman.setEnvironmentVariable(\"NewOwner\", \"user_\" + _.random(1,9999999) + \"@\" + data_partition_id + URLdomain);", "" ], "type": "text/javascript" } } ], "request": { "method": "POST", "header": [ { "key": "Content-Type", "type": "text", "value": "application/json" }, { "description": "This value should be the desired data partition id.", "key": "data-partition-id", "type": "text", "value": "{{data-partition-id}}" } ], "body": { "mode": "raw", "raw": "{\r\n \"email\" : \"{{NewOwner}}\",\r\n \"role\" : \"OWNER\"\r\n}", "options": { "raw": {} } }, "url": { "raw": "https://{{ENTITLEMENTS_HOST}}/groups/:group_email/members", "protocol": "https", "host": [ "{{ENTITLEMENTS_HOST}}" ], "path": [ "groups", ":group_email", "members" ], "variable": [ { "key": "group_email", "value": "{{New_ViewerUserGroup}}@{{data-partition-id}}{{domain}}" } ] } }, "response": [] } ], "description": "Grants access to the given data group of vendor partition to the given user group of the same vendor partition or any primary partition.", "event": [ { "listen": "prerequest", "script": { "id": "389d7dc4-77c9-4a85-acd5-c89eabd25a32", "type": "text/javascript", "exec": [ "" ] } }, { "listen": "test", "script": { "id": "f1a710e5-5b44-42c6-9ee0-90f5e5f66304", "type": "text/javascript", "exec": [ "" ] } } ], "protocolProfileBehavior": {}, "_postman_isSubFolder": true }, { "name": "Add members to a viewer user group", "item": [ { "name": "18 Entitlements - Add members to existing group success scenario", "event": [ { "listen": "test", "script": { "id": "13a234cf-6937-47b6-9ff3-a4f633ec1612", "exec": [ "//Ensure there were no error codes in the API response", "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", "});", "pm.test(\"Status description - OK\", function () {", " pm.response.to.have.status(\"OK\");", "});", "", "// Ensure the API response from the member addition was correct and successful ", "pm.test(\"Member addition submitted successfully? :\", function () {", " var jsonData = pm.response.json();", " var memberEmail = pm.environment.get(\"NewUserName\");", " pm.expect(jsonData.email).to.equal(memberEmail);", "});", "" ], "type": "text/javascript" } }, { "listen": "prerequest", "script": { "id": "836f9869-0473-41d7-b668-7a73ede050f2", "exec": [ "//postman.setEnvironmentVariable(\"NewUserName\", \"user_\" + _.random(1,9999999) + \"@common.p4d.cloud.slb-ds.com\");", "// Create a unique user name to use in the body of this request. This unique user name will also be used in later tests.", "var data_partition_id = pm.variables.get(\"data-partition-id\");", "var URLdomain = pm.variables.get(\"domain\");", "postman.setEnvironmentVariable(\"NewUserName\", \"user_\" + _.random(1,9999999) + \"@\" + data_partition_id + URLdomain);", "" ], "type": "text/javascript" } } ], "request": { "method": "POST", "header": [ { "key": "Content-Type", "type": "text", "value": "application/json" }, { "description": "This value should be the desired data partition id.", "key": "data-partition-id", "type": "text", "value": "{{data-partition-id}}" } ], "body": { "mode": "raw", "raw": "{\n \"email\" : \"{{NewUserName}}\",\n \"role\" : \"MEMBER\"\n}\n", "options": { "raw": {} } }, "url": { "raw": "https://{{ENTITLEMENTS_HOST}}/groups/:group_email/members", "protocol": "https", "host": [ "{{ENTITLEMENTS_HOST}}" ], "path": [ "groups", ":group_email", "members" ], "variable": [ { "key": "group_email", "value": "{{New_ViewerDataGroup}}@{{data-partition-id}}{{domain}}", "description": "group email" } ] } }, "response": [] }, { "name": "19 Entitlements - Add members to existing group with invalid parameters[no error message]", "event": [ { "listen": "test", "script": { "id": "7466bb3e-71d9-4897-8a16-76fc622b9ec8", "exec": [ "// Validate the status code and description", "pm.test(\"Status code is ?\", function () {", " pm.response.to.have.status(200);", "});", "pm.test(\"Status description - \", function () {", " pm.response.to.have.status(\"?\");", "});" ], "type": "text/javascript" } }, { "listen": "prerequest", "script": { "id": "d01c7ee3-e0e3-49b3-bebd-ddad26350588", "exec": [ "var data_partition_id = pm.variables.get(\"data-partition-id\");", "var URLdomain = pm.variables.get(\"domain\");", "postman.setEnvironmentVariable(\"NewMember\", \"user_\" + _.random(1,9999999) + \"@\" + data_partition_id + URLdomain);" ], "type": "text/javascript" } } ], "request": { "method": "POST", "header": [ { "key": "Content-Type", "type": "text", "value": "application/json" }, { "description": "This value should be the desired data partition id.", "key": "data-partition-id", "type": "text", "value": "{{data-partition-id}}" } ], "body": { "mode": "raw", "raw": "{\n \"emailaddress\" : \"{{NewUserName}}\",\n \"role\" : \"MEMBER\"\n}\n", "options": { "raw": {} } }, "url": { "raw": "https://{{ENTITLEMENTS_HOST}}/groups/:group_emailinvalid/members", "protocol": "https", "host": [ "{{ENTITLEMENTS_HOST}}" ], "path": [ "groups", ":group_emailinvalid", "members" ], "variable": [ { "key": "group_emailinvalid", "value": "{{New_ViewerDataGroup}}@{{data-partition-id}}{{domain}}" } ] } }, "response": [] }, { "name": "20 Entitlements - Add members to existing group without correct permission to access the API", "event": [ { "listen": "test", "script": { "id": "7a4aad83-56f8-480d-b51f-edb6da047f5b", "exec": [ "// Validate the status code and description", "pm.test(\"Status code to be 401 or 403\", function () {", " pm.expect(pm.response.code).to.be.oneOf([401,403]);", "});", "try {", " let resBody = pm.response.json();", " if (resBody != null) {", " pm.test(\"Response has not authorized string\", function () {", " pm.expect(pm.response.text()).to.include(\"not authorized\");", " });", " }", "}", "catch (e) {", " console.log(e.message);", "}", "" ], "type": "text/javascript" } }, { "listen": "prerequest", "script": { "id": "b5174e42-3f31-4c56-b4d2-5832f782efd8", "exec": [ "var data_partition_id = pm.variables.get(\"data-partition-id\");", "var URLdomain = pm.variables.get(\"domain\");", "postman.setEnvironmentVariable(\"NewMember\", \"user_\" + _.random(1,9999999) + \"@\" + data_partition_id + URLdomain);" ], "type": "text/javascript" } } ], "request": { "method": "POST", "header": [ { "key": "Content-Type", "type": "text", "value": "application/json" }, { "description": "This value should be the desired data partition id.", "key": "slb-data-partition-id", "type": "text", "value": "{{data-partition-id}}" } ], "body": { "mode": "raw", "raw": "{\n \"email\" : \"{{NewUserName}}\",\n \"role\" : \"MEMBER\"\n}\n", "options": { "raw": {} } }, "url": { "raw": "https://{{ENTITLEMENTS_HOST}}/groups/:group_email/members", "protocol": "https", "host": [ "{{ENTITLEMENTS_HOST}}" ], "path": [ "groups", ":group_email", "members" ], "variable": [ { "key": "group_email", "value": "{{New_ViewerDataGroup}}@{{data-partition-id}}{{domain}}", "description": "group email" } ] } }, "response": [] } ], "protocolProfileBehavior": {}, "_postman_isSubFolder": true }, { "name": "Retrieves members that belong to a group", "item": [ { "name": "21 Entitlements - List all members of the Viewer group Success scenario - without specifying a role", "event": [ { "listen": "test", "script": { "id": "b4674190-c84d-448b-9201-7d147c4b9599", "exec": [ "//Ensure there were no error codes in the API response", "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", "});", "pm.test(\"Status description - OK\", function () {", " pm.response.to.have.status(\"OK\");", "});", "", "// Ensure the list of members contains the recently added member ", "pm.test(\"Member addition was successful? :\", function () {", " var jsonData = pm.response.json();", " var returnedMembers = jsonData.members;", " var expectedMemberEmail = pm.environment.get(\"NewOwner\");", " var memberStatus=\"Not Present\";", " for (var i=0; i