Complete the code to create an Access Level with a basic condition.
access_level = {
"name": "accessPolicies/123/accessLevels/level1",
"title": "Office Hours Access",
"basic": {
"conditions": [
{
"ipSubnetworks": ["[1]"],
"members": ["user:alice@example.com"]
}
]
}
}The IP subnet "192.168.1.0/24" restricts access to a local office network, which is a common use case for Access Context Manager conditions.
Complete the code to define an Access Policy with a specific parent resource.
access_policy = {
"parent": "[1]",
"title": "My Access Policy"
}The parent for an Access Policy must be an organization resource, such as "organizations/456".
Fix the error in the Access Level condition to correctly specify device policy.
access_level = {
"name": "accessPolicies/123/accessLevels/level2",
"devicePolicy": {
"requireScreenlock": [1]
}
}The value for requireScreenlock must be a boolean true, not a string or Python False.
Fill both blanks to create a condition that restricts access by device OS and IP subnet.
condition = {
"devicePolicy": {
"osType": "[1]"
},
"ipSubnetworks": ["[2]"]
}The device OS type is set to IOS and the IP subnet restricts access to 10.1.0.0/16 network.
Fill all three blanks to define an Access Level with title, description, and a condition requiring a specific member.
access_level = {
"title": "[1]",
"description": "[2]",
"basic": {
"conditions": [
{
"members": ["[3]"]
}
]
}
}The Access Level is titled "Remote Access", described as "Access for remote employees", and restricts members to "user:bob@example.com".