Skip to content

Latest commit

 

History

History
307 lines (210 loc) · 8.09 KB

File metadata and controls

307 lines (210 loc) · 8.09 KB

Branch

Method HTTP request
create POST /v1/datasets/{datasetRid}/branches
delete DELETE /v1/datasets/{datasetRid}/branches/{branchId}
get GET /v1/datasets/{datasetRid}/branches/{branchId}
list GET /v1/datasets/{datasetRid}/branches
page GET /v1/datasets/{datasetRid}/branches

create

Creates a branch on an existing dataset. A branch may optionally point to a (committed) transaction.

Third-party applications using this endpoint via OAuth2 must request the following operation scope: api:datasets-write.

Parameters

Name Type Description Notes
dataset_rid DatasetRid datasetRid
branch_id BranchId
transaction_rid Optional[TransactionRid] [optional]

Return type

Branch

Example

from foundry.v1 import FoundryClient
import foundry
from pprint import pprint

foundry_client = FoundryClient(
    auth=foundry.UserTokenAuth(...), hostname="example.palantirfoundry.com"
)

# DatasetRid | datasetRid
dataset_rid = "ri.foundry.main.dataset.c26f11c8-cdb3-4f44-9f5d-9816ea1c82da"
# BranchId |
branch_id = "my-branch"
# Optional[TransactionRid] |
transaction_rid = None


try:
    api_response = foundry_client.datasets.Dataset.Branch.create(
        dataset_rid,
        branch_id=branch_id,
        transaction_rid=transaction_rid,
    )
    print("The create response:\n")
    pprint(api_response)
except foundry.PalantirRPCException as e:
    print("HTTP error when calling Branch.create: %s\n" % e)

Authorization

See README

HTTP response details

Status Code Type Description Content Type
200 Branch application/json

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

delete

Deletes the Branch with the given BranchId.

Third-party applications using this endpoint via OAuth2 must request the following operation scope: api:datasets-write.

Parameters

Name Type Description Notes
dataset_rid DatasetRid datasetRid
branch_id BranchId branchId

Return type

None

Example

from foundry.v1 import FoundryClient
import foundry
from pprint import pprint

foundry_client = FoundryClient(
    auth=foundry.UserTokenAuth(...), hostname="example.palantirfoundry.com"
)

# DatasetRid | datasetRid
dataset_rid = "ri.foundry.main.dataset.c26f11c8-cdb3-4f44-9f5d-9816ea1c82da"
# BranchId | branchId
branch_id = "my-branch"


try:
    api_response = foundry_client.datasets.Dataset.Branch.delete(
        dataset_rid,
        branch_id,
    )
    print("The delete response:\n")
    pprint(api_response)
except foundry.PalantirRPCException as e:
    print("HTTP error when calling Branch.delete: %s\n" % e)

Authorization

See README

HTTP response details

Status Code Type Description Content Type
204 None Branch deleted. None

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

get

Get a Branch of a Dataset.

Third-party applications using this endpoint via OAuth2 must request the following operation scope: api:datasets-read.

Parameters

Name Type Description Notes
dataset_rid DatasetRid datasetRid
branch_id BranchId branchId

Return type

Branch

Example

from foundry.v1 import FoundryClient
import foundry
from pprint import pprint

foundry_client = FoundryClient(
    auth=foundry.UserTokenAuth(...), hostname="example.palantirfoundry.com"
)

# DatasetRid | datasetRid
dataset_rid = "ri.foundry.main.dataset.c26f11c8-cdb3-4f44-9f5d-9816ea1c82da"
# BranchId | branchId
branch_id = "master"


try:
    api_response = foundry_client.datasets.Dataset.Branch.get(
        dataset_rid,
        branch_id,
    )
    print("The get response:\n")
    pprint(api_response)
except foundry.PalantirRPCException as e:
    print("HTTP error when calling Branch.get: %s\n" % e)

Authorization

See README

HTTP response details

Status Code Type Description Content Type
200 Branch application/json

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

list

Lists the Branches of a Dataset.

Third-party applications using this endpoint via OAuth2 must request the following operation scope: api:datasets-read.

Parameters

Name Type Description Notes
dataset_rid DatasetRid datasetRid
page_size Optional[PageSize] pageSize [optional]

Return type

ResourceIterator[Branch]

Example

from foundry.v1 import FoundryClient
import foundry
from pprint import pprint

foundry_client = FoundryClient(
    auth=foundry.UserTokenAuth(...), hostname="example.palantirfoundry.com"
)

# DatasetRid | datasetRid
dataset_rid = "ri.foundry.main.dataset.c26f11c8-cdb3-4f44-9f5d-9816ea1c82da"
# Optional[PageSize] | pageSize
page_size = None


try:
    for branch in foundry_client.datasets.Dataset.Branch.list(
        dataset_rid,
        page_size=page_size,
    ):
        pprint(branch)
except foundry.PalantirRPCException as e:
    print("HTTP error when calling Branch.list: %s\n" % e)

Authorization

See README

HTTP response details

Status Code Type Description Content Type
200 ListBranchesResponse application/json

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

page

Lists the Branches of a Dataset.

Third-party applications using this endpoint via OAuth2 must request the following operation scope: api:datasets-read.

Parameters

Name Type Description Notes
dataset_rid DatasetRid datasetRid
page_size Optional[PageSize] pageSize [optional]
page_token Optional[PageToken] pageToken [optional]

Return type

ListBranchesResponse

Example

from foundry.v1 import FoundryClient
import foundry
from pprint import pprint

foundry_client = FoundryClient(
    auth=foundry.UserTokenAuth(...), hostname="example.palantirfoundry.com"
)

# DatasetRid | datasetRid
dataset_rid = "ri.foundry.main.dataset.c26f11c8-cdb3-4f44-9f5d-9816ea1c82da"
# Optional[PageSize] | pageSize
page_size = None
# Optional[PageToken] | pageToken
page_token = None


try:
    api_response = foundry_client.datasets.Dataset.Branch.page(
        dataset_rid,
        page_size=page_size,
        page_token=page_token,
    )
    print("The page response:\n")
    pprint(api_response)
except foundry.PalantirRPCException as e:
    print("HTTP error when calling Branch.page: %s\n" % e)

Authorization

See README

HTTP response details

Status Code Type Description Content Type
200 ListBranchesResponse application/json

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