Result Types
WebhookModel
Represents a webhook within a project, detailing its configuration and status.
Applicable Functions
project.batch.webhooks.create()
project.batch.webhooks.list()
project.batch.webhooks.get()
project.batch.webhooks.update()
project.batch.webhooks.update_secret()
Attributes
WebhookModel(
id='webhook_f7d8aec2-7e2b-4d2c-a103-c8dd575c29c7',
object='webhook',
project_id='proj_ca5fe71e7592bbcf7705ea36e4f29ed4',
name='aws-lambda',
endpoint='https://lambda-url.ap-southeast-1.on.aws/',
retries=WebhookRetries(
max_retries=3,
max_retry_delay=15000
),
create_date=1723633671620,
update_date=1723736909980
)
Name | Type | Description |
---|---|---|
id | str | The webhook ID as a string. |
object | str | Object type of the webhook. |
project_id | str | Identifier of the project associated with the webhook. |
name | str | Name of the webhook. |
endpoint | str | URL endpoint of the webhook. |
retries | WebhookRetries | Retry configuration for the webhook. |
create_date | int | Creation timestamp of the webhook, in milliseconds. |
update_date | int | Last updated timestamp of the webhook, in milliseconds. |
WebhookRetries
Represents the retry configuration of a webhook.
Attributes
WebhookRetries(
max_retries=3,
max_retry_delay=15000
)
Name | Type | Description |
---|---|---|
max_retries | int | Maximum number of retries to send prediction results to the specified endpoint. Defaults to 3 . |
max_retry_delay | int | Maximum delay time between retries (in milliseconds). Defaults to 15000 . |
WebhookTestResponse
Represents the response data of a webhook test to send a sample payload to a specified endpoint URL.
Applicable Functions
Attributes
WebhookTestResponse(
status='Ok',
response_code=204,
latency_ms=648,
attempt_count=1,
body=None,
reason=None
)
Name | Type | Description |
---|---|---|
status | str | Status of the webhook test |
response_code | int | Response code of the webhook test. |
latency_ms | int | Latency of the webhook test, in milliseconds. |
attempt_count | int | Number of attempts made to test the webhook for a successful response. |
body | Optional[str] | Body of the webhook test response, if any. |
Dataset
Represents a batch dataset within a project, detailing its configuration and status.
Applicable Functions
project.batch.datasets.create()
project.batch.datasets.list()
project.batch.datasets.get()
project.batch.datasets.wait_until_done()
Attributes
Dataset(
id='dataset_652ef566-af5c-4d52-b1e4-ec8ec6dc4b8e',
object='dataset',
name='my-dataset-08-19',
project_id='proj_ca5fe71e7592bbcf7705ea36e4f29ed4',
expiry_time=1724561116000,
status=DatasetStatus(
overview='Uploaded',
message='Uploaded Dataset',
update_time=1723697121735,
source=DatasetSource(
kind='UploadedNewlineDelimitedJsonFile',
upload_url=DatasetUploadUrl(
method='PUT',
url='',
headers=[
'content-length',
'x-goog-hash',
'x-goog-meta-datature-dataset-link',
'x-goog-if-generation-match',
'content-type'
],
expires_at_time=1723740318174
)
),
item_count=50
),
create_date=1723697118174,
update_date=1723697121774
)
Name | Type | Description |
---|---|---|
id | str | Dataset ID as a string. |
object | str | Object type of the dataset. |
name | str | Name of the dataset. |
project_id | str | Identifier of the project associated with the dataset. |
expiry_time | str | Expiry timestamp of the dataset, in milliseconds. |
status | DatasetStatus | Status object of the dataset. |
create_date | int | Creation timestamp of the dataset, in milliseconds. |
update_date | int | Last updated timestamp of the dataset, in milliseconds. |
DatasetStatus
Represents the item status statistics of a batch dataset.
Attributes
DatasetStatus(
overview='Uploaded',
message='Uploaded Dataset',
update_time=1723697121735,
source=DatasetSource(
kind='UploadedNewlineDelimitedJsonFile',
upload_url=DatasetUploadUrl(
method='PUT',
url='',
headers=[
'content-length',
'x-goog-hash',
'x-goog-meta-datature-dataset-link',
'x-goog-if-generation-match',
'content-type'
],
expires_at_time=1723740318174
)
),
item_count=50
)
Name | Type | Description |
---|---|---|
overview | str | Overview of the dataset status. |
message | str | Status message providing additional information. |
update_time | int | Timestamp of the last update to the dataset status (in milliseconds). |
source | DatasetSource | Dataset source. Used internally to automatically upload dataset SignedURL items into a GCS bucket. |
item_count | int | Total number of items in the dataset. |
Job
Represents a batch job within a project, detailing its configuration and status.
Applicable Functions
project.batch.jobs.create()
project.batch.jobs.list()
project.batch.jobs.get()
project.batch.jobs.cancel()
project.batch.jobs.wait_until_done()
Attributes
Job(
id='batchjob_4e5566d0-6538-441a-9fa5-f3495516646a',
object='batch_job',
name='my-batch-job-08-15',
project_id='proj_ca5fe71e7592bbcf7705ea36e4f29ed4',
spec=JobSpec(
start_at_time=1723734419985,
stop_at_time=1723993619985,
dataset_id='dataset_652ef566-af5c-4d52-b1e4-ec8ec6dc4b8e',
result_delivery=ResultDelivery(
destinations=[Webhook(
webhook_id='webhook_ed981529-0160-4704-8794-e7702a8de470'
)]
),
deployment=ExistingDeployment(
deployment_id='deploy_3286bd71-9a8b-42bb-8ba6-c07549b81367'
),
),
status=JobStatus(
overview='Waiting',
message='Waiting',
update_date=1723734509417,
items=JobItemStatus(
gathered=50,
failed_gather=0,
preprocessed=0,
failed_process=0,
predicted=0,
failed_predict=0,
delivered=0,
failed_deliver=0
),
reason=None
),
create_date=1723734419985,
update_date=1723734509434
)
Name | Type | Description |
---|---|---|
id | str | Batch job ID as a string. |
object | str | Object type of the batch job. |
name | str | Name of the batch job. |
project_id | str | Identifier of the project associated with the batch job. |
spec | JobSpec | Configuration object of the batch job. |
status | JobStatus | Status object of the batch job. |
create_date | int | Creation timestamp of the batch job, in milliseconds. |
JobSpec
Represents the configuration of a batch job.
Attributes
JobSpec(
start_at_time=1723734419985,
stop_at_time=1723993619985,
dataset_id='dataset_652ef566-af5c-4d52-b1e4-ec8ec6dc4b8e',
result_delivery=ResultDelivery(
destinations=[Webhook(
webhook_id='webhook_ed981529-0160-4704-8794-e7702a8de470'
)]
),
deployment=ExistingDeployment(
deployment_id='deploy_3286bd71-9a8b-42bb-8ba6-c07549b81367'
),
)
Name | Type | Description |
---|---|---|
start_at_time | int | Start timestamp of the job, in milliseconds. |
stop_at_time | int | Stop timestamp of the job, in milliseconds. |
dataset_id | str | Dataset ID associated with the batch job. |
result_delivery | ResultDelivery | Result delivery configuration for the batch job. |
deployment | NewEphemeralDeployment | ExistingDeployment | Deployment configuration for the batch job. |
ResultDelivery
Result delivery configuration for a batch job.
Attributes
ResultDelivery(
destinations=[Webhook(
webhook_id='webhook_ed981529-0160-4704-8794-e7702a8de470'
)]
)
Name | Type | Description |
---|---|---|
destinations | List[Webhook] | List of result destinations. Currently only supports webhooks. |
NewEphemeralDeployment
Represents the configuration of a new temporary deployment created for a batch job.
Attributes
NewEphemeralDeployment(
template=Deployment(
id='deploy_1c144673-c757-40b4-8eeb-d400f0b9b2f9',
name='My API',
project_id='proj_cd067221d5a6e4007ccbb4afb5966535',
artifact_id='artifact_65a7678a91afa7d22455c5ba',
version_tag='v1.0.0',
history_versions=[
DeploymentHistoryVersion(
version_tag='v1.0.0',
artifact_id='artifact_65a7678a91afa7d22455c5ba',
update_date=1705475663570
)
],
resources=DeploymentResources(
cpu=4,
ram=8192,
GPU_T4=None
),
scaling=DeploymentScaling(
replicas=1,
mode='FixedReplicaCount'
),
status=DeploymentStatus(
overview='Available',
message='Created service successfully',
update_data=1705475727032
),
create_date=1705475663570,
update_date=1705475727051,
url='https://asia-inference.nip.io/1c144673-c757-40b4-8eeb-d400f0b9b2f9'
)
)
Name | Type | Description |
---|---|---|
template | Deployment | Deployment configuration for the batch job. |
ExistingDeployment
Represents the configuration of an existing deployment.
Attributes
ExistingDeployment(
deployment_id='deploy_3286bd71-9a8b-42bb-8ba6-c07549b81367'
)
Name | Type | Description |
---|---|---|
deployment_id | str | ID of the existing deployment. To retrieve more information on the deployment, run project.deployments.get(DEPLOYMENT_ID) . |
JobStatus
Represents the job-level and item-level status statistics of a batch job.
Attributes
JobStatus(
overview='Waiting',
message='Waiting',
update_date=1723734509417,
items=JobItemStatus(
gathered=50,
failed_gather=0,
preprocessed=0,
failed_process=0,
predicted=0,
failed_predict=0,
delivered=0,
failed_deliver=0
),
reason=None
)
Name | Type | Description |
---|---|---|
overview | str | Overview of the batch job status. |
message | str | Status message providing additional information about the batch job. |
update_date | int | Last update timestamp of the job status, in milliseconds. |
items | JobItemStatus | Status object containing item-level statistics. |
reason | Optional[str] | Reason for the error in the job status, if any. Defaults to None . |
cancelled_at | Optional[int] | Timestamp when the job was cancelled (in milliseconds), if any. Defaults to None . |
JobItemStatus
Represents the item-level status statistic of a batch job.
Attributes
JobItemStatus(
gathered=50,
failed_gather=0,
preprocessed=0,
failed_process=0,
predicted=0,
failed_predict=0,
delivered=0,
failed_deliver=0
)
Name | Type | Description |
---|---|---|
gathered | int | Number of dataset items that have successfully been retrieved and downloaded. |
failed_gather | int | Number of dataset items that have failed to be retrieved and downloaded. |
preprocessed | int | Number of dataset items that have successfully been processed. |
failed_process | int | Number of dataset items that have failed to be processed. |
predicted | int | Number of dataset items that the deployed model has successfully run predictions on. |
failed_predict | int | Number of dataset items that the deployed model has failed to run predictions on. |
delivered | int | Number of dataset items where the prediction results have successfully been delivered to the webhook endpoint URL. |
failed_deliver | int | Number of dataset items where the prediction results have failed to be delivered to the webhook endpoint URL. |
JobLogs
Represnts the log entries of a batch job.
Applicable Functions
Attributes
JobLogs(
id='batchjoblog_3d561cfa-9a53-4eb3-81c1-4193ae27f4fc',
object='batch_job_log',
project_id='proj_ca5fe71e7592bbcf7705ea36e4f29ed4',
entries=[
JobLogEntry(
kind='ItemPredicted',
create_time=1723080300011,
id='1e0ad7896a4aa2dd47eda727',
level='Info',
item='https://my-endpoint.url/blood_cell/36.jpg',
status='Delivered',
time_ms=9819.226,
reason=''
)
]
)
Name | Type | Description |
---|---|---|
id | str | Batch job ID as a string. |
object | str | Object type of the batch job. |
project_id | str | Identifier of the project associated with the batch job. |
entries | List[JobLogEntry] | List of log entries for the batch job. |
JobLogEntry
Represents a single log entry of a batch job.
Attributes
JobLogEntry(
kind='ItemPredicted',
create_time=1723080300011,
id='1e0ad7896a4aa2dd47eda727',
level='Info',
item='https://my-endpoint.url/blood_cell/36.jpg',
status='Delivered',
time_ms=9819.226,
reason=''
)
Name | Type | Description |
---|---|---|
kind | str | Type of log entry. |
create_time | int | Creation timestamp of the log entry, in milliseconds. |
id | str | Log entry ID. |
level | str | Severity level of the log entry. |
item | str | Dataset item associated with the log entry. |
status | str | Status of the log entry. |
time_ms | int | Time taken for the event described by the log entry, in milliseconds. |
reason | Optional[str] | Reason for the error in the log entry, if any. Defaults to None . |
Updated 4 months ago