Method | HTTP request |
---|---|
add | POST /v2/admin/markings/{markingId}/roleAssignments/add |
list | GET /v2/admin/markings/{markingId}/roleAssignments |
page | GET /v2/admin/markings/{markingId}/roleAssignments |
remove | POST /v2/admin/markings/{markingId}/roleAssignments/remove |
Name | Type | Description | Notes |
---|---|---|---|
marking_id | MarkingId | markingId | |
role_assignments | List[MarkingRoleUpdateDict] | ||
preview | Optional[PreviewMode] | preview | [optional] |
None
from foundry.v2 import FoundryClient
import foundry
from pprint import pprint
foundry_client = FoundryClient(
auth=foundry.UserTokenAuth(...), hostname="example.palantirfoundry.com"
)
# MarkingId | markingId
marking_id = None
# List[MarkingRoleUpdateDict] |
role_assignments = [{"role": "ADMINISTER", "principalId": "f05f8da4-b84c-4fca-9c77-8af0b13d11de"}]
# Optional[PreviewMode] | preview
preview = None
try:
api_response = foundry_client.admin.Marking.MarkingRoleAssignment.add(
marking_id,
role_assignments=role_assignments,
preview=preview,
)
print("The add response:\n")
pprint(api_response)
except foundry.PalantirRPCException as e:
print("HTTP error when calling MarkingRoleAssignment.add: %s\n" % e)
See README
Status Code | Type | Description | Content Type |
---|---|---|---|
204 | None | None |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
List all principals who are assigned a role for the given Marking. Ignores the pageSize
parameter.
Name | Type | Description | Notes |
---|---|---|---|
marking_id | MarkingId | markingId | |
page_size | Optional[PageSize] | pageSize | [optional] |
page_token | Optional[PageToken] | pageToken | [optional] |
preview | Optional[PreviewMode] | preview | [optional] |
ResourceIterator[MarkingRoleAssignment]
from foundry.v2 import FoundryClient
import foundry
from pprint import pprint
foundry_client = FoundryClient(
auth=foundry.UserTokenAuth(...), hostname="example.palantirfoundry.com"
)
# MarkingId | markingId
marking_id = None
# Optional[PageSize] | pageSize
page_size = None
# Optional[PageToken] | pageToken
page_token = None
# Optional[PreviewMode] | preview
preview = None
try:
for marking_role_assignment in foundry_client.admin.Marking.MarkingRoleAssignment.list(
marking_id,
page_size=page_size,
page_token=page_token,
preview=preview,
):
pprint(marking_role_assignment)
except foundry.PalantirRPCException as e:
print("HTTP error when calling MarkingRoleAssignment.list: %s\n" % e)
See README
Status Code | Type | Description | Content Type |
---|---|---|---|
200 | ListMarkingRoleAssignmentsResponse | application/json |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
List all principals who are assigned a role for the given Marking. Ignores the pageSize
parameter.
Name | Type | Description | Notes |
---|---|---|---|
marking_id | MarkingId | markingId | |
page_size | Optional[PageSize] | pageSize | [optional] |
page_token | Optional[PageToken] | pageToken | [optional] |
preview | Optional[PreviewMode] | preview | [optional] |
ListMarkingRoleAssignmentsResponse
from foundry.v2 import FoundryClient
import foundry
from pprint import pprint
foundry_client = FoundryClient(
auth=foundry.UserTokenAuth(...), hostname="example.palantirfoundry.com"
)
# MarkingId | markingId
marking_id = None
# Optional[PageSize] | pageSize
page_size = None
# Optional[PageToken] | pageToken
page_token = None
# Optional[PreviewMode] | preview
preview = None
try:
api_response = foundry_client.admin.Marking.MarkingRoleAssignment.page(
marking_id,
page_size=page_size,
page_token=page_token,
preview=preview,
)
print("The page response:\n")
pprint(api_response)
except foundry.PalantirRPCException as e:
print("HTTP error when calling MarkingRoleAssignment.page: %s\n" % e)
See README
Status Code | Type | Description | Content Type |
---|---|---|---|
200 | ListMarkingRoleAssignmentsResponse | application/json |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Name | Type | Description | Notes |
---|---|---|---|
marking_id | MarkingId | markingId | |
role_assignments | List[MarkingRoleUpdateDict] | ||
preview | Optional[PreviewMode] | preview | [optional] |
None
from foundry.v2 import FoundryClient
import foundry
from pprint import pprint
foundry_client = FoundryClient(
auth=foundry.UserTokenAuth(...), hostname="example.palantirfoundry.com"
)
# MarkingId | markingId
marking_id = None
# List[MarkingRoleUpdateDict] |
role_assignments = [{"role": "ADMINISTER", "principalId": "f05f8da4-b84c-4fca-9c77-8af0b13d11de"}]
# Optional[PreviewMode] | preview
preview = None
try:
api_response = foundry_client.admin.Marking.MarkingRoleAssignment.remove(
marking_id,
role_assignments=role_assignments,
preview=preview,
)
print("The remove response:\n")
pprint(api_response)
except foundry.PalantirRPCException as e:
print("HTTP error when calling MarkingRoleAssignment.remove: %s\n" % e)
See README
Status Code | Type | Description | Content Type |
---|---|---|---|
204 | None | None |
[Back to top] [Back to API list] [Back to Model list] [Back to README]