All Projects → argoproj-labs → Argo Client Python

argoproj-labs / Argo Client Python

Licence: apache-2.0
Python client for Argo Workflows

Programming Languages

python
139335 projects - #7 most used programming language

Argo Workflows Python Client

Python client for Argo Workflows

Argo Version: 2.12.2

Installation

pip install argo-workflows

Examples

A quick start example with one of the example workflow

import yaml
import requests
from argo.workflows.client import (ApiClient,
                                   WorkflowServiceApi,
                                   Configuration,
                                   V1alpha1WorkflowCreateRequest)

# assume we ran `kubectl -n argo port-forward deployment/argo-server 2746:2746`

config = Configuration(host="http://localhost:2746")
client = ApiClient(configuration=config)
service = WorkflowServiceApi(api_client=client)
WORKFLOW = 'https://raw.githubusercontent.com/argoproj/argo/v2.12.2/examples/dag-diamond-steps.yaml'

resp = requests.get(WORKFLOW)
manifest: dict = yaml.safe_load(resp.text)

service.create_workflow('argo', V1alpha1WorkflowCreateRequest(workflow=manifest))

Documentation for API Endpoints

All URIs are relative to http://localhost

Class Method HTTP request Description
ArchivedWorkflowServiceApi deleteArchivedWorkflow DELETE /api/v1/archived-workflows/{uid}
ArchivedWorkflowServiceApi getArchivedWorkflow GET /api/v1/archived-workflows/{uid}
ArchivedWorkflowServiceApi listArchivedWorkflows GET /api/v1/archived-workflows
ClusterWorkflowTemplateServiceApi createClusterWorkflowTemplate POST /api/v1/cluster-workflow-templates
ClusterWorkflowTemplateServiceApi deleteClusterWorkflowTemplate DELETE /api/v1/cluster-workflow-templates/{name}
ClusterWorkflowTemplateServiceApi getClusterWorkflowTemplate GET /api/v1/cluster-workflow-templates/{name}
ClusterWorkflowTemplateServiceApi lintClusterWorkflowTemplate POST /api/v1/cluster-workflow-templates/lint
ClusterWorkflowTemplateServiceApi listClusterWorkflowTemplates GET /api/v1/cluster-workflow-templates
ClusterWorkflowTemplateServiceApi updateClusterWorkflowTemplate PUT /api/v1/cluster-workflow-templates/{name}
CronWorkflowServiceApi createCronWorkflow POST /api/v1/cron-workflows/{namespace}
CronWorkflowServiceApi deleteCronWorkflow DELETE /api/v1/cron-workflows/{namespace}/{name}
CronWorkflowServiceApi getCronWorkflow GET /api/v1/cron-workflows/{namespace}/{name}
CronWorkflowServiceApi lintCronWorkflow POST /api/v1/cron-workflows/{namespace}/lint
CronWorkflowServiceApi listCronWorkflows GET /api/v1/cron-workflows/{namespace}
CronWorkflowServiceApi updateCronWorkflow PUT /api/v1/cron-workflows/{namespace}/{name}
EventServiceApi receiveEvent POST /api/v1/events/{namespace}/{discriminator}
InfoServiceApi getInfo GET /api/v1/info
InfoServiceApi getUserInfo GET /api/v1/userinfo
InfoServiceApi getVersion GET /api/v1/version
WorkflowServiceApi createWorkflow POST /api/v1/workflows/{namespace}
WorkflowServiceApi deleteWorkflow DELETE /api/v1/workflows/{namespace}/{name}
WorkflowServiceApi getWorkflow GET /api/v1/workflows/{namespace}/{name}
WorkflowServiceApi lintWorkflow POST /api/v1/workflows/{namespace}/lint
WorkflowServiceApi listWorkflows GET /api/v1/workflows/{namespace}
WorkflowServiceApi podLogs GET /api/v1/workflows/{namespace}/{name}/{podName}/log
WorkflowServiceApi resubmitWorkflow PUT /api/v1/workflows/{namespace}/{name}/resubmit
WorkflowServiceApi resumeWorkflow PUT /api/v1/workflows/{namespace}/{name}/resume
WorkflowServiceApi retryWorkflow PUT /api/v1/workflows/{namespace}/{name}/retry
WorkflowServiceApi setWorkflow PUT /api/v1/workflows/{namespace}/{name}/set
WorkflowServiceApi stopWorkflow PUT /api/v1/workflows/{namespace}/{name}/stop
WorkflowServiceApi submitWorkflow POST /api/v1/workflows/{namespace}/submit
WorkflowServiceApi suspendWorkflow PUT /api/v1/workflows/{namespace}/{name}/suspend
WorkflowServiceApi terminateWorkflow PUT /api/v1/workflows/{namespace}/{name}/terminate
WorkflowServiceApi watchEvents GET /api/v1/stream/events/{namespace}
WorkflowServiceApi watchWorkflows GET /api/v1/workflow-events/{namespace}
WorkflowTemplateServiceApi createWorkflowTemplate POST /api/v1/workflow-templates/{namespace}
WorkflowTemplateServiceApi deleteWorkflowTemplate DELETE /api/v1/workflow-templates/{namespace}/{name}
WorkflowTemplateServiceApi getWorkflowTemplate GET /api/v1/workflow-templates/{namespace}/{name}
WorkflowTemplateServiceApi lintWorkflowTemplate POST /api/v1/workflow-templates/{namespace}/lint
WorkflowTemplateServiceApi listWorkflowTemplates GET /api/v1/workflow-templates/{namespace}
WorkflowTemplateServiceApi updateWorkflowTemplate PUT /api/v1/workflow-templates/{namespace}/{name}

Documentation for Models

Code generation

The generated SDK will correspond to the argo version specified in the ARGO_VERSION file.

If you wish to generate code yourself, you can do so by reproducing the build environment (image): make builder_image, then running make builder_make to generate the client.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].