JobsApi

Method

HTTP request

Description

cancel_job

POST /jobs/{job-id}/cancel

Stops a specific job from running on the server.

count_pending_jobs

GET /jobs/pending/count

Counts the number of global, pending jobs on the server.

delete_job

DELETE /jobs/{job-id}

Deletes job.

get_job

GET /jobs/{job-id}

Lists jobs associated with the user.

list_jobs

GET /jobs

Lists jobs associated with the user.

cancel_job

JobDetails cancel_job(job_id)

Stops a specific job from running on the server.

Stops a specific job from running on the server.

Example

  • Bearer Authentication (bearerAuth):

import h2ogpte.rest
from h2ogpte.rest.models.job_details import JobDetails
from h2ogpte.rest.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://h2ogpte.genai.h2o.ai/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = h2ogpte.rest.Configuration(
    host = "https://h2ogpte.genai.h2o.ai/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: bearerAuth
configuration = h2ogpte.rest.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with h2ogpte.rest.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = h2ogpte.rest.JobsApi(api_client)
    job_id = 'job_id_example' # str | Id of the job

    try:
        # Stops a specific job from running on the server.
        api_response = api_instance.cancel_job(job_id)
        print("The response of JobsApi->cancel_job:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling JobsApi->cancel_job: %s\n" % e)

Parameters

Name

Type

Description

Notes

job_id

str

Id of the job

Return type

JobDetails

HTTP request headers

  • Content-Type: Not defined

  • Accept: application/json

HTTP response details

Status code

Description

Response headers

200

Successful operation

-

401

Unauthorized - Invalid or missing API key

-

count_pending_jobs

List[Count] count_pending_jobs()

Counts the number of global, pending jobs on the server.

Counts the number of global, pending jobs on the server.

Example

  • Bearer Authentication (bearerAuth):

import h2ogpte.rest
from h2ogpte.rest.models.count import Count
from h2ogpte.rest.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://h2ogpte.genai.h2o.ai/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = h2ogpte.rest.Configuration(
    host = "https://h2ogpte.genai.h2o.ai/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: bearerAuth
configuration = h2ogpte.rest.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with h2ogpte.rest.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = h2ogpte.rest.JobsApi(api_client)

    try:
        # Counts the number of global, pending jobs on the server.
        api_response = api_instance.count_pending_jobs()
        print("The response of JobsApi->count_pending_jobs:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling JobsApi->count_pending_jobs: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

List[Count]

HTTP request headers

  • Content-Type: Not defined

  • Accept: application/json

HTTP response details

Status code

Description

Response headers

200

Successful operation

-

401

Unauthorized - Invalid or missing API key

-

delete_job

delete_job(job_id)

Deletes job.

Deletes job with a given unique identifier.

Example

  • Bearer Authentication (bearerAuth):

import h2ogpte.rest
from h2ogpte.rest.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://h2ogpte.genai.h2o.ai/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = h2ogpte.rest.Configuration(
    host = "https://h2ogpte.genai.h2o.ai/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: bearerAuth
configuration = h2ogpte.rest.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with h2ogpte.rest.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = h2ogpte.rest.JobsApi(api_client)
    job_id = 'job_id_example' # str | Id of the job

    try:
        # Deletes job.
        api_instance.delete_job(job_id)
    except Exception as e:
        print("Exception when calling JobsApi->delete_job: %s\n" % e)

Parameters

Name

Type

Description

Notes

job_id

str

Id of the job

Return type

void (empty response body)

HTTP request headers

  • Content-Type: Not defined

  • Accept: application/json

HTTP response details

Status code

Description

Response headers

204

Successful operation

-

401

Unauthorized - Invalid or missing API key

-

get_job

JobDetails get_job(job_id)

Lists jobs associated with the user.

Lists jobs associated with the user calling this endpoint.

Example

  • Bearer Authentication (bearerAuth):

import h2ogpte.rest
from h2ogpte.rest.models.job_details import JobDetails
from h2ogpte.rest.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://h2ogpte.genai.h2o.ai/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = h2ogpte.rest.Configuration(
    host = "https://h2ogpte.genai.h2o.ai/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: bearerAuth
configuration = h2ogpte.rest.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with h2ogpte.rest.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = h2ogpte.rest.JobsApi(api_client)
    job_id = 'job_id_example' # str | Id of the job

    try:
        # Lists jobs associated with the user.
        api_response = api_instance.get_job(job_id)
        print("The response of JobsApi->get_job:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling JobsApi->get_job: %s\n" % e)

Parameters

Name

Type

Description

Notes

job_id

str

Id of the job

Return type

JobDetails

HTTP request headers

  • Content-Type: Not defined

  • Accept: application/json

HTTP response details

Status code

Description

Response headers

200

Successful operation

-

401

Unauthorized - Invalid or missing API key

-

list_jobs

List[JobDetails] list_jobs()

Lists jobs associated with the user.

Lists jobs associated with the user making call.

Example

  • Bearer Authentication (bearerAuth):

import h2ogpte.rest
from h2ogpte.rest.models.job_details import JobDetails
from h2ogpte.rest.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://h2ogpte.genai.h2o.ai/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = h2ogpte.rest.Configuration(
    host = "https://h2ogpte.genai.h2o.ai/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: bearerAuth
configuration = h2ogpte.rest.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with h2ogpte.rest.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = h2ogpte.rest.JobsApi(api_client)

    try:
        # Lists jobs associated with the user.
        api_response = api_instance.list_jobs()
        print("The response of JobsApi->list_jobs:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling JobsApi->list_jobs: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

List[JobDetails]

HTTP request headers

  • Content-Type: Not defined

  • Accept: application/json

HTTP response details

Status code

Description

Response headers

200

Successful operation

-

401

Unauthorized - Invalid or missing API key

-