Skip to content

Latest commit

 

History

History
301 lines (209 loc) · 7.42 KB

File metadata and controls

301 lines (209 loc) · 7.42 KB

Branch

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

create

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

Parameters

Name Type Description Notes
dataset_rid DatasetRid datasetRid
name BranchName
transaction_rid Optional[TransactionRid] [optional]

Return type

Branch

Example

from foundry.v2 import FoundryClient
import foundry
from pprint import pprint

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

# DatasetRid | datasetRid
dataset_rid = None
# BranchName |
name = "master"
# Optional[TransactionRid] |
transaction_rid = "ri.foundry.main.transaction.0a0207cb-26b7-415b-bc80-66a3aa3933f4"


try:
    api_response = foundry_client.datasets.Dataset.Branch.create(
        dataset_rid,
        name=name,
        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 The created Branch application/json

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

delete

Deletes the Branch with the given BranchName.

Parameters

Name Type Description Notes
dataset_rid DatasetRid datasetRid
branch_name BranchName branchName

Return type

None

Example

from foundry.v2 import FoundryClient
import foundry
from pprint import pprint

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

# DatasetRid | datasetRid
dataset_rid = None
# BranchName | branchName
branch_name = None


try:
    api_response = foundry_client.datasets.Dataset.Branch.delete(
        dataset_rid,
        branch_name,
    )
    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 None

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

get

Get a Branch of a Dataset.

Parameters

Name Type Description Notes
dataset_rid DatasetRid datasetRid
branch_name BranchName branchName

Return type

Branch

Example

from foundry.v2 import FoundryClient
import foundry
from pprint import pprint

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

# DatasetRid | datasetRid
dataset_rid = None
# BranchName | branchName
branch_name = None


try:
    api_response = foundry_client.datasets.Dataset.Branch.get(
        dataset_rid,
        branch_name,
    )
    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.

Parameters

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

Return type

ResourceIterator[Branch]

Example

from foundry.v2 import FoundryClient
import foundry
from pprint import pprint

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

# DatasetRid | datasetRid
dataset_rid = None
# Optional[PageSize] | pageSize
page_size = None
# Optional[PageToken] | pageToken
page_token = None


try:
    for branch in foundry_client.datasets.Dataset.Branch.list(
        dataset_rid,
        page_size=page_size,
        page_token=page_token,
    ):
        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.

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.v2 import FoundryClient
import foundry
from pprint import pprint

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

# DatasetRid | datasetRid
dataset_rid = None
# 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]