Skip to content

Latest commit

 

History

History
275 lines (187 loc) · 8.94 KB

File metadata and controls

275 lines (187 loc) · 8.94 KB

Marking

Method HTTP request Release Stage
create POST /v2/admin/markings Stable
get GET /v2/admin/markings/{markingId} Stable
get_batch POST /v2/admin/markings/getBatch Stable
list GET /v2/admin/markings Stable
replace PUT /v2/admin/markings/{markingId} Stable

create

Creates a new Marking.

Parameters

Name Type Description Notes
category_id MarkingCategoryId
initial_members List[PrincipalId] Users and Groups that will be able to view resources protected by this Marking. This can be changed later through the MarkingMember operations.
initial_role_assignments List[MarkingRoleUpdate] The initial roles that will be assigned when the Marking is created. At least one ADMINISTER role must be provided. This can be changed later through the MarkingRoleAssignment operations. WARNING: If you do not include your own principal ID or the ID of a Group that you are a member of, you will create a Marking that you cannot administer.
name MarkingName
description Optional[str] [optional]

Return type

Marking

Example

from foundry_sdk import FoundryClient
import foundry_sdk
from pprint import pprint

client = FoundryClient(auth=foundry_sdk.UserTokenAuth(...), hostname="example.palantirfoundry.com")

# MarkingCategoryId
category_id = "0950264e-01c8-4e83-81a9-1a6b7f77621a"
# List[PrincipalId] | Users and Groups that will be able to view resources protected by this Marking. This can be changed later through the MarkingMember operations.
initial_members = ["f05f8da4-b84c-4fca-9c77-8af0b13d11de"]
# List[MarkingRoleUpdate] | The initial roles that will be assigned when the Marking is created. At least one ADMINISTER role must be provided. This can be changed later through the MarkingRoleAssignment operations.  WARNING: If you do not include your own principal ID or the ID of a Group that you are a member of, you will create a Marking that you cannot administer.
initial_role_assignments = [
    {"role": "ADMINISTER", "principalId": "f05f8da4-b84c-4fca-9c77-8af0b13d11de"}
]
# MarkingName
name = "PII"
# Optional[str]
description = "Contains personally identifiable information about our customers"


try:
    api_response = client.admin.Marking.create(
        category_id=category_id,
        initial_members=initial_members,
        initial_role_assignments=initial_role_assignments,
        name=name,
        description=description,
    )
    print("The create response:\n")
    pprint(api_response)
except foundry_sdk.PalantirRPCException as e:
    print("HTTP error when calling Marking.create: %s\n" % e)

Authorization

See README

HTTP response details

Status Code Type Description Content Type
200 Marking The created Marking application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get

Get the Marking with the specified id.

Parameters

Name Type Description Notes
marking_id MarkingId

Return type

Marking

Example

from foundry_sdk import FoundryClient
import foundry_sdk
from pprint import pprint

client = FoundryClient(auth=foundry_sdk.UserTokenAuth(...), hostname="example.palantirfoundry.com")

# MarkingId
marking_id = None


try:
    api_response = client.admin.Marking.get(marking_id)
    print("The get response:\n")
    pprint(api_response)
except foundry_sdk.PalantirRPCException as e:
    print("HTTP error when calling Marking.get: %s\n" % e)

Authorization

See README

HTTP response details

Status Code Type Description Content Type
200 Marking application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_batch

Execute multiple get requests on Marking.

The maximum batch size for this endpoint is 500.

Parameters

Name Type Description Notes
body List[GetMarkingsBatchRequestElement] Body of the request

Return type

GetMarkingsBatchResponse

Example

from foundry_sdk import FoundryClient
import foundry_sdk
from pprint import pprint

client = FoundryClient(auth=foundry_sdk.UserTokenAuth(...), hostname="example.palantirfoundry.com")

# List[GetMarkingsBatchRequestElement] | Body of the request
body = [{"markingId": "18212f9a-0e63-4b79-96a0-aae04df23336"}]


try:
    api_response = client.admin.Marking.get_batch(body)
    print("The get_batch response:\n")
    pprint(api_response)
except foundry_sdk.PalantirRPCException as e:
    print("HTTP error when calling Marking.get_batch: %s\n" % e)

Authorization

See README

HTTP response details

Status Code Type Description Content Type
200 GetMarkingsBatchResponse application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

list

Maximum page size 100.

Parameters

Name Type Description Notes
page_size Optional[PageSize] The page size to use for the endpoint. [optional]
page_token Optional[PageToken] The page token indicates where to start paging. This should be omitted from the first page's request. To fetch the next page, clients should take the value from the nextPageToken field of the previous response and use it to populate the pageToken field of the next request. [optional]

Return type

ListMarkingsResponse

Example

from foundry_sdk import FoundryClient
import foundry_sdk
from pprint import pprint

client = FoundryClient(auth=foundry_sdk.UserTokenAuth(...), hostname="example.palantirfoundry.com")

# Optional[PageSize] | The page size to use for the endpoint.
page_size = None
# Optional[PageToken] | The page token indicates where to start paging. This should be omitted from the first page's request. To fetch the next page, clients should take the value from the `nextPageToken` field of the previous response and use it to populate the `pageToken` field of the next request.
page_token = None


try:
    for marking in client.admin.Marking.list(page_size=page_size, page_token=page_token):
        pprint(marking)
except foundry_sdk.PalantirRPCException as e:
    print("HTTP error when calling Marking.list: %s\n" % e)

Authorization

See README

HTTP response details

Status Code Type Description Content Type
200 ListMarkingsResponse application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

replace

Replace the Marking with the specified id.

Parameters

Name Type Description Notes
marking_id MarkingId
name MarkingName
description Optional[str] [optional]

Return type

Marking

Example

from foundry_sdk import FoundryClient
import foundry_sdk
from pprint import pprint

client = FoundryClient(auth=foundry_sdk.UserTokenAuth(...), hostname="example.palantirfoundry.com")

# MarkingId
marking_id = None
# MarkingName
name = "PII"
# Optional[str]
description = "Contains personally identifiable information about our customers"


try:
    api_response = client.admin.Marking.replace(marking_id, name=name, description=description)
    print("The replace response:\n")
    pprint(api_response)
except foundry_sdk.PalantirRPCException as e:
    print("HTTP error when calling Marking.replace: %s\n" % e)

Authorization

See README

HTTP response details

Status Code Type Description Content Type
200 Marking The replaced Marking application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]