Skip to content

Latest commit

 

History

History
592 lines (432 loc) · 16 KB

File metadata and controls

592 lines (432 loc) · 16 KB

Schedule

Method HTTP request
create POST /v2/orchestration/schedules
delete DELETE /v2/orchestration/schedules/{scheduleRid}
get GET /v2/orchestration/schedules/{scheduleRid}
pause POST /v2/orchestration/schedules/{scheduleRid}/pause
replace PUT /v2/orchestration/schedules/{scheduleRid}
run POST /v2/orchestration/schedules/{scheduleRid}/run
runs GET /v2/orchestration/schedules/{scheduleRid}/runs
runs_page GET /v2/orchestration/schedules/{scheduleRid}/runs
unpause POST /v2/orchestration/schedules/{scheduleRid}/unpause

create

Creates a new Schedule.

Parameters

Name Type Description Notes
action CreateScheduleRequestActionDict
description Optional[str] [optional]
display_name Optional[str] [optional]
preview Optional[PreviewMode] preview [optional]
scope_mode Optional[CreateScheduleRequestScopeModeDict] [optional]
trigger Optional[TriggerDict] The schedule trigger. If the requesting user does not have permission to see the trigger, this will be empty. [optional]

Return type

Schedule

Example

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

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

# CreateScheduleRequestActionDict |
action = {
    "abortOnFailure": False,
    "forceBuild": False,
    "retryBackoffDuration": {"unit": "SECONDS", "value": 30},
    "retryCount": 1,
    "fallbackBranches": [],
    "branchName": "master",
    "notificationsEnabled": False,
    "target": {
        "type": "manual",
        "targetRids": [
            "ri.foundry.main.dataset.b737e24d-6b19-43aa-93d5-da9fc4073f6e",
            "ri.foundry.main.dataset.d2452a94-a755-4778-8bfc-a315ab52fc43",
        ],
    },
}
# Optional[str] |
description = "Run all the transforms at midnight"
# Optional[str] |
display_name = "My Daily Schedule"
# Optional[PreviewMode] | preview
preview = None
# Optional[CreateScheduleRequestScopeModeDict] |
scope_mode = {"type": "user"}
# Optional[TriggerDict] | The schedule trigger. If the requesting user does not have permission to see the trigger, this will be empty.
trigger = {"type": "time", "cronExpression": "0 0 * * *", "timeZone": "UTC"}


try:
    api_response = foundry_client.orchestration.Schedule.create(
        action=action,
        description=description,
        display_name=display_name,
        preview=preview,
        scope_mode=scope_mode,
        trigger=trigger,
    )
    print("The create response:\n")
    pprint(api_response)
except foundry.PalantirRPCException as e:
    print("HTTP error when calling Schedule.create: %s\n" % e)

Authorization

See README

HTTP response details

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

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

delete

Delete the Schedule with the specified rid.

Parameters

Name Type Description Notes
schedule_rid ScheduleRid scheduleRid
preview Optional[PreviewMode] preview [optional]

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"
)

# ScheduleRid | scheduleRid
schedule_rid = None
# Optional[PreviewMode] | preview
preview = None


try:
    api_response = foundry_client.orchestration.Schedule.delete(
        schedule_rid,
        preview=preview,
    )
    print("The delete response:\n")
    pprint(api_response)
except foundry.PalantirRPCException as e:
    print("HTTP error when calling Schedule.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 the Schedule with the specified rid.

Parameters

Name Type Description Notes
schedule_rid ScheduleRid scheduleRid
preview Optional[PreviewMode] preview [optional]

Return type

Schedule

Example

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

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

# ScheduleRid | scheduleRid
schedule_rid = None
# Optional[PreviewMode] | preview
preview = None


try:
    api_response = foundry_client.orchestration.Schedule.get(
        schedule_rid,
        preview=preview,
    )
    print("The get response:\n")
    pprint(api_response)
except foundry.PalantirRPCException as e:
    print("HTTP error when calling Schedule.get: %s\n" % e)

Authorization

See README

HTTP response details

Status Code Type Description Content Type
200 Schedule application/json

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

pause

Parameters

Name Type Description Notes
schedule_rid ScheduleRid scheduleRid
preview Optional[PreviewMode] preview [optional]

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"
)

# ScheduleRid | scheduleRid
schedule_rid = None
# Optional[PreviewMode] | preview
preview = None


try:
    api_response = foundry_client.orchestration.Schedule.pause(
        schedule_rid,
        preview=preview,
    )
    print("The pause response:\n")
    pprint(api_response)
except foundry.PalantirRPCException as e:
    print("HTTP error when calling Schedule.pause: %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]

replace

Replace the Schedule with the specified rid.

Parameters

Name Type Description Notes
schedule_rid ScheduleRid scheduleRid
action ReplaceScheduleRequestActionDict
description Optional[str] [optional]
display_name Optional[str] [optional]
preview Optional[PreviewMode] preview [optional]
scope_mode Optional[ReplaceScheduleRequestScopeModeDict] [optional]
trigger Optional[TriggerDict] The schedule trigger. If the requesting user does not have permission to see the trigger, this will be empty. [optional]

Return type

Schedule

Example

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

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

# ScheduleRid | scheduleRid
schedule_rid = None
# ReplaceScheduleRequestActionDict |
action = {
    "abortOnFailure": False,
    "forceBuild": False,
    "retryBackoffDuration": {"unit": "SECONDS", "value": 30},
    "retryCount": 1,
    "fallbackBranches": [],
    "branchName": "master",
    "notificationsEnabled": False,
    "target": {
        "type": "manual",
        "targetRids": [
            "ri.foundry.main.dataset.b737e24d-6b19-43aa-93d5-da9fc4073f6e",
            "ri.foundry.main.dataset.d2452a94-a755-4778-8bfc-a315ab52fc43",
        ],
    },
}
# Optional[str] |
description = "Run all the transforms at midnight"
# Optional[str] |
display_name = "My Daily Schedule"
# Optional[PreviewMode] | preview
preview = None
# Optional[ReplaceScheduleRequestScopeModeDict] |
scope_mode = {"type": "user"}
# Optional[TriggerDict] | The schedule trigger. If the requesting user does not have permission to see the trigger, this will be empty.
trigger = {"type": "time", "cronExpression": "0 0 * * *", "timeZone": "UTC"}


try:
    api_response = foundry_client.orchestration.Schedule.replace(
        schedule_rid,
        action=action,
        description=description,
        display_name=display_name,
        preview=preview,
        scope_mode=scope_mode,
        trigger=trigger,
    )
    print("The replace response:\n")
    pprint(api_response)
except foundry.PalantirRPCException as e:
    print("HTTP error when calling Schedule.replace: %s\n" % e)

Authorization

See README

HTTP response details

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

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

run

Parameters

Name Type Description Notes
schedule_rid ScheduleRid scheduleRid
preview Optional[PreviewMode] preview [optional]

Return type

ScheduleRun

Example

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

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

# ScheduleRid | scheduleRid
schedule_rid = None
# Optional[PreviewMode] | preview
preview = None


try:
    api_response = foundry_client.orchestration.Schedule.run(
        schedule_rid,
        preview=preview,
    )
    print("The run response:\n")
    pprint(api_response)
except foundry.PalantirRPCException as e:
    print("HTTP error when calling Schedule.run: %s\n" % e)

Authorization

See README

HTTP response details

Status Code Type Description Content Type
200 ScheduleRun application/json

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

runs

Get the most recent runs of a Schedule. If no page size is provided, a page size of 100 will be used.

Parameters

Name Type Description Notes
schedule_rid ScheduleRid scheduleRid
page_size Optional[PageSize] pageSize [optional]
page_token Optional[PageToken] pageToken [optional]
preview Optional[PreviewMode] preview [optional]

Return type

ResourceIterator[ScheduleRun]

Example

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

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

# ScheduleRid | scheduleRid
schedule_rid = None
# Optional[PageSize] | pageSize
page_size = None
# Optional[PageToken] | pageToken
page_token = None
# Optional[PreviewMode] | preview
preview = None


try:
    for schedule in foundry_client.orchestration.Schedule.runs(
        schedule_rid,
        page_size=page_size,
        page_token=page_token,
        preview=preview,
    ):
        pprint(schedule)
except foundry.PalantirRPCException as e:
    print("HTTP error when calling Schedule.runs: %s\n" % e)

Authorization

See README

HTTP response details

Status Code Type Description Content Type
200 ListRunsOfScheduleResponse application/json

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

runs_page

Get the most recent runs of a Schedule. If no page size is provided, a page size of 100 will be used.

Parameters

Name Type Description Notes
schedule_rid ScheduleRid scheduleRid
page_size Optional[PageSize] pageSize [optional]
page_token Optional[PageToken] pageToken [optional]
preview Optional[PreviewMode] preview [optional]

Return type

ListRunsOfScheduleResponse

Example

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

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

# ScheduleRid | scheduleRid
schedule_rid = None
# Optional[PageSize] | pageSize
page_size = None
# Optional[PageToken] | pageToken
page_token = None
# Optional[PreviewMode] | preview
preview = None


try:
    api_response = foundry_client.orchestration.Schedule.runs_page(
        schedule_rid,
        page_size=page_size,
        page_token=page_token,
        preview=preview,
    )
    print("The runs_page response:\n")
    pprint(api_response)
except foundry.PalantirRPCException as e:
    print("HTTP error when calling Schedule.runs_page: %s\n" % e)

Authorization

See README

HTTP response details

Status Code Type Description Content Type
200 ListRunsOfScheduleResponse application/json

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

unpause

Parameters

Name Type Description Notes
schedule_rid ScheduleRid scheduleRid
preview Optional[PreviewMode] preview [optional]

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"
)

# ScheduleRid | scheduleRid
schedule_rid = None
# Optional[PreviewMode] | preview
preview = None


try:
    api_response = foundry_client.orchestration.Schedule.unpause(
        schedule_rid,
        preview=preview,
    )
    print("The unpause response:\n")
    pprint(api_response)
except foundry.PalantirRPCException as e:
    print("HTTP error when calling Schedule.unpause: %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]