17 KiB
kfp_server_api.JobServiceApi
All URIs are relative to http://localhost
| Method | HTTP request | Description |
|---|---|---|
| create_job | POST /apis/v1beta1/jobs | Creates a new job. |
| delete_job | DELETE /apis/v1beta1/jobs/{id} | Deletes a job. |
| disable_job | POST /apis/v1beta1/jobs/{id}/disable | Stops a job and all its associated runs. The job is not deleted. |
| enable_job | POST /apis/v1beta1/jobs/{id}/enable | Restarts a job that was previously stopped. All runs associated with the job will continue. |
| get_job | GET /apis/v1beta1/jobs/{id} | Finds a specific job by ID. |
| list_jobs | GET /apis/v1beta1/jobs | Finds all jobs. |
create_job
ApiJob create_job(body)
Creates a new job.
Example
- Api Key Authentication (Bearer):
from __future__ import print_function
import time
import kfp_server_api
from kfp_server_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = kfp_server_api.Configuration(
host = "http://localhost"
)
# 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 API key authorization: Bearer
configuration = kfp_server_api.Configuration(
host = "http://localhost",
api_key = {
'authorization': 'YOUR_API_KEY'
}
)
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['authorization'] = 'Bearer'
# Enter a context with an instance of the API client
with kfp_server_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = kfp_server_api.JobServiceApi(api_client)
body = kfp_server_api.ApiJob() # ApiJob | The job to be created
try:
# Creates a new job.
api_response = api_instance.create_job(body)
pprint(api_response)
except ApiException as e:
print("Exception when calling JobServiceApi->create_job: %s\n" % e)
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| body | ApiJob | The job to be created |
Return type
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | A successful response. | - |
| 0 | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
delete_job
object delete_job(id)
Deletes a job.
Example
- Api Key Authentication (Bearer):
from __future__ import print_function
import time
import kfp_server_api
from kfp_server_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = kfp_server_api.Configuration(
host = "http://localhost"
)
# 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 API key authorization: Bearer
configuration = kfp_server_api.Configuration(
host = "http://localhost",
api_key = {
'authorization': 'YOUR_API_KEY'
}
)
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['authorization'] = 'Bearer'
# Enter a context with an instance of the API client
with kfp_server_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = kfp_server_api.JobServiceApi(api_client)
id = 'id_example' # str | The ID of the job to be deleted
try:
# Deletes a job.
api_response = api_instance.delete_job(id)
pprint(api_response)
except ApiException as e:
print("Exception when calling JobServiceApi->delete_job: %s\n" % e)
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| id | str | The ID of the job to be deleted |
Return type
object
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | A successful response. | - |
| 0 | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
disable_job
object disable_job(id)
Stops a job and all its associated runs. The job is not deleted.
Example
- Api Key Authentication (Bearer):
from __future__ import print_function
import time
import kfp_server_api
from kfp_server_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = kfp_server_api.Configuration(
host = "http://localhost"
)
# 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 API key authorization: Bearer
configuration = kfp_server_api.Configuration(
host = "http://localhost",
api_key = {
'authorization': 'YOUR_API_KEY'
}
)
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['authorization'] = 'Bearer'
# Enter a context with an instance of the API client
with kfp_server_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = kfp_server_api.JobServiceApi(api_client)
id = 'id_example' # str | The ID of the job to be disabled
try:
# Stops a job and all its associated runs. The job is not deleted.
api_response = api_instance.disable_job(id)
pprint(api_response)
except ApiException as e:
print("Exception when calling JobServiceApi->disable_job: %s\n" % e)
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| id | str | The ID of the job to be disabled |
Return type
object
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | A successful response. | - |
| 0 | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
enable_job
object enable_job(id)
Restarts a job that was previously stopped. All runs associated with the job will continue.
Example
- Api Key Authentication (Bearer):
from __future__ import print_function
import time
import kfp_server_api
from kfp_server_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = kfp_server_api.Configuration(
host = "http://localhost"
)
# 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 API key authorization: Bearer
configuration = kfp_server_api.Configuration(
host = "http://localhost",
api_key = {
'authorization': 'YOUR_API_KEY'
}
)
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['authorization'] = 'Bearer'
# Enter a context with an instance of the API client
with kfp_server_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = kfp_server_api.JobServiceApi(api_client)
id = 'id_example' # str | The ID of the job to be enabled
try:
# Restarts a job that was previously stopped. All runs associated with the job will continue.
api_response = api_instance.enable_job(id)
pprint(api_response)
except ApiException as e:
print("Exception when calling JobServiceApi->enable_job: %s\n" % e)
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| id | str | The ID of the job to be enabled |
Return type
object
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | A successful response. | - |
| 0 | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
get_job
ApiJob get_job(id)
Finds a specific job by ID.
Example
- Api Key Authentication (Bearer):
from __future__ import print_function
import time
import kfp_server_api
from kfp_server_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = kfp_server_api.Configuration(
host = "http://localhost"
)
# 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 API key authorization: Bearer
configuration = kfp_server_api.Configuration(
host = "http://localhost",
api_key = {
'authorization': 'YOUR_API_KEY'
}
)
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['authorization'] = 'Bearer'
# Enter a context with an instance of the API client
with kfp_server_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = kfp_server_api.JobServiceApi(api_client)
id = 'id_example' # str | The ID of the job to be retrieved
try:
# Finds a specific job by ID.
api_response = api_instance.get_job(id)
pprint(api_response)
except ApiException as e:
print("Exception when calling JobServiceApi->get_job: %s\n" % e)
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| id | str | The ID of the job to be retrieved |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | A successful response. | - |
| 0 | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
list_jobs
ApiListJobsResponse list_jobs(page_token=page_token, page_size=page_size, sort_by=sort_by, resource_reference_key_type=resource_reference_key_type, resource_reference_key_id=resource_reference_key_id, filter=filter)
Finds all jobs.
Example
- Api Key Authentication (Bearer):
from __future__ import print_function
import time
import kfp_server_api
from kfp_server_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = kfp_server_api.Configuration(
host = "http://localhost"
)
# 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 API key authorization: Bearer
configuration = kfp_server_api.Configuration(
host = "http://localhost",
api_key = {
'authorization': 'YOUR_API_KEY'
}
)
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['authorization'] = 'Bearer'
# Enter a context with an instance of the API client
with kfp_server_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = kfp_server_api.JobServiceApi(api_client)
page_token = 'page_token_example' # str | A page token to request the next page of results. The token is acquried from the nextPageToken field of the response from the previous ListJobs call or can be omitted when fetching the first page. (optional)
page_size = 56 # int | The number of jobs to be listed per page. If there are more jobs than this number, the response message will contain a nextPageToken field you can use to fetch the next page. (optional)
sort_by = 'sort_by_example' # str | Can be format of \"field_name\", \"field_name asc\" or \"field_name desc\". Ascending by default. (optional)
resource_reference_key_type = 'UNKNOWN_RESOURCE_TYPE' # str | The type of the resource that referred to. (optional) (default to 'UNKNOWN_RESOURCE_TYPE')
resource_reference_key_id = 'resource_reference_key_id_example' # str | The ID of the resource that referred to. (optional)
filter = 'filter_example' # str | A url-encoded, JSON-serialized Filter protocol buffer (see [filter.proto](https://github.com/kubeflow/pipelines/blob/master/backend/api/filter.proto)). (optional)
try:
# Finds all jobs.
api_response = api_instance.list_jobs(page_token=page_token, page_size=page_size, sort_by=sort_by, resource_reference_key_type=resource_reference_key_type, resource_reference_key_id=resource_reference_key_id, filter=filter)
pprint(api_response)
except ApiException as e:
print("Exception when calling JobServiceApi->list_jobs: %s\n" % e)
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| page_token | str | A page token to request the next page of results. The token is acquried from the nextPageToken field of the response from the previous ListJobs call or can be omitted when fetching the first page. | [optional] |
| page_size | int | The number of jobs to be listed per page. If there are more jobs than this number, the response message will contain a nextPageToken field you can use to fetch the next page. | [optional] |
| sort_by | str | Can be format of "field_name", "field_name asc" or "field_name desc". Ascending by default. | [optional] |
| resource_reference_key_type | str | The type of the resource that referred to. | [optional] [default to 'UNKNOWN_RESOURCE_TYPE'] |
| resource_reference_key_id | str | The ID of the resource that referred to. | [optional] |
| filter | str | A url-encoded, JSON-serialized Filter protocol buffer (see filter.proto). | [optional] |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | A successful response. | - |
| 0 | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]