Import KFP backend kubeflow/pipelines (#192)

... using commit #ec9445aa from 5/19/2020
This commit is contained in:
kfp-tekton-bot 2020-06-22 21:09:43 -07:00 committed by GitHub
parent cfed0e3f8c
commit b2582b580f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1858 changed files with 388688 additions and 13 deletions

290
.cloudbuild.yaml Normal file
View File

@ -0,0 +1,290 @@
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Test before submit:
# gcloud builds submit --config=.cloudbuild.yaml --substitutions=COMMIT_SHA="$(git rev-parse HEAD)" --project=ml-pipeline-test
steps:
# Build the Python SDK
- name: 'python:3-alpine'
entrypoint: '/bin/sh'
args: ['-c', 'cd /workspace/sdk/python/; python3 setup.py sdist --format=gztar; cp dist/*.tar.gz /workspace/kfp.tar.gz']
id: 'preparePythonSDK'
waitFor: ["-"]
- name: 'gcr.io/cloud-builders/gsutil'
args: ['cp', '/workspace/kfp.tar.gz', 'gs://$PROJECT_ID/builds/$COMMIT_SHA/kfp.tar.gz']
id: 'copyPythonSDK'
waitFor: ['preparePythonSDK']
- name: 'gcr.io/cloud-builders/gsutil'
args: ['cp', '/workspace/kfp.tar.gz', 'gs://$PROJECT_ID/builds/latest/kfp.tar.gz']
id: 'copyPythonSDKToLatest'
waitFor: ['preparePythonSDK']
# Build the Python Component SDK
- name: 'python:2-alpine'
entrypoint: '/bin/sh'
args: ['-c', 'cd /workspace/components/gcp/container/component_sdk/python;python setup.py sdist --format=gztar; cp dist/*.tar.gz /workspace/kfp-component.tar.gz']
id: 'preparePythonComponentSDK'
waitFor: ["-"]
- name: 'gcr.io/cloud-builders/gsutil'
args: ['cp', '/workspace/kfp-component.tar.gz', 'gs://$PROJECT_ID/builds/$COMMIT_SHA/kfp-component.tar.gz']
id: 'copyPythonComponentSDK'
waitFor: ['preparePythonComponentSDK']
- name: 'gcr.io/cloud-builders/gsutil'
args: ['cp', '/workspace/kfp-component.tar.gz', 'gs://$PROJECT_ID/builds/latest/kfp-component.tar.gz']
id: 'copyPythonComponentSDKToLatest'
waitFor: ['preparePythonComponentSDK']
# Build the pipeline system images
- name: 'debian'
entrypoint: '/bin/bash'
args: ['-c', 'sed -i -e "s/ARG DATE/ENV DATE \"$(date -u)\"/" /workspace/frontend/Dockerfile']
id: 'prepareFrontend'
waitFor: ["-"]
- name: 'gcr.io/cloud-builders/docker'
args: ['build', '-t', 'gcr.io/$PROJECT_ID/frontend:$COMMIT_SHA',
'--build-arg', 'COMMIT_HASH=$COMMIT_SHA',
'--build-arg', 'TAG_NAME=$TAG_NAME',
'-f', '/workspace/frontend/Dockerfile', '/workspace']
id: 'buildFrontend'
waitFor: ['prepareFrontend']
- name: 'gcr.io/cloud-builders/docker'
args: ['build', '-t', 'gcr.io/$PROJECT_ID/api-server:$COMMIT_SHA',
'--build-arg', 'COMMIT_SHA=$COMMIT_SHA',
'--build-arg', 'TAG_NAME=$TAG_NAME',
'-f', '/workspace/backend/Dockerfile', '/workspace']
id: 'buildApiServer'
waitFor: ['copyPythonSDK']
- name: 'gcr.io/cloud-builders/docker'
args: ['build', '-t', 'gcr.io/$PROJECT_ID/scheduledworkflow:$COMMIT_SHA', '-f',
'/workspace/backend/Dockerfile.scheduledworkflow', '/workspace']
id: 'buildScheduledWorkflow'
waitFor: ["-"]
- name: 'gcr.io/cloud-builders/docker'
args: ['build', '-t', 'gcr.io/$PROJECT_ID/viewer-crd-controller:$COMMIT_SHA', '-f',
'/workspace/backend/Dockerfile.viewercontroller', '/workspace']
id: 'buildViewerCrdController'
- name: 'gcr.io/cloud-builders/docker'
args: ['build', '-t', 'gcr.io/$PROJECT_ID/persistenceagent:$COMMIT_SHA', '-f',
'/workspace/backend/Dockerfile.persistenceagent', '/workspace']
id: 'buildPersistenceAgent'
waitFor: ["-"]
- name: 'gcr.io/cloud-builders/docker'
args: ['build', '-t', 'gcr.io/$PROJECT_ID/inverse-proxy-agent:$COMMIT_SHA', '-f',
'/workspace/proxy/Dockerfile', '/workspace/proxy']
id: 'buildInverseProxyAgent'
waitFor: ["-"]
- name: 'gcr.io/cloud-builders/docker'
args: ['build', '-t', 'gcr.io/$PROJECT_ID/visualization-server:$COMMIT_SHA',
'--build-arg', 'COMMIT_HASH=$COMMIT_SHA', '-f',
'/workspace/backend/Dockerfile.visualization', '/workspace']
id: 'buildVisualizationServer'
waitFor: ["-"]
- id: 'buildMetadataWriter'
name: 'gcr.io/cloud-builders/docker'
args: ['build', '-t', 'gcr.io/$PROJECT_ID/metadata-writer:$COMMIT_SHA',
'--build-arg', 'COMMIT_HASH=$COMMIT_SHA', '-f',
'/workspace/backend/metadata_writer/Dockerfile', '/workspace']
waitFor: ["-"]
- id: 'buildCacheServer'
name: 'gcr.io/cloud-builders/docker'
args: ['build', '-t', 'gcr.io/$PROJECT_ID/cache-server:$COMMIT_SHA',
'--build-arg', 'COMMIT_HASH=$COMMIT_SHA', '-f',
'/workspace/backend/Dockerfile.cacheserver', '/workspace']
waitFor: ["-"]
- id: 'buildCacheDeployer'
name: 'gcr.io/cloud-builders/docker'
args: ['build', '-t', 'gcr.io/$PROJECT_ID/cache-deployer:$COMMIT_SHA',
'--build-arg', 'COMMIT_HASH=$COMMIT_SHA', '-f',
'/workspace/backend/src/cache/deployer/Dockerfile', '/workspace']
waitFor: ["-"]
# Build marketplace deployer
- id: 'buildMarketplaceDeployer'
name: 'gcr.io/cloud-builders/docker'
args: ['build', '-t', 'gcr.io/$PROJECT_ID/deployer:$COMMIT_SHA',
'--build-arg', 'COMMIT_HASH=$COMMIT_SHA', '-f',
'/workspace/manifests/gcp_marketplace/deployer/Dockerfile', '/workspace/manifests/gcp_marketplace']
waitFor: ["-"]
# Build the Kubeflow-based pipeline component images
- name: 'gcr.io/cloud-builders/docker'
args: ['build', '-t', 'gcr.io/$PROJECT_ID/ml-pipeline-kubeflow-deployer:$COMMIT_SHA',
'/workspace/components/kubeflow/deployer']
id: 'buildDeployer'
waitFor: ["-"]
- name: 'gcr.io/cloud-builders/docker'
entrypoint: '/bin/bash'
args: ['-c', 'cd /workspace/components/kubeflow/launcher && ./build_image.sh -p $PROJECT_ID -t $COMMIT_SHA']
id: 'buildLauncher'
waitFor: ["-"]
- id: 'buildCpuTrainer'
name: 'gcr.io/cloud-builders/docker'
entrypoint: '/bin/bash'
args: ['-c', 'cd /workspace/components/kubeflow/dnntrainer && ./build_image.sh -p $PROJECT_ID -t $COMMIT_SHA -l ml-pipeline-kubeflow-tf-trainer -b 1.6.0']
waitFor: ["-"]
- name: 'gcr.io/cloud-builders/docker'
entrypoint: '/bin/bash'
args: ['-c', 'cd /workspace/components/kubeflow/dnntrainer && ./build_image.sh -p $PROJECT_ID -t $COMMIT_SHA -l ml-pipeline-kubeflow-tf-trainer-gpu -b 1.6.0-gpu']
id: 'buildGpuTrainer'
waitFor: ["-"]
# Build the Dataproc-based pipeline component images
- name: 'gcr.io/cloud-builders/docker'
entrypoint: '/bin/bash'
args: ['-c', 'cd /workspace/components/deprecated/dataproc/analyze && ./build_image.sh -p $PROJECT_ID -t $COMMIT_SHA']
id: 'buildDataprocAnalyze'
waitFor: ["-"]
- name: 'gcr.io/cloud-builders/docker'
entrypoint: '/bin/bash'
args: ['-c', 'cd /workspace/components/deprecated/dataproc/create_cluster && ./build_image.sh -p $PROJECT_ID -t $COMMIT_SHA']
id: 'buildDataprocCreateCluster'
waitFor: ["-"]
- name: 'gcr.io/cloud-builders/docker'
entrypoint: '/bin/bash'
args: ['-c', 'cd /workspace/components/deprecated/dataproc/delete_cluster && ./build_image.sh -p $PROJECT_ID -t $COMMIT_SHA']
id: 'buildDataprocDeleteCluster'
waitFor: ["-"]
- name: 'gcr.io/cloud-builders/docker'
entrypoint: '/bin/bash'
args: ['-c', 'cd /workspace/components/deprecated/dataproc/predict && ./build_image.sh -p $PROJECT_ID -t $COMMIT_SHA']
id: 'buildDataprocPredict'
waitFor: ["-"]
- name: 'gcr.io/cloud-builders/docker'
entrypoint: '/bin/bash'
args: ['-c', 'cd /workspace/components/deprecated/dataproc/transform && ./build_image.sh -p $PROJECT_ID -t $COMMIT_SHA']
id: 'buildDataprocTransform'
waitFor: ["-"]
- name: 'gcr.io/cloud-builders/docker'
entrypoint: '/bin/bash'
args: ['-c', 'cd /workspace/components/deprecated/dataproc/train && ./build_image.sh -p $PROJECT_ID -t $COMMIT_SHA']
id: 'buildDataprocTrain'
waitFor: ["-"]
# Build the Generic GCP component image
- name: 'gcr.io/cloud-builders/docker'
entrypoint: '/bin/bash'
args: ['-c', 'cd /workspace/components/gcp/container/ && ./build_image.sh -p $PROJECT_ID -t $COMMIT_SHA']
id: 'buildGcpGenericComponent'
waitFor: ["-"]
# Build the local pipeline component images
- name: 'gcr.io/cloud-builders/docker'
entrypoint: '/bin/bash'
args: ['-c', 'cd /workspace/components/local/confusion_matrix && ./build_image.sh -p $PROJECT_ID -t $COMMIT_SHA']
id: 'buildConfusionMatrix'
waitFor: ["-"]
- name: 'gcr.io/cloud-builders/docker'
entrypoint: '/bin/bash'
args: ['-c', 'cd /workspace/components/local/roc && ./build_image.sh -p $PROJECT_ID -t $COMMIT_SHA']
id: 'buildROC'
waitFor: ["-"]
# Build third_party images
- name: 'gcr.io/cloud-builders/docker'
args: ['build', '-t', 'gcr.io/$PROJECT_ID/metadata-envoy:$COMMIT_SHA', '-f',
'/workspace/third_party/metadata_envoy/Dockerfile', '/workspace']
id: 'buildMetadataEnvoy'
# Pull third_party images
- name: 'gcr.io/cloud-builders/docker'
args: ['pull', 'gcr.io/tfx-oss-public/ml_metadata_store_server:0.21.1']
id: 'pullMetadataServer'
- name: 'gcr.io/cloud-builders/docker'
args: ['pull', 'gcr.io/ml-pipeline/minio:RELEASE.2019-08-14T20-37-41Z-license-compliance']
id: 'pullMinio'
- name: 'gcr.io/cloud-builders/docker'
args: ['pull', 'gcr.io/ml-pipeline/mysql:5.6']
id: 'pullMysql'
- name: 'gcr.io/cloud-builders/docker'
args: ['pull', 'gcr.io/cloudsql-docker/gce-proxy:1.14']
id: 'pullCloudsqlProxy'
- name: 'gcr.io/cloud-builders/docker'
args: ['pull', 'gcr.io/ml-pipeline/argoexec:v2.7.5-license-compliance']
id: 'pullArgoExecutor'
- name: 'gcr.io/cloud-builders/docker'
args: ['pull', 'gcr.io/ml-pipeline/workflow-controller:v2.7.5-license-compliance']
id: 'pullArgoWorkflowController'
# Tag for Hosted - SemVersion to Major.Minor parsing
- id: "parseMajorMinorVersion"
waitFor: ["-"]
name: gcr.io/cloud-builders/docker
entrypoint: /bin/bash
args:
- -ceux
- |
# Parse major minor version and save to a file for reusing in other steps.
cat /workspace/VERSION | sed -e "s#[^0-9]*\([0-9]*\)[.]\([0-9]*\)[.]\([0-9]*\)#\1.\2#" > /workspace/mm.ver
# Tag for Hosted - Tag to hosted folder with MKP friendly name
- id: 'tagForHosted'
waitFor: ['parseMajorMinorVersion', 'buildFrontend', 'buildApiServer', 'buildScheduledWorkflow',
'buildViewerCrdController', 'buildPersistenceAgent', 'buildInverseProxyAgent', 'buildVisualizationServer',
'buildMetadataWriter', 'buildCacheServer', 'buildCacheDeployer', 'buildMetadataEnvoy',
'buildMarketplaceDeployer', 'pullMetadataServer', 'pullMinio', 'pullMysql', 'pullCloudsqlProxy',
'pullArgoExecutor', 'pullArgoWorkflowController']
name: 'gcr.io/cloud-builders/docker'
entrypoint: bash
args:
- -ceux
- |
/workspace/test/tag_for_hosted.sh $PROJECT_ID $COMMIT_SHA $(cat /workspace/VERSION) $(cat /workspace/mm.ver)
images:
# Images for the pipeline system itself
- 'gcr.io/$PROJECT_ID/frontend:$COMMIT_SHA'
- 'gcr.io/$PROJECT_ID/api-server:$COMMIT_SHA'
- 'gcr.io/$PROJECT_ID/scheduledworkflow:$COMMIT_SHA'
- 'gcr.io/$PROJECT_ID/persistenceagent:$COMMIT_SHA'
- 'gcr.io/$PROJECT_ID/viewer-crd-controller:$COMMIT_SHA'
- 'gcr.io/$PROJECT_ID/inverse-proxy-agent:$COMMIT_SHA'
- 'gcr.io/$PROJECT_ID/visualization-server:$COMMIT_SHA'
- 'gcr.io/$PROJECT_ID/metadata-writer:$COMMIT_SHA'
- 'gcr.io/$PROJECT_ID/cache-server:$COMMIT_SHA'
- 'gcr.io/$PROJECT_ID/cache-deployer:$COMMIT_SHA'
# Images for Marketplace
- 'gcr.io/$PROJECT_ID/deployer:$COMMIT_SHA'
# Images for the Kubeflow-based pipeline components
- 'gcr.io/$PROJECT_ID/ml-pipeline-kubeflow-deployer:$COMMIT_SHA'
- 'gcr.io/$PROJECT_ID/ml-pipeline-kubeflow-tf-trainer:$COMMIT_SHA'
- 'gcr.io/$PROJECT_ID/ml-pipeline-kubeflow-tf-trainer-gpu:$COMMIT_SHA'
- 'gcr.io/$PROJECT_ID/ml-pipeline-kubeflow-tfjob:$COMMIT_SHA'
# Images for the Dataproc-based pipeline components
- 'gcr.io/$PROJECT_ID/ml-pipeline-dataproc-analyze:$COMMIT_SHA'
- 'gcr.io/$PROJECT_ID/ml-pipeline-dataproc-create-cluster:$COMMIT_SHA'
- 'gcr.io/$PROJECT_ID/ml-pipeline-dataproc-delete-cluster:$COMMIT_SHA'
- 'gcr.io/$PROJECT_ID/ml-pipeline-dataproc-predict:$COMMIT_SHA'
- 'gcr.io/$PROJECT_ID/ml-pipeline-dataproc-transform:$COMMIT_SHA'
- 'gcr.io/$PROJECT_ID/ml-pipeline-dataproc-train:$COMMIT_SHA'
# Images for the GCP generic pipeline components
- 'gcr.io/$PROJECT_ID/ml-pipeline-gcp:$COMMIT_SHA'
# Images for the local components
- 'gcr.io/$PROJECT_ID/ml-pipeline-local-confusion-matrix:$COMMIT_SHA'
- 'gcr.io/$PROJECT_ID/ml-pipeline-local-roc:$COMMIT_SHA'
# Images for the third_party components
- 'gcr.io/$PROJECT_ID/metadata-envoy:$COMMIT_SHA'
timeout: '3600s'
options:
diskSizeGb: 300
machineType: 'N1_HIGHCPU_8'

4
.dockerignore Normal file
View File

@ -0,0 +1,4 @@
.git
bower_components
dist
node_modules

15
.gitattributes vendored Normal file
View File

@ -0,0 +1,15 @@
# Ignore backend generated client libraries
backend/api/go_client/* linguist-generated
backend/api/go_http_client/* linguist-generated
backend/api/swagger/* linguist-generated
# Ignore go.sum
go.sum linguist-generated
# Ignore npm lock
frontend/package-lock.json linguist-generated
frontend/server/package-lock.json linguist-generated
frontend/test/package-lock.json linguist-generated
# Ignore generated TS client library
frontend/src/apis/* linguist-generated

74
.gitignore vendored
View File

@ -1,4 +1,3 @@
# Binaries for programs and plugins # Binaries for programs and plugins
*.exe *.exe
*.exe~ *.exe~
@ -19,24 +18,79 @@ bin
# Kubernetes Generated files - skip generated files, except for vendored files # Kubernetes Generated files - skip generated files, except for vendored files
!vendor/**/zz_generated.* !vendor/**/zz_generated.*
# editor and IDE paraphernalia
.idea
*.swp
*.swo
*~
# Python dev # Python dev
.mypy_cache .mypy_cache
.venv/ .venv/
*.egg-info/ *.egg-info/
# Logs
logs
*.log
npm-debug.log*
# JS Sourcemaps
*.js.map
# Dependencies
node_modules/
bower_components/
# Build output
dist
# Web server
frontend/server/dist
# Python built package
*.egg-info
dist
.tox
# UI test outputs
frontend/test/ui/visual-regression/errorShots
frontend/test/ui/visual-regression/screenshots/diff
frontend/test/ui/visual-regression/screenshots/screen
# sqlite db
*.db
# IDE
.idea/
.ijwb/
*.iml
*.swp
*.swo
*~
# Merge files
*.orig
# Operating system generated files
.DS_Store
# go vendor
vendor
# Go module cache
backend/pkg/mod/cache
# Bazel output artifacts
bazel-*
# VSCode # VSCode
.vscode .vscode
# Ignore files for MacOS
**/.DS_Store
# Local or temporary build files # Local or temporary build files
build/ build/
sdk/samples/*.yaml sdk/samples/*.yaml
temp/ temp/
# test yaml
sdk/python/tests/compiler/pipeline.yaml
sdk/python/tests/compiler/testdata/testpackage/pipeline.yaml
# Test temporary files
_artifacts
# Generated Python SDK documentation
docs/_build

410
.pylintrc Normal file
View File

@ -0,0 +1,410 @@
[MASTER]
# Specify a configuration file.
#rcfile=
# Python code to execute, usually for sys.path manipulation such as
# pygtk.require().
#init-hook=
# Add files or directories to the blacklist. They should be base names, not
# paths.
ignore=CVS
# Add files or directories matching the regex patterns to the blacklist. The
# regex matches against base names, not paths.
ignore-patterns=
# Pickle collected data for later comparisons.
persistent=yes
# List of plugins (as comma separated values of python modules names) to load,
# usually to register additional checkers.
load-plugins=
# Use multiple processes to speed up Pylint.
jobs=1
# Allow loading of arbitrary C extensions. Extensions are imported into the
# active Python interpreter and may run arbitrary code.
unsafe-load-any-extension=no
# A comma-separated list of package or module names from where C extensions may
# be loaded. Extensions are loading into the active Python interpreter and may
# run arbitrary code
extension-pkg-whitelist=numpy
# Allow optimization of some AST trees. This will activate a peephole AST
# optimizer, which will apply various small optimizations. For instance, it can
# be used to obtain the result of joining multiple strings with the addition
# operator. Joining a lot of strings can lead to a maximum recursion error in
# Pylint and this flag can prevent that. It has one side effect, the resulting
# AST will be different than the one from reality. This option is deprecated
# and it will be removed in Pylint 2.0.
optimize-ast=no
[MESSAGES CONTROL]
# Only show warnings with the listed confidence levels. Leave empty to show
# all. Valid levels: HIGH, INFERENCE, INFERENCE_FAILURE, UNDEFINED
confidence=
# Enable the message, report, category or checker with the given id(s). You can
# either give multiple identifier separated by comma (,) or put this option
# multiple time (only on the command line, not in the configuration file where
# it should appear only once). See also the "--disable" option for examples.
#enable=
# Disable the message, report, category or checker with the given id(s). You
# can either give multiple identifiers separated by comma (,) or put this
# option multiple times (only on the command line, not in the configuration
# file where it should appear only once).You can also use "--disable=all" to
# disable everything first and then reenable specific checks. For example, if
# you want to run only the similarities checker, you can use "--disable=all
# --enable=similarities". If you want to run only the classes checker, but have
# no Warning level messages displayed, use"--disable=all --enable=classes
# --disable=W"
# TODO(numerology): enable missing-module-docstring after finish the effort.
disable=missing-module-docstring
[REPORTS]
# Set the output format. Available formats are text, parseable, colorized, msvs
# (visual studio) and html. You can also give a reporter class, eg
# mypackage.mymodule.MyReporterClass.
output-format=text
# Put messages in a separate file for each module / package specified on the
# command line instead of printing them on stdout. Reports (if any) will be
# written in a file name "pylint_global.[txt|html]". This option is deprecated
# and it will be removed in Pylint 2.0.
files-output=no
# Tells whether to display a full report or only the messages
reports=yes
# Python expression which should return a note less than 10 (10 is the highest
# note). You have access to the variables errors warning, statement which
# respectively contain the number of errors / warnings messages and the total
# number of statements analyzed. This is used by the global evaluation report
# (RP0004).
evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)
# Template used to display messages. This is a python new-style format string
# used to format the message information. See doc for all details
#msg-template=
[BASIC]
# Good variable names which should always be accepted, separated by a comma
# s3 is whitelisted for its special meaning.
good-names=i,j,k,ex,Run,_,s3
# Bad variable names which should always be refused, separated by a comma
bad-names=foo,bar,baz,toto,tutu,tata
# Colon-delimited sets of names that determine each other's naming style when
# the name regexes allow several styles.
name-group=
# Include a hint for the correct naming format with invalid-name
include-naming-hint=no
# List of decorators that produce properties, such as abc.abstractproperty. Add
# to this list to register other decorators that produce valid properties.
property-classes=abc.abstractproperty
# Regular expression matching correct variable names
variable-rgx=[a-z_][a-z0-9_]{2,30}$
# Naming hint for variable names
variable-name-hint=[a-z_][a-z0-9_]{2,30}$
# Regular expression matching correct class attribute names
class-attribute-rgx=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$
# Naming hint for class attribute names
class-attribute-name-hint=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$
# Regular expression matching correct argument names
argument-rgx=[a-z_][a-z0-9_]{2,30}$
# Naming hint for argument names
argument-name-hint=[a-z_][a-z0-9_]{2,30}$
# Regular expression matching correct module names
module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$
# Naming hint for module names
module-name-hint=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$
# Regular expression matching correct constant names
const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__))$
# Naming hint for constant names
const-name-hint=(([A-Z_][A-Z0-9_]*)|(__.*__))$
# Regular expression matching correct inline iteration names
inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$
# Naming hint for inline iteration names
inlinevar-name-hint=[A-Za-z_][A-Za-z0-9_]*$
# Regular expression matching correct method names
method-rgx=[a-z_][a-z0-9_]{2,30}$
# Naming hint for method names
method-name-hint=[a-z_][a-z0-9_]{2,30}$
# Regular expression matching correct function names
function-rgx=[a-z_][a-z0-9_]{2,30}$
# Naming hint for function names
function-name-hint=[a-z_][a-z0-9_]{2,30}$
# Regular expression matching correct attribute names
attr-rgx=[a-z_][a-z0-9_]{2,30}$
# Naming hint for attribute names
attr-name-hint=[a-z_][a-z0-9_]{2,30}$
# Regular expression matching correct class names
class-rgx=[A-Z_][a-zA-Z0-9]+$
# Naming hint for class names
class-name-hint=[A-Z_][a-zA-Z0-9]+$
# Regular expression which should only match function or class names that do
# not require a docstring.
no-docstring-rgx=^test_
# Minimum line length for functions/classes that require docstrings, shorter
# ones are exempt.
docstring-min-length=-1
[ELIF]
# Maximum number of nested blocks for function / method body
max-nested-blocks=5
[FORMAT]
# Maximum number of characters on a single line.
max-line-length=80
# Regexp for a line that is allowed to be longer than the limit.
# Ignoring 1) links in comment, 2) component yaml specs and 3) import statements.
ignore-long-lines=(^\s*(# )?<?https?://\S+>?$|^.*'https://raw\.githubusercontent\.com/kubeflow/pipelines\S*$|^\s*(import|from).*$)
# Allow the body of an if to be on the same line as the test if there is no
# else.
single-line-if-stmt=y
# List of optional constructs for which whitespace checking is disabled. `dict-
# separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}.
# `trailing-comma` allows a space between comma and closing bracket: (a, ).
# `empty-line` allows space-only lines.
no-space-check=trailing-comma,dict-separator
# Maximum number of lines in a module
max-module-lines=1000
# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1
# tab).
indent-string=' '
# Number of spaces of indent required inside a hanging or continued line.
indent-after-paren=4
# Expected format of line ending, e.g. empty (any line ending), LF or CRLF.
expected-line-ending-format=
[LOGGING]
# Logging modules to check that the string format arguments are in logging
# function parameter format
logging-modules=logging
[MISCELLANEOUS]
# List of note tags to take in consideration, separated by a comma.
notes=FIXME,XXX,TODO
[SIMILARITIES]
# Minimum lines number of a similarity.
min-similarity-lines=10
# Ignore comments when computing similarities.
ignore-comments=yes
# Ignore docstrings when computing similarities.
ignore-docstrings=yes
# Ignore imports when computing similarities.
ignore-imports=no
[SPELLING]
# Spelling dictionary name. Available dictionaries: none. To make it working
# install python-enchant package.
spelling-dict=
# List of comma separated words that should not be checked.
spelling-ignore-words=
# A path to a file that contains private dictionary; one word per line.
spelling-private-dict-file=
# Tells whether to store unknown words to indicated private dictionary in
# --spelling-private-dict-file option instead of raising a message.
spelling-store-unknown-words=no
[TYPECHECK]
# Tells whether missing members accessed in mixin class should be ignored. A
# mixin class is detected if its name ends with "mixin" (case insensitive).
ignore-mixin-members=yes
# List of module names for which member attributes should not be checked
# (useful for modules/projects where namespaces are manipulated during runtime
# and thus existing member attributes cannot be deduced by static analysis. It
# supports qualified module names, as well as Unix pattern matching.
ignored-modules=
# List of class names for which member attributes should not be checked (useful
# for classes with dynamically set attributes). This supports the use of
# qualified names.
ignored-classes=optparse.Values,thread._local,_thread._local,matplotlib.cm,tensorflow.python,tensorflow,tensorflow.train.Example,RunOptions
# List of members which are set dynamically and missed by pylint inference
# system, and so shouldn't trigger E1101 when accessed. Python regular
# expressions are accepted.
generated-members=set_shape,np.float32
# List of decorators that produce context managers, such as
# contextlib.contextmanager. Add to this list to register other decorators that
# produce valid context managers.
contextmanager-decorators=contextlib.contextmanager
[VARIABLES]
# Tells whether we should check for unused import in __init__ files.
init-import=no
# A regular expression matching the name of dummy variables (i.e. expectedly
# not used).
dummy-variables-rgx=(_+[a-zA-Z0-9_]*?$)|dummy
# List of additional names supposed to be defined in builtins. Remember that
# you should avoid to define new builtins when possible.
additional-builtins=
# List of strings which can identify a callback function by name. A callback
# name must start or end with one of those strings.
callbacks=cb_,_cb
# List of qualified module names which can have objects that can redefine
# builtins.
redefining-builtins-modules=six.moves,future.builtins
[CLASSES]
# List of method names used to declare (i.e. assign) instance attributes.
defining-attr-methods=__init__,__new__,setUp
# List of valid names for the first argument in a class method.
valid-classmethod-first-arg=cls
# List of valid names for the first argument in a metaclass class method.
valid-metaclass-classmethod-first-arg=mcs
# List of member names, which should be excluded from the protected access
# warning.
exclude-protected=_asdict,_fields,_replace,_source,_make
[DESIGN]
# Maximum number of arguments for function / method
max-args=10
# Argument names that match this expression will be ignored. Default to name
# with leading underscore
ignored-argument-names=_.*
# Maximum number of locals for function / method body
max-locals=30
# Maximum number of return / yield for function / method body
max-returns=6
# Maximum number of branch for function / method body
max-branches=12
# Maximum number of statements in function / method body
max-statements=100
# Maximum number of parents for a class (see R0901).
max-parents=7
# Maximum number of attributes for a class (see R0902).
max-attributes=10
# Minimum number of public methods for a class (see R0903).
min-public-methods=0
# Maximum number of public methods for a class (see R0904).
max-public-methods=20
# Maximum number of boolean expressions in a if statement
max-bool-expr=5
[IMPORTS]
# Deprecated modules which should not be used, separated by a comma
deprecated-modules=optparse
# Create a graph of every (i.e. internal and external) dependencies in the
# given file (report RP0402 must not be disabled)
import-graph=
# Create a graph of external dependencies in the given file (report RP0402 must
# not be disabled)
ext-import-graph=
# Create a graph of internal dependencies in the given file (report RP0402 must
# not be disabled)
int-import-graph=
# Force import order to recognize a module as part of the standard
# compatibility libraries.
known-standard-library=
# Force import order to recognize a module as part of a third party library.
known-third-party=enchant
# Analyse import fallback blocks. This can be used to support both Python 2 and
# 3 compatible code, which means that the block might have code that exists
# only in one or another interpreter, leading to false positives when analysed.
analyse-fallback-blocks=no
[EXCEPTIONS]
# Exceptions that will emit a warning when being caught. Defaults to
# "Exception"
overgeneral-exceptions=Exception

608
.release.cloudbuild.yaml Normal file
View File

@ -0,0 +1,608 @@
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
steps:
# Marketplace Major.Minor parsing
- id: "parseMajorMinorVersion"
name: gcr.io/cloud-builders/docker
entrypoint: /bin/bash
args:
- -ceux
- |
# Parse major minor version and save to a file for reusing in other steps.
echo $TAG_NAME | sed -e "s#[^0-9]*\([0-9]*\)[.]\([0-9]*\)[.]\([0-9]*\)#\1.\2#" > /workspace/mm.ver
# Pull and retag the images for the pipeline system
- name: 'gcr.io/cloud-builders/docker'
args: ['pull', 'gcr.io/$PROJECT_ID/frontend:$COMMIT_SHA']
id: 'pullFrontend'
- id: 'tagFrontendForMarketplaceMajorMin'
waitFor: ['pullFrontend', 'parseMajorMinorVersion']
name: 'gcr.io/cloud-builders/docker'
entrypoint: bash
args:
- -ceux
- |
docker tag gcr.io/$PROJECT_ID/frontend:$COMMIT_SHA gcr.io/ml-pipeline/frontend:$TAG_NAME
docker tag gcr.io/$PROJECT_ID/frontend:$COMMIT_SHA gcr.io/ml-pipeline/frontend:$COMMIT_SHA
docker tag gcr.io/$PROJECT_ID/frontend:$COMMIT_SHA gcr.io/ml-pipeline/google/pipelines/frontend:$TAG_NAME
docker tag gcr.io/$PROJECT_ID/frontend:$COMMIT_SHA gcr.io/ml-pipeline/google/pipelines-test/frontend:$TAG_NAME
docker tag gcr.io/$PROJECT_ID/frontend:$COMMIT_SHA gcr.io/ml-pipeline/google/pipelines/frontend:$(cat /workspace/mm.ver)
docker tag gcr.io/$PROJECT_ID/frontend:$COMMIT_SHA gcr.io/ml-pipeline/google/pipelines-test/frontend:$(cat /workspace/mm.ver)
docker push gcr.io/ml-pipeline/frontend:$TAG_NAME
docker push gcr.io/ml-pipeline/frontend:$COMMIT_SHA
docker push gcr.io/ml-pipeline/google/pipelines/frontend:$TAG_NAME
docker push gcr.io/ml-pipeline/google/pipelines-test/frontend:$TAG_NAME
docker push gcr.io/ml-pipeline/google/pipelines/frontend:$(cat /workspace/mm.ver)
docker push gcr.io/ml-pipeline/google/pipelines-test/frontend:$(cat /workspace/mm.ver)
- name: 'gcr.io/cloud-builders/docker'
args: ['pull', 'gcr.io/$PROJECT_ID/api-server:$COMMIT_SHA']
id: 'pullAPIServer'
- id: 'tagAPIServerForMarketplaceMajorMinor'
waitFor: ['pullAPIServer', 'parseMajorMinorVersion']
name: 'gcr.io/cloud-builders/docker'
entrypoint: bash
args:
- -ceux
- |
docker tag gcr.io/$PROJECT_ID/api-server:$COMMIT_SHA 'gcr.io/ml-pipeline/api-server:$TAG_NAME'
docker tag gcr.io/$PROJECT_ID/api-server:$COMMIT_SHA 'gcr.io/ml-pipeline/api-server:$COMMIT_SHA'
docker tag gcr.io/$PROJECT_ID/api-server:$COMMIT_SHA 'gcr.io/ml-pipeline/google/pipelines/apiserver:$TAG_NAME'
docker tag gcr.io/$PROJECT_ID/api-server:$COMMIT_SHA 'gcr.io/ml-pipeline/google/pipelines-test/apiserver:$TAG_NAME'
docker tag gcr.io/$PROJECT_ID/api-server:$COMMIT_SHA gcr.io/ml-pipeline/google/pipelines/apiserver:$(cat /workspace/mm.ver)
docker tag gcr.io/$PROJECT_ID/api-server:$COMMIT_SHA gcr.io/ml-pipeline/google/pipelines-test/apiserver:$(cat /workspace/mm.ver)
docker push 'gcr.io/ml-pipeline/api-server:$TAG_NAME'
docker push 'gcr.io/ml-pipeline/api-server:$COMMIT_SHA'
docker push 'gcr.io/ml-pipeline/google/pipelines/apiserver:$TAG_NAME'
docker push 'gcr.io/ml-pipeline/google/pipelines-test/apiserver:$TAG_NAME'
docker push gcr.io/ml-pipeline/google/pipelines/apiserver:$(cat /workspace/mm.ver)
docker push gcr.io/ml-pipeline/google/pipelines-test/apiserver:$(cat /workspace/mm.ver)
- name: 'gcr.io/cloud-builders/docker'
args: ['pull', 'gcr.io/$PROJECT_ID/scheduledworkflow:$COMMIT_SHA']
id: 'pullScheduledworkflow'
- name: 'gcr.io/cloud-builders/docker'
args: ['tag', 'gcr.io/$PROJECT_ID/scheduledworkflow:$COMMIT_SHA', 'gcr.io/ml-pipeline/scheduledworkflow:$TAG_NAME']
id: 'tagScheduledworkflowVersionNumber'
waitFor: ['pullScheduledworkflow']
- name: 'gcr.io/cloud-builders/docker'
args: ['tag', 'gcr.io/$PROJECT_ID/scheduledworkflow:$COMMIT_SHA', 'gcr.io/ml-pipeline/scheduledworkflow:$COMMIT_SHA']
id: 'tagScheduledworkflowCommitSHA'
waitFor: ['pullScheduledworkflow']
- name: 'gcr.io/cloud-builders/docker'
args: ['tag', 'gcr.io/$PROJECT_ID/scheduledworkflow:$COMMIT_SHA', 'gcr.io/ml-pipeline/google/pipelines/scheduledworkflow:$TAG_NAME']
id: 'tagScheduledworkflowForMarketplace'
waitFor: ['pullScheduledworkflow']
- name: 'gcr.io/cloud-builders/docker'
args: ['tag', 'gcr.io/$PROJECT_ID/scheduledworkflow:$COMMIT_SHA', 'gcr.io/ml-pipeline/google/pipelines-test/scheduledworkflow:$TAG_NAME']
id: 'tagScheduledworkflowForMarketplaceTest'
waitFor: ['pullScheduledworkflow']
- id: 'tagScheduledworkflowForMarketplaceMajorMinor'
waitFor: ['pullScheduledworkflow', 'parseMajorMinorVersion']
name: 'gcr.io/cloud-builders/docker'
entrypoint: bash
args:
- -ceux
- |
docker tag gcr.io/$PROJECT_ID/scheduledworkflow:$COMMIT_SHA gcr.io/ml-pipeline/google/pipelines/scheduledworkflow:$(cat /workspace/mm.ver)
docker tag gcr.io/$PROJECT_ID/scheduledworkflow:$COMMIT_SHA gcr.io/ml-pipeline/google/pipelines-test/scheduledworkflow:$(cat /workspace/mm.ver)
docker push gcr.io/ml-pipeline/google/pipelines/scheduledworkflow:$(cat /workspace/mm.ver)
docker push gcr.io/ml-pipeline/google/pipelines-test/scheduledworkflow:$(cat /workspace/mm.ver)
- name: 'gcr.io/cloud-builders/docker'
args: ['pull', 'gcr.io/$PROJECT_ID/viewer-crd-controller:$COMMIT_SHA']
id: 'pullViewerCrdController'
- name: 'gcr.io/cloud-builders/docker'
args: ['tag', 'gcr.io/$PROJECT_ID/viewer-crd-controller:$COMMIT_SHA', 'gcr.io/ml-pipeline/viewer-crd-controller:$TAG_NAME']
id: 'tagViewerCrdControllerVersionNumber'
waitFor: ['pullViewerCrdController']
- name: 'gcr.io/cloud-builders/docker'
args: ['tag', 'gcr.io/$PROJECT_ID/viewer-crd-controller:$COMMIT_SHA', 'gcr.io/ml-pipeline/viewer-crd-controller:$COMMIT_SHA']
id: 'tagViewerCrdControllerCommitSHA'
waitFor: ['pullViewerCrdController']
- name: 'gcr.io/cloud-builders/docker'
args: ['tag', 'gcr.io/$PROJECT_ID/viewer-crd-controller:$COMMIT_SHA', 'gcr.io/ml-pipeline/google/pipelines/viewercrd:$TAG_NAME']
id: 'tagViewerCrdControllerForMarketplace'
waitFor: ['pullViewerCrdController']
- name: 'gcr.io/cloud-builders/docker'
args: ['tag', 'gcr.io/$PROJECT_ID/viewer-crd-controller:$COMMIT_SHA', 'gcr.io/ml-pipeline/google/pipelines-test/viewercrd:$TAG_NAME']
id: 'tagViewerCrdControllerForMarketplaceTest'
waitFor: ['pullViewerCrdController']
- id: 'tagViewerCrdControllerForMarketplaceMajorMinor'
waitFor: ['pullViewerCrdController', 'parseMajorMinorVersion']
name: 'gcr.io/cloud-builders/docker'
entrypoint: bash
args:
- -ceux
- |
docker tag gcr.io/$PROJECT_ID/viewer-crd-controller:$COMMIT_SHA gcr.io/ml-pipeline/google/pipelines/viewercrd:$(cat /workspace/mm.ver)
docker tag gcr.io/$PROJECT_ID/viewer-crd-controller:$COMMIT_SHA gcr.io/ml-pipeline/google/pipelines-test/viewercrd:$(cat /workspace/mm.ver)
docker push gcr.io/ml-pipeline/google/pipelines/viewercrd:$(cat /workspace/mm.ver)
docker push gcr.io/ml-pipeline/google/pipelines-test/viewercrd:$(cat /workspace/mm.ver)
- name: 'gcr.io/cloud-builders/docker'
args: ['pull', 'gcr.io/$PROJECT_ID/persistenceagent:$COMMIT_SHA']
id: 'pullPersistenceagent'
- name: 'gcr.io/cloud-builders/docker'
args: ['tag', 'gcr.io/$PROJECT_ID/persistenceagent:$COMMIT_SHA', 'gcr.io/ml-pipeline/persistenceagent:$TAG_NAME']
id: 'tagPersistenceagentVersionNumber'
waitFor: ['pullPersistenceagent']
- name: 'gcr.io/cloud-builders/docker'
args: ['tag', 'gcr.io/$PROJECT_ID/persistenceagent:$COMMIT_SHA', 'gcr.io/ml-pipeline/persistenceagent:$COMMIT_SHA']
id: 'tagPersistenceagentCommitSHA'
waitFor: ['pullPersistenceagent']
- name: 'gcr.io/cloud-builders/docker'
args: ['tag', 'gcr.io/$PROJECT_ID/persistenceagent:$COMMIT_SHA', 'gcr.io/ml-pipeline/google/pipelines/persistenceagent:$TAG_NAME']
id: 'tagPersistenceagentForMarketplace'
waitFor: ['pullPersistenceagent']
- name: 'gcr.io/cloud-builders/docker'
args: ['tag', 'gcr.io/$PROJECT_ID/persistenceagent:$COMMIT_SHA', 'gcr.io/ml-pipeline/google/pipelines-test/persistenceagent:$TAG_NAME']
id: 'tagPersistenceagentForMarketplaceTest'
waitFor: ['pullPersistenceagent']
- id: 'tagPersistenceagentForMarketplaceMajorMinor'
waitFor: ['pullPersistenceagent', 'parseMajorMinorVersion']
name: 'gcr.io/cloud-builders/docker'
entrypoint: bash
args:
- -ceux
- |
docker tag gcr.io/$PROJECT_ID/persistenceagent:$COMMIT_SHA gcr.io/ml-pipeline/google/pipelines/persistenceagent:$(cat /workspace/mm.ver)
docker tag gcr.io/$PROJECT_ID/persistenceagent:$COMMIT_SHA gcr.io/ml-pipeline/google/pipelines-test/persistenceagent:$(cat /workspace/mm.ver)
docker push gcr.io/ml-pipeline/google/pipelines/persistenceagent:$(cat /workspace/mm.ver)
docker push gcr.io/ml-pipeline/google/pipelines-test/persistenceagent:$(cat /workspace/mm.ver)
- name: 'gcr.io/cloud-builders/docker'
args: ['pull', 'gcr.io/$PROJECT_ID/inverse-proxy-agent:$COMMIT_SHA']
id: 'pullInverseProxyAgent'
- name: 'gcr.io/cloud-builders/docker'
args: ['tag', 'gcr.io/$PROJECT_ID/inverse-proxy-agent:$COMMIT_SHA', 'gcr.io/ml-pipeline/inverse-proxy-agent:$TAG_NAME']
id: 'tagInverseProxyAgentVersionNumber'
waitFor: ['pullInverseProxyAgent']
- name: 'gcr.io/cloud-builders/docker'
args: ['tag', 'gcr.io/$PROJECT_ID/inverse-proxy-agent:$COMMIT_SHA', 'gcr.io/ml-pipeline/inverse-proxy-agent:$COMMIT_SHA']
id: 'tagInverseProxyAgentCommitSHA'
waitFor: ['pullInverseProxyAgent']
- name: 'gcr.io/cloud-builders/docker'
args: ['tag', 'gcr.io/$PROJECT_ID/inverse-proxy-agent:$COMMIT_SHA', 'gcr.io/ml-pipeline/google/pipelines/proxyagent:$TAG_NAME']
id: 'tagInverseProxyAgentForMarketplace'
waitFor: ['pullInverseProxyAgent']
- name: 'gcr.io/cloud-builders/docker'
args: ['tag', 'gcr.io/$PROJECT_ID/inverse-proxy-agent:$COMMIT_SHA', 'gcr.io/ml-pipeline/google/pipelines-test/proxyagent:$TAG_NAME']
id: 'tagInverseProxyAgentForMarketplaceTest'
waitFor: ['pullInverseProxyAgent']
- id: 'tagInverseProxyAgentForMarketplaceMajorMinor'
waitFor: ['pullInverseProxyAgent', 'parseMajorMinorVersion']
name: 'gcr.io/cloud-builders/docker'
entrypoint: bash
args:
- -ceux
- |
docker tag gcr.io/$PROJECT_ID/inverse-proxy-agent:$COMMIT_SHA gcr.io/ml-pipeline/google/pipelines/proxyagent:$(cat /workspace/mm.ver)
docker tag gcr.io/$PROJECT_ID/inverse-proxy-agent:$COMMIT_SHA gcr.io/ml-pipeline/google/pipelines-test/proxyagent:$(cat /workspace/mm.ver)
docker push gcr.io/ml-pipeline/google/pipelines/proxyagent:$(cat /workspace/mm.ver)
docker push gcr.io/ml-pipeline/google/pipelines-test/proxyagent:$(cat /workspace/mm.ver)
- name: 'gcr.io/cloud-builders/docker'
args: ['pull', 'gcr.io/$PROJECT_ID/visualization-server:$COMMIT_SHA']
id: 'pullVisualizationServer'
- name: 'gcr.io/cloud-builders/docker'
args: ['tag', 'gcr.io/$PROJECT_ID/visualization-server:$COMMIT_SHA', 'gcr.io/ml-pipeline/visualization-server:$TAG_NAME']
id: 'tagVisualizationServerVersionNumber'
waitFor: ['pullVisualizationServer']
- name: 'gcr.io/cloud-builders/docker'
args: ['tag', 'gcr.io/$PROJECT_ID/visualization-server:$COMMIT_SHA', 'gcr.io/ml-pipeline/visualization-server:$COMMIT_SHA']
id: 'tagVisualizationServerCommitSHA'
waitFor: ['pullVisualizationServer']
- name: 'gcr.io/cloud-builders/docker'
args: ['tag', 'gcr.io/$PROJECT_ID/visualization-server:$COMMIT_SHA', 'gcr.io/ml-pipeline/google/pipelines/visualizationserver:$TAG_NAME']
id: 'tagVisualizationServerForMarketplace'
waitFor: ['pullVisualizationServer']
- name: 'gcr.io/cloud-builders/docker'
args: ['tag', 'gcr.io/$PROJECT_ID/visualization-server:$COMMIT_SHA', 'gcr.io/ml-pipeline/google/pipelines-test/visualizationserver:$TAG_NAME']
id: 'tagVisualizationServerForMarketplaceTest'
waitFor: ['pullVisualizationServer']
- id: 'tagVisualizationServerForMarketplaceMajorMinor'
waitFor: ['pullVisualizationServer', 'parseMajorMinorVersion']
name: 'gcr.io/cloud-builders/docker'
entrypoint: bash
args:
- -ceux
- |
docker tag gcr.io/$PROJECT_ID/visualization-server:$COMMIT_SHA gcr.io/ml-pipeline/google/pipelines/visualizationserver:$(cat /workspace/mm.ver)
docker tag gcr.io/$PROJECT_ID/visualization-server:$COMMIT_SHA gcr.io/ml-pipeline/google/pipelines-test/visualizationserver:$(cat /workspace/mm.ver)
docker push gcr.io/ml-pipeline/google/pipelines/visualizationserver:$(cat /workspace/mm.ver)
docker push gcr.io/ml-pipeline/google/pipelines-test/visualizationserver:$(cat /workspace/mm.ver)
- name: 'gcr.io/cloud-builders/docker'
args: ['pull', 'gcr.io/tfx-oss-public/ml_metadata_store_server:0.21.1']
id: 'pullMetadataServer'
- name: 'gcr.io/cloud-builders/docker'
args: ['tag', 'gcr.io/tfx-oss-public/ml_metadata_store_server:0.21.1', 'gcr.io/ml-pipeline/google/pipelines/metadataserver:$TAG_NAME']
id: 'tagMetadataServerForMarketplace'
waitFor: ['pullMetadataServer']
- name: 'gcr.io/cloud-builders/docker'
args: ['tag', 'gcr.io/tfx-oss-public/ml_metadata_store_server:0.21.1', 'gcr.io/ml-pipeline/google/pipelines-test/metadataserver:$TAG_NAME']
id: 'tagMetadataServerForMarketplaceTest'
waitFor: ['pullMetadataServer']
- id: 'tagMetadataServerForMarketplaceMajorMinor'
waitFor: ['pullMetadataServer', 'parseMajorMinorVersion']
name: 'gcr.io/cloud-builders/docker'
entrypoint: bash
args:
- -ceux
- |
docker tag gcr.io/tfx-oss-public/ml_metadata_store_server:0.21.1 gcr.io/ml-pipeline/google/pipelines/metadataserver:$(cat /workspace/mm.ver)
docker tag gcr.io/tfx-oss-public/ml_metadata_store_server:0.21.1 gcr.io/ml-pipeline/google/pipelines-test/metadataserver:$(cat /workspace/mm.ver)
docker push gcr.io/ml-pipeline/google/pipelines/metadataserver:$(cat /workspace/mm.ver)
docker push gcr.io/ml-pipeline/google/pipelines-test/metadataserver:$(cat /workspace/mm.ver)
- id: 'pullMetadataWriter'
name: 'gcr.io/cloud-builders/docker'
args: ['pull', 'gcr.io/$PROJECT_ID/metadata-writer:$COMMIT_SHA']
waitFor: ['-']
- id: 'tagMetadataWriterVersionNumber'
name: 'gcr.io/cloud-builders/docker'
args: ['tag', 'gcr.io/$PROJECT_ID/metadata-writer:$COMMIT_SHA', 'gcr.io/ml-pipeline/metadata-writer:$TAG_NAME']
waitFor: ['pullMetadataWriter']
- id: 'tagMetadataWriterCommitSHA'
name: 'gcr.io/cloud-builders/docker'
args: ['tag', 'gcr.io/$PROJECT_ID/metadata-writer:$COMMIT_SHA', 'gcr.io/ml-pipeline/metadata-writer:$COMMIT_SHA']
waitFor: ['pullMetadataWriter']
- id: 'tagMetadataWriterForMarketplace'
name: 'gcr.io/cloud-builders/docker'
args: ['tag', 'gcr.io/$PROJECT_ID/metadata-writer:$COMMIT_SHA', 'gcr.io/ml-pipeline/google/pipelines/metadatawriter:$TAG_NAME']
waitFor: ['pullMetadataWriter']
- id: 'tagMetadataWriterForMarketplaceTest'
name: 'gcr.io/cloud-builders/docker'
args: ['tag', 'gcr.io/$PROJECT_ID/metadata-writer:$COMMIT_SHA', 'gcr.io/ml-pipeline/google/pipelines-test/metadatawriter:$TAG_NAME']
waitFor: ['pullMetadataWriter']
- id: 'tagMetadataWriterForMarketplaceMajorMinor'
waitFor: ['pullMetadataWriter', 'parseMajorMinorVersion']
name: 'gcr.io/cloud-builders/docker'
entrypoint: bash
args:
- -ceux
- |
docker tag gcr.io/$PROJECT_ID/metadata-writer:$COMMIT_SHA gcr.io/ml-pipeline/google/pipelines/metadatawriter:$(cat /workspace/mm.ver)
docker tag gcr.io/$PROJECT_ID/metadata-writer:$COMMIT_SHA gcr.io/ml-pipeline/google/pipelines-test/metadatawriter:$(cat /workspace/mm.ver)
docker push gcr.io/ml-pipeline/google/pipelines/metadatawriter:$(cat /workspace/mm.ver)
docker push gcr.io/ml-pipeline/google/pipelines-test/metadatawriter:$(cat /workspace/mm.ver)
- id: 'pullCacheServer'
name: 'gcr.io/cloud-builders/docker'
args: ['pull', 'gcr.io/$PROJECT_ID/cache-server:$COMMIT_SHA']
waitFor: ['-']
- id: 'tagCacheServerVersionNumber'
name: 'gcr.io/cloud-builders/docker'
args: ['tag', 'gcr.io/$PROJECT_ID/cache-server:$COMMIT_SHA', 'gcr.io/ml-pipeline/cache-server:$TAG_NAME']
waitFor: ['pullCacheServer']
- id: 'tagCacheServerCommitSHA'
name: 'gcr.io/cloud-builders/docker'
args: ['tag', 'gcr.io/$PROJECT_ID/cache-server:$COMMIT_SHA', 'gcr.io/ml-pipeline/cache-server:$COMMIT_SHA']
waitFor: ['pullCacheServer']
- id: 'tagCacheServerForMarketplace'
name: 'gcr.io/cloud-builders/docker'
args: ['tag', 'gcr.io/$PROJECT_ID/cache-server:$COMMIT_SHA', 'gcr.io/ml-pipeline/google/pipelines/cacheserver:$TAG_NAME']
waitFor: ['pullCacheServer']
- id: 'tagCacheServerForMarketplaceTest'
name: 'gcr.io/cloud-builders/docker'
args: ['tag', 'gcr.io/$PROJECT_ID/cache-server:$COMMIT_SHA', 'gcr.io/ml-pipeline/google/pipelines-test/cacheserver:$TAG_NAME']
waitFor: ['pullCacheServer']
- id: 'tagCacheServerForMarketplaceMajorMinor'
waitFor: ['pullCacheServer', 'parseMajorMinorVersion']
name: 'gcr.io/cloud-builders/docker'
entrypoint: bash
args:
- -ceux
- |
docker tag gcr.io/$PROJECT_ID/cache-server:$COMMIT_SHA gcr.io/ml-pipeline/google/pipelines/cacheserver:$(cat /workspace/mm.ver)
docker tag gcr.io/$PROJECT_ID/cache-server:$COMMIT_SHA gcr.io/ml-pipeline/google/pipelines-test/cacheserver:$(cat /workspace/mm.ver)
docker push gcr.io/ml-pipeline/google/pipelines/cacheserver:$(cat /workspace/mm.ver)
docker push gcr.io/ml-pipeline/google/pipelines-test/cacheserver:$(cat /workspace/mm.ver)
- id: 'pullCacheDeployer'
name: 'gcr.io/cloud-builders/docker'
args: ['pull', 'gcr.io/$PROJECT_ID/cache-deployer:$COMMIT_SHA']
waitFor: ['-']
- id: 'tagCacheDeployerVersionNumber'
name: 'gcr.io/cloud-builders/docker'
args: ['tag', 'gcr.io/$PROJECT_ID/cache-deployer:$COMMIT_SHA', 'gcr.io/ml-pipeline/cache-deployer:$TAG_NAME']
waitFor: ['pullCacheDeployer']
- id: 'tagCacheDeployerCommitSHA'
name: 'gcr.io/cloud-builders/docker'
args: ['tag', 'gcr.io/$PROJECT_ID/cache-deployer:$COMMIT_SHA', 'gcr.io/ml-pipeline/cache-deployer:$COMMIT_SHA']
waitFor: ['pullCacheDeployer']
- id: 'tagCacheDeployerForMarketplace'
name: 'gcr.io/cloud-builders/docker'
args: ['tag', 'gcr.io/$PROJECT_ID/cache-deployer:$COMMIT_SHA', 'gcr.io/ml-pipeline/google/pipelines/cachedeployer:$TAG_NAME']
waitFor: ['pullCacheDeployer']
- id: 'tagCacheDeployerForMarketplaceTest'
name: 'gcr.io/cloud-builders/docker'
args: ['tag', 'gcr.io/$PROJECT_ID/cache-deployer:$COMMIT_SHA', 'gcr.io/ml-pipeline/google/pipelines-test/cachedeployer:$TAG_NAME']
waitFor: ['pullCacheDeployer']
- id: 'tagCacheDeployerForMarketplaceMajorMinor'
waitFor: ['pullCacheDeployer', 'parseMajorMinorVersion']
name: 'gcr.io/cloud-builders/docker'
entrypoint: bash
args:
- -ceux
- |
docker tag gcr.io/$PROJECT_ID/cache-deployer:$COMMIT_SHA gcr.io/ml-pipeline/google/pipelines/cachedeployer:$(cat /workspace/mm.ver)
docker tag gcr.io/$PROJECT_ID/cache-deployer:$COMMIT_SHA gcr.io/ml-pipeline/google/pipelines-test/cachedeployer:$(cat /workspace/mm.ver)
docker push gcr.io/ml-pipeline/google/pipelines/cachedeployer:$(cat /workspace/mm.ver)
docker push gcr.io/ml-pipeline/google/pipelines-test/cachedeployer:$(cat /workspace/mm.ver)
- name: 'gcr.io/cloud-builders/docker'
args: ['pull', 'gcr.io/$PROJECT_ID/metadata-envoy:$COMMIT_SHA']
id: 'pullMetadataEnvoy'
- name: 'gcr.io/cloud-builders/docker'
args: ['tag', 'gcr.io/$PROJECT_ID/metadata-envoy:$COMMIT_SHA', 'gcr.io/ml-pipeline/google/pipelines/metadataenvoy:$TAG_NAME']
id: 'tagMetadataEnvoyForMarketplace'
waitFor: ['pullMetadataEnvoy']
- name: 'gcr.io/cloud-builders/docker'
args: ['tag', 'gcr.io/$PROJECT_ID/metadata-envoy:$COMMIT_SHA', 'gcr.io/ml-pipeline/google/pipelines-test/metadataenvoy:$TAG_NAME']
id: 'tagMetadataEnvoyForMarketplaceTest'
waitFor: ['pullMetadataEnvoy']
- id: 'tagMetadataEnvoyForMarketplaceMajorMinor'
waitFor: ['pullMetadataEnvoy', 'parseMajorMinorVersion']
name: 'gcr.io/cloud-builders/docker'
entrypoint: bash
args:
- -ceux
- |
docker tag gcr.io/$PROJECT_ID/metadata-envoy:$COMMIT_SHA gcr.io/ml-pipeline/google/pipelines/metadataenvoy:$(cat /workspace/mm.ver)
docker tag gcr.io/$PROJECT_ID/metadata-envoy:$COMMIT_SHA gcr.io/ml-pipeline/google/pipelines-test/metadataenvoy:$(cat /workspace/mm.ver)
docker push gcr.io/ml-pipeline/google/pipelines/metadataenvoy:$(cat /workspace/mm.ver)
docker push gcr.io/ml-pipeline/google/pipelines-test/metadataenvoy:$(cat /workspace/mm.ver)
- name: 'gcr.io/cloud-builders/docker'
args: ['pull', 'gcr.io/ml-pipeline/minio:RELEASE.2019-08-14T20-37-41Z-license-compliance']
id: 'pullMinio'
- name: 'gcr.io/cloud-builders/docker'
args: ['tag', 'gcr.io/ml-pipeline/minio:RELEASE.2019-08-14T20-37-41Z-license-compliance', 'gcr.io/ml-pipeline/google/pipelines/minio:$TAG_NAME']
id: 'tagMinioForMarketplace'
waitFor: ['pullMinio']
- name: 'gcr.io/cloud-builders/docker'
args: ['tag', 'gcr.io/ml-pipeline/minio:RELEASE.2019-08-14T20-37-41Z-license-compliance', 'gcr.io/ml-pipeline/google/pipelines-test/minio:$TAG_NAME']
id: 'tagMinioForMarketplaceTest'
waitFor: ['pullMinio']
- id: 'tagMinioForMarketplaceMajorMinor'
waitFor: ['pullMinio', 'parseMajorMinorVersion']
name: 'gcr.io/cloud-builders/docker'
entrypoint: bash
args:
- -ceux
- |
docker tag gcr.io/ml-pipeline/minio:RELEASE.2019-08-14T20-37-41Z-license-compliance gcr.io/ml-pipeline/google/pipelines/minio:$(cat /workspace/mm.ver)
docker tag gcr.io/ml-pipeline/minio:RELEASE.2019-08-14T20-37-41Z-license-compliance gcr.io/ml-pipeline/google/pipelines-test/minio:$(cat /workspace/mm.ver)
docker push gcr.io/ml-pipeline/google/pipelines/minio:$(cat /workspace/mm.ver)
docker push gcr.io/ml-pipeline/google/pipelines-test/minio:$(cat /workspace/mm.ver)
- name: 'gcr.io/cloud-builders/docker'
args: ['pull', 'gcr.io/ml-pipeline/mysql:5.6']
id: 'pullMysql'
- name: 'gcr.io/cloud-builders/docker'
args: ['tag', 'gcr.io/ml-pipeline/mysql:5.6', 'gcr.io/ml-pipeline/google/pipelines/mysql:$TAG_NAME']
id: 'tagMySqlForMarketplace'
waitFor: ['pullMysql']
- name: 'gcr.io/cloud-builders/docker'
args: ['tag', 'gcr.io/ml-pipeline/mysql:5.6', 'gcr.io/ml-pipeline/google/pipelines-test/mysql:$TAG_NAME']
id: 'tagMySqlForMarketplaceTest'
waitFor: ['pullMysql']
- id: 'tagMySqlForMarketplaceMajorMinor'
waitFor: ['pullMysql', 'parseMajorMinorVersion']
name: 'gcr.io/cloud-builders/docker'
entrypoint: bash
args:
- -ceux
- |
docker tag gcr.io/ml-pipeline/mysql:5.6 gcr.io/ml-pipeline/google/pipelines/mysql:$(cat /workspace/mm.ver)
docker tag gcr.io/ml-pipeline/mysql:5.6 gcr.io/ml-pipeline/google/pipelines-test/mysql:$(cat /workspace/mm.ver)
docker push gcr.io/ml-pipeline/google/pipelines/mysql:$(cat /workspace/mm.ver)
docker push gcr.io/ml-pipeline/google/pipelines-test/mysql:$(cat /workspace/mm.ver)
- name: 'gcr.io/cloud-builders/docker'
args: ['pull', 'gcr.io/cloudsql-docker/gce-proxy:1.14']
id: 'pullCloudsqlProxy'
- name: 'gcr.io/cloud-builders/docker'
args: ['tag', 'gcr.io/cloudsql-docker/gce-proxy:1.14', 'gcr.io/ml-pipeline/google/pipelines/cloudsqlproxy:$TAG_NAME']
id: 'tagCloudSqlProxyForMarketplace'
waitFor: ['pullCloudsqlProxy']
- name: 'gcr.io/cloud-builders/docker'
args: ['tag', 'gcr.io/cloudsql-docker/gce-proxy:1.14', 'gcr.io/ml-pipeline/google/pipelines-test/cloudsqlproxy:$TAG_NAME']
id: 'tagCloudSqlProxyForMarketplaceTest'
waitFor: ['pullCloudsqlProxy']
- id: 'tagCloudSqlProxyForMarketplaceMajorMinor'
waitFor: ['pullCloudsqlProxy', 'parseMajorMinorVersion']
name: 'gcr.io/cloud-builders/docker'
entrypoint: bash
args:
- -ceux
- |
docker tag gcr.io/cloudsql-docker/gce-proxy:1.14 gcr.io/ml-pipeline/google/pipelines/cloudsqlproxy:$(cat /workspace/mm.ver)
docker tag gcr.io/cloudsql-docker/gce-proxy:1.14 gcr.io/ml-pipeline/google/pipelines-test/cloudsqlproxy:$(cat /workspace/mm.ver)
docker push gcr.io/ml-pipeline/google/pipelines/cloudsqlproxy:$(cat /workspace/mm.ver)
docker push gcr.io/ml-pipeline/google/pipelines-test/cloudsqlproxy:$(cat /workspace/mm.ver)
- name: 'gcr.io/cloud-builders/docker'
args: ['pull', 'gcr.io/ml-pipeline/argoexec:v2.7.5-license-compliance']
id: 'pullArgoExecutor'
- name: 'gcr.io/cloud-builders/docker'
args: ['tag', 'gcr.io/ml-pipeline/argoexec:v2.7.5-license-compliance', 'gcr.io/ml-pipeline/google/pipelines/argoexecutor:$TAG_NAME']
id: 'tagArgoExecutorForMarketplace'
waitFor: ['pullArgoExecutor']
- name: 'gcr.io/cloud-builders/docker'
args: ['tag', 'gcr.io/ml-pipeline/argoexec:v2.7.5-license-compliance', 'gcr.io/ml-pipeline/google/pipelines-test/argoexecutor:$TAG_NAME']
id: 'tagArgoExecutorForMarketplaceTest'
waitFor: ['pullArgoExecutor']
- id: 'tagArgoExecutorForMarketplaceMajorMinor'
waitFor: ['pullArgoExecutor', 'parseMajorMinorVersion']
name: 'gcr.io/cloud-builders/docker'
entrypoint: bash
args:
- -ceux
- |
docker tag gcr.io/ml-pipeline/argoexec:v2.7.5-license-compliance gcr.io/ml-pipeline/google/pipelines/argoexecutor:$(cat /workspace/mm.ver)
docker tag gcr.io/ml-pipeline/argoexec:v2.7.5-license-compliance gcr.io/ml-pipeline/google/pipelines-test/argoexecutor:$(cat /workspace/mm.ver)
docker push gcr.io/ml-pipeline/google/pipelines/argoexecutor:$(cat /workspace/mm.ver)
docker push gcr.io/ml-pipeline/google/pipelines-test/argoexecutor:$(cat /workspace/mm.ver)
- name: 'gcr.io/cloud-builders/docker'
args: ['pull', 'gcr.io/ml-pipeline/workflow-controller:v2.7.5-license-compliance']
id: 'pullArgoWorkflowController'
- name: 'gcr.io/cloud-builders/docker'
args: ['tag', 'gcr.io/ml-pipeline/workflow-controller:v2.7.5-license-compliance', 'gcr.io/ml-pipeline/google/pipelines/argoworkflowcontroller:$TAG_NAME']
id: 'tagArgoWorkflowControllerForMarketplace'
waitFor: ['pullArgoWorkflowController']
- name: 'gcr.io/cloud-builders/docker'
args: ['tag', 'gcr.io/ml-pipeline/workflow-controller:v2.7.5-license-compliance', 'gcr.io/ml-pipeline/google/pipelines-test/argoworkflowcontroller:$TAG_NAME']
id: 'tagArgoWorkflowControllerForMarketplaceTest'
waitFor: ['pullArgoWorkflowController']
- id: 'tagArgoWorkflowControllerForMarketplaceMajorMinor'
waitFor: ['pullArgoWorkflowController', 'parseMajorMinorVersion']
name: 'gcr.io/cloud-builders/docker'
entrypoint: bash
args:
- -ceux
- |
docker tag gcr.io/ml-pipeline/workflow-controller:v2.7.5-license-compliance gcr.io/ml-pipeline/google/pipelines/argoworkflowcontroller:$(cat /workspace/mm.ver)
docker tag gcr.io/ml-pipeline/workflow-controller:v2.7.5-license-compliance gcr.io/ml-pipeline/google/pipelines-test/argoworkflowcontroller:$(cat /workspace/mm.ver)
docker push gcr.io/ml-pipeline/google/pipelines/argoworkflowcontroller:$(cat /workspace/mm.ver)
docker push gcr.io/ml-pipeline/google/pipelines-test/argoworkflowcontroller:$(cat /workspace/mm.ver)
# Marketplace specific deployer and specific primary image
- id: 'pullMarketplaceDeployer'
name: 'gcr.io/cloud-builders/docker'
args: ['pull', 'gcr.io/$PROJECT_ID/deployer:$COMMIT_SHA']
waitFor: ['-']
- id: 'tagMarketplaceDeployerVersionNumber'
name: 'gcr.io/cloud-builders/docker'
args: ['tag', 'gcr.io/$PROJECT_ID/deployer:$COMMIT_SHA', 'gcr.io/ml-pipeline/google/pipelines/deployer:$TAG_NAME']
waitFor: ['pullMarketplaceDeployer']
- id: 'tagMarketplaceDeployerVersionNumberTest'
name: 'gcr.io/cloud-builders/docker'
args: ['tag', 'gcr.io/$PROJECT_ID/deployer:$COMMIT_SHA', 'gcr.io/ml-pipeline/google/pipelines-test/deployer:$TAG_NAME']
waitFor: ['pullMarketplaceDeployer']
- id: 'tagMarketplaceDeployerVersionNumberMajorMinor'
waitFor: ['pullMarketplaceDeployer', 'parseMajorMinorVersion']
name: 'gcr.io/cloud-builders/docker'
entrypoint: bash
args:
- -ceux
- |
docker tag gcr.io/$PROJECT_ID/deployer:$COMMIT_SHA gcr.io/ml-pipeline/google/pipelines/deployer:$(cat /workspace/mm.ver)
docker tag gcr.io/$PROJECT_ID/deployer:$COMMIT_SHA gcr.io/ml-pipeline/google/pipelines-test/deployer:$(cat /workspace/mm.ver)
docker push gcr.io/ml-pipeline/google/pipelines/deployer:$(cat /workspace/mm.ver)
docker push gcr.io/ml-pipeline/google/pipelines-test/deployer:$(cat /workspace/mm.ver)
- id: 'tagMarketplacePrimaryVersionNumber'
name: 'gcr.io/cloud-builders/docker'
args: ['tag', 'gcr.io/$PROJECT_ID/deployer:$COMMIT_SHA', 'gcr.io/ml-pipeline/google/pipelines:$TAG_NAME']
waitFor: ['pullMarketplaceDeployer']
- id: 'tagMarketplacePrimaryVersionNumberTest'
name: 'gcr.io/cloud-builders/docker'
args: ['tag', 'gcr.io/$PROJECT_ID/deployer:$COMMIT_SHA', 'gcr.io/ml-pipeline/google/pipelines-test:$TAG_NAME']
waitFor: ['pullMarketplaceDeployer']
- id: 'tagMarketplacePrimaryVersionNumberMajorMinor'
waitFor: ['pullMarketplaceDeployer', 'parseMajorMinorVersion']
name: 'gcr.io/cloud-builders/docker'
entrypoint: bash
args:
- -ceux
- |
docker tag gcr.io/$PROJECT_ID/deployer:$COMMIT_SHA gcr.io/ml-pipeline/google/pipelines:$(cat /workspace/mm.ver)
docker tag gcr.io/$PROJECT_ID/deployer:$COMMIT_SHA gcr.io/ml-pipeline/google/pipelines-test:$(cat /workspace/mm.ver)
docker push gcr.io/ml-pipeline/google/pipelines:$(cat /workspace/mm.ver)
docker push gcr.io/ml-pipeline/google/pipelines-test:$(cat /workspace/mm.ver)
# Copy the Python SDK
- name: 'gcr.io/cloud-builders/gsutil'
args: ['cp', 'gs://$PROJECT_ID/builds/$COMMIT_SHA/kfp.tar.gz', '/workspace/']
id: 'copyPythonSDKLocal'
- name: 'gcr.io/cloud-builders/gsutil'
args: ['cp', '/workspace/kfp.tar.gz', 'gs://ml-pipeline/release/$TAG_NAME/kfp.tar.gz']
id: 'copyPythonSDK'
waitFor: ['copyPythonSDKLocal']
- name: 'gcr.io/cloud-builders/gsutil'
args: ['cp', '/workspace/kfp.tar.gz', 'gs://ml-pipeline/release/latest/kfp.tar.gz']
id: 'copyPythonSDKToLatest'
waitFor: ['copyPythonSDKLocal']
# Copy the Python Component SDK
- name: 'gcr.io/cloud-builders/gsutil'
args: ['cp', 'gs://$PROJECT_ID/builds/$COMMIT_SHA/kfp-component.tar.gz', '/workspace/']
id: 'copyPythonComponentSDKLocal'
- name: 'gcr.io/cloud-builders/gsutil'
args: ['cp', '/workspace/kfp-component.tar.gz', 'gs://ml-pipeline/release/$TAG_NAME/kfp-component.tar.gz']
id: 'copyPythonComponentSDK'
waitFor: ['copyPythonComponentSDKLocal']
- name: 'gcr.io/cloud-builders/gsutil'
args: ['cp', '/workspace/kfp-component.tar.gz', 'gs://ml-pipeline/release/latest/kfp-component.tar.gz']
id: 'copyPythonComponentSDKToLatest'
waitFor: ['copyPythonComponentSDKLocal']
images:
- 'gcr.io/ml-pipeline/scheduledworkflow:$TAG_NAME'
- 'gcr.io/ml-pipeline/scheduledworkflow:$COMMIT_SHA'
- 'gcr.io/ml-pipeline/persistenceagent:$TAG_NAME'
- 'gcr.io/ml-pipeline/persistenceagent:$COMMIT_SHA'
- 'gcr.io/ml-pipeline/viewer-crd-controller:$TAG_NAME'
- 'gcr.io/ml-pipeline/viewer-crd-controller:$COMMIT_SHA'
- 'gcr.io/ml-pipeline/inverse-proxy-agent:$TAG_NAME'
- 'gcr.io/ml-pipeline/inverse-proxy-agent:$COMMIT_SHA'
- 'gcr.io/ml-pipeline/visualization-server:$TAG_NAME'
- 'gcr.io/ml-pipeline/visualization-server:$COMMIT_SHA'
- 'gcr.io/ml-pipeline/metadata-writer:$TAG_NAME'
- 'gcr.io/ml-pipeline/metadata-writer:$COMMIT_SHA'
- 'gcr.io/ml-pipeline/cache-server:$TAG_NAME'
- 'gcr.io/ml-pipeline/cache-server:$COMMIT_SHA'
- 'gcr.io/ml-pipeline/cache-deployer:$TAG_NAME'
- 'gcr.io/ml-pipeline/cache-deployer:$COMMIT_SHA'
- 'gcr.io/ml-pipeline/google/pipelines/scheduledworkflow:$TAG_NAME'
- 'gcr.io/ml-pipeline/google/pipelines/viewercrd:$TAG_NAME'
- 'gcr.io/ml-pipeline/google/pipelines/persistenceagent:$TAG_NAME'
- 'gcr.io/ml-pipeline/google/pipelines/proxyagent:$TAG_NAME'
- 'gcr.io/ml-pipeline/google/pipelines/visualizationserver:$TAG_NAME'
- 'gcr.io/ml-pipeline/google/pipelines/metadataserver:$TAG_NAME'
- 'gcr.io/ml-pipeline/google/pipelines/minio:$TAG_NAME'
- 'gcr.io/ml-pipeline/google/pipelines/mysql:$TAG_NAME'
- 'gcr.io/ml-pipeline/google/pipelines/cloudsqlproxy:$TAG_NAME'
- 'gcr.io/ml-pipeline/google/pipelines/argoexecutor:$TAG_NAME'
- 'gcr.io/ml-pipeline/google/pipelines/argoworkflowcontroller:$TAG_NAME'
- 'gcr.io/ml-pipeline/google/pipelines/metadataenvoy:$TAG_NAME'
- 'gcr.io/ml-pipeline/google/pipelines/metadatawriter:$TAG_NAME'
- 'gcr.io/ml-pipeline/google/pipelines/deployer:$TAG_NAME'
- 'gcr.io/ml-pipeline/google/pipelines/cacheserver:$TAG_NAME'
- 'gcr.io/ml-pipeline/google/pipelines/cachedeployer:$TAG_NAME'
- 'gcr.io/ml-pipeline/google/pipelines:$TAG_NAME'
- 'gcr.io/ml-pipeline/google/pipelines-test/scheduledworkflow:$TAG_NAME'
- 'gcr.io/ml-pipeline/google/pipelines-test/viewercrd:$TAG_NAME'
- 'gcr.io/ml-pipeline/google/pipelines-test/persistenceagent:$TAG_NAME'
- 'gcr.io/ml-pipeline/google/pipelines-test/proxyagent:$TAG_NAME'
- 'gcr.io/ml-pipeline/google/pipelines-test/visualizationserver:$TAG_NAME'
- 'gcr.io/ml-pipeline/google/pipelines-test/metadataserver:$TAG_NAME'
- 'gcr.io/ml-pipeline/google/pipelines-test/minio:$TAG_NAME'
- 'gcr.io/ml-pipeline/google/pipelines-test/mysql:$TAG_NAME'
- 'gcr.io/ml-pipeline/google/pipelines-test/cloudsqlproxy:$TAG_NAME'
- 'gcr.io/ml-pipeline/google/pipelines-test/argoexecutor:$TAG_NAME'
- 'gcr.io/ml-pipeline/google/pipelines-test/argoworkflowcontroller:$TAG_NAME'
- 'gcr.io/ml-pipeline/google/pipelines-test/metadataenvoy:$TAG_NAME'
- 'gcr.io/ml-pipeline/google/pipelines-test/metadatawriter:$TAG_NAME'
- 'gcr.io/ml-pipeline/google/pipelines-test/cacheserver:$TAG_NAME'
- 'gcr.io/ml-pipeline/google/pipelines-test/cachedeployer:$TAG_NAME'
- 'gcr.io/ml-pipeline/google/pipelines-test/deployer:$TAG_NAME'
- 'gcr.io/ml-pipeline/google/pipelines-test:$TAG_NAME'
timeout: '1200s'

9
.style.yapf Normal file
View File

@ -0,0 +1,9 @@
[style]
based_on_style = google
blank_line_before_nested_class_or_def = true
column_limit = 80
continuation_indent_width = 4
dedent_closing_brackets = true
coalesce_brackets = true
indent_width = 2
split_before_first_argument = true

View File

@ -1,3 +1,17 @@
# Copyright 2020 kubeflow.org
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
matrix: matrix:
include: include:
- name: "Unit tests, Python 3.6" - name: "Unit tests, Python 3.6"
@ -32,3 +46,94 @@ matrix:
python: "3.7" python: "3.7"
script: script:
- make lint - make lint
# =================================
# TODO: merge with config from KFP
# =================================
#matrix:
# include:
# - language: python
# python: "3.5"
# env: TOXENV=py35
# before_install:
# - export PYTHONPATH=$PYTHONPATH:/home/travis/.local/lib/python3.5/site-packages/
# install: &0
# - python3 -m pip install --upgrade pip
# - python3 -m pip install -r $TRAVIS_BUILD_DIR/sdk/python/requirements.txt
# # Additional dependencies
# - pip3 install coverage==4.5.4 coveralls==1.9.2 six>=1.13.0
# # Sample test infra dependencies
# - pip3 install minio
# - pip3 install junit_xml
# # Visualization test dependencies
# - cd $TRAVIS_BUILD_DIR/backend/src/apiserver/visualization
# - pip3 install -r requirements-test.txt
# script: &1 # DSL tests
# - cd $TRAVIS_BUILD_DIR/sdk/python
# - python3 -m pip install -e .
# - cd $TRAVIS_BUILD_DIR # Changing the current directory to the repo root for correct coverall paths
# - coverage run --source=kfp --append sdk/python/tests/dsl/main.py
# - coverage run --source=kfp --append sdk/python/tests/compiler/main.py
# - coverage run --source=kfp --append -m unittest discover --verbose --start-dir sdk/python/tests --top-level-directory=sdk/python
# #- coveralls
#
# # Test against TFX
# # Compile and setup protobuf
# - PROTOC_ZIP=protoc-3.7.1-linux-x86_64.zip
# - curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v3.7.1/$PROTOC_ZIP
# - sudo unzip -o $PROTOC_ZIP -d /usr/local bin/protoc
# - sudo unzip -o $PROTOC_ZIP -d /usr/local 'include/*'
# - rm -f $PROTOC_ZIP
# # Install TFX from head
# - cd $TRAVIS_BUILD_DIR
# - git clone https://github.com/tensorflow/tfx.git
# - cd $TRAVIS_BUILD_DIR/tfx
# - pip3 install --upgrade pip
# - set -x
# - set -e
# - python3 setup.py bdist_wheel
# - WHEEL_PATH=$(find dist -name "tfx-*.whl")
# - python3 -m pip install "${WHEEL_PATH}" --upgrade
# - set +e
# - set +x
# # Three KFP-related unittests
# - cd $TRAVIS_BUILD_DIR/tfx/tfx/orchestration/kubeflow
# - python3 kubeflow_dag_runner_test.py
# - cd $TRAVIS_BUILD_DIR/tfx/tfx/examples/chicago_taxi_pipeline
# - python3 taxi_pipeline_kubeflow_gcp_test.py
# - python3 taxi_pipeline_kubeflow_local_test.py
#
# # Visualization test
# - cd $TRAVIS_BUILD_DIR/backend/src/apiserver/visualization
# - python3 test_exporter.py
# - python3 test_server.py
#
# # Test loading all component.yaml definitions
# - $TRAVIS_BUILD_DIR/components/test_load_all_components.sh
#
# # Component SDK tests
# - cd $TRAVIS_BUILD_DIR/components/gcp/container/component_sdk/python
# - ./run_test.sh
#
# # Sample test unittests.
# - cd $TRAVIS_BUILD_DIR/test/sample-test/unittests
# - python3 -m unittest utils_tests.py
# - language: python
# python: "3.6"
# env: TOXENV=py36
# before_install:
# - export PYTHONPATH=$PYTHONPATH:/home/travis/.local/lib/python3.6/site-packages/
# install: *0
# script: *1
# - language: python
# python: "3.7"
# env: TOXENV=py37
# before_install:
# - export PYTHONPATH=$PYTHONPATH:/home/travis/.local/lib/python3.7/site-packages/
# install: *0
# script: *1
# - name: "Lint Python code with flake8"
# language: python
# python: "3.7"
# install: pip install flake8
# script: flake8 . --count --exclude=backend/src/apiserver/visualization/types/*.py --select=E9,F63,F7,F82 --show-source --statistics || true

8
BUILD.bazel Normal file
View File

@ -0,0 +1,8 @@
load("@bazel_gazelle//:def.bzl", "gazelle")
# gazelle:prefix github.com/kubeflow/pipelines
# gazelle:resolve proto protoc-gen-swagger/options/annotations.proto @com_github_grpc_ecosystem_grpc_gateway//protoc-gen-swagger/options:options_proto
# gazelle:resolve proto go protoc-gen-swagger/options/annotations.proto @com_github_grpc_ecosystem_grpc_gateway//protoc-gen-swagger/options:go_default_library
# gazelle:resolve go github.com/kubeflow/pipelines/backend/api/go_client //backend/api:go_default_library
# gazelle:exclude vendor/
gazelle(name = "gazelle")

View File

@ -29,8 +29,19 @@ again.
## Development Guidelines ## Development Guidelines
Please take a look at the [KFP-Tekton Developer Guide](sdk/python/README.md) for details about how to make code Please take a look at the [KFP-Tekton Developer Guide](sdk/python/README.md) for
contributions to the KFP-Tekton project. details about how to make code contributions to the KFP-Tekton project.
## Coding style
The Python part of the project will follow [Google Python style guide](http://google.github.io/styleguide/pyguide.html).
We provide a [yapf](https://github.com/google/yapf) configuration file to help
contributors auto-format their code to adopt the Google Python style. Also, it
is encouraged to lint python docstrings by [docformatter](https://github.com/myint/docformatter).
The frontend part of the project uses [prettier](https://prettier.io/) for
formatting, read [frontend/README.md#code-style](frontend/README.md#code-style)
for more details.
## Code reviews ## Code reviews
@ -39,7 +50,8 @@ use GitHub pull requests for this purpose. Consult
[GitHub Help](https://help.github.com/articles/about-pull-requests/) for more [GitHub Help](https://help.github.com/articles/about-pull-requests/) for more
information on using pull requests. information on using pull requests.
The following should be viewed as Best Practices unless you know better ones (please submit a guidelines PR). The following should be viewed as Best Practices unless you know better ones
(please submit a guidelines PR).
| Practice | Rationale | | Practice | Rationale |
| -------- | --------- | | -------- | --------- |

View File

@ -79,3 +79,13 @@ distribution: venv ## Create a distribution and upload to test.PyPi.org
python3 setup.py sdist && \ python3 setup.py sdist && \
twine check dist/* && \ twine check dist/* && \
twine upload --repository testpypi dist/* twine upload --repository testpypi dist/*
.PHONY: build
build: ## Create GO vendor directories with all dependencies
go mod vendor
# Extract go licenses into a single file. This assume licext is install globally through
# npm install -g license-extractor
# See https://github.com/arei/license-extractor
licext --mode merge --source vendor/ --target third_party/license.txt --overwrite
# Delete vendor directory
rm -rf vendor

1
VERSION Normal file
View File

@ -0,0 +1 @@
0.5.1

1081
WORKSPACE Normal file

File diff suppressed because it is too large Load Diff

93
backend/Dockerfile Normal file
View File

@ -0,0 +1,93 @@
ARG BAZEL_IMAGE=l.gcr.io/google/bazel:0.24.0
FROM $BAZEL_IMAGE as builder
RUN apt-get update && \
apt-get install -y cmake clang musl-dev openssl
WORKDIR /go/src/github.com/kubeflow/pipelines
COPY . .
ARG google_application_credentials
ARG use_remote_build=false
# RUN bazel build -c opt --action_env=PATH --define=grpc_no_ares=true backend/src/apiserver:apiserver
RUN if [ "$use_remote_build" = "true" ]; then \
echo "Using remote build execution ..." && \
printf "%s" "$google_application_credentials" > /credentials.json && \
bazel --bazelrc=tools/bazel_builder/bazelrc \
build -c opt backend/src/apiserver:apiserver --config=remote \
--google_credentials=/credentials.json; \
else \
echo "Using local build execution..." && \
bazel --bazelrc=tools/bazel_builder/bazelrc \
build -c opt backend/src/apiserver:apiserver; \
fi
# Compile
FROM python:3.5 as compiler
RUN apt-get update -y && \
apt-get install --no-install-recommends -y -q default-jdk python3-setuptools python3-dev
RUN wget https://bootstrap.pypa.io/get-pip.py && python3 get-pip.py
COPY backend/requirements.txt .
RUN python3 -m pip install -r requirements.txt
# Downloading Argo CLI so that the samples are validated
#ADD https://github.com/argoproj/argo/releases/download/v2.7.5/argo-linux-amd64 /usr/local/bin/argo
ADD https://github.com/argoproj/argo/releases/download/v2.4.3/argo-linux-amd64 /usr/local/bin/argo
RUN chmod +x /usr/local/bin/argo
WORKDIR /go/src/github.com/kubeflow/pipelines
COPY sdk sdk
WORKDIR /go/src/github.com/kubeflow/pipelines/sdk/python
RUN python3 setup.py install
WORKDIR /samples
COPY ./samples .
# We need to check that all samples have been compiled without error.
# For find program, the -exec argument is a filter predicate just like -name. It
# only affects whether the file is "found", not the find's exit code.
# One way to solve this problem is to check whether we have any python pipelines
# that cannot compile. Here the exit code is the number of such files:
# RUN bash -e -c 'exit $(find . -maxdepth 2 -name "*.py" ! -exec dsl-compile --py {} --output {}.tar.gz \; -print | wc -l)'
# I think it's better to just use a shell loop though.
# RUN for pipeline in $(find . -maxdepth 2 -name '*.py' -type f); do dsl-compile --py "$pipeline" --output "$pipeline.tar.gz"; done
# The "for" loop breaks on all whitespace, so we either need to override IFS or
# use the "read" command instead.
RUN line="import kfp;kfp.components.default_base_image_or_builder='gcr.io/google-appengine/python:2020-03-31-141326";\
set -e; find core tutorials -maxdepth 2 -name '*.py' -type f | while read pipeline; do \
awk -v text="$line" '!/^#/ && !p {print text; p=1} 1' "$pipeline" && \
python3 "$pipeline"; \
done
FROM debian:stretch
ARG COMMIT_SHA=unknown
ENV COMMIT_SHA=${COMMIT_SHA}
ARG TAG_NAME=unknown
ENV TAG_NAME=${TAG_NAME}
WORKDIR /bin
COPY third_party/license.txt /bin/license.txt
COPY --from=builder /go/src/github.com/kubeflow/pipelines/bazel-bin/backend/src/apiserver/ /usr/local/apiserver
RUN cp /usr/local/apiserver/linux_$(dpkg --print-architecture)_stripped/apiserver /bin/apiserver && \
rm -rf /usr/local/apiserver
COPY backend/src/apiserver/config/ /config
COPY --from=compiler /samples/ /samples/
# Adding CA certificate so API server can download pipeline through URL
RUN apt-get update && apt-get install -y ca-certificates \
# wget is used for liveness/readiness probe command
wget
# Pin sample doc links to the commit that built the backend image
RUN sed -E "s#/(blob|tree)/master/#/\1/${COMMIT_SHA}/#g" -i /config/sample_config.json && \
sed -E "s/%252Fmaster/%252F${COMMIT_SHA}/#g" -i /config/sample_config.json
# Expose apiserver port
EXPOSE 8888
# Start the apiserver
CMD apiserver --config=/config --sampleconfig=/config/sample_config.json -logtostderr=true

30
backend/Dockerfile.bazel Normal file
View File

@ -0,0 +1,30 @@
FROM ubuntu:18.04 as builder
RUN apt-get update \
&& apt-get install -y --no-install-recommends software-properties-common \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN apt-get update \
&& apt-get install -y curl \
openjdk-11-jdk \
openjdk-11-jre-headless \
pkg-config \
zip \
g++ \
git \
zlib1g-dev \
unzip \
python \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
ENV BAZEL_VERSION=0.24.0
RUN mkdir -p /bazel \
&& cd /bazel \
&& curl -fSsL -O https://github.com/bazelbuild/bazel/releases/download/$BAZEL_VERSION/bazel-$BAZEL_VERSION-dist.zip \
&& unzip bazel-$BAZEL_VERSION-dist.zip \
&& ./compile.sh \
&& cp output/bazel /usr/local/bin \
&& rm -rf /bazel

View File

@ -0,0 +1,20 @@
# Dockerfile for building the source code of cache_server
FROM golang:1.11-alpine3.7 as builder
RUN apk update && apk upgrade && \
apk add --no-cache bash git openssh gcc musl-dev
WORKDIR /go/src/github.com/kubeflow/pipelines
COPY . .
RUN GO111MODULE=on go build -o /bin/cache_server backend/src/cache/*.go
RUN git clone https://github.com/hashicorp/golang-lru.git /kfp/cache/golang-lru/
FROM alpine:3.8
WORKDIR /bin
COPY --from=builder /bin/cache_server /bin/cache_server
COPY --from=builder /go/src/github.com/kubeflow/pipelines/third_party/license.txt /bin/license.txt
COPY --from=builder /kfp/cache/golang-lru/* /bin/golang-lru/
ENTRYPOINT [ "/bin/cache_server" ]

View File

@ -0,0 +1,23 @@
FROM golang:1.11-alpine3.7 as builder
WORKDIR /go/src/github.com/kubeflow/pipelines
COPY . .
# Needed musl-dev for github.com/mattn/go-sqlite3
RUN apk update && apk upgrade && \
apk add --no-cache bash git openssh gcc musl-dev
RUN GO111MODULE=on go build -o /bin/persistence_agent backend/src/agent/persistence/*.go
FROM alpine:3.8
WORKDIR /bin
COPY --from=builder /bin/persistence_agent /bin/persistence_agent
COPY --from=builder /go/src/github.com/kubeflow/pipelines/third_party/license.txt /bin/license.txt
ENV NAMESPACE ""
# Set Workflow TTL to 7 days
ENV TTL_SECONDS_AFTER_WORKFLOW_FINISH 604800
CMD persistence_agent --logtostderr=true --namespace=${NAMESPACE} --ttlSecondsAfterWorkflowFinish=${TTL_SECONDS_AFTER_WORKFLOW_FINISH}

View File

@ -0,0 +1,21 @@
FROM golang:1.11-alpine3.7 as builder
WORKDIR /go/src/github.com/kubeflow/pipelines
COPY . .
# Needed musl-dev for github.com/mattn/go-sqlite3
RUN apk update && apk upgrade && \
apk add --no-cache bash git openssh gcc musl-dev
RUN GO111MODULE=on go build -o /bin/controller backend/src/crd/controller/scheduledworkflow/*.go
FROM alpine:3.8
WORKDIR /bin
COPY --from=builder /bin/controller /bin/controller
COPY --from=builder /go/src/github.com/kubeflow/pipelines/third_party/license.txt /bin/license.txt
RUN chmod +x /bin/controller
ENV NAMESPACE ""
CMD /bin/controller --logtostderr=true --namespace=${NAMESPACE}

View File

@ -0,0 +1,25 @@
FROM golang:alpine as builder
RUN apk update && apk upgrade
RUN apk add --no-cache git gcc musl-dev
WORKDIR /src/github.com/kubeflow/pipelines
COPY . .
RUN go mod vendor
RUN go build -o /bin/controller backend/src/crd/controller/viewer/*.go
FROM alpine
WORKDIR /src
COPY --from=builder /src/github.com/kubeflow/pipelines/vendor vendor
WORKDIR /bin
COPY --from=builder /bin/controller /bin/controller
COPY --from=builder /src/github.com/kubeflow/pipelines/third_party/license.txt /bin/license.txt
RUN chmod +x /bin/controller
ENV MAX_NUM_VIEWERS "50"
ENV NAMESPACE "kubeflow"
CMD /bin/controller -logtostderr=true -max_num_viewers=${MAX_NUM_VIEWERS} --namespace=${NAMESPACE}

View File

@ -0,0 +1,46 @@
# This docker file starts server.py (located at src/apiserver/visualization)
# which accepts a post request that resolves to html that depicts a specified
# visualization. More details about this process can be found in the server.py
# and exporter.py files in the directory specified above.
# Copyright 2019-2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
FROM tensorflow/tensorflow:2.1.0-py3
RUN apt-get update \
&& apt-get install -y wget curl tar \
pkg-config libcairo2-dev libgirepository1.0-dev # For the pygobject and pycairo package setup due to licensing
RUN curl https://dl.google.com/dl/cloudsdk/release/google-cloud-sdk.tar.gz > /tmp/google-cloud-sdk.tar.gz
RUN mkdir -p /usr/local/gcloud
RUN tar -C /usr/local/gcloud -xf /tmp/google-cloud-sdk.tar.gz
RUN /usr/local/gcloud/google-cloud-sdk/install.sh
ENV PATH $PATH:/usr/local/gcloud/google-cloud-sdk/bin
WORKDIR /src
COPY backend/src/apiserver/visualization/requirements.txt /src
RUN pip3 install -r requirements.txt
COPY backend/src/apiserver/visualization/license.sh /src
COPY backend/src/apiserver/visualization/third_party_licenses.csv /src
COPY backend/src/apiserver/visualization/third_party_licenses /usr/licenses
RUN ./license.sh third_party_licenses.csv /usr/licenses
COPY backend/src/apiserver/visualization /src
ENTRYPOINT [ "python3", "server.py" ]

53
backend/README.md Normal file
View File

@ -0,0 +1,53 @@
This directory contains code for the components that comprise the Kubeflow
Pipelines backend.
## Building & Testing
All components can be built using [Bazel](https://bazel.build/). To build
everything under backend, run: `bazel build --action_env=PATH
--define=grpc_no_ares=true //backend/...`
To run all tests: `bazel test --action_env=PATH --define=grpc_no_ares=true
//backend/...`
The API server itself can only be built/tested using Bazel. The following
commands target building and testing just the API server. `bazel build
--action_env=PATH --define=grpc_no_ares=true backend/src/apiserver/...` `bazel
test --action_env=PATH --define=grpc_no_ares=true backend/src/apiserver/...`
## Building APIServer Image using Remote Build Execution
If you are a dev in the Kubeflow Pipelines team, you can use
[Remote Build Execution Service](https://cloud.google.com/sdk/gcloud/reference/alpha/remote-build-execution/)
to build the API Server image using Bazel with use of a shared cache for
speeding up the build. To do so, execute the following command:
```
./build_api_server.sh -i gcr.io/cloud-ml-pipelines-test/api-server:dev
```
## Building Go client library and swagger files
After making changes to proto files, the Go client libraries and swagger files
need to be regenerated and checked-in. The backend/api/generate_api.sh script
takes care of this.
## Updating BUILD files
As the backend is written in Go, the BUILD files can be updated automatically
using [Gazelle](https://github.com/bazelbuild/bazel-gazelle). Whenever a Go file
is added or updated, run the following to ensure the BUILD files are updated as
well: `bazel run //:gazelle`
If a new external Go dependency is added, or an existing one has its version
bumped in the `go.mod` file, ensure the BUILD files pick this up by updating the
WORKSPACE go_repository rules using the following command: `bazel run
//:gazelle -- update-repos --from_file=go.mod`
## Updating python dependencies
[pip-tools](https://github.com/jazzband/pip-tools) is used to manage python
dependencies. To update dependencies, edit [requirements.in](requirements.in)
and run `./update_requirements.sh <requirements.in >requirements.txt` to update and pin the transitive
dependencies.

63
backend/api/BUILD.bazel Normal file
View File

@ -0,0 +1,63 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_path")
load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library")
load("@com_github_grpc_ecosystem_grpc_gateway//protoc-gen-swagger:defs.bzl", "protoc_gen_swagger")
proto_library(
name = "go_client_proto",
srcs = [
"auth.proto",
"error.proto",
"experiment.proto",
"filter.proto",
"job.proto",
"parameter.proto",
"pipeline.proto",
"pipeline_spec.proto",
"report.proto",
"resource_reference.proto",
"run.proto",
"visualization.proto",
],
visibility = ["//visibility:public"],
deps = [
"@com_github_grpc_ecosystem_grpc_gateway//protoc-gen-swagger/options:options_proto",
"@com_google_protobuf//:any_proto",
"@com_google_protobuf//:empty_proto",
"@com_google_protobuf//:timestamp_proto",
"@go_googleapis//google/api:annotations_proto",
],
)
go_proto_library(
name = "go_client_go_proto",
compilers = [
"@io_bazel_rules_go//proto:go_grpc",
"@com_github_grpc_ecosystem_grpc_gateway//protoc-gen-grpc-gateway:go_gen_grpc_gateway",
],
importpath = "github.com/kubeflow/pipelines/backend/api/go_client", # keep
proto = ":go_client_proto",
visibility = ["//visibility:public"],
deps = [
"@com_github_grpc_ecosystem_grpc_gateway//protoc-gen-swagger/options:go_default_library",
"@go_googleapis//google/api:annotations_go_proto",
],
)
go_library(
name = "go_default_library",
embed = [":go_client_go_proto"],
importpath = "github.com/kubeflow/pipelines/backend/api/go_client",
visibility = ["//visibility:public"],
)
protoc_gen_swagger(
name = "api_swagger",
proto = ":go_client_proto",
)
go_path(
name = "api_generated_go_sources",
deps = [
":go_client_go_proto",
],
)

130
backend/api/Makefile Normal file
View File

@ -0,0 +1,130 @@
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Building requires protobuf version 3.6.0 or above. Unzip this directory to a
# suitable location and modify the values of the following two variables before
# running make.
protocompiler = ${HOME}/protobuf-3.6.1/bin/protoc
protoinclude = ${HOME}/protobuf-3.6.1/include
TMPDIR := $(shell mktemp -d)
default: all
dependencies:
@echo "Using temporary directory: $(TMPDIR)"
GOBIN=$(TMPDIR) go install ../../vendor/github.com/go-swagger/go-swagger/cmd/swagger
GOBIN=$(TMPDIR) go install ../../vendor/github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway
GOBIN=$(TMPDIR) go install ../../vendor/github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger
GOBIN=$(TMPDIR) go install ../../vendor/github.com/golang/protobuf/protoc-gen-go
all: dependencies
# Delete currently generated code.
rm -r -f go_http_client/*
rm -r -f go_client/*
# Compile the *.proto files into *.pb.go (grpc client).
$(protocompiler) -I$(protoinclude) -I/usr/local/include -I. \
-I../../vendor/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis \
-I../../vendor/github.com/grpc-ecosystem/grpc-gateway/ \
--plugin=protoc-gen-go=${TMPDIR}/protoc-gen-go \
--go_out=plugins=grpc:go_client \
*.proto
# Compile the *.proto files into *.pb.gw.go (grpc client).
$(protocompiler) -I$(protoinclude) -I/usr/local/include -I. \
-I../../vendor/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis \
-I../../vendor/github.com/grpc-ecosystem/grpc-gateway/ \
--plugin=protoc-gen-grpc-gateway=${TMPDIR}/protoc-gen-grpc-gateway \
--grpc-gateway_out=logtostderr=true:go_client \
*.proto
# Filter.proto is implicitly used by clients and server, and transmitted as a
# serialized string in ListXXX requests. This hack defines a dummy service to
# coerce protoc-gen-swagger to generate Swagger JSON definitions for
# filter.proto.
cp -f filter.proto filter.proto.bak
printf "service DummyFilterService {\nrpc DoFilter(Filter) returns (Filter) {\n option (google.api.http) = { \nget: \"/apis/v1beta1/filters\"\n};\n }}" >> filter.proto
# Compile the *.proto files into *.swagger.json (swagger specification).
$(protocompiler) -I$(protoinclude) -I/usr/local/include -I. \
-I../../vendor/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis \
-I../../vendor/github.com/grpc-ecosystem/grpc-gateway/ \
--plugin=protoc-gen-swagger=${TMPDIR}/protoc-gen-swagger \
--swagger_out=logtostderr=true:swagger \
*.proto
# Revert the dummy service definition.
mv -f filter.proto.bak filter.proto
# Compile the *.swagger.json into go REST clients.
# Instructions to install the 'swagger' command are located here:
# https://github.com/go-swagger/go-swagger
# swagger v0.17.0 was last used.
$(TMPDIR)/swagger generate client \
-f swagger/job.swagger.json \
-A job \
--principal models.Principal \
-c job_client \
-m job_model \
-t go_http_client
$(TMPDIR)/swagger generate client \
-f swagger/run.swagger.json \
-A run \
--principal models.Principal \
-c run_client \
-m run_model \
-t go_http_client
$(TMPDIR)/swagger generate client \
-f swagger/experiment.swagger.json \
-A experiment \
--principal models.Principal \
-c experiment_client \
-m experiment_model \
-t go_http_client
$(TMPDIR)/swagger generate client \
-f swagger/pipeline.upload.swagger.json \
-A pipeline_upload \
--principal models.Principal \
-c pipeline_upload_client \
-m pipeline_upload_model \
-t go_http_client
$(TMPDIR)/swagger generate client \
-f swagger/pipeline.swagger.json \
-A pipeline \
--principal models.Principal \
-c pipeline_client \
-m pipeline_model \
-t go_http_client
# Hack to fix an issue with go-swagger
# See https://github.com/go-swagger/go-swagger/issues/1381 for details.
sed -i -- 's/MaxConcurrency int64 `json:"max_concurrency,omitempty"`/MaxConcurrency int64 `json:"max_concurrency,omitempty,string"`/g' ./go_http_client/job_model/api_job.go
sed -i -- 's/IntervalSecond int64 `json:"interval_second,omitempty"`/IntervalSecond int64 `json:"interval_second,omitempty,string"`/g' ./go_http_client/job_model/api_periodic_schedule.go
sed -i -- 's/MaxConcurrency string `json:"max_concurrency,omitempty"`/MaxConcurrency int64 `json:"max_concurrency,omitempty,string"`/g' ./go_http_client/job_model/api_job.go
sed -i -- 's/IntervalSecond string `json:"interval_second,omitempty"`/IntervalSecond int64 `json:"interval_second,omitempty,string"`/g' ./go_http_client/job_model/api_periodic_schedule.go
# Executes the //go:generate directives in the generated code.
go generate ./...
# Add licenses to the generated files.
# Instructions to install the 'autogen' command are located here:
# https://github.com/mbrukman/autogen
find ./ -name "*.go" -exec autogen.sh -i --no-tlc -c "Google LLC" -l apache {} \;
@echo "Cleaning $(TMPDIR)"
rm -r -f $(TMPDIR)

86
backend/api/auth.proto Normal file
View File

@ -0,0 +1,86 @@
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
option go_package = "github.com/kubeflow/pipelines/backend/api/go_client";
package api;
import "google/api/annotations.proto";
import "google/protobuf/empty.proto";
import "backend/api/error.proto";
import "protoc-gen-swagger/options/annotations.proto";
option (grpc.gateway.protoc_gen_swagger.options.openapiv2_swagger) = {
responses: {
key: "default";
value: {
schema: {
json_schema: {
ref: ".api.Status";
}
}
}
}
// Use bearer token for authorizing access to job service.
// Kubernetes client library(https://kubernetes.io/docs/reference/using-api/client-libraries/)
// uses bearer token as default for authorization. The section below
// ensures security definition object is generated in the swagger definition.
// For more details see https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#securityDefinitionsObject
security_definitions: {
security: {
key: "Bearer";
value: {
type: TYPE_API_KEY;
in: IN_HEADER;
name: "authorization";
}
}
}
security: {
security_requirement: {
key: "Bearer";
value: {};
}
}
};
service AuthService {
rpc Authorize(AuthorizeRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
get: "/apis/v1beta1/auth"
};
}
}
// Ask for authorization of an access by providing resource's namespace, type
// and verb. User identity is not part of the message, because it is expected
// to be parsed from request headers. Caller should proxy user request's headers.
message AuthorizeRequest {
// Type of resources in pipelines system.
enum Resources {
UNASSIGNED_RESOURCES = 0;
VIEWERS = 1;
}
// Type of verbs that act on the resources.
enum Verb {
UNASSIGNED_VERB = 0;
CREATE = 1;
GET = 2;
DELETE = 3;
}
string namespace = 1; // Namespace the resource belongs to.
Resources resources = 2; // Resource type asking for authorization.
Verb verb = 3; // Verb on the resource asking for authorization.
}

View File

@ -0,0 +1,74 @@
#!/bin/bash -e
#
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# The scripts creates a the KF Pipelines API python package.
# Requirements: jq and Java
# To install the prerequisites run the following:
#
# # Debian / Ubuntu:
# sudo apt-get install --no-install-recommends -y -q default-jdk jq
#
# # OS X
# brew tap caskroom/cask
# brew cask install caskroom/versions/java8
# brew install jq
VERSION="$1"
if [ -z "$VERSION" ]; then
echo "Usage: build_kfp_server_api_python_package.sh <version>"
exit 1
fi
codegen_file=/tmp/swagger-codegen-cli.jar
# Browse all versions in: https://repo1.maven.org/maven2/io/swagger/swagger-codegen-cli/2.4.7/
codegen_uri=https://repo1.maven.org/maven2/io/swagger/swagger-codegen-cli/2.4.7/swagger-codegen-cli-2.4.7.jar
if ! [ -f "$codegen_file" ]; then
wget --no-verbose "$codegen_uri" -O "$codegen_file"
fi
pushd "$(dirname "$0")"
DIR=$(mktemp -d)
swagger_file=$(mktemp)
echo "Merging all Swagger API definitions to $swagger_file."
jq -s '
reduce .[] as $item ({}; . * $item) |
.info.title = "KF Pipelines API" |
.info.description = "Generated python client for the KF Pipelines server API"
' ./swagger/{run,job,pipeline,experiment,pipeline.upload}.swagger.json > "$swagger_file"
echo "Generating python code from swagger json in $DIR."
java -jar "$codegen_file" generate -l python -i "$swagger_file" -o "$DIR" -c <(echo '{
"packageName": "kfp_server_api",
"projectName": "kfp-server-api",
"packageVersion": "'"$VERSION"'",
"packageUrl": "https://github.com/kubeflow/pipelines"
}')
echo "Building the python package in $DIR."
pushd "$DIR"
python3 setup.py --quiet sdist
popd
echo "Run the following commands to update the package on PyPI"
echo "python3 -m pip install twine"
echo "python3 -m twine upload --username kubeflow-pipelines $DIR/dist/*"
popd

31
backend/api/error.proto Normal file
View File

@ -0,0 +1,31 @@
// Copyright 2018 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
option go_package = "github.com/kubeflow/pipelines/backend/api/go_client";
package api;
import "google/protobuf/any.proto";
message Error {
string error_message = 1;
string error_details = 2;
}
message Status {
string error = 1;
int32 code = 2;
repeated google.protobuf.Any details = 3;
}

View File

@ -0,0 +1,183 @@
// Copyright 2018 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
option go_package = "github.com/kubeflow/pipelines/backend/api/go_client";
package api;
import "backend/api/error.proto";
import "backend/api/resource_reference.proto";
import "google/api/annotations.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/timestamp.proto";
import "protoc-gen-swagger/options/annotations.proto";
option (grpc.gateway.protoc_gen_swagger.options.openapiv2_swagger) = {
responses: {
key: "default";
value: {
schema: {
json_schema: {
ref: ".api.Status";
}
}
}
}
// Use bearer token for authorizing access to job service.
// Kubernetes client library(https://kubernetes.io/docs/reference/using-api/client-libraries/)
// uses bearer token as default for authorization. The section below
// ensures security definition object is generated in the swagger definition.
// For more details see https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#securityDefinitionsObject
security_definitions: {
security: {
key: "Bearer";
value: {
type: TYPE_API_KEY;
in: IN_HEADER;
name: "authorization";
}
}
}
security: {
security_requirement: {
key: "Bearer";
value: {};
}
}
};
service ExperimentService {
//Create a new experiment.
rpc CreateExperiment(CreateExperimentRequest) returns (Experiment) {
option (google.api.http) = {
post: "/apis/v1beta1/experiments"
body: "experiment"
};
}
//Find a specific experiment by ID.
rpc GetExperiment(GetExperimentRequest) returns (Experiment) {
option (google.api.http) = {
get: "/apis/v1beta1/experiments/{id}"
};
}
//Find all experiments.
rpc ListExperiment(ListExperimentsRequest) returns (ListExperimentsResponse) {
option (google.api.http) = {
get: "/apis/v1beta1/experiments"
};
}
//Delete an experiment.
rpc DeleteExperiment(DeleteExperimentRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
delete: "/apis/v1beta1/experiments/{id}"
};
}
//Archive an experiment.
rpc ArchiveExperiment(ArchiveExperimentRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
post: "/apis/v1beta1/experiments/{id}:archive"
};
}
//Restore an archived experiment.
rpc UnarchiveExperiment(UnarchiveExperimentRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
post: "/apis/v1beta1/experiments/{id}:unarchive"
};
}
}
message CreateExperimentRequest {
// The experiment to be created.
Experiment experiment = 1;
}
message GetExperimentRequest {
// The ID of the experiment to be retrieved.
string id = 1;
}
message ListExperimentsRequest {
string page_token = 1;
int32 page_size = 2;
// Can be format of "field_name", "field_name asc" or "field_name des"
// Ascending by default.
string sort_by = 3;
// A url-encoded, JSON-serialized Filter protocol buffer (see
// [filter.proto](https://github.com/kubeflow/pipelines/
// blob/master/backend/api/filter.proto)).
string filter = 4;
// What resource reference to filter on.
// For Experiment, the only valid resource type is Namespace. An sample query string could be
// resource_reference_key.type=NAMESPACE&resource_reference_key.id=ns1
ResourceKey resource_reference_key = 5;
}
message ListExperimentsResponse {
// A list of experiments returned.
repeated Experiment experiments = 1;
// The total number of experiments for the given query.
int32 total_size = 3;
// The token to list the next page of experiments.
string next_page_token = 2;
}
message DeleteExperimentRequest {
// The ID of the experiment to be deleted.
string id = 1;
}
message Experiment {
// Output. Unique experiment ID. Generated by API server.
string id = 1;
// Required input field. Unique experiment name provided by user.
string name = 2;
// Optional input field. Describing the purpose of the experiment
string description = 3;
// Output. The time that the experiment created.
google.protobuf.Timestamp created_at = 4;
// Optional input field. Specify which resource this run belongs to.
// For Experiment, the only valid resource reference is a single Namespace.
repeated ResourceReference resource_references = 5;
enum StorageState {
STORAGESTATE_UNSPECIFIED = 0;
STORAGESTATE_AVAILABLE = 1;
STORAGESTATE_ARCHIVED = 2;
}
StorageState storage_state = 6;
}
message ArchiveExperimentRequest {
string id = 1;
}
message UnarchiveExperimentRequest {
string id = 1;
}

129
backend/api/filter.proto Normal file
View File

@ -0,0 +1,129 @@
// Copyright 2018 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
option go_package = "github.com/kubeflow/pipelines/backend/api/go_client";
package api;
import "google/api/annotations.proto";
import "google/protobuf/timestamp.proto";
// Predicate captures individual conditions that must be true for a resource
// being filtered.
message Predicate {
// Op is the operation to apply.
enum Op {
UNKNOWN = 0;
// Operators on scalar values. Only applies to one of |int_value|,
// |long_value|, |string_value| or |timestamp_value|.
EQUALS = 1;
NOT_EQUALS = 2;
GREATER_THAN = 3;
GREATER_THAN_EQUALS = 5;
LESS_THAN = 6;
LESS_THAN_EQUALS = 7;
// Checks if the value is a member of a given array, which should be one of
// |int_values|, |long_values| or |string_values|.
IN = 8;
// Checks if the value contains |string_value| as a substring match. Only
// applies to |string_value|.
IS_SUBSTRING = 9;
}
Op op = 1;
string key = 2;
oneof value {
int32 int_value = 3;
int64 long_value = 4;
string string_value = 5;
// Timestamp values will be converted to Unix time (seconds since the epoch)
// prior to being used in a filtering operation.
google.protobuf.Timestamp timestamp_value = 6;
// Array values below are only meant to be used by the IN operator.
IntValues int_values = 7;
LongValues long_values = 8;
StringValues string_values = 9;
}
}
message IntValues {
repeated int32 values = 1;
}
message StringValues {
repeated string values = 2;
}
message LongValues {
repeated int64 values = 3;
}
// Filter is used to filter resources returned from a ListXXX request.
//
// Example filters:
// 1) Filter runs with status = 'Running'
// filter {
// predicate {
// key: "status"
// op: EQUALS
// string_value: "Running"
// }
// }
//
// 2) Filter runs that succeeded since Dec 1, 2018
// filter {
// predicate {
// key: "status"
// op: EQUALS
// string_value: "Succeeded"
// }
// predicate {
// key: "created_at"
// op: GREATER_THAN
// timestamp_value {
// seconds: 1543651200
// }
// }
// }
//
// 3) Filter runs with one of labels 'label_1' or 'label_2'
//
// filter {
// predicate {
// key: "label"
// op: IN
// string_values {
// value: 'label_1'
// value: 'label_2'
// }
// }
// }
message Filter {
// All predicates are AND-ed when this filter is applied.
repeated Predicate predicates = 1;
}
// This dummy service is required so that grpc-gateway will generate Swagger
// definitions for the Filter message. Otherwise, it does not get generated
// since Filter itself is not used in any of the RPC calls - only a serialized
// encoded version of it is used.
service DummyFilterService {
rpc GetFilter(Filter) returns (Filter) {}
}

126
backend/api/generate_api.sh Executable file
View File

@ -0,0 +1,126 @@
#!/bin/bash
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# This file generates API sources from the protocol buffers defined in this
# directory using Bazel, then copies them back into the source tree so they can
# be checked-in.
set -ex
BAZEL_BINDIR=$(bazel info bazel-bin)
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" > /dev/null && pwd)"
SWAGGER_CMD=${DIR}/../../bazel-bin/external/com_github_go_swagger/cmd/swagger/*stripped/swagger
AUTOGEN_CMD="${DIR}/../../bazel-bin/external/com_github_mbrukman_autogen/autogen_tool"
GENERATED_GO_PROTO_FILES="${BAZEL_BINDIR}/backend/api/api_generated_go_sources/src/github.com/kubeflow/pipelines/backend/api/go_client/*.go"
# TODO this script should be able to be run from anywhere, not just within .../backend/api/
# Delete currently generated code.
rm -r -f ${DIR}/go_http_client/*
rm -r -f ${DIR}/go_client/*
# Build required tools.
bazel build @com_github_mbrukman_autogen//:autogen_tool
bazel build @com_github_go_swagger//cmd/swagger
# Build .pb.go and .gw.pb.go files from the proto sources.
bazel build //backend/api:api_generated_go_sources
set -x
# Copy the generated files into the source tree and add license.
for f in $GENERATED_GO_PROTO_FILES; do
target=${DIR}/go_client/$(basename ${f})
cp $f $target
chmod 766 $target
${AUTOGEN_CMD} -i --no-tlc -c "Google LLC" -l apache $target
done
# Generate and copy back into source tree .swagger.json files.
bazel build //backend/api:api_swagger
cp ${BAZEL_BINDIR}/backend/api/*.swagger.json ${DIR}/swagger
jq -s '
reduce .[] as $item ({}; . * $item) |
.info.title = "Kubeflow Pipelines API" |
.info.description = "This file contains REST API specification for Kubeflow Pipelines. The file is autogenerated from the swagger definition." |
.info.version = "0.1.38"
' ${DIR}/swagger/{run,job,pipeline,experiment,pipeline.upload}.swagger.json > "${DIR}/swagger/kfp_api_single_file.swagger.json"
# Generate Go HTTP client from the swagger files.
${SWAGGER_CMD} generate client \
-f ${DIR}/swagger/job.swagger.json \
-A job \
--principal models.Principal \
-c job_client \
-m job_model \
-t ${DIR}/go_http_client
${SWAGGER_CMD} generate client \
-f ${DIR}/swagger/run.swagger.json \
-A run \
--principal models.Principal \
-c run_client \
-m run_model \
-t ${DIR}/go_http_client
${SWAGGER_CMD} generate client \
-f ${DIR}/swagger/experiment.swagger.json \
-A experiment \
--principal models.Principal \
-c experiment_client \
-m experiment_model \
-t ${DIR}/go_http_client
${SWAGGER_CMD} generate client \
-f ${DIR}/swagger/pipeline.upload.swagger.json \
-A pipeline_upload \
--principal models.Principal \
-c pipeline_upload_client \
-m pipeline_upload_model \
-t ${DIR}/go_http_client
${SWAGGER_CMD} generate client \
-f ${DIR}/swagger/pipeline.swagger.json \
-A pipeline \
--principal models.Principal \
-c pipeline_client \
-m pipeline_model \
-t ${DIR}/go_http_client
${SWAGGER_CMD} generate client \
-f ${DIR}/swagger/visualization.swagger.json \
-A visualization \
--principal models.Principal \
-c visualization_client \
-m visualization_model \
-t ${DIR}/go_http_client
# Hack to fix an issue with go-swagger
# See https://github.com/go-swagger/go-swagger/issues/1381 for details.
sed -i -- 's/MaxConcurrency int64 `json:"max_concurrency,omitempty"`/MaxConcurrency int64 `json:"max_concurrency,omitempty,string"`/g' ${DIR}/go_http_client/job_model/api_job.go
sed -i -- 's/IntervalSecond int64 `json:"interval_second,omitempty"`/IntervalSecond int64 `json:"interval_second,omitempty,string"`/g' ${DIR}/go_http_client/job_model/api_periodic_schedule.go
sed -i -- 's/MaxConcurrency string `json:"max_concurrency,omitempty"`/MaxConcurrency int64 `json:"max_concurrency,omitempty,string"`/g' ${DIR}/go_http_client/job_model/api_job.go
sed -i -- 's/IntervalSecond string `json:"interval_second,omitempty"`/IntervalSecond int64 `json:"interval_second,omitempty,string"`/g' ${DIR}/go_http_client/job_model/api_periodic_schedule.go
# Executes the //go:generate directives in the generated code.
go generate ./...
# Add license to files in go_http_client.
find ${DIR}/go_http_client/ -name "*.go" -exec ${AUTOGEN_CMD} -i --no-tlc -c "Google LLC" -l apache {} \;
# Finally, run gazelle to add BUILD files for the generated code.
bazel run //:gazelle

43
backend/api/go_client/BUILD.bazel generated Normal file
View File

@ -0,0 +1,43 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library")
go_library(
name = "go_default_library",
srcs = [
"auth.pb.go",
"auth.pb.gw.go",
"error.pb.go",
"experiment.pb.go",
"experiment.pb.gw.go",
"filter.pb.go",
"job.pb.go",
"job.pb.gw.go",
"parameter.pb.go",
"pipeline.pb.go",
"pipeline.pb.gw.go",
"pipeline_spec.pb.go",
"report.pb.go",
"report.pb.gw.go",
"resource_reference.pb.go",
"run.pb.go",
"run.pb.gw.go",
"visualization.pb.go",
"visualization.pb.gw.go",
],
importpath = "github.com/kubeflow/pipelines/backend/api/go_client",
visibility = ["//visibility:public"],
deps = [
"@com_github_golang_protobuf//proto:go_default_library",
"@com_github_grpc_ecosystem_grpc_gateway//protoc-gen-swagger/options:go_default_library",
"@com_github_grpc_ecosystem_grpc_gateway//runtime:go_default_library",
"@com_github_grpc_ecosystem_grpc_gateway//utilities:go_default_library",
"@go_googleapis//google/api:annotations_go_proto",
"@io_bazel_rules_go//proto/wkt:any_go_proto",
"@io_bazel_rules_go//proto/wkt:empty_go_proto",
"@io_bazel_rules_go//proto/wkt:timestamp_go_proto",
"@org_golang_google_grpc//:go_default_library",
"@org_golang_google_grpc//codes:go_default_library",
"@org_golang_google_grpc//grpclog:go_default_library",
"@org_golang_google_grpc//status:go_default_library",
"@org_golang_x_net//context:go_default_library",
],
)

260
backend/api/go_client/auth.pb.go generated Executable file
View File

@ -0,0 +1,260 @@
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: backend/api/auth.proto
package go_client // import "github.com/kubeflow/pipelines/backend/api/go_client"
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import empty "github.com/golang/protobuf/ptypes/empty"
import _ "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger/options"
import _ "google.golang.org/genproto/googleapis/api/annotations"
import (
context "golang.org/x/net/context"
grpc "google.golang.org/grpc"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
type AuthorizeRequest_Resources int32
const (
AuthorizeRequest_UNASSIGNED_RESOURCES AuthorizeRequest_Resources = 0
AuthorizeRequest_VIEWERS AuthorizeRequest_Resources = 1
)
var AuthorizeRequest_Resources_name = map[int32]string{
0: "UNASSIGNED_RESOURCES",
1: "VIEWERS",
}
var AuthorizeRequest_Resources_value = map[string]int32{
"UNASSIGNED_RESOURCES": 0,
"VIEWERS": 1,
}
func (x AuthorizeRequest_Resources) String() string {
return proto.EnumName(AuthorizeRequest_Resources_name, int32(x))
}
func (AuthorizeRequest_Resources) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_auth_b463ef3269931e86, []int{0, 0}
}
type AuthorizeRequest_Verb int32
const (
AuthorizeRequest_UNASSIGNED_VERB AuthorizeRequest_Verb = 0
AuthorizeRequest_CREATE AuthorizeRequest_Verb = 1
AuthorizeRequest_GET AuthorizeRequest_Verb = 2
AuthorizeRequest_DELETE AuthorizeRequest_Verb = 3
)
var AuthorizeRequest_Verb_name = map[int32]string{
0: "UNASSIGNED_VERB",
1: "CREATE",
2: "GET",
3: "DELETE",
}
var AuthorizeRequest_Verb_value = map[string]int32{
"UNASSIGNED_VERB": 0,
"CREATE": 1,
"GET": 2,
"DELETE": 3,
}
func (x AuthorizeRequest_Verb) String() string {
return proto.EnumName(AuthorizeRequest_Verb_name, int32(x))
}
func (AuthorizeRequest_Verb) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_auth_b463ef3269931e86, []int{0, 1}
}
type AuthorizeRequest struct {
Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"`
Resources AuthorizeRequest_Resources `protobuf:"varint,2,opt,name=resources,proto3,enum=api.AuthorizeRequest_Resources" json:"resources,omitempty"`
Verb AuthorizeRequest_Verb `protobuf:"varint,3,opt,name=verb,proto3,enum=api.AuthorizeRequest_Verb" json:"verb,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *AuthorizeRequest) Reset() { *m = AuthorizeRequest{} }
func (m *AuthorizeRequest) String() string { return proto.CompactTextString(m) }
func (*AuthorizeRequest) ProtoMessage() {}
func (*AuthorizeRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_auth_b463ef3269931e86, []int{0}
}
func (m *AuthorizeRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_AuthorizeRequest.Unmarshal(m, b)
}
func (m *AuthorizeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_AuthorizeRequest.Marshal(b, m, deterministic)
}
func (dst *AuthorizeRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_AuthorizeRequest.Merge(dst, src)
}
func (m *AuthorizeRequest) XXX_Size() int {
return xxx_messageInfo_AuthorizeRequest.Size(m)
}
func (m *AuthorizeRequest) XXX_DiscardUnknown() {
xxx_messageInfo_AuthorizeRequest.DiscardUnknown(m)
}
var xxx_messageInfo_AuthorizeRequest proto.InternalMessageInfo
func (m *AuthorizeRequest) GetNamespace() string {
if m != nil {
return m.Namespace
}
return ""
}
func (m *AuthorizeRequest) GetResources() AuthorizeRequest_Resources {
if m != nil {
return m.Resources
}
return AuthorizeRequest_UNASSIGNED_RESOURCES
}
func (m *AuthorizeRequest) GetVerb() AuthorizeRequest_Verb {
if m != nil {
return m.Verb
}
return AuthorizeRequest_UNASSIGNED_VERB
}
func init() {
proto.RegisterType((*AuthorizeRequest)(nil), "api.AuthorizeRequest")
proto.RegisterEnum("api.AuthorizeRequest_Resources", AuthorizeRequest_Resources_name, AuthorizeRequest_Resources_value)
proto.RegisterEnum("api.AuthorizeRequest_Verb", AuthorizeRequest_Verb_name, AuthorizeRequest_Verb_value)
}
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConn
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion4
// AuthServiceClient is the client API for AuthService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type AuthServiceClient interface {
Authorize(ctx context.Context, in *AuthorizeRequest, opts ...grpc.CallOption) (*empty.Empty, error)
}
type authServiceClient struct {
cc *grpc.ClientConn
}
func NewAuthServiceClient(cc *grpc.ClientConn) AuthServiceClient {
return &authServiceClient{cc}
}
func (c *authServiceClient) Authorize(ctx context.Context, in *AuthorizeRequest, opts ...grpc.CallOption) (*empty.Empty, error) {
out := new(empty.Empty)
err := c.cc.Invoke(ctx, "/api.AuthService/Authorize", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// AuthServiceServer is the server API for AuthService service.
type AuthServiceServer interface {
Authorize(context.Context, *AuthorizeRequest) (*empty.Empty, error)
}
func RegisterAuthServiceServer(s *grpc.Server, srv AuthServiceServer) {
s.RegisterService(&_AuthService_serviceDesc, srv)
}
func _AuthService_Authorize_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(AuthorizeRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AuthServiceServer).Authorize(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/api.AuthService/Authorize",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AuthServiceServer).Authorize(ctx, req.(*AuthorizeRequest))
}
return interceptor(ctx, in, info, handler)
}
var _AuthService_serviceDesc = grpc.ServiceDesc{
ServiceName: "api.AuthService",
HandlerType: (*AuthServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "Authorize",
Handler: _AuthService_Authorize_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "backend/api/auth.proto",
}
func init() { proto.RegisterFile("backend/api/auth.proto", fileDescriptor_auth_b463ef3269931e86) }
var fileDescriptor_auth_b463ef3269931e86 = []byte{
// 460 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x52, 0xc1, 0x6e, 0xd3, 0x40,
0x14, 0x8c, 0x9d, 0x2a, 0xc1, 0x2f, 0x94, 0x9a, 0x6d, 0x29, 0x91, 0x09, 0x6a, 0x94, 0x53, 0x0f,
0xd4, 0x56, 0xd3, 0x2b, 0x1c, 0x92, 0x76, 0x55, 0x55, 0x82, 0x22, 0xad, 0xd3, 0x20, 0xf5, 0x52,
0xad, 0xdd, 0x17, 0x67, 0x55, 0xc7, 0x6b, 0xd6, 0xeb, 0x54, 0x70, 0x44, 0xe2, 0x03, 0x80, 0x4f,
0xe3, 0x17, 0xf8, 0x10, 0xe4, 0x4d, 0x9a, 0x46, 0x90, 0xd3, 0x6a, 0xdf, 0xcc, 0x9b, 0x19, 0x69,
0x1e, 0xec, 0x47, 0x3c, 0xbe, 0xc3, 0xec, 0x36, 0xe0, 0xb9, 0x08, 0x78, 0xa9, 0xa7, 0x7e, 0xae,
0xa4, 0x96, 0xa4, 0xce, 0x73, 0xe1, 0x75, 0x12, 0x29, 0x93, 0x14, 0x17, 0x58, 0x96, 0x49, 0xcd,
0xb5, 0x90, 0x59, 0xb1, 0xa0, 0x78, 0xaf, 0x96, 0xa8, 0xf9, 0x45, 0xe5, 0x24, 0xc0, 0x59, 0xae,
0xbf, 0x2c, 0xc1, 0x97, 0xeb, 0xba, 0xa8, 0x94, 0x54, 0x4b, 0xe0, 0x8d, 0x79, 0xe2, 0xa3, 0x04,
0xb3, 0xa3, 0xe2, 0x9e, 0x27, 0x09, 0xaa, 0x40, 0xe6, 0x46, 0xf7, 0x7f, 0x8f, 0xde, 0x0f, 0x1b,
0xdc, 0x41, 0xa9, 0xa7, 0x52, 0x89, 0xaf, 0xc8, 0xf0, 0x73, 0x89, 0x85, 0x26, 0x1d, 0x70, 0x32,
0x3e, 0xc3, 0x22, 0xe7, 0x31, 0xb6, 0xad, 0xae, 0x75, 0xe8, 0xb0, 0xc7, 0x01, 0x79, 0x07, 0x8e,
0xc2, 0x42, 0x96, 0x2a, 0xc6, 0xa2, 0x6d, 0x77, 0xad, 0xc3, 0x67, 0xfd, 0x03, 0x9f, 0xe7, 0xc2,
0xff, 0x57, 0xc7, 0x67, 0x0f, 0x34, 0xf6, 0xb8, 0x41, 0x7c, 0xd8, 0x9a, 0xa3, 0x8a, 0xda, 0x75,
0xb3, 0xe9, 0x6d, 0xde, 0x1c, 0xa3, 0x8a, 0x98, 0xe1, 0xf5, 0xfa, 0xe0, 0xac, 0x74, 0x48, 0x1b,
0xf6, 0xae, 0x2e, 0x07, 0x61, 0x78, 0x71, 0x7e, 0x49, 0xcf, 0x6e, 0x18, 0x0d, 0x3f, 0x5e, 0xb1,
0x53, 0x1a, 0xba, 0x35, 0xd2, 0x82, 0xe6, 0xf8, 0x82, 0x7e, 0xa2, 0x2c, 0x74, 0xad, 0xde, 0x5b,
0xd8, 0xaa, 0x14, 0xc8, 0x2e, 0xec, 0xac, 0xd1, 0xc7, 0x94, 0x0d, 0xdd, 0x1a, 0x01, 0x68, 0x9c,
0x32, 0x3a, 0x18, 0x51, 0xd7, 0x22, 0x4d, 0xa8, 0x9f, 0xd3, 0x91, 0x6b, 0x57, 0xc3, 0x33, 0xfa,
0x9e, 0x8e, 0xa8, 0x5b, 0xef, 0x23, 0xb4, 0xaa, 0x40, 0x21, 0xaa, 0xb9, 0x88, 0x91, 0x8c, 0xc1,
0x59, 0xe5, 0x23, 0x2f, 0x36, 0xe6, 0xf5, 0xf6, 0xfd, 0x45, 0x57, 0xfe, 0x43, 0x57, 0x3e, 0xad,
0xba, 0xea, 0x79, 0xdf, 0x7e, 0xff, 0xf9, 0x65, 0xef, 0x11, 0x52, 0xd5, 0x54, 0x04, 0xf3, 0xe3,
0x08, 0x35, 0x3f, 0x36, 0x77, 0x30, 0xfc, 0x6e, 0xfd, 0x1c, 0x7c, 0x60, 0x1d, 0x68, 0xde, 0xe2,
0x84, 0x97, 0xa9, 0x26, 0xcf, 0xc9, 0x0e, 0x6c, 0x7b, 0x2d, 0xe3, 0x10, 0x6a, 0xae, 0xcb, 0xe2,
0xfa, 0x00, 0x5e, 0x43, 0x63, 0x88, 0x5c, 0xa1, 0x22, 0xbb, 0x4f, 0x6c, 0x6f, 0x9b, 0x2f, 0x9d,
0x4d, 0x89, 0x5d, 0x3b, 0x7a, 0x0a, 0xb0, 0x22, 0xd4, 0xae, 0x4f, 0x12, 0xa1, 0xa7, 0x65, 0xe4,
0xc7, 0x72, 0x16, 0xdc, 0x95, 0x11, 0x4e, 0x52, 0x79, 0x1f, 0xe4, 0x22, 0xc7, 0x54, 0x64, 0x58,
0x04, 0xeb, 0x27, 0x93, 0xc8, 0x9b, 0x38, 0x15, 0x98, 0xe9, 0xa8, 0x61, 0x32, 0x9f, 0xfc, 0x0d,
0x00, 0x00, 0xff, 0xff, 0x8e, 0x47, 0x2d, 0x41, 0xaa, 0x02, 0x00, 0x00,
}

129
backend/api/go_client/auth.pb.gw.go generated Executable file
View File

@ -0,0 +1,129 @@
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
// source: backend/api/auth.proto
/*
Package go_client is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
*/
package go_client
import (
"context"
"io"
"net/http"
"github.com/golang/protobuf/proto"
"github.com/grpc-ecosystem/grpc-gateway/runtime"
"github.com/grpc-ecosystem/grpc-gateway/utilities"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/grpclog"
"google.golang.org/grpc/status"
)
var _ codes.Code
var _ io.Reader
var _ status.Status
var _ = runtime.String
var _ = utilities.NewDoubleArray
var (
filter_AuthService_Authorize_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
)
func request_AuthService_Authorize_0(ctx context.Context, marshaler runtime.Marshaler, client AuthServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq AuthorizeRequest
var metadata runtime.ServerMetadata
if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_AuthService_Authorize_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.Authorize(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
// RegisterAuthServiceHandlerFromEndpoint is same as RegisterAuthServiceHandler but
// automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterAuthServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) {
conn, err := grpc.Dial(endpoint, opts...)
if err != nil {
return err
}
defer func() {
if err != nil {
if cerr := conn.Close(); cerr != nil {
grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
}
return
}
go func() {
<-ctx.Done()
if cerr := conn.Close(); cerr != nil {
grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
}
}()
}()
return RegisterAuthServiceHandler(ctx, mux, conn)
}
// RegisterAuthServiceHandler registers the http handlers for service AuthService to "mux".
// The handlers forward requests to the grpc endpoint over "conn".
func RegisterAuthServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {
return RegisterAuthServiceHandlerClient(ctx, mux, NewAuthServiceClient(conn))
}
// RegisterAuthServiceHandlerClient registers the http handlers for service AuthService
// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "AuthServiceClient".
// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "AuthServiceClient"
// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in
// "AuthServiceClient" to call the correct interceptors.
func RegisterAuthServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AuthServiceClient) error {
mux.Handle("GET", pattern_AuthService_Authorize_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateContext(ctx, mux, req)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_AuthService_Authorize_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_AuthService_Authorize_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
return nil
}
var (
pattern_AuthService_Authorize_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"apis", "v1beta1", "auth"}, ""))
)
var (
forward_AuthService_Authorize_0 = runtime.ForwardResponseMessage
)

160
backend/api/go_client/error.pb.go generated Executable file
View File

@ -0,0 +1,160 @@
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: backend/api/error.proto
package go_client // import "github.com/kubeflow/pipelines/backend/api/go_client"
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import any "github.com/golang/protobuf/ptypes/any"
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
type Error struct {
ErrorMessage string `protobuf:"bytes,1,opt,name=error_message,json=errorMessage,proto3" json:"error_message,omitempty"`
ErrorDetails string `protobuf:"bytes,2,opt,name=error_details,json=errorDetails,proto3" json:"error_details,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *Error) Reset() { *m = Error{} }
func (m *Error) String() string { return proto.CompactTextString(m) }
func (*Error) ProtoMessage() {}
func (*Error) Descriptor() ([]byte, []int) {
return fileDescriptor_error_c958bf85e2691313, []int{0}
}
func (m *Error) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Error.Unmarshal(m, b)
}
func (m *Error) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Error.Marshal(b, m, deterministic)
}
func (dst *Error) XXX_Merge(src proto.Message) {
xxx_messageInfo_Error.Merge(dst, src)
}
func (m *Error) XXX_Size() int {
return xxx_messageInfo_Error.Size(m)
}
func (m *Error) XXX_DiscardUnknown() {
xxx_messageInfo_Error.DiscardUnknown(m)
}
var xxx_messageInfo_Error proto.InternalMessageInfo
func (m *Error) GetErrorMessage() string {
if m != nil {
return m.ErrorMessage
}
return ""
}
func (m *Error) GetErrorDetails() string {
if m != nil {
return m.ErrorDetails
}
return ""
}
type Status struct {
Error string `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"`
Code int32 `protobuf:"varint,2,opt,name=code,proto3" json:"code,omitempty"`
Details []*any.Any `protobuf:"bytes,3,rep,name=details,proto3" json:"details,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *Status) Reset() { *m = Status{} }
func (m *Status) String() string { return proto.CompactTextString(m) }
func (*Status) ProtoMessage() {}
func (*Status) Descriptor() ([]byte, []int) {
return fileDescriptor_error_c958bf85e2691313, []int{1}
}
func (m *Status) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Status.Unmarshal(m, b)
}
func (m *Status) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Status.Marshal(b, m, deterministic)
}
func (dst *Status) XXX_Merge(src proto.Message) {
xxx_messageInfo_Status.Merge(dst, src)
}
func (m *Status) XXX_Size() int {
return xxx_messageInfo_Status.Size(m)
}
func (m *Status) XXX_DiscardUnknown() {
xxx_messageInfo_Status.DiscardUnknown(m)
}
var xxx_messageInfo_Status proto.InternalMessageInfo
func (m *Status) GetError() string {
if m != nil {
return m.Error
}
return ""
}
func (m *Status) GetCode() int32 {
if m != nil {
return m.Code
}
return 0
}
func (m *Status) GetDetails() []*any.Any {
if m != nil {
return m.Details
}
return nil
}
func init() {
proto.RegisterType((*Error)(nil), "api.Error")
proto.RegisterType((*Status)(nil), "api.Status")
}
func init() { proto.RegisterFile("backend/api/error.proto", fileDescriptor_error_c958bf85e2691313) }
var fileDescriptor_error_c958bf85e2691313 = []byte{
// 228 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x4c, 0x90, 0x4d, 0x4b, 0x03, 0x31,
0x10, 0x86, 0xa9, 0xeb, 0x56, 0x8c, 0x7a, 0x09, 0x05, 0xab, 0xa7, 0x52, 0x2f, 0x3d, 0x25, 0x60,
0xf1, 0x07, 0x28, 0x7a, 0xf4, 0xe0, 0x7a, 0xf3, 0x52, 0x92, 0xec, 0x34, 0x86, 0xa6, 0x99, 0x90,
0x0f, 0x64, 0xff, 0xbd, 0x98, 0xb8, 0x74, 0x6f, 0xc9, 0x33, 0xcf, 0xbc, 0xbc, 0x0c, 0xb9, 0x95,
0x42, 0x1d, 0xc0, 0xf5, 0x5c, 0x78, 0xc3, 0x21, 0x04, 0x0c, 0xcc, 0x07, 0x4c, 0x48, 0x1b, 0xe1,
0xcd, 0xfd, 0x9d, 0x46, 0xd4, 0x16, 0x78, 0x41, 0x32, 0xef, 0xb9, 0x70, 0x43, 0x9d, 0xaf, 0x3f,
0x48, 0xfb, 0xf6, 0xa7, 0xd3, 0x07, 0x72, 0x53, 0xf6, 0x76, 0x47, 0x88, 0x51, 0x68, 0x58, 0xce,
0x56, 0xb3, 0xcd, 0x65, 0x77, 0x5d, 0xe0, 0x7b, 0x65, 0x27, 0xa9, 0x87, 0x24, 0x8c, 0x8d, 0xcb,
0xb3, 0x89, 0xf4, 0x5a, 0xd9, 0x5a, 0x92, 0xf9, 0x67, 0x12, 0x29, 0x47, 0xba, 0x20, 0x6d, 0x99,
0xfc, 0x67, 0xd5, 0x0f, 0xa5, 0xe4, 0x5c, 0x61, 0x0f, 0x65, 0xb7, 0xed, 0xca, 0x9b, 0x32, 0x72,
0x31, 0x46, 0x36, 0xab, 0x66, 0x73, 0xf5, 0xb8, 0x60, 0xb5, 0x33, 0x1b, 0x3b, 0xb3, 0x67, 0x37,
0x74, 0xa3, 0xf4, 0xf2, 0xf4, 0xb5, 0xd5, 0x26, 0x7d, 0x67, 0xc9, 0x14, 0x1e, 0xf9, 0x21, 0x4b,
0xd8, 0x5b, 0xfc, 0xe1, 0xde, 0x78, 0xb0, 0xc6, 0x41, 0xe4, 0xd3, 0x7b, 0x68, 0xdc, 0x29, 0x6b,
0xc0, 0x25, 0x39, 0x2f, 0x69, 0xdb, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x12, 0x2e, 0x20, 0xa9,
0x2f, 0x01, 0x00, 0x00,
}

17
backend/api/go_client/error.pb.gw.go generated Executable file
View File

@ -0,0 +1,17 @@
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// +build ignore
package ignore

773
backend/api/go_client/experiment.pb.go generated Executable file
View File

@ -0,0 +1,773 @@
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: backend/api/experiment.proto
package go_client // import "github.com/kubeflow/pipelines/backend/api/go_client"
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import empty "github.com/golang/protobuf/ptypes/empty"
import timestamp "github.com/golang/protobuf/ptypes/timestamp"
import _ "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger/options"
import _ "google.golang.org/genproto/googleapis/api/annotations"
import (
context "golang.org/x/net/context"
grpc "google.golang.org/grpc"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
type Experiment_StorageState int32
const (
Experiment_STORAGESTATE_UNSPECIFIED Experiment_StorageState = 0
Experiment_STORAGESTATE_AVAILABLE Experiment_StorageState = 1
Experiment_STORAGESTATE_ARCHIVED Experiment_StorageState = 2
)
var Experiment_StorageState_name = map[int32]string{
0: "STORAGESTATE_UNSPECIFIED",
1: "STORAGESTATE_AVAILABLE",
2: "STORAGESTATE_ARCHIVED",
}
var Experiment_StorageState_value = map[string]int32{
"STORAGESTATE_UNSPECIFIED": 0,
"STORAGESTATE_AVAILABLE": 1,
"STORAGESTATE_ARCHIVED": 2,
}
func (x Experiment_StorageState) String() string {
return proto.EnumName(Experiment_StorageState_name, int32(x))
}
func (Experiment_StorageState) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_experiment_b177a3d23629b3a5, []int{5, 0}
}
type CreateExperimentRequest struct {
Experiment *Experiment `protobuf:"bytes,1,opt,name=experiment,proto3" json:"experiment,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *CreateExperimentRequest) Reset() { *m = CreateExperimentRequest{} }
func (m *CreateExperimentRequest) String() string { return proto.CompactTextString(m) }
func (*CreateExperimentRequest) ProtoMessage() {}
func (*CreateExperimentRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_experiment_b177a3d23629b3a5, []int{0}
}
func (m *CreateExperimentRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_CreateExperimentRequest.Unmarshal(m, b)
}
func (m *CreateExperimentRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_CreateExperimentRequest.Marshal(b, m, deterministic)
}
func (dst *CreateExperimentRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_CreateExperimentRequest.Merge(dst, src)
}
func (m *CreateExperimentRequest) XXX_Size() int {
return xxx_messageInfo_CreateExperimentRequest.Size(m)
}
func (m *CreateExperimentRequest) XXX_DiscardUnknown() {
xxx_messageInfo_CreateExperimentRequest.DiscardUnknown(m)
}
var xxx_messageInfo_CreateExperimentRequest proto.InternalMessageInfo
func (m *CreateExperimentRequest) GetExperiment() *Experiment {
if m != nil {
return m.Experiment
}
return nil
}
type GetExperimentRequest struct {
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *GetExperimentRequest) Reset() { *m = GetExperimentRequest{} }
func (m *GetExperimentRequest) String() string { return proto.CompactTextString(m) }
func (*GetExperimentRequest) ProtoMessage() {}
func (*GetExperimentRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_experiment_b177a3d23629b3a5, []int{1}
}
func (m *GetExperimentRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetExperimentRequest.Unmarshal(m, b)
}
func (m *GetExperimentRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_GetExperimentRequest.Marshal(b, m, deterministic)
}
func (dst *GetExperimentRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_GetExperimentRequest.Merge(dst, src)
}
func (m *GetExperimentRequest) XXX_Size() int {
return xxx_messageInfo_GetExperimentRequest.Size(m)
}
func (m *GetExperimentRequest) XXX_DiscardUnknown() {
xxx_messageInfo_GetExperimentRequest.DiscardUnknown(m)
}
var xxx_messageInfo_GetExperimentRequest proto.InternalMessageInfo
func (m *GetExperimentRequest) GetId() string {
if m != nil {
return m.Id
}
return ""
}
type ListExperimentsRequest struct {
PageToken string `protobuf:"bytes,1,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"`
PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
SortBy string `protobuf:"bytes,3,opt,name=sort_by,json=sortBy,proto3" json:"sort_by,omitempty"`
Filter string `protobuf:"bytes,4,opt,name=filter,proto3" json:"filter,omitempty"`
ResourceReferenceKey *ResourceKey `protobuf:"bytes,5,opt,name=resource_reference_key,json=resourceReferenceKey,proto3" json:"resource_reference_key,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *ListExperimentsRequest) Reset() { *m = ListExperimentsRequest{} }
func (m *ListExperimentsRequest) String() string { return proto.CompactTextString(m) }
func (*ListExperimentsRequest) ProtoMessage() {}
func (*ListExperimentsRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_experiment_b177a3d23629b3a5, []int{2}
}
func (m *ListExperimentsRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ListExperimentsRequest.Unmarshal(m, b)
}
func (m *ListExperimentsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ListExperimentsRequest.Marshal(b, m, deterministic)
}
func (dst *ListExperimentsRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_ListExperimentsRequest.Merge(dst, src)
}
func (m *ListExperimentsRequest) XXX_Size() int {
return xxx_messageInfo_ListExperimentsRequest.Size(m)
}
func (m *ListExperimentsRequest) XXX_DiscardUnknown() {
xxx_messageInfo_ListExperimentsRequest.DiscardUnknown(m)
}
var xxx_messageInfo_ListExperimentsRequest proto.InternalMessageInfo
func (m *ListExperimentsRequest) GetPageToken() string {
if m != nil {
return m.PageToken
}
return ""
}
func (m *ListExperimentsRequest) GetPageSize() int32 {
if m != nil {
return m.PageSize
}
return 0
}
func (m *ListExperimentsRequest) GetSortBy() string {
if m != nil {
return m.SortBy
}
return ""
}
func (m *ListExperimentsRequest) GetFilter() string {
if m != nil {
return m.Filter
}
return ""
}
func (m *ListExperimentsRequest) GetResourceReferenceKey() *ResourceKey {
if m != nil {
return m.ResourceReferenceKey
}
return nil
}
type ListExperimentsResponse struct {
Experiments []*Experiment `protobuf:"bytes,1,rep,name=experiments,proto3" json:"experiments,omitempty"`
TotalSize int32 `protobuf:"varint,3,opt,name=total_size,json=totalSize,proto3" json:"total_size,omitempty"`
NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *ListExperimentsResponse) Reset() { *m = ListExperimentsResponse{} }
func (m *ListExperimentsResponse) String() string { return proto.CompactTextString(m) }
func (*ListExperimentsResponse) ProtoMessage() {}
func (*ListExperimentsResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_experiment_b177a3d23629b3a5, []int{3}
}
func (m *ListExperimentsResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ListExperimentsResponse.Unmarshal(m, b)
}
func (m *ListExperimentsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ListExperimentsResponse.Marshal(b, m, deterministic)
}
func (dst *ListExperimentsResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_ListExperimentsResponse.Merge(dst, src)
}
func (m *ListExperimentsResponse) XXX_Size() int {
return xxx_messageInfo_ListExperimentsResponse.Size(m)
}
func (m *ListExperimentsResponse) XXX_DiscardUnknown() {
xxx_messageInfo_ListExperimentsResponse.DiscardUnknown(m)
}
var xxx_messageInfo_ListExperimentsResponse proto.InternalMessageInfo
func (m *ListExperimentsResponse) GetExperiments() []*Experiment {
if m != nil {
return m.Experiments
}
return nil
}
func (m *ListExperimentsResponse) GetTotalSize() int32 {
if m != nil {
return m.TotalSize
}
return 0
}
func (m *ListExperimentsResponse) GetNextPageToken() string {
if m != nil {
return m.NextPageToken
}
return ""
}
type DeleteExperimentRequest struct {
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *DeleteExperimentRequest) Reset() { *m = DeleteExperimentRequest{} }
func (m *DeleteExperimentRequest) String() string { return proto.CompactTextString(m) }
func (*DeleteExperimentRequest) ProtoMessage() {}
func (*DeleteExperimentRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_experiment_b177a3d23629b3a5, []int{4}
}
func (m *DeleteExperimentRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_DeleteExperimentRequest.Unmarshal(m, b)
}
func (m *DeleteExperimentRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_DeleteExperimentRequest.Marshal(b, m, deterministic)
}
func (dst *DeleteExperimentRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_DeleteExperimentRequest.Merge(dst, src)
}
func (m *DeleteExperimentRequest) XXX_Size() int {
return xxx_messageInfo_DeleteExperimentRequest.Size(m)
}
func (m *DeleteExperimentRequest) XXX_DiscardUnknown() {
xxx_messageInfo_DeleteExperimentRequest.DiscardUnknown(m)
}
var xxx_messageInfo_DeleteExperimentRequest proto.InternalMessageInfo
func (m *DeleteExperimentRequest) GetId() string {
if m != nil {
return m.Id
}
return ""
}
type Experiment struct {
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"`
CreatedAt *timestamp.Timestamp `protobuf:"bytes,4,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
ResourceReferences []*ResourceReference `protobuf:"bytes,5,rep,name=resource_references,json=resourceReferences,proto3" json:"resource_references,omitempty"`
StorageState Experiment_StorageState `protobuf:"varint,6,opt,name=storage_state,json=storageState,proto3,enum=api.Experiment_StorageState" json:"storage_state,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *Experiment) Reset() { *m = Experiment{} }
func (m *Experiment) String() string { return proto.CompactTextString(m) }
func (*Experiment) ProtoMessage() {}
func (*Experiment) Descriptor() ([]byte, []int) {
return fileDescriptor_experiment_b177a3d23629b3a5, []int{5}
}
func (m *Experiment) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Experiment.Unmarshal(m, b)
}
func (m *Experiment) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Experiment.Marshal(b, m, deterministic)
}
func (dst *Experiment) XXX_Merge(src proto.Message) {
xxx_messageInfo_Experiment.Merge(dst, src)
}
func (m *Experiment) XXX_Size() int {
return xxx_messageInfo_Experiment.Size(m)
}
func (m *Experiment) XXX_DiscardUnknown() {
xxx_messageInfo_Experiment.DiscardUnknown(m)
}
var xxx_messageInfo_Experiment proto.InternalMessageInfo
func (m *Experiment) GetId() string {
if m != nil {
return m.Id
}
return ""
}
func (m *Experiment) GetName() string {
if m != nil {
return m.Name
}
return ""
}
func (m *Experiment) GetDescription() string {
if m != nil {
return m.Description
}
return ""
}
func (m *Experiment) GetCreatedAt() *timestamp.Timestamp {
if m != nil {
return m.CreatedAt
}
return nil
}
func (m *Experiment) GetResourceReferences() []*ResourceReference {
if m != nil {
return m.ResourceReferences
}
return nil
}
func (m *Experiment) GetStorageState() Experiment_StorageState {
if m != nil {
return m.StorageState
}
return Experiment_STORAGESTATE_UNSPECIFIED
}
type ArchiveExperimentRequest struct {
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *ArchiveExperimentRequest) Reset() { *m = ArchiveExperimentRequest{} }
func (m *ArchiveExperimentRequest) String() string { return proto.CompactTextString(m) }
func (*ArchiveExperimentRequest) ProtoMessage() {}
func (*ArchiveExperimentRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_experiment_b177a3d23629b3a5, []int{6}
}
func (m *ArchiveExperimentRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ArchiveExperimentRequest.Unmarshal(m, b)
}
func (m *ArchiveExperimentRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ArchiveExperimentRequest.Marshal(b, m, deterministic)
}
func (dst *ArchiveExperimentRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_ArchiveExperimentRequest.Merge(dst, src)
}
func (m *ArchiveExperimentRequest) XXX_Size() int {
return xxx_messageInfo_ArchiveExperimentRequest.Size(m)
}
func (m *ArchiveExperimentRequest) XXX_DiscardUnknown() {
xxx_messageInfo_ArchiveExperimentRequest.DiscardUnknown(m)
}
var xxx_messageInfo_ArchiveExperimentRequest proto.InternalMessageInfo
func (m *ArchiveExperimentRequest) GetId() string {
if m != nil {
return m.Id
}
return ""
}
type UnarchiveExperimentRequest struct {
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *UnarchiveExperimentRequest) Reset() { *m = UnarchiveExperimentRequest{} }
func (m *UnarchiveExperimentRequest) String() string { return proto.CompactTextString(m) }
func (*UnarchiveExperimentRequest) ProtoMessage() {}
func (*UnarchiveExperimentRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_experiment_b177a3d23629b3a5, []int{7}
}
func (m *UnarchiveExperimentRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_UnarchiveExperimentRequest.Unmarshal(m, b)
}
func (m *UnarchiveExperimentRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_UnarchiveExperimentRequest.Marshal(b, m, deterministic)
}
func (dst *UnarchiveExperimentRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_UnarchiveExperimentRequest.Merge(dst, src)
}
func (m *UnarchiveExperimentRequest) XXX_Size() int {
return xxx_messageInfo_UnarchiveExperimentRequest.Size(m)
}
func (m *UnarchiveExperimentRequest) XXX_DiscardUnknown() {
xxx_messageInfo_UnarchiveExperimentRequest.DiscardUnknown(m)
}
var xxx_messageInfo_UnarchiveExperimentRequest proto.InternalMessageInfo
func (m *UnarchiveExperimentRequest) GetId() string {
if m != nil {
return m.Id
}
return ""
}
func init() {
proto.RegisterType((*CreateExperimentRequest)(nil), "api.CreateExperimentRequest")
proto.RegisterType((*GetExperimentRequest)(nil), "api.GetExperimentRequest")
proto.RegisterType((*ListExperimentsRequest)(nil), "api.ListExperimentsRequest")
proto.RegisterType((*ListExperimentsResponse)(nil), "api.ListExperimentsResponse")
proto.RegisterType((*DeleteExperimentRequest)(nil), "api.DeleteExperimentRequest")
proto.RegisterType((*Experiment)(nil), "api.Experiment")
proto.RegisterType((*ArchiveExperimentRequest)(nil), "api.ArchiveExperimentRequest")
proto.RegisterType((*UnarchiveExperimentRequest)(nil), "api.UnarchiveExperimentRequest")
proto.RegisterEnum("api.Experiment_StorageState", Experiment_StorageState_name, Experiment_StorageState_value)
}
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConn
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion4
// ExperimentServiceClient is the client API for ExperimentService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type ExperimentServiceClient interface {
CreateExperiment(ctx context.Context, in *CreateExperimentRequest, opts ...grpc.CallOption) (*Experiment, error)
GetExperiment(ctx context.Context, in *GetExperimentRequest, opts ...grpc.CallOption) (*Experiment, error)
ListExperiment(ctx context.Context, in *ListExperimentsRequest, opts ...grpc.CallOption) (*ListExperimentsResponse, error)
DeleteExperiment(ctx context.Context, in *DeleteExperimentRequest, opts ...grpc.CallOption) (*empty.Empty, error)
ArchiveExperiment(ctx context.Context, in *ArchiveExperimentRequest, opts ...grpc.CallOption) (*empty.Empty, error)
UnarchiveExperiment(ctx context.Context, in *UnarchiveExperimentRequest, opts ...grpc.CallOption) (*empty.Empty, error)
}
type experimentServiceClient struct {
cc *grpc.ClientConn
}
func NewExperimentServiceClient(cc *grpc.ClientConn) ExperimentServiceClient {
return &experimentServiceClient{cc}
}
func (c *experimentServiceClient) CreateExperiment(ctx context.Context, in *CreateExperimentRequest, opts ...grpc.CallOption) (*Experiment, error) {
out := new(Experiment)
err := c.cc.Invoke(ctx, "/api.ExperimentService/CreateExperiment", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *experimentServiceClient) GetExperiment(ctx context.Context, in *GetExperimentRequest, opts ...grpc.CallOption) (*Experiment, error) {
out := new(Experiment)
err := c.cc.Invoke(ctx, "/api.ExperimentService/GetExperiment", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *experimentServiceClient) ListExperiment(ctx context.Context, in *ListExperimentsRequest, opts ...grpc.CallOption) (*ListExperimentsResponse, error) {
out := new(ListExperimentsResponse)
err := c.cc.Invoke(ctx, "/api.ExperimentService/ListExperiment", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *experimentServiceClient) DeleteExperiment(ctx context.Context, in *DeleteExperimentRequest, opts ...grpc.CallOption) (*empty.Empty, error) {
out := new(empty.Empty)
err := c.cc.Invoke(ctx, "/api.ExperimentService/DeleteExperiment", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *experimentServiceClient) ArchiveExperiment(ctx context.Context, in *ArchiveExperimentRequest, opts ...grpc.CallOption) (*empty.Empty, error) {
out := new(empty.Empty)
err := c.cc.Invoke(ctx, "/api.ExperimentService/ArchiveExperiment", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *experimentServiceClient) UnarchiveExperiment(ctx context.Context, in *UnarchiveExperimentRequest, opts ...grpc.CallOption) (*empty.Empty, error) {
out := new(empty.Empty)
err := c.cc.Invoke(ctx, "/api.ExperimentService/UnarchiveExperiment", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// ExperimentServiceServer is the server API for ExperimentService service.
type ExperimentServiceServer interface {
CreateExperiment(context.Context, *CreateExperimentRequest) (*Experiment, error)
GetExperiment(context.Context, *GetExperimentRequest) (*Experiment, error)
ListExperiment(context.Context, *ListExperimentsRequest) (*ListExperimentsResponse, error)
DeleteExperiment(context.Context, *DeleteExperimentRequest) (*empty.Empty, error)
ArchiveExperiment(context.Context, *ArchiveExperimentRequest) (*empty.Empty, error)
UnarchiveExperiment(context.Context, *UnarchiveExperimentRequest) (*empty.Empty, error)
}
func RegisterExperimentServiceServer(s *grpc.Server, srv ExperimentServiceServer) {
s.RegisterService(&_ExperimentService_serviceDesc, srv)
}
func _ExperimentService_CreateExperiment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CreateExperimentRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ExperimentServiceServer).CreateExperiment(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/api.ExperimentService/CreateExperiment",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ExperimentServiceServer).CreateExperiment(ctx, req.(*CreateExperimentRequest))
}
return interceptor(ctx, in, info, handler)
}
func _ExperimentService_GetExperiment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetExperimentRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ExperimentServiceServer).GetExperiment(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/api.ExperimentService/GetExperiment",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ExperimentServiceServer).GetExperiment(ctx, req.(*GetExperimentRequest))
}
return interceptor(ctx, in, info, handler)
}
func _ExperimentService_ListExperiment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ListExperimentsRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ExperimentServiceServer).ListExperiment(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/api.ExperimentService/ListExperiment",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ExperimentServiceServer).ListExperiment(ctx, req.(*ListExperimentsRequest))
}
return interceptor(ctx, in, info, handler)
}
func _ExperimentService_DeleteExperiment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(DeleteExperimentRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ExperimentServiceServer).DeleteExperiment(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/api.ExperimentService/DeleteExperiment",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ExperimentServiceServer).DeleteExperiment(ctx, req.(*DeleteExperimentRequest))
}
return interceptor(ctx, in, info, handler)
}
func _ExperimentService_ArchiveExperiment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ArchiveExperimentRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ExperimentServiceServer).ArchiveExperiment(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/api.ExperimentService/ArchiveExperiment",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ExperimentServiceServer).ArchiveExperiment(ctx, req.(*ArchiveExperimentRequest))
}
return interceptor(ctx, in, info, handler)
}
func _ExperimentService_UnarchiveExperiment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(UnarchiveExperimentRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ExperimentServiceServer).UnarchiveExperiment(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/api.ExperimentService/UnarchiveExperiment",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ExperimentServiceServer).UnarchiveExperiment(ctx, req.(*UnarchiveExperimentRequest))
}
return interceptor(ctx, in, info, handler)
}
var _ExperimentService_serviceDesc = grpc.ServiceDesc{
ServiceName: "api.ExperimentService",
HandlerType: (*ExperimentServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "CreateExperiment",
Handler: _ExperimentService_CreateExperiment_Handler,
},
{
MethodName: "GetExperiment",
Handler: _ExperimentService_GetExperiment_Handler,
},
{
MethodName: "ListExperiment",
Handler: _ExperimentService_ListExperiment_Handler,
},
{
MethodName: "DeleteExperiment",
Handler: _ExperimentService_DeleteExperiment_Handler,
},
{
MethodName: "ArchiveExperiment",
Handler: _ExperimentService_ArchiveExperiment_Handler,
},
{
MethodName: "UnarchiveExperiment",
Handler: _ExperimentService_UnarchiveExperiment_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "backend/api/experiment.proto",
}
func init() {
proto.RegisterFile("backend/api/experiment.proto", fileDescriptor_experiment_b177a3d23629b3a5)
}
var fileDescriptor_experiment_b177a3d23629b3a5 = []byte{
// 889 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x55, 0x51, 0x53, 0xdb, 0x46,
0x10, 0x8e, 0x4c, 0x70, 0xc2, 0x1a, 0x83, 0x39, 0x52, 0x5b, 0x08, 0x53, 0x5c, 0x4d, 0x87, 0xba,
0x4c, 0xb0, 0x0a, 0x79, 0x6a, 0xde, 0x0c, 0x38, 0x94, 0x86, 0xb6, 0x19, 0xd9, 0xc9, 0x43, 0x5e,
0x3c, 0x67, 0x79, 0x6d, 0x6e, 0xb0, 0x75, 0xea, 0xdd, 0x89, 0xc4, 0x74, 0x3a, 0xd3, 0xe9, 0x4c,
0xff, 0x40, 0xf3, 0xb3, 0x3a, 0x7d, 0xea, 0x5f, 0xe8, 0xef, 0xe8, 0x74, 0x74, 0x96, 0x41, 0xb6,
0xec, 0x84, 0x27, 0xb8, 0xdd, 0xcf, 0xb7, 0xf7, 0x7d, 0xfb, 0xed, 0x0a, 0xca, 0x1d, 0xea, 0x5d,
0xa1, 0xdf, 0x75, 0x68, 0xc0, 0x1c, 0x7c, 0x1f, 0xa0, 0x60, 0x43, 0xf4, 0x55, 0x2d, 0x10, 0x5c,
0x71, 0xb2, 0x44, 0x03, 0x66, 0x95, 0xa6, 0x20, 0x42, 0x70, 0x31, 0xce, 0x5a, 0x5f, 0x26, 0x13,
0x02, 0x25, 0x0f, 0x85, 0x87, 0x6d, 0x81, 0x3d, 0x14, 0xe8, 0x7b, 0x18, 0xa3, 0xca, 0x7d, 0xce,
0xfb, 0x03, 0xd4, 0x20, 0xea, 0xfb, 0x5c, 0x51, 0xc5, 0xb8, 0x2f, 0xe3, 0xec, 0x76, 0x9c, 0xd5,
0xa7, 0x4e, 0xd8, 0x73, 0x70, 0x18, 0xa8, 0x51, 0x9c, 0xdc, 0x9d, 0x4d, 0x2a, 0x36, 0x44, 0xa9,
0xe8, 0x30, 0x88, 0x01, 0x4f, 0xf5, 0x1f, 0xef, 0xa0, 0x8f, 0xfe, 0x81, 0x7c, 0x47, 0xfb, 0x7d,
0x14, 0x0e, 0x0f, 0xf4, 0xfd, 0xe9, 0x5a, 0xf6, 0xf7, 0x50, 0x3a, 0x11, 0x48, 0x15, 0x36, 0x6e,
0x79, 0xba, 0xf8, 0x73, 0x88, 0x52, 0x11, 0x07, 0xe0, 0x8e, 0xbc, 0x69, 0x54, 0x8c, 0x6a, 0xee,
0x68, 0xbd, 0x46, 0x03, 0x56, 0x4b, 0x60, 0x13, 0x10, 0x7b, 0x0f, 0x9e, 0x9c, 0xa1, 0x4a, 0x5f,
0xb4, 0x06, 0x19, 0xd6, 0xd5, 0x17, 0xac, 0xb8, 0x19, 0xd6, 0xb5, 0xff, 0x36, 0xa0, 0x78, 0xc1,
0x64, 0x02, 0x29, 0x27, 0xd0, 0x1d, 0x80, 0x80, 0xf6, 0xb1, 0xad, 0xf8, 0x15, 0xfa, 0xf1, 0x4f,
0x56, 0xa2, 0x48, 0x2b, 0x0a, 0x90, 0x6d, 0xd0, 0x87, 0xb6, 0x64, 0x37, 0x68, 0x66, 0x2a, 0x46,
0x75, 0xd9, 0x7d, 0x1c, 0x05, 0x9a, 0xec, 0x06, 0x49, 0x09, 0x1e, 0x49, 0x2e, 0x54, 0xbb, 0x33,
0x32, 0x97, 0xf4, 0x0f, 0xb3, 0xd1, 0xf1, 0x78, 0x44, 0x8a, 0x90, 0xed, 0xb1, 0x81, 0x42, 0x61,
0x3e, 0x1c, 0xc7, 0xc7, 0x27, 0xf2, 0x02, 0x8a, 0xe9, 0x0e, 0xb5, 0xaf, 0x70, 0x64, 0x2e, 0x6b,
0xb2, 0x05, 0x4d, 0xd6, 0x8d, 0x21, 0x2f, 0x71, 0xe4, 0x3e, 0x99, 0xe0, 0xdd, 0x09, 0xfc, 0x25,
0x8e, 0xec, 0x0f, 0x06, 0x94, 0x52, 0x7c, 0x64, 0xc0, 0x7d, 0x89, 0xe4, 0x10, 0x72, 0x77, 0x0a,
0x49, 0xd3, 0xa8, 0x2c, 0xcd, 0x53, 0x31, 0x89, 0x89, 0x34, 0x50, 0x5c, 0xd1, 0xc1, 0x98, 0xe5,
0x92, 0x66, 0xb9, 0xa2, 0x23, 0x9a, 0xe6, 0x1e, 0xac, 0xfb, 0xf8, 0x5e, 0xb5, 0x13, 0x3a, 0x65,
0x34, 0xad, 0x7c, 0x14, 0x7e, 0x35, 0xd1, 0xca, 0xfe, 0x1a, 0x4a, 0xa7, 0x38, 0xc0, 0x79, 0x9d,
0x9d, 0x6d, 0xc8, 0x7f, 0x19, 0x80, 0x3b, 0xd4, 0x6c, 0x9a, 0x10, 0x78, 0xe8, 0xd3, 0x21, 0xc6,
0x65, 0xf4, 0xff, 0xa4, 0x02, 0xb9, 0x2e, 0x4a, 0x4f, 0x30, 0xed, 0xac, 0x58, 0xf0, 0x64, 0x88,
0x7c, 0x0b, 0xe0, 0x69, 0x67, 0x75, 0xdb, 0x54, 0x69, 0xe5, 0x73, 0x47, 0x56, 0x6d, 0xec, 0xde,
0xda, 0xc4, 0xbd, 0xb5, 0xd6, 0xc4, 0xbd, 0xee, 0x4a, 0x8c, 0xae, 0x2b, 0x72, 0x06, 0x9b, 0xe9,
0xc6, 0x48, 0x73, 0x59, 0x8b, 0x57, 0x9c, 0xea, 0xca, 0x6d, 0x23, 0x5c, 0x92, 0xea, 0x8d, 0x24,
0x75, 0xc8, 0x4b, 0xc5, 0x85, 0xb6, 0x8c, 0xa2, 0x0a, 0xcd, 0x6c, 0xc5, 0xa8, 0xae, 0x1d, 0x95,
0x67, 0xf4, 0xaf, 0x35, 0xc7, 0xa0, 0x66, 0x84, 0x71, 0x57, 0x65, 0xe2, 0x64, 0x7b, 0xb0, 0x9a,
0xcc, 0x92, 0x32, 0x98, 0xcd, 0xd6, 0x4f, 0x6e, 0xfd, 0xac, 0xd1, 0x6c, 0xd5, 0x5b, 0x8d, 0xf6,
0xeb, 0x1f, 0x9b, 0xaf, 0x1a, 0x27, 0xe7, 0x2f, 0xce, 0x1b, 0xa7, 0x85, 0x07, 0xc4, 0x82, 0xe2,
0x54, 0xb6, 0xfe, 0xa6, 0x7e, 0x7e, 0x51, 0x3f, 0xbe, 0x68, 0x14, 0x0c, 0xb2, 0x05, 0x9f, 0x4d,
0xe7, 0xdc, 0x93, 0xef, 0xce, 0xdf, 0x34, 0x4e, 0x0b, 0x19, 0x7b, 0x1f, 0xcc, 0xba, 0xf0, 0x2e,
0xd9, 0xf5, 0x3d, 0x9a, 0xf5, 0x14, 0xac, 0xd7, 0x3e, 0xbd, 0x27, 0xfa, 0xe8, 0xaf, 0x65, 0xd8,
0xb8, 0x43, 0x35, 0x51, 0x5c, 0x33, 0x0f, 0x49, 0x00, 0x85, 0xd9, 0xa9, 0x27, 0x63, 0x51, 0x16,
0x2c, 0x03, 0x6b, 0xd6, 0xb2, 0xf6, 0xc1, 0xef, 0xff, 0xfc, 0xfb, 0x21, 0xf3, 0x95, 0xbd, 0x15,
0x2d, 0x31, 0xe9, 0x5c, 0x1f, 0x76, 0x50, 0xd1, 0xc3, 0xc4, 0xba, 0x94, 0xcf, 0x13, 0xbb, 0x81,
0x78, 0x90, 0x9f, 0xda, 0x0d, 0x64, 0x4b, 0x5f, 0x38, 0x6f, 0x5f, 0xa4, 0x6b, 0xed, 0xe9, 0x5a,
0x15, 0xf2, 0xf9, 0xc2, 0x5a, 0xce, 0x2f, 0xac, 0xfb, 0x2b, 0xf1, 0x61, 0x6d, 0x7a, 0x0e, 0xc9,
0xb6, 0xbe, 0x6a, 0xfe, 0xb2, 0xb1, 0xca, 0xf3, 0x93, 0xe3, 0xc9, 0xb5, 0xbf, 0xd0, 0x45, 0xb7,
0xc9, 0x62, 0x82, 0x91, 0x8c, 0xb3, 0x23, 0x16, 0xcb, 0xb8, 0x60, 0xf2, 0xac, 0x62, 0x6a, 0x00,
0x1a, 0xd1, 0x6e, 0x9f, 0x30, 0xdc, 0xff, 0x14, 0xc3, 0x1b, 0xd8, 0x48, 0x19, 0x85, 0xec, 0xe8,
0x92, 0x8b, 0x0c, 0xb4, 0xb0, 0x66, 0x4d, 0xd7, 0xac, 0xda, 0x7b, 0x1f, 0xaf, 0xf9, 0x3c, 0xf6,
0x1a, 0xf9, 0xcd, 0x80, 0xcd, 0x39, 0xce, 0x23, 0xbb, 0xba, 0xfc, 0x62, 0x4f, 0x2e, 0x7c, 0xc0,
0x37, 0xfa, 0x01, 0xfb, 0x76, 0xf5, 0x13, 0x0f, 0x08, 0x27, 0x57, 0x1f, 0xff, 0x61, 0xfc, 0x59,
0xff, 0xc1, 0x2d, 0xc3, 0xa3, 0x2e, 0xf6, 0x68, 0x38, 0x50, 0x64, 0x83, 0xac, 0x43, 0xde, 0xca,
0xe9, 0x17, 0x44, 0xf3, 0x19, 0xca, 0xb7, 0xbb, 0xb0, 0x03, 0xd9, 0x63, 0xa4, 0x02, 0x05, 0xd9,
0x7c, 0x9c, 0xb1, 0xf2, 0x34, 0x54, 0x97, 0x5c, 0xb0, 0x1b, 0xfd, 0xdd, 0xab, 0x64, 0x3a, 0xab,
0x00, 0xb7, 0x80, 0x07, 0x6f, 0x9f, 0xf5, 0x99, 0xba, 0x0c, 0x3b, 0x35, 0x8f, 0x0f, 0x9d, 0xab,
0xb0, 0x83, 0xbd, 0x01, 0x7f, 0xe7, 0x04, 0x2c, 0xc0, 0x01, 0xf3, 0x51, 0x3a, 0xc9, 0xcf, 0x79,
0x9f, 0xb7, 0xbd, 0x01, 0x43, 0x5f, 0x75, 0xb2, 0x9a, 0xc9, 0xb3, 0xff, 0x03, 0x00, 0x00, 0xff,
0xff, 0x0b, 0x8f, 0xfa, 0xad, 0x2a, 0x08, 0x00, 0x00,
}

374
backend/api/go_client/experiment.pb.gw.go generated Executable file
View File

@ -0,0 +1,374 @@
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
// source: backend/api/experiment.proto
/*
Package go_client is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
*/
package go_client
import (
"context"
"io"
"net/http"
"github.com/golang/protobuf/proto"
"github.com/grpc-ecosystem/grpc-gateway/runtime"
"github.com/grpc-ecosystem/grpc-gateway/utilities"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/grpclog"
"google.golang.org/grpc/status"
)
var _ codes.Code
var _ io.Reader
var _ status.Status
var _ = runtime.String
var _ = utilities.NewDoubleArray
func request_ExperimentService_CreateExperiment_0(ctx context.Context, marshaler runtime.Marshaler, client ExperimentServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq CreateExperimentRequest
var metadata runtime.ServerMetadata
newReader, berr := utilities.IOReaderFactory(req.Body)
if berr != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
}
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Experiment); err != nil && err != io.EOF {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.CreateExperiment(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func request_ExperimentService_GetExperiment_0(ctx context.Context, marshaler runtime.Marshaler, client ExperimentServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq GetExperimentRequest
var metadata runtime.ServerMetadata
var (
val string
ok bool
err error
_ = err
)
val, ok = pathParams["id"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id")
}
protoReq.Id, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err)
}
msg, err := client.GetExperiment(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
var (
filter_ExperimentService_ListExperiment_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
)
func request_ExperimentService_ListExperiment_0(ctx context.Context, marshaler runtime.Marshaler, client ExperimentServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq ListExperimentsRequest
var metadata runtime.ServerMetadata
if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_ExperimentService_ListExperiment_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.ListExperiment(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func request_ExperimentService_DeleteExperiment_0(ctx context.Context, marshaler runtime.Marshaler, client ExperimentServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq DeleteExperimentRequest
var metadata runtime.ServerMetadata
var (
val string
ok bool
err error
_ = err
)
val, ok = pathParams["id"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id")
}
protoReq.Id, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err)
}
msg, err := client.DeleteExperiment(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func request_ExperimentService_ArchiveExperiment_0(ctx context.Context, marshaler runtime.Marshaler, client ExperimentServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq ArchiveExperimentRequest
var metadata runtime.ServerMetadata
var (
val string
ok bool
err error
_ = err
)
val, ok = pathParams["id"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id")
}
protoReq.Id, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err)
}
msg, err := client.ArchiveExperiment(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func request_ExperimentService_UnarchiveExperiment_0(ctx context.Context, marshaler runtime.Marshaler, client ExperimentServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq UnarchiveExperimentRequest
var metadata runtime.ServerMetadata
var (
val string
ok bool
err error
_ = err
)
val, ok = pathParams["id"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id")
}
protoReq.Id, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err)
}
msg, err := client.UnarchiveExperiment(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
// RegisterExperimentServiceHandlerFromEndpoint is same as RegisterExperimentServiceHandler but
// automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterExperimentServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) {
conn, err := grpc.Dial(endpoint, opts...)
if err != nil {
return err
}
defer func() {
if err != nil {
if cerr := conn.Close(); cerr != nil {
grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
}
return
}
go func() {
<-ctx.Done()
if cerr := conn.Close(); cerr != nil {
grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
}
}()
}()
return RegisterExperimentServiceHandler(ctx, mux, conn)
}
// RegisterExperimentServiceHandler registers the http handlers for service ExperimentService to "mux".
// The handlers forward requests to the grpc endpoint over "conn".
func RegisterExperimentServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {
return RegisterExperimentServiceHandlerClient(ctx, mux, NewExperimentServiceClient(conn))
}
// RegisterExperimentServiceHandlerClient registers the http handlers for service ExperimentService
// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ExperimentServiceClient".
// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ExperimentServiceClient"
// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in
// "ExperimentServiceClient" to call the correct interceptors.
func RegisterExperimentServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ExperimentServiceClient) error {
mux.Handle("POST", pattern_ExperimentService_CreateExperiment_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateContext(ctx, mux, req)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_ExperimentService_CreateExperiment_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_ExperimentService_CreateExperiment_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_ExperimentService_GetExperiment_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateContext(ctx, mux, req)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_ExperimentService_GetExperiment_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_ExperimentService_GetExperiment_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_ExperimentService_ListExperiment_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateContext(ctx, mux, req)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_ExperimentService_ListExperiment_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_ExperimentService_ListExperiment_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("DELETE", pattern_ExperimentService_DeleteExperiment_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateContext(ctx, mux, req)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_ExperimentService_DeleteExperiment_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_ExperimentService_DeleteExperiment_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("POST", pattern_ExperimentService_ArchiveExperiment_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateContext(ctx, mux, req)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_ExperimentService_ArchiveExperiment_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_ExperimentService_ArchiveExperiment_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("POST", pattern_ExperimentService_UnarchiveExperiment_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateContext(ctx, mux, req)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_ExperimentService_UnarchiveExperiment_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_ExperimentService_UnarchiveExperiment_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
return nil
}
var (
pattern_ExperimentService_CreateExperiment_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"apis", "v1beta1", "experiments"}, ""))
pattern_ExperimentService_GetExperiment_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"apis", "v1beta1", "experiments", "id"}, ""))
pattern_ExperimentService_ListExperiment_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"apis", "v1beta1", "experiments"}, ""))
pattern_ExperimentService_DeleteExperiment_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"apis", "v1beta1", "experiments", "id"}, ""))
pattern_ExperimentService_ArchiveExperiment_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"apis", "v1beta1", "experiments", "id"}, "archive"))
pattern_ExperimentService_UnarchiveExperiment_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"apis", "v1beta1", "experiments", "id"}, "unarchive"))
)
var (
forward_ExperimentService_CreateExperiment_0 = runtime.ForwardResponseMessage
forward_ExperimentService_GetExperiment_0 = runtime.ForwardResponseMessage
forward_ExperimentService_ListExperiment_0 = runtime.ForwardResponseMessage
forward_ExperimentService_DeleteExperiment_0 = runtime.ForwardResponseMessage
forward_ExperimentService_ArchiveExperiment_0 = runtime.ForwardResponseMessage
forward_ExperimentService_UnarchiveExperiment_0 = runtime.ForwardResponseMessage
)

670
backend/api/go_client/filter.pb.go generated Executable file
View File

@ -0,0 +1,670 @@
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: backend/api/filter.proto
package go_client // import "github.com/kubeflow/pipelines/backend/api/go_client"
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import timestamp "github.com/golang/protobuf/ptypes/timestamp"
import _ "google.golang.org/genproto/googleapis/api/annotations"
import (
context "golang.org/x/net/context"
grpc "google.golang.org/grpc"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
type Predicate_Op int32
const (
Predicate_UNKNOWN Predicate_Op = 0
Predicate_EQUALS Predicate_Op = 1
Predicate_NOT_EQUALS Predicate_Op = 2
Predicate_GREATER_THAN Predicate_Op = 3
Predicate_GREATER_THAN_EQUALS Predicate_Op = 5
Predicate_LESS_THAN Predicate_Op = 6
Predicate_LESS_THAN_EQUALS Predicate_Op = 7
Predicate_IN Predicate_Op = 8
Predicate_IS_SUBSTRING Predicate_Op = 9
)
var Predicate_Op_name = map[int32]string{
0: "UNKNOWN",
1: "EQUALS",
2: "NOT_EQUALS",
3: "GREATER_THAN",
5: "GREATER_THAN_EQUALS",
6: "LESS_THAN",
7: "LESS_THAN_EQUALS",
8: "IN",
9: "IS_SUBSTRING",
}
var Predicate_Op_value = map[string]int32{
"UNKNOWN": 0,
"EQUALS": 1,
"NOT_EQUALS": 2,
"GREATER_THAN": 3,
"GREATER_THAN_EQUALS": 5,
"LESS_THAN": 6,
"LESS_THAN_EQUALS": 7,
"IN": 8,
"IS_SUBSTRING": 9,
}
func (x Predicate_Op) String() string {
return proto.EnumName(Predicate_Op_name, int32(x))
}
func (Predicate_Op) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_filter_117257288386a875, []int{0, 0}
}
type Predicate struct {
Op Predicate_Op `protobuf:"varint,1,opt,name=op,proto3,enum=api.Predicate_Op" json:"op,omitempty"`
Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"`
// Types that are valid to be assigned to Value:
// *Predicate_IntValue
// *Predicate_LongValue
// *Predicate_StringValue
// *Predicate_TimestampValue
// *Predicate_IntValues
// *Predicate_LongValues
// *Predicate_StringValues
Value isPredicate_Value `protobuf_oneof:"value"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *Predicate) Reset() { *m = Predicate{} }
func (m *Predicate) String() string { return proto.CompactTextString(m) }
func (*Predicate) ProtoMessage() {}
func (*Predicate) Descriptor() ([]byte, []int) {
return fileDescriptor_filter_117257288386a875, []int{0}
}
func (m *Predicate) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Predicate.Unmarshal(m, b)
}
func (m *Predicate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Predicate.Marshal(b, m, deterministic)
}
func (dst *Predicate) XXX_Merge(src proto.Message) {
xxx_messageInfo_Predicate.Merge(dst, src)
}
func (m *Predicate) XXX_Size() int {
return xxx_messageInfo_Predicate.Size(m)
}
func (m *Predicate) XXX_DiscardUnknown() {
xxx_messageInfo_Predicate.DiscardUnknown(m)
}
var xxx_messageInfo_Predicate proto.InternalMessageInfo
func (m *Predicate) GetOp() Predicate_Op {
if m != nil {
return m.Op
}
return Predicate_UNKNOWN
}
func (m *Predicate) GetKey() string {
if m != nil {
return m.Key
}
return ""
}
type isPredicate_Value interface {
isPredicate_Value()
}
type Predicate_IntValue struct {
IntValue int32 `protobuf:"varint,3,opt,name=int_value,json=intValue,proto3,oneof"`
}
type Predicate_LongValue struct {
LongValue int64 `protobuf:"varint,4,opt,name=long_value,json=longValue,proto3,oneof"`
}
type Predicate_StringValue struct {
StringValue string `protobuf:"bytes,5,opt,name=string_value,json=stringValue,proto3,oneof"`
}
type Predicate_TimestampValue struct {
TimestampValue *timestamp.Timestamp `protobuf:"bytes,6,opt,name=timestamp_value,json=timestampValue,proto3,oneof"`
}
type Predicate_IntValues struct {
IntValues *IntValues `protobuf:"bytes,7,opt,name=int_values,json=intValues,proto3,oneof"`
}
type Predicate_LongValues struct {
LongValues *LongValues `protobuf:"bytes,8,opt,name=long_values,json=longValues,proto3,oneof"`
}
type Predicate_StringValues struct {
StringValues *StringValues `protobuf:"bytes,9,opt,name=string_values,json=stringValues,proto3,oneof"`
}
func (*Predicate_IntValue) isPredicate_Value() {}
func (*Predicate_LongValue) isPredicate_Value() {}
func (*Predicate_StringValue) isPredicate_Value() {}
func (*Predicate_TimestampValue) isPredicate_Value() {}
func (*Predicate_IntValues) isPredicate_Value() {}
func (*Predicate_LongValues) isPredicate_Value() {}
func (*Predicate_StringValues) isPredicate_Value() {}
func (m *Predicate) GetValue() isPredicate_Value {
if m != nil {
return m.Value
}
return nil
}
func (m *Predicate) GetIntValue() int32 {
if x, ok := m.GetValue().(*Predicate_IntValue); ok {
return x.IntValue
}
return 0
}
func (m *Predicate) GetLongValue() int64 {
if x, ok := m.GetValue().(*Predicate_LongValue); ok {
return x.LongValue
}
return 0
}
func (m *Predicate) GetStringValue() string {
if x, ok := m.GetValue().(*Predicate_StringValue); ok {
return x.StringValue
}
return ""
}
func (m *Predicate) GetTimestampValue() *timestamp.Timestamp {
if x, ok := m.GetValue().(*Predicate_TimestampValue); ok {
return x.TimestampValue
}
return nil
}
func (m *Predicate) GetIntValues() *IntValues {
if x, ok := m.GetValue().(*Predicate_IntValues); ok {
return x.IntValues
}
return nil
}
func (m *Predicate) GetLongValues() *LongValues {
if x, ok := m.GetValue().(*Predicate_LongValues); ok {
return x.LongValues
}
return nil
}
func (m *Predicate) GetStringValues() *StringValues {
if x, ok := m.GetValue().(*Predicate_StringValues); ok {
return x.StringValues
}
return nil
}
// XXX_OneofFuncs is for the internal use of the proto package.
func (*Predicate) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {
return _Predicate_OneofMarshaler, _Predicate_OneofUnmarshaler, _Predicate_OneofSizer, []interface{}{
(*Predicate_IntValue)(nil),
(*Predicate_LongValue)(nil),
(*Predicate_StringValue)(nil),
(*Predicate_TimestampValue)(nil),
(*Predicate_IntValues)(nil),
(*Predicate_LongValues)(nil),
(*Predicate_StringValues)(nil),
}
}
func _Predicate_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
m := msg.(*Predicate)
// value
switch x := m.Value.(type) {
case *Predicate_IntValue:
b.EncodeVarint(3<<3 | proto.WireVarint)
b.EncodeVarint(uint64(x.IntValue))
case *Predicate_LongValue:
b.EncodeVarint(4<<3 | proto.WireVarint)
b.EncodeVarint(uint64(x.LongValue))
case *Predicate_StringValue:
b.EncodeVarint(5<<3 | proto.WireBytes)
b.EncodeStringBytes(x.StringValue)
case *Predicate_TimestampValue:
b.EncodeVarint(6<<3 | proto.WireBytes)
if err := b.EncodeMessage(x.TimestampValue); err != nil {
return err
}
case *Predicate_IntValues:
b.EncodeVarint(7<<3 | proto.WireBytes)
if err := b.EncodeMessage(x.IntValues); err != nil {
return err
}
case *Predicate_LongValues:
b.EncodeVarint(8<<3 | proto.WireBytes)
if err := b.EncodeMessage(x.LongValues); err != nil {
return err
}
case *Predicate_StringValues:
b.EncodeVarint(9<<3 | proto.WireBytes)
if err := b.EncodeMessage(x.StringValues); err != nil {
return err
}
case nil:
default:
return fmt.Errorf("Predicate.Value has unexpected type %T", x)
}
return nil
}
func _Predicate_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
m := msg.(*Predicate)
switch tag {
case 3: // value.int_value
if wire != proto.WireVarint {
return true, proto.ErrInternalBadWireType
}
x, err := b.DecodeVarint()
m.Value = &Predicate_IntValue{int32(x)}
return true, err
case 4: // value.long_value
if wire != proto.WireVarint {
return true, proto.ErrInternalBadWireType
}
x, err := b.DecodeVarint()
m.Value = &Predicate_LongValue{int64(x)}
return true, err
case 5: // value.string_value
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
x, err := b.DecodeStringBytes()
m.Value = &Predicate_StringValue{x}
return true, err
case 6: // value.timestamp_value
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
msg := new(timestamp.Timestamp)
err := b.DecodeMessage(msg)
m.Value = &Predicate_TimestampValue{msg}
return true, err
case 7: // value.int_values
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
msg := new(IntValues)
err := b.DecodeMessage(msg)
m.Value = &Predicate_IntValues{msg}
return true, err
case 8: // value.long_values
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
msg := new(LongValues)
err := b.DecodeMessage(msg)
m.Value = &Predicate_LongValues{msg}
return true, err
case 9: // value.string_values
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
msg := new(StringValues)
err := b.DecodeMessage(msg)
m.Value = &Predicate_StringValues{msg}
return true, err
default:
return false, nil
}
}
func _Predicate_OneofSizer(msg proto.Message) (n int) {
m := msg.(*Predicate)
// value
switch x := m.Value.(type) {
case *Predicate_IntValue:
n += 1 // tag and wire
n += proto.SizeVarint(uint64(x.IntValue))
case *Predicate_LongValue:
n += 1 // tag and wire
n += proto.SizeVarint(uint64(x.LongValue))
case *Predicate_StringValue:
n += 1 // tag and wire
n += proto.SizeVarint(uint64(len(x.StringValue)))
n += len(x.StringValue)
case *Predicate_TimestampValue:
s := proto.Size(x.TimestampValue)
n += 1 // tag and wire
n += proto.SizeVarint(uint64(s))
n += s
case *Predicate_IntValues:
s := proto.Size(x.IntValues)
n += 1 // tag and wire
n += proto.SizeVarint(uint64(s))
n += s
case *Predicate_LongValues:
s := proto.Size(x.LongValues)
n += 1 // tag and wire
n += proto.SizeVarint(uint64(s))
n += s
case *Predicate_StringValues:
s := proto.Size(x.StringValues)
n += 1 // tag and wire
n += proto.SizeVarint(uint64(s))
n += s
case nil:
default:
panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
}
return n
}
type IntValues struct {
Values []int32 `protobuf:"varint,1,rep,packed,name=values,proto3" json:"values,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *IntValues) Reset() { *m = IntValues{} }
func (m *IntValues) String() string { return proto.CompactTextString(m) }
func (*IntValues) ProtoMessage() {}
func (*IntValues) Descriptor() ([]byte, []int) {
return fileDescriptor_filter_117257288386a875, []int{1}
}
func (m *IntValues) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_IntValues.Unmarshal(m, b)
}
func (m *IntValues) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_IntValues.Marshal(b, m, deterministic)
}
func (dst *IntValues) XXX_Merge(src proto.Message) {
xxx_messageInfo_IntValues.Merge(dst, src)
}
func (m *IntValues) XXX_Size() int {
return xxx_messageInfo_IntValues.Size(m)
}
func (m *IntValues) XXX_DiscardUnknown() {
xxx_messageInfo_IntValues.DiscardUnknown(m)
}
var xxx_messageInfo_IntValues proto.InternalMessageInfo
func (m *IntValues) GetValues() []int32 {
if m != nil {
return m.Values
}
return nil
}
type StringValues struct {
Values []string `protobuf:"bytes,2,rep,name=values,proto3" json:"values,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *StringValues) Reset() { *m = StringValues{} }
func (m *StringValues) String() string { return proto.CompactTextString(m) }
func (*StringValues) ProtoMessage() {}
func (*StringValues) Descriptor() ([]byte, []int) {
return fileDescriptor_filter_117257288386a875, []int{2}
}
func (m *StringValues) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_StringValues.Unmarshal(m, b)
}
func (m *StringValues) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_StringValues.Marshal(b, m, deterministic)
}
func (dst *StringValues) XXX_Merge(src proto.Message) {
xxx_messageInfo_StringValues.Merge(dst, src)
}
func (m *StringValues) XXX_Size() int {
return xxx_messageInfo_StringValues.Size(m)
}
func (m *StringValues) XXX_DiscardUnknown() {
xxx_messageInfo_StringValues.DiscardUnknown(m)
}
var xxx_messageInfo_StringValues proto.InternalMessageInfo
func (m *StringValues) GetValues() []string {
if m != nil {
return m.Values
}
return nil
}
type LongValues struct {
Values []int64 `protobuf:"varint,3,rep,packed,name=values,proto3" json:"values,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *LongValues) Reset() { *m = LongValues{} }
func (m *LongValues) String() string { return proto.CompactTextString(m) }
func (*LongValues) ProtoMessage() {}
func (*LongValues) Descriptor() ([]byte, []int) {
return fileDescriptor_filter_117257288386a875, []int{3}
}
func (m *LongValues) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_LongValues.Unmarshal(m, b)
}
func (m *LongValues) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_LongValues.Marshal(b, m, deterministic)
}
func (dst *LongValues) XXX_Merge(src proto.Message) {
xxx_messageInfo_LongValues.Merge(dst, src)
}
func (m *LongValues) XXX_Size() int {
return xxx_messageInfo_LongValues.Size(m)
}
func (m *LongValues) XXX_DiscardUnknown() {
xxx_messageInfo_LongValues.DiscardUnknown(m)
}
var xxx_messageInfo_LongValues proto.InternalMessageInfo
func (m *LongValues) GetValues() []int64 {
if m != nil {
return m.Values
}
return nil
}
type Filter struct {
Predicates []*Predicate `protobuf:"bytes,1,rep,name=predicates,proto3" json:"predicates,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *Filter) Reset() { *m = Filter{} }
func (m *Filter) String() string { return proto.CompactTextString(m) }
func (*Filter) ProtoMessage() {}
func (*Filter) Descriptor() ([]byte, []int) {
return fileDescriptor_filter_117257288386a875, []int{4}
}
func (m *Filter) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Filter.Unmarshal(m, b)
}
func (m *Filter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Filter.Marshal(b, m, deterministic)
}
func (dst *Filter) XXX_Merge(src proto.Message) {
xxx_messageInfo_Filter.Merge(dst, src)
}
func (m *Filter) XXX_Size() int {
return xxx_messageInfo_Filter.Size(m)
}
func (m *Filter) XXX_DiscardUnknown() {
xxx_messageInfo_Filter.DiscardUnknown(m)
}
var xxx_messageInfo_Filter proto.InternalMessageInfo
func (m *Filter) GetPredicates() []*Predicate {
if m != nil {
return m.Predicates
}
return nil
}
func init() {
proto.RegisterType((*Predicate)(nil), "api.Predicate")
proto.RegisterType((*IntValues)(nil), "api.IntValues")
proto.RegisterType((*StringValues)(nil), "api.StringValues")
proto.RegisterType((*LongValues)(nil), "api.LongValues")
proto.RegisterType((*Filter)(nil), "api.Filter")
proto.RegisterEnum("api.Predicate_Op", Predicate_Op_name, Predicate_Op_value)
}
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConn
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion4
// DummyFilterServiceClient is the client API for DummyFilterService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type DummyFilterServiceClient interface {
GetFilter(ctx context.Context, in *Filter, opts ...grpc.CallOption) (*Filter, error)
}
type dummyFilterServiceClient struct {
cc *grpc.ClientConn
}
func NewDummyFilterServiceClient(cc *grpc.ClientConn) DummyFilterServiceClient {
return &dummyFilterServiceClient{cc}
}
func (c *dummyFilterServiceClient) GetFilter(ctx context.Context, in *Filter, opts ...grpc.CallOption) (*Filter, error) {
out := new(Filter)
err := c.cc.Invoke(ctx, "/api.DummyFilterService/GetFilter", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// DummyFilterServiceServer is the server API for DummyFilterService service.
type DummyFilterServiceServer interface {
GetFilter(context.Context, *Filter) (*Filter, error)
}
func RegisterDummyFilterServiceServer(s *grpc.Server, srv DummyFilterServiceServer) {
s.RegisterService(&_DummyFilterService_serviceDesc, srv)
}
func _DummyFilterService_GetFilter_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(Filter)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(DummyFilterServiceServer).GetFilter(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/api.DummyFilterService/GetFilter",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(DummyFilterServiceServer).GetFilter(ctx, req.(*Filter))
}
return interceptor(ctx, in, info, handler)
}
var _DummyFilterService_serviceDesc = grpc.ServiceDesc{
ServiceName: "api.DummyFilterService",
HandlerType: (*DummyFilterServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "GetFilter",
Handler: _DummyFilterService_GetFilter_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "backend/api/filter.proto",
}
func init() { proto.RegisterFile("backend/api/filter.proto", fileDescriptor_filter_117257288386a875) }
var fileDescriptor_filter_117257288386a875 = []byte{
// 553 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x4c, 0x93, 0xdf, 0x8f, 0xd2, 0x40,
0x10, 0xc7, 0xfb, 0xe3, 0x28, 0xd7, 0x81, 0xe3, 0xea, 0x6a, 0xb4, 0x21, 0x9a, 0xab, 0x9c, 0xd1,
0x3e, 0xb5, 0x09, 0x17, 0x93, 0x7b, 0xf1, 0x01, 0x22, 0x02, 0x91, 0x14, 0x6d, 0x41, 0x13, 0x5f,
0x48, 0xe1, 0x16, 0xdc, 0x50, 0xba, 0x1b, 0xba, 0x9c, 0xb9, 0xbf, 0xc4, 0xff, 0xc2, 0xbf, 0xd1,
0xb4, 0xdb, 0x2e, 0x7d, 0xeb, 0xcc, 0x7c, 0xbe, 0xd3, 0xf9, 0x4e, 0xa7, 0x60, 0xaf, 0xe3, 0xcd,
0x1e, 0xa7, 0x0f, 0x7e, 0xcc, 0x88, 0xbf, 0x25, 0x09, 0xc7, 0x47, 0x8f, 0x1d, 0x29, 0xa7, 0x48,
0x8f, 0x19, 0xe9, 0xbe, 0xde, 0x51, 0xba, 0x4b, 0x70, 0x51, 0x8d, 0xd3, 0x94, 0xf2, 0x98, 0x13,
0x9a, 0x66, 0x02, 0xe9, 0xde, 0x94, 0xd5, 0x22, 0x5a, 0x9f, 0xb6, 0x3e, 0x27, 0x07, 0x9c, 0xf1,
0xf8, 0xc0, 0x04, 0xd0, 0xfb, 0x77, 0x01, 0xe6, 0xb7, 0x23, 0x7e, 0x20, 0x9b, 0x98, 0x63, 0xf4,
0x16, 0x34, 0xca, 0x6c, 0xd5, 0x51, 0xdd, 0x4e, 0xff, 0x99, 0x17, 0x33, 0xe2, 0xc9, 0x9a, 0x37,
0x67, 0xa1, 0x46, 0x19, 0xb2, 0x40, 0xdf, 0xe3, 0x27, 0x5b, 0x73, 0x54, 0xd7, 0x0c, 0xf3, 0x47,
0xf4, 0x06, 0x4c, 0x92, 0xf2, 0xd5, 0x63, 0x9c, 0x9c, 0xb0, 0xad, 0x3b, 0xaa, 0xdb, 0x98, 0x28,
0xe1, 0x25, 0x49, 0xf9, 0x8f, 0x3c, 0x83, 0x6e, 0x00, 0x12, 0x9a, 0xee, 0xca, 0xfa, 0x85, 0xa3,
0xba, 0xfa, 0x44, 0x09, 0xcd, 0x3c, 0x27, 0x80, 0x5b, 0x68, 0x67, 0xfc, 0x48, 0x24, 0xd2, 0xc8,
0x5b, 0x4f, 0x94, 0xb0, 0x25, 0xb2, 0x02, 0x1a, 0xc1, 0xb5, 0x1c, 0xbd, 0xe4, 0x0c, 0x47, 0x75,
0x5b, 0xfd, 0xae, 0x27, 0x2c, 0x7a, 0x95, 0x45, 0x6f, 0x51, 0x71, 0x13, 0x25, 0xec, 0x48, 0x91,
0x68, 0xe3, 0x03, 0xc8, 0x59, 0x33, 0xbb, 0x59, 0x74, 0xe8, 0x14, 0x46, 0xa7, 0xe5, 0xbc, 0x59,
0x3e, 0x5c, 0x35, 0x7c, 0x86, 0xfa, 0xd0, 0x3a, 0x4f, 0x9f, 0xd9, 0x97, 0x85, 0xe2, 0xba, 0x50,
0xcc, 0x2a, 0x07, 0xb9, 0x04, 0xa4, 0x9f, 0x0c, 0xdd, 0xc3, 0x55, 0xdd, 0x50, 0x66, 0x9b, 0x85,
0x4a, 0x2c, 0x34, 0x3a, 0x9b, 0xca, 0x75, 0xed, 0x9a, 0xc9, 0xac, 0xf7, 0x57, 0x05, 0x6d, 0xce,
0x50, 0x0b, 0x9a, 0xcb, 0xe0, 0x6b, 0x30, 0xff, 0x19, 0x58, 0x0a, 0x02, 0x30, 0x46, 0xdf, 0x97,
0x83, 0x59, 0x64, 0xa9, 0xa8, 0x03, 0x10, 0xcc, 0x17, 0xab, 0x32, 0xd6, 0x90, 0x05, 0xed, 0x71,
0x38, 0x1a, 0x2c, 0x46, 0xe1, 0x6a, 0x31, 0x19, 0x04, 0x96, 0x8e, 0x5e, 0xc1, 0xf3, 0x7a, 0xa6,
0x42, 0x1b, 0xe8, 0x0a, 0xcc, 0xd9, 0x28, 0x8a, 0x04, 0x67, 0xa0, 0x17, 0x60, 0xc9, 0xb0, 0x82,
0x9a, 0xc8, 0x00, 0x6d, 0x1a, 0x58, 0x97, 0x79, 0xdf, 0x69, 0xb4, 0x8a, 0x96, 0xc3, 0x68, 0x11,
0x4e, 0x83, 0xb1, 0x65, 0x0e, 0x9b, 0xd0, 0x28, 0xcc, 0xf4, 0x6e, 0xc1, 0x94, 0xab, 0x42, 0x2f,
0xc1, 0x28, 0x2d, 0xaa, 0x8e, 0xee, 0x36, 0xc2, 0x32, 0xea, 0xbd, 0x87, 0x76, 0xdd, 0x67, 0x8d,
0xd3, 0x1c, 0xdd, 0x35, 0x25, 0xf7, 0x0e, 0xe0, 0xbc, 0xc5, 0x1a, 0xa5, 0x3b, 0xba, 0xab, 0x4b,
0xea, 0x1e, 0x8c, 0x2f, 0xc5, 0xdd, 0x23, 0x0f, 0x80, 0x55, 0x07, 0x29, 0xde, 0x59, 0x7d, 0x3e,
0x79, 0xa7, 0x61, 0x8d, 0xe8, 0x7f, 0x02, 0xf4, 0xf9, 0x74, 0x38, 0x3c, 0x09, 0x79, 0x84, 0x8f,
0x8f, 0x64, 0x83, 0xd1, 0x07, 0x30, 0xc7, 0x98, 0x97, 0x2d, 0x5b, 0x85, 0x5c, 0x04, 0xdd, 0x7a,
0xd0, 0x53, 0x86, 0x1f, 0x7f, 0xdd, 0xed, 0x08, 0xff, 0x7d, 0x5a, 0x7b, 0x1b, 0x7a, 0xf0, 0xf7,
0xa7, 0x35, 0xde, 0x26, 0xf4, 0x8f, 0xcf, 0x08, 0xc3, 0x09, 0x49, 0x71, 0xe6, 0xd7, 0x7f, 0xcd,
0x1d, 0x5d, 0x6d, 0x12, 0x82, 0x53, 0xbe, 0x36, 0x8a, 0x53, 0xbc, 0xfb, 0x1f, 0x00, 0x00, 0xff,
0xff, 0xf8, 0x38, 0x00, 0xb0, 0xba, 0x03, 0x00, 0x00,
}

17
backend/api/go_client/filter.pb.gw.go generated Executable file
View File

@ -0,0 +1,17 @@
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// +build ignore
package ignore

1116
backend/api/go_client/job.pb.go generated Executable file

File diff suppressed because it is too large Load Diff

374
backend/api/go_client/job.pb.gw.go generated Executable file
View File

@ -0,0 +1,374 @@
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
// source: backend/api/job.proto
/*
Package go_client is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
*/
package go_client
import (
"context"
"io"
"net/http"
"github.com/golang/protobuf/proto"
"github.com/grpc-ecosystem/grpc-gateway/runtime"
"github.com/grpc-ecosystem/grpc-gateway/utilities"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/grpclog"
"google.golang.org/grpc/status"
)
var _ codes.Code
var _ io.Reader
var _ status.Status
var _ = runtime.String
var _ = utilities.NewDoubleArray
func request_JobService_CreateJob_0(ctx context.Context, marshaler runtime.Marshaler, client JobServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq CreateJobRequest
var metadata runtime.ServerMetadata
newReader, berr := utilities.IOReaderFactory(req.Body)
if berr != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
}
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Job); err != nil && err != io.EOF {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.CreateJob(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func request_JobService_GetJob_0(ctx context.Context, marshaler runtime.Marshaler, client JobServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq GetJobRequest
var metadata runtime.ServerMetadata
var (
val string
ok bool
err error
_ = err
)
val, ok = pathParams["id"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id")
}
protoReq.Id, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err)
}
msg, err := client.GetJob(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
var (
filter_JobService_ListJobs_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
)
func request_JobService_ListJobs_0(ctx context.Context, marshaler runtime.Marshaler, client JobServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq ListJobsRequest
var metadata runtime.ServerMetadata
if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_JobService_ListJobs_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.ListJobs(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func request_JobService_EnableJob_0(ctx context.Context, marshaler runtime.Marshaler, client JobServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq EnableJobRequest
var metadata runtime.ServerMetadata
var (
val string
ok bool
err error
_ = err
)
val, ok = pathParams["id"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id")
}
protoReq.Id, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err)
}
msg, err := client.EnableJob(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func request_JobService_DisableJob_0(ctx context.Context, marshaler runtime.Marshaler, client JobServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq DisableJobRequest
var metadata runtime.ServerMetadata
var (
val string
ok bool
err error
_ = err
)
val, ok = pathParams["id"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id")
}
protoReq.Id, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err)
}
msg, err := client.DisableJob(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func request_JobService_DeleteJob_0(ctx context.Context, marshaler runtime.Marshaler, client JobServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq DeleteJobRequest
var metadata runtime.ServerMetadata
var (
val string
ok bool
err error
_ = err
)
val, ok = pathParams["id"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id")
}
protoReq.Id, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err)
}
msg, err := client.DeleteJob(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
// RegisterJobServiceHandlerFromEndpoint is same as RegisterJobServiceHandler but
// automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterJobServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) {
conn, err := grpc.Dial(endpoint, opts...)
if err != nil {
return err
}
defer func() {
if err != nil {
if cerr := conn.Close(); cerr != nil {
grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
}
return
}
go func() {
<-ctx.Done()
if cerr := conn.Close(); cerr != nil {
grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
}
}()
}()
return RegisterJobServiceHandler(ctx, mux, conn)
}
// RegisterJobServiceHandler registers the http handlers for service JobService to "mux".
// The handlers forward requests to the grpc endpoint over "conn".
func RegisterJobServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {
return RegisterJobServiceHandlerClient(ctx, mux, NewJobServiceClient(conn))
}
// RegisterJobServiceHandlerClient registers the http handlers for service JobService
// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "JobServiceClient".
// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "JobServiceClient"
// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in
// "JobServiceClient" to call the correct interceptors.
func RegisterJobServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client JobServiceClient) error {
mux.Handle("POST", pattern_JobService_CreateJob_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateContext(ctx, mux, req)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_JobService_CreateJob_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_JobService_CreateJob_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_JobService_GetJob_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateContext(ctx, mux, req)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_JobService_GetJob_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_JobService_GetJob_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_JobService_ListJobs_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateContext(ctx, mux, req)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_JobService_ListJobs_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_JobService_ListJobs_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("POST", pattern_JobService_EnableJob_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateContext(ctx, mux, req)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_JobService_EnableJob_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_JobService_EnableJob_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("POST", pattern_JobService_DisableJob_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateContext(ctx, mux, req)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_JobService_DisableJob_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_JobService_DisableJob_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("DELETE", pattern_JobService_DeleteJob_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateContext(ctx, mux, req)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_JobService_DeleteJob_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_JobService_DeleteJob_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
return nil
}
var (
pattern_JobService_CreateJob_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"apis", "v1beta1", "jobs"}, ""))
pattern_JobService_GetJob_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"apis", "v1beta1", "jobs", "id"}, ""))
pattern_JobService_ListJobs_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"apis", "v1beta1", "jobs"}, ""))
pattern_JobService_EnableJob_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"apis", "v1beta1", "jobs", "id", "enable"}, ""))
pattern_JobService_DisableJob_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"apis", "v1beta1", "jobs", "id", "disable"}, ""))
pattern_JobService_DeleteJob_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"apis", "v1beta1", "jobs", "id"}, ""))
)
var (
forward_JobService_CreateJob_0 = runtime.ForwardResponseMessage
forward_JobService_GetJob_0 = runtime.ForwardResponseMessage
forward_JobService_ListJobs_0 = runtime.ForwardResponseMessage
forward_JobService_EnableJob_0 = runtime.ForwardResponseMessage
forward_JobService_DisableJob_0 = runtime.ForwardResponseMessage
forward_JobService_DeleteJob_0 = runtime.ForwardResponseMessage
)

101
backend/api/go_client/parameter.pb.go generated Executable file
View File

@ -0,0 +1,101 @@
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: backend/api/parameter.proto
package go_client // import "github.com/kubeflow/pipelines/backend/api/go_client"
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
type Parameter struct {
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *Parameter) Reset() { *m = Parameter{} }
func (m *Parameter) String() string { return proto.CompactTextString(m) }
func (*Parameter) ProtoMessage() {}
func (*Parameter) Descriptor() ([]byte, []int) {
return fileDescriptor_parameter_096b3b61dd8773be, []int{0}
}
func (m *Parameter) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Parameter.Unmarshal(m, b)
}
func (m *Parameter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Parameter.Marshal(b, m, deterministic)
}
func (dst *Parameter) XXX_Merge(src proto.Message) {
xxx_messageInfo_Parameter.Merge(dst, src)
}
func (m *Parameter) XXX_Size() int {
return xxx_messageInfo_Parameter.Size(m)
}
func (m *Parameter) XXX_DiscardUnknown() {
xxx_messageInfo_Parameter.DiscardUnknown(m)
}
var xxx_messageInfo_Parameter proto.InternalMessageInfo
func (m *Parameter) GetName() string {
if m != nil {
return m.Name
}
return ""
}
func (m *Parameter) GetValue() string {
if m != nil {
return m.Value
}
return ""
}
func init() {
proto.RegisterType((*Parameter)(nil), "api.Parameter")
}
func init() {
proto.RegisterFile("backend/api/parameter.proto", fileDescriptor_parameter_096b3b61dd8773be)
}
var fileDescriptor_parameter_096b3b61dd8773be = []byte{
// 147 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4e, 0x4a, 0x4c, 0xce,
0x4e, 0xcd, 0x4b, 0xd1, 0x4f, 0x2c, 0xc8, 0xd4, 0x2f, 0x48, 0x2c, 0x4a, 0xcc, 0x4d, 0x2d, 0x49,
0x2d, 0xd2, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x4e, 0x2c, 0xc8, 0x54, 0x32, 0xe5, 0xe2,
0x0c, 0x80, 0x89, 0x0b, 0x09, 0x71, 0xb1, 0xe4, 0x25, 0xe6, 0xa6, 0x4a, 0x30, 0x2a, 0x30, 0x6a,
0x70, 0x06, 0x81, 0xd9, 0x42, 0x22, 0x5c, 0xac, 0x65, 0x89, 0x39, 0xa5, 0xa9, 0x12, 0x4c, 0x60,
0x41, 0x08, 0xc7, 0xc9, 0x34, 0xca, 0x38, 0x3d, 0xb3, 0x24, 0xa3, 0x34, 0x49, 0x2f, 0x39, 0x3f,
0x57, 0x3f, 0xbb, 0x34, 0x29, 0x35, 0x2d, 0x27, 0xbf, 0x5c, 0xbf, 0x20, 0xb3, 0x20, 0x35, 0x27,
0x33, 0x2f, 0xb5, 0x58, 0x1f, 0xd9, 0xe2, 0xf4, 0xfc, 0xf8, 0xe4, 0x9c, 0xcc, 0xd4, 0xbc, 0x92,
0x24, 0x36, 0xb0, 0xcd, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0xc4, 0x47, 0x98, 0xfd, 0x98,
0x00, 0x00, 0x00,
}

17
backend/api/go_client/parameter.pb.gw.go generated Executable file
View File

@ -0,0 +1,17 @@
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// +build ignore
package ignore

1312
backend/api/go_client/pipeline.pb.go generated Executable file

File diff suppressed because it is too large Load Diff

558
backend/api/go_client/pipeline.pb.gw.go generated Executable file
View File

@ -0,0 +1,558 @@
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
// source: backend/api/pipeline.proto
/*
Package go_client is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
*/
package go_client
import (
"context"
"io"
"net/http"
"github.com/golang/protobuf/proto"
"github.com/grpc-ecosystem/grpc-gateway/runtime"
"github.com/grpc-ecosystem/grpc-gateway/utilities"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/grpclog"
"google.golang.org/grpc/status"
)
var _ codes.Code
var _ io.Reader
var _ status.Status
var _ = runtime.String
var _ = utilities.NewDoubleArray
func request_PipelineService_CreatePipeline_0(ctx context.Context, marshaler runtime.Marshaler, client PipelineServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq CreatePipelineRequest
var metadata runtime.ServerMetadata
newReader, berr := utilities.IOReaderFactory(req.Body)
if berr != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
}
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Pipeline); err != nil && err != io.EOF {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.CreatePipeline(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func request_PipelineService_GetPipeline_0(ctx context.Context, marshaler runtime.Marshaler, client PipelineServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq GetPipelineRequest
var metadata runtime.ServerMetadata
var (
val string
ok bool
err error
_ = err
)
val, ok = pathParams["id"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id")
}
protoReq.Id, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err)
}
msg, err := client.GetPipeline(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
var (
filter_PipelineService_ListPipelines_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
)
func request_PipelineService_ListPipelines_0(ctx context.Context, marshaler runtime.Marshaler, client PipelineServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq ListPipelinesRequest
var metadata runtime.ServerMetadata
if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_PipelineService_ListPipelines_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.ListPipelines(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func request_PipelineService_DeletePipeline_0(ctx context.Context, marshaler runtime.Marshaler, client PipelineServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq DeletePipelineRequest
var metadata runtime.ServerMetadata
var (
val string
ok bool
err error
_ = err
)
val, ok = pathParams["id"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id")
}
protoReq.Id, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err)
}
msg, err := client.DeletePipeline(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func request_PipelineService_GetTemplate_0(ctx context.Context, marshaler runtime.Marshaler, client PipelineServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq GetTemplateRequest
var metadata runtime.ServerMetadata
var (
val string
ok bool
err error
_ = err
)
val, ok = pathParams["id"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id")
}
protoReq.Id, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err)
}
msg, err := client.GetTemplate(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func request_PipelineService_CreatePipelineVersion_0(ctx context.Context, marshaler runtime.Marshaler, client PipelineServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq CreatePipelineVersionRequest
var metadata runtime.ServerMetadata
newReader, berr := utilities.IOReaderFactory(req.Body)
if berr != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
}
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Version); err != nil && err != io.EOF {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.CreatePipelineVersion(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func request_PipelineService_GetPipelineVersion_0(ctx context.Context, marshaler runtime.Marshaler, client PipelineServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq GetPipelineVersionRequest
var metadata runtime.ServerMetadata
var (
val string
ok bool
err error
_ = err
)
val, ok = pathParams["version_id"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "version_id")
}
protoReq.VersionId, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "version_id", err)
}
msg, err := client.GetPipelineVersion(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
var (
filter_PipelineService_ListPipelineVersions_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
)
func request_PipelineService_ListPipelineVersions_0(ctx context.Context, marshaler runtime.Marshaler, client PipelineServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq ListPipelineVersionsRequest
var metadata runtime.ServerMetadata
if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_PipelineService_ListPipelineVersions_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.ListPipelineVersions(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func request_PipelineService_DeletePipelineVersion_0(ctx context.Context, marshaler runtime.Marshaler, client PipelineServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq DeletePipelineVersionRequest
var metadata runtime.ServerMetadata
var (
val string
ok bool
err error
_ = err
)
val, ok = pathParams["version_id"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "version_id")
}
protoReq.VersionId, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "version_id", err)
}
msg, err := client.DeletePipelineVersion(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func request_PipelineService_GetPipelineVersionTemplate_0(ctx context.Context, marshaler runtime.Marshaler, client PipelineServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq GetPipelineVersionTemplateRequest
var metadata runtime.ServerMetadata
var (
val string
ok bool
err error
_ = err
)
val, ok = pathParams["version_id"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "version_id")
}
protoReq.VersionId, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "version_id", err)
}
msg, err := client.GetPipelineVersionTemplate(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
// RegisterPipelineServiceHandlerFromEndpoint is same as RegisterPipelineServiceHandler but
// automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterPipelineServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) {
conn, err := grpc.Dial(endpoint, opts...)
if err != nil {
return err
}
defer func() {
if err != nil {
if cerr := conn.Close(); cerr != nil {
grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
}
return
}
go func() {
<-ctx.Done()
if cerr := conn.Close(); cerr != nil {
grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
}
}()
}()
return RegisterPipelineServiceHandler(ctx, mux, conn)
}
// RegisterPipelineServiceHandler registers the http handlers for service PipelineService to "mux".
// The handlers forward requests to the grpc endpoint over "conn".
func RegisterPipelineServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {
return RegisterPipelineServiceHandlerClient(ctx, mux, NewPipelineServiceClient(conn))
}
// RegisterPipelineServiceHandlerClient registers the http handlers for service PipelineService
// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "PipelineServiceClient".
// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "PipelineServiceClient"
// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in
// "PipelineServiceClient" to call the correct interceptors.
func RegisterPipelineServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client PipelineServiceClient) error {
mux.Handle("POST", pattern_PipelineService_CreatePipeline_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateContext(ctx, mux, req)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_PipelineService_CreatePipeline_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_PipelineService_CreatePipeline_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_PipelineService_GetPipeline_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateContext(ctx, mux, req)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_PipelineService_GetPipeline_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_PipelineService_GetPipeline_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_PipelineService_ListPipelines_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateContext(ctx, mux, req)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_PipelineService_ListPipelines_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_PipelineService_ListPipelines_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("DELETE", pattern_PipelineService_DeletePipeline_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateContext(ctx, mux, req)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_PipelineService_DeletePipeline_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_PipelineService_DeletePipeline_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_PipelineService_GetTemplate_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateContext(ctx, mux, req)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_PipelineService_GetTemplate_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_PipelineService_GetTemplate_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("POST", pattern_PipelineService_CreatePipelineVersion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateContext(ctx, mux, req)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_PipelineService_CreatePipelineVersion_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_PipelineService_CreatePipelineVersion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_PipelineService_GetPipelineVersion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateContext(ctx, mux, req)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_PipelineService_GetPipelineVersion_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_PipelineService_GetPipelineVersion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_PipelineService_ListPipelineVersions_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateContext(ctx, mux, req)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_PipelineService_ListPipelineVersions_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_PipelineService_ListPipelineVersions_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("DELETE", pattern_PipelineService_DeletePipelineVersion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateContext(ctx, mux, req)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_PipelineService_DeletePipelineVersion_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_PipelineService_DeletePipelineVersion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_PipelineService_GetPipelineVersionTemplate_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateContext(ctx, mux, req)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_PipelineService_GetPipelineVersionTemplate_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_PipelineService_GetPipelineVersionTemplate_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
return nil
}
var (
pattern_PipelineService_CreatePipeline_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"apis", "v1beta1", "pipelines"}, ""))
pattern_PipelineService_GetPipeline_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"apis", "v1beta1", "pipelines", "id"}, ""))
pattern_PipelineService_ListPipelines_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"apis", "v1beta1", "pipelines"}, ""))
pattern_PipelineService_DeletePipeline_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"apis", "v1beta1", "pipelines", "id"}, ""))
pattern_PipelineService_GetTemplate_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"apis", "v1beta1", "pipelines", "id", "templates"}, ""))
pattern_PipelineService_CreatePipelineVersion_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"apis", "v1beta1", "pipeline_versions"}, ""))
pattern_PipelineService_GetPipelineVersion_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"apis", "v1beta1", "pipeline_versions", "version_id"}, ""))
pattern_PipelineService_ListPipelineVersions_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"apis", "v1beta1", "pipeline_versions"}, ""))
pattern_PipelineService_DeletePipelineVersion_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"apis", "v1beta1", "pipeline_versions", "version_id"}, ""))
pattern_PipelineService_GetPipelineVersionTemplate_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"apis", "v1beta1", "pipeline_versions", "version_id", "templates"}, ""))
)
var (
forward_PipelineService_CreatePipeline_0 = runtime.ForwardResponseMessage
forward_PipelineService_GetPipeline_0 = runtime.ForwardResponseMessage
forward_PipelineService_ListPipelines_0 = runtime.ForwardResponseMessage
forward_PipelineService_DeletePipeline_0 = runtime.ForwardResponseMessage
forward_PipelineService_GetTemplate_0 = runtime.ForwardResponseMessage
forward_PipelineService_CreatePipelineVersion_0 = runtime.ForwardResponseMessage
forward_PipelineService_GetPipelineVersion_0 = runtime.ForwardResponseMessage
forward_PipelineService_ListPipelineVersions_0 = runtime.ForwardResponseMessage
forward_PipelineService_DeletePipelineVersion_0 = runtime.ForwardResponseMessage
forward_PipelineService_GetPipelineVersionTemplate_0 = runtime.ForwardResponseMessage
)

130
backend/api/go_client/pipeline_spec.pb.go generated Executable file
View File

@ -0,0 +1,130 @@
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: backend/api/pipeline_spec.proto
package go_client // import "github.com/kubeflow/pipelines/backend/api/go_client"
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
type PipelineSpec struct {
PipelineId string `protobuf:"bytes,1,opt,name=pipeline_id,json=pipelineId,proto3" json:"pipeline_id,omitempty"`
PipelineName string `protobuf:"bytes,5,opt,name=pipeline_name,json=pipelineName,proto3" json:"pipeline_name,omitempty"`
WorkflowManifest string `protobuf:"bytes,2,opt,name=workflow_manifest,json=workflowManifest,proto3" json:"workflow_manifest,omitempty"`
PipelineManifest string `protobuf:"bytes,3,opt,name=pipeline_manifest,json=pipelineManifest,proto3" json:"pipeline_manifest,omitempty"`
Parameters []*Parameter `protobuf:"bytes,4,rep,name=parameters,proto3" json:"parameters,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *PipelineSpec) Reset() { *m = PipelineSpec{} }
func (m *PipelineSpec) String() string { return proto.CompactTextString(m) }
func (*PipelineSpec) ProtoMessage() {}
func (*PipelineSpec) Descriptor() ([]byte, []int) {
return fileDescriptor_pipeline_spec_ab99afe9ca6994cc, []int{0}
}
func (m *PipelineSpec) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_PipelineSpec.Unmarshal(m, b)
}
func (m *PipelineSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_PipelineSpec.Marshal(b, m, deterministic)
}
func (dst *PipelineSpec) XXX_Merge(src proto.Message) {
xxx_messageInfo_PipelineSpec.Merge(dst, src)
}
func (m *PipelineSpec) XXX_Size() int {
return xxx_messageInfo_PipelineSpec.Size(m)
}
func (m *PipelineSpec) XXX_DiscardUnknown() {
xxx_messageInfo_PipelineSpec.DiscardUnknown(m)
}
var xxx_messageInfo_PipelineSpec proto.InternalMessageInfo
func (m *PipelineSpec) GetPipelineId() string {
if m != nil {
return m.PipelineId
}
return ""
}
func (m *PipelineSpec) GetPipelineName() string {
if m != nil {
return m.PipelineName
}
return ""
}
func (m *PipelineSpec) GetWorkflowManifest() string {
if m != nil {
return m.WorkflowManifest
}
return ""
}
func (m *PipelineSpec) GetPipelineManifest() string {
if m != nil {
return m.PipelineManifest
}
return ""
}
func (m *PipelineSpec) GetParameters() []*Parameter {
if m != nil {
return m.Parameters
}
return nil
}
func init() {
proto.RegisterType((*PipelineSpec)(nil), "api.PipelineSpec")
}
func init() {
proto.RegisterFile("backend/api/pipeline_spec.proto", fileDescriptor_pipeline_spec_ab99afe9ca6994cc)
}
var fileDescriptor_pipeline_spec_ab99afe9ca6994cc = []byte{
// 236 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0xd0, 0xc1, 0x4a, 0xc3, 0x40,
0x10, 0x06, 0x60, 0x62, 0x54, 0x70, 0x5a, 0x45, 0x73, 0x0a, 0x7a, 0x68, 0xd1, 0x4b, 0x41, 0xd8,
0x80, 0xc5, 0x17, 0xf0, 0xe6, 0x41, 0x29, 0xf5, 0xe6, 0x25, 0x4c, 0x36, 0xd3, 0x3a, 0x24, 0xbb,
0x3b, 0x24, 0x5b, 0xfa, 0xb6, 0x3e, 0x8b, 0x34, 0xed, 0x2e, 0xf1, 0xfa, 0xcf, 0xb7, 0xb3, 0xcc,
0x0f, 0xb3, 0x0a, 0x75, 0x43, 0xb6, 0x2e, 0x50, 0xb8, 0x10, 0x16, 0x6a, 0xd9, 0x52, 0xd9, 0x0b,
0x69, 0x25, 0x9d, 0xf3, 0x2e, 0x4b, 0x51, 0xf8, 0xfe, 0xe1, 0x9f, 0xc2, 0x0e, 0x0d, 0x79, 0xea,
0x8e, 0xe2, 0xf1, 0x37, 0x81, 0xe9, 0xea, 0xf4, 0xf2, 0x4b, 0x48, 0x67, 0x33, 0x98, 0xc4, 0x4d,
0x5c, 0xe7, 0xc9, 0x3c, 0x59, 0x5c, 0xad, 0x21, 0x44, 0xef, 0x75, 0xf6, 0x04, 0xd7, 0x11, 0x58,
0x34, 0x94, 0x5f, 0x0c, 0x64, 0x1a, 0xc2, 0x4f, 0x34, 0x94, 0x3d, 0xc3, 0xdd, 0xde, 0x75, 0xcd,
0xa6, 0x75, 0xfb, 0xd2, 0xa0, 0xe5, 0x0d, 0xf5, 0x3e, 0x3f, 0x1b, 0xe0, 0x6d, 0x18, 0x7c, 0x9c,
0xf2, 0x03, 0x8e, 0x1b, 0x23, 0x4e, 0x8f, 0x38, 0x0c, 0x22, 0x56, 0x00, 0xf1, 0x86, 0x3e, 0x3f,
0x9f, 0xa7, 0x8b, 0xc9, 0xcb, 0x8d, 0x42, 0x61, 0xb5, 0x0a, 0xf1, 0x7a, 0x24, 0xde, 0x5e, 0xbf,
0x97, 0x5b, 0xf6, 0x3f, 0xbb, 0x4a, 0x69, 0x67, 0x8a, 0x66, 0x57, 0xd1, 0xe1, 0xef, 0xd8, 0x56,
0x5f, 0x8c, 0xdb, 0xd9, 0xba, 0x52, 0xb7, 0x4c, 0xd6, 0x57, 0x97, 0x43, 0x3d, 0xcb, 0xbf, 0x00,
0x00, 0x00, 0xff, 0xff, 0xeb, 0x6c, 0x41, 0xaf, 0x63, 0x01, 0x00, 0x00,
}

17
backend/api/go_client/pipeline_spec.pb.gw.go generated Executable file
View File

@ -0,0 +1,17 @@
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// +build ignore
package ignore

252
backend/api/go_client/report.pb.go generated Executable file
View File

@ -0,0 +1,252 @@
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: backend/api/report.proto
package go_client // import "github.com/kubeflow/pipelines/backend/api/go_client"
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import empty "github.com/golang/protobuf/ptypes/empty"
import _ "google.golang.org/genproto/googleapis/api/annotations"
import (
context "golang.org/x/net/context"
grpc "google.golang.org/grpc"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
type ReportWorkflowRequest struct {
Workflow string `protobuf:"bytes,1,opt,name=workflow,proto3" json:"workflow,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *ReportWorkflowRequest) Reset() { *m = ReportWorkflowRequest{} }
func (m *ReportWorkflowRequest) String() string { return proto.CompactTextString(m) }
func (*ReportWorkflowRequest) ProtoMessage() {}
func (*ReportWorkflowRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_report_cafa40ca8b98916d, []int{0}
}
func (m *ReportWorkflowRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ReportWorkflowRequest.Unmarshal(m, b)
}
func (m *ReportWorkflowRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ReportWorkflowRequest.Marshal(b, m, deterministic)
}
func (dst *ReportWorkflowRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_ReportWorkflowRequest.Merge(dst, src)
}
func (m *ReportWorkflowRequest) XXX_Size() int {
return xxx_messageInfo_ReportWorkflowRequest.Size(m)
}
func (m *ReportWorkflowRequest) XXX_DiscardUnknown() {
xxx_messageInfo_ReportWorkflowRequest.DiscardUnknown(m)
}
var xxx_messageInfo_ReportWorkflowRequest proto.InternalMessageInfo
func (m *ReportWorkflowRequest) GetWorkflow() string {
if m != nil {
return m.Workflow
}
return ""
}
type ReportScheduledWorkflowRequest struct {
ScheduledWorkflow string `protobuf:"bytes,1,opt,name=scheduled_workflow,json=scheduledWorkflow,proto3" json:"scheduled_workflow,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *ReportScheduledWorkflowRequest) Reset() { *m = ReportScheduledWorkflowRequest{} }
func (m *ReportScheduledWorkflowRequest) String() string { return proto.CompactTextString(m) }
func (*ReportScheduledWorkflowRequest) ProtoMessage() {}
func (*ReportScheduledWorkflowRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_report_cafa40ca8b98916d, []int{1}
}
func (m *ReportScheduledWorkflowRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ReportScheduledWorkflowRequest.Unmarshal(m, b)
}
func (m *ReportScheduledWorkflowRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ReportScheduledWorkflowRequest.Marshal(b, m, deterministic)
}
func (dst *ReportScheduledWorkflowRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_ReportScheduledWorkflowRequest.Merge(dst, src)
}
func (m *ReportScheduledWorkflowRequest) XXX_Size() int {
return xxx_messageInfo_ReportScheduledWorkflowRequest.Size(m)
}
func (m *ReportScheduledWorkflowRequest) XXX_DiscardUnknown() {
xxx_messageInfo_ReportScheduledWorkflowRequest.DiscardUnknown(m)
}
var xxx_messageInfo_ReportScheduledWorkflowRequest proto.InternalMessageInfo
func (m *ReportScheduledWorkflowRequest) GetScheduledWorkflow() string {
if m != nil {
return m.ScheduledWorkflow
}
return ""
}
func init() {
proto.RegisterType((*ReportWorkflowRequest)(nil), "api.ReportWorkflowRequest")
proto.RegisterType((*ReportScheduledWorkflowRequest)(nil), "api.ReportScheduledWorkflowRequest")
}
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConn
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion4
// ReportServiceClient is the client API for ReportService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type ReportServiceClient interface {
ReportWorkflow(ctx context.Context, in *ReportWorkflowRequest, opts ...grpc.CallOption) (*empty.Empty, error)
ReportScheduledWorkflow(ctx context.Context, in *ReportScheduledWorkflowRequest, opts ...grpc.CallOption) (*empty.Empty, error)
}
type reportServiceClient struct {
cc *grpc.ClientConn
}
func NewReportServiceClient(cc *grpc.ClientConn) ReportServiceClient {
return &reportServiceClient{cc}
}
func (c *reportServiceClient) ReportWorkflow(ctx context.Context, in *ReportWorkflowRequest, opts ...grpc.CallOption) (*empty.Empty, error) {
out := new(empty.Empty)
err := c.cc.Invoke(ctx, "/api.ReportService/ReportWorkflow", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *reportServiceClient) ReportScheduledWorkflow(ctx context.Context, in *ReportScheduledWorkflowRequest, opts ...grpc.CallOption) (*empty.Empty, error) {
out := new(empty.Empty)
err := c.cc.Invoke(ctx, "/api.ReportService/ReportScheduledWorkflow", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// ReportServiceServer is the server API for ReportService service.
type ReportServiceServer interface {
ReportWorkflow(context.Context, *ReportWorkflowRequest) (*empty.Empty, error)
ReportScheduledWorkflow(context.Context, *ReportScheduledWorkflowRequest) (*empty.Empty, error)
}
func RegisterReportServiceServer(s *grpc.Server, srv ReportServiceServer) {
s.RegisterService(&_ReportService_serviceDesc, srv)
}
func _ReportService_ReportWorkflow_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ReportWorkflowRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ReportServiceServer).ReportWorkflow(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/api.ReportService/ReportWorkflow",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ReportServiceServer).ReportWorkflow(ctx, req.(*ReportWorkflowRequest))
}
return interceptor(ctx, in, info, handler)
}
func _ReportService_ReportScheduledWorkflow_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ReportScheduledWorkflowRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ReportServiceServer).ReportScheduledWorkflow(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/api.ReportService/ReportScheduledWorkflow",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ReportServiceServer).ReportScheduledWorkflow(ctx, req.(*ReportScheduledWorkflowRequest))
}
return interceptor(ctx, in, info, handler)
}
var _ReportService_serviceDesc = grpc.ServiceDesc{
ServiceName: "api.ReportService",
HandlerType: (*ReportServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "ReportWorkflow",
Handler: _ReportService_ReportWorkflow_Handler,
},
{
MethodName: "ReportScheduledWorkflow",
Handler: _ReportService_ReportScheduledWorkflow_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "backend/api/report.proto",
}
func init() { proto.RegisterFile("backend/api/report.proto", fileDescriptor_report_cafa40ca8b98916d) }
var fileDescriptor_report_cafa40ca8b98916d = []byte{
// 310 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x92, 0xcf, 0x4a, 0xc3, 0x40,
0x10, 0x87, 0x69, 0x05, 0xd1, 0x05, 0x05, 0x17, 0xb4, 0x25, 0x8a, 0x94, 0xf4, 0xa2, 0x07, 0x77,
0xa9, 0x45, 0x0f, 0xe2, 0x49, 0xf0, 0x2c, 0xd4, 0x83, 0xe0, 0xa5, 0xec, 0xa6, 0xd3, 0x74, 0x69,
0xba, 0xb3, 0x66, 0x37, 0x2d, 0x5e, 0x7d, 0x05, 0x05, 0x1f, 0xcc, 0x57, 0xf0, 0x41, 0x24, 0x7f,
0x6d, 0x43, 0x73, 0x9c, 0xf9, 0x65, 0x26, 0xdf, 0x37, 0x2c, 0xe9, 0x4a, 0x11, 0xcc, 0x41, 0x4f,
0xb8, 0x30, 0x8a, 0xc7, 0x60, 0x30, 0x76, 0xcc, 0xc4, 0xe8, 0x90, 0xee, 0x08, 0xa3, 0xbc, 0xb3,
0x10, 0x31, 0x8c, 0x20, 0x4b, 0x85, 0xd6, 0xe8, 0x84, 0x53, 0xa8, 0x6d, 0xfe, 0x89, 0x77, 0x5a,
0xa4, 0x59, 0x25, 0x93, 0x29, 0x87, 0x85, 0x71, 0xef, 0x79, 0xe8, 0x0f, 0xc9, 0xf1, 0x28, 0xdb,
0xf7, 0x82, 0xf1, 0x7c, 0x1a, 0xe1, 0x6a, 0x04, 0x6f, 0x09, 0x58, 0x47, 0x3d, 0xb2, 0xb7, 0x2a,
0x5a, 0xdd, 0x56, 0xaf, 0x75, 0xb1, 0x3f, 0xaa, 0x6a, 0xff, 0x89, 0x9c, 0xe7, 0x43, 0xcf, 0xc1,
0x0c, 0x26, 0x49, 0x04, 0x93, 0xfa, 0xf4, 0x15, 0xa1, 0xb6, 0xcc, 0xc6, 0xb5, 0x3d, 0x47, 0xb6,
0x3e, 0x75, 0xfd, 0xdd, 0x26, 0x07, 0xc5, 0x46, 0x88, 0x97, 0x2a, 0x00, 0x8a, 0xe4, 0x70, 0x93,
0x8b, 0x7a, 0x4c, 0x18, 0xc5, 0xb6, 0xc2, 0x7a, 0x27, 0x2c, 0x77, 0x64, 0xa5, 0x23, 0x7b, 0x4c,
0x1d, 0xfd, 0xcb, 0x8f, 0x9f, 0xdf, 0xcf, 0x76, 0xdf, 0xef, 0xa4, 0xa7, 0xb1, 0x7c, 0x39, 0x90,
0xe0, 0xc4, 0x80, 0x97, 0x40, 0xf6, 0xae, 0x72, 0xa2, 0x5f, 0x2d, 0xd2, 0x69, 0x90, 0xa2, 0xfd,
0xb5, 0x5f, 0x37, 0x29, 0x37, 0x32, 0xdc, 0x67, 0x0c, 0xb7, 0x7e, 0x6f, 0x93, 0xa1, 0x3a, 0xc2,
0x3f, 0xcc, 0x96, 0x93, 0x3d, 0xdc, 0xbc, 0x0e, 0x43, 0xe5, 0x66, 0x89, 0x64, 0x01, 0x2e, 0xf8,
0x3c, 0x91, 0x90, 0xb6, 0xb9, 0x51, 0x06, 0x22, 0xa5, 0xc1, 0xf2, 0xf5, 0x97, 0x11, 0xe2, 0x38,
0x88, 0x14, 0x68, 0x27, 0x77, 0x33, 0x88, 0xe1, 0x5f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x12, 0xe5,
0x5d, 0x89, 0x39, 0x02, 0x00, 0x00,
}

170
backend/api/go_client/report.pb.gw.go generated Executable file
View File

@ -0,0 +1,170 @@
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
// source: backend/api/report.proto
/*
Package go_client is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
*/
package go_client
import (
"context"
"io"
"net/http"
"github.com/golang/protobuf/proto"
"github.com/grpc-ecosystem/grpc-gateway/runtime"
"github.com/grpc-ecosystem/grpc-gateway/utilities"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/grpclog"
"google.golang.org/grpc/status"
)
var _ codes.Code
var _ io.Reader
var _ status.Status
var _ = runtime.String
var _ = utilities.NewDoubleArray
func request_ReportService_ReportWorkflow_0(ctx context.Context, marshaler runtime.Marshaler, client ReportServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq ReportWorkflowRequest
var metadata runtime.ServerMetadata
newReader, berr := utilities.IOReaderFactory(req.Body)
if berr != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
}
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Workflow); err != nil && err != io.EOF {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.ReportWorkflow(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func request_ReportService_ReportScheduledWorkflow_0(ctx context.Context, marshaler runtime.Marshaler, client ReportServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq ReportScheduledWorkflowRequest
var metadata runtime.ServerMetadata
newReader, berr := utilities.IOReaderFactory(req.Body)
if berr != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
}
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.ScheduledWorkflow); err != nil && err != io.EOF {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.ReportScheduledWorkflow(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
// RegisterReportServiceHandlerFromEndpoint is same as RegisterReportServiceHandler but
// automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterReportServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) {
conn, err := grpc.Dial(endpoint, opts...)
if err != nil {
return err
}
defer func() {
if err != nil {
if cerr := conn.Close(); cerr != nil {
grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
}
return
}
go func() {
<-ctx.Done()
if cerr := conn.Close(); cerr != nil {
grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
}
}()
}()
return RegisterReportServiceHandler(ctx, mux, conn)
}
// RegisterReportServiceHandler registers the http handlers for service ReportService to "mux".
// The handlers forward requests to the grpc endpoint over "conn".
func RegisterReportServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {
return RegisterReportServiceHandlerClient(ctx, mux, NewReportServiceClient(conn))
}
// RegisterReportServiceHandlerClient registers the http handlers for service ReportService
// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ReportServiceClient".
// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ReportServiceClient"
// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in
// "ReportServiceClient" to call the correct interceptors.
func RegisterReportServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ReportServiceClient) error {
mux.Handle("POST", pattern_ReportService_ReportWorkflow_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateContext(ctx, mux, req)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_ReportService_ReportWorkflow_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_ReportService_ReportWorkflow_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("POST", pattern_ReportService_ReportScheduledWorkflow_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateContext(ctx, mux, req)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_ReportService_ReportScheduledWorkflow_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_ReportService_ReportScheduledWorkflow_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
return nil
}
var (
pattern_ReportService_ReportWorkflow_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"apis", "v1beta1", "workflows"}, ""))
pattern_ReportService_ReportScheduledWorkflow_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"apis", "v1beta1", "scheduledworkflows"}, ""))
)
var (
forward_ReportService_ReportWorkflow_0 = runtime.ForwardResponseMessage
forward_ReportService_ReportScheduledWorkflow_0 = runtime.ForwardResponseMessage
)

232
backend/api/go_client/resource_reference.pb.go generated Executable file
View File

@ -0,0 +1,232 @@
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: backend/api/resource_reference.proto
package go_client // import "github.com/kubeflow/pipelines/backend/api/go_client"
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
type ResourceType int32
const (
ResourceType_UNKNOWN_RESOURCE_TYPE ResourceType = 0
ResourceType_EXPERIMENT ResourceType = 1
ResourceType_JOB ResourceType = 2
ResourceType_PIPELINE ResourceType = 3
ResourceType_PIPELINE_VERSION ResourceType = 4
ResourceType_NAMESPACE ResourceType = 5
)
var ResourceType_name = map[int32]string{
0: "UNKNOWN_RESOURCE_TYPE",
1: "EXPERIMENT",
2: "JOB",
3: "PIPELINE",
4: "PIPELINE_VERSION",
5: "NAMESPACE",
}
var ResourceType_value = map[string]int32{
"UNKNOWN_RESOURCE_TYPE": 0,
"EXPERIMENT": 1,
"JOB": 2,
"PIPELINE": 3,
"PIPELINE_VERSION": 4,
"NAMESPACE": 5,
}
func (x ResourceType) String() string {
return proto.EnumName(ResourceType_name, int32(x))
}
func (ResourceType) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_resource_reference_876ea904b7b7aed8, []int{0}
}
type Relationship int32
const (
Relationship_UNKNOWN_RELATIONSHIP Relationship = 0
Relationship_OWNER Relationship = 1
Relationship_CREATOR Relationship = 2
)
var Relationship_name = map[int32]string{
0: "UNKNOWN_RELATIONSHIP",
1: "OWNER",
2: "CREATOR",
}
var Relationship_value = map[string]int32{
"UNKNOWN_RELATIONSHIP": 0,
"OWNER": 1,
"CREATOR": 2,
}
func (x Relationship) String() string {
return proto.EnumName(Relationship_name, int32(x))
}
func (Relationship) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_resource_reference_876ea904b7b7aed8, []int{1}
}
type ResourceKey struct {
Type ResourceType `protobuf:"varint,1,opt,name=type,proto3,enum=api.ResourceType" json:"type,omitempty"`
Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *ResourceKey) Reset() { *m = ResourceKey{} }
func (m *ResourceKey) String() string { return proto.CompactTextString(m) }
func (*ResourceKey) ProtoMessage() {}
func (*ResourceKey) Descriptor() ([]byte, []int) {
return fileDescriptor_resource_reference_876ea904b7b7aed8, []int{0}
}
func (m *ResourceKey) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ResourceKey.Unmarshal(m, b)
}
func (m *ResourceKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ResourceKey.Marshal(b, m, deterministic)
}
func (dst *ResourceKey) XXX_Merge(src proto.Message) {
xxx_messageInfo_ResourceKey.Merge(dst, src)
}
func (m *ResourceKey) XXX_Size() int {
return xxx_messageInfo_ResourceKey.Size(m)
}
func (m *ResourceKey) XXX_DiscardUnknown() {
xxx_messageInfo_ResourceKey.DiscardUnknown(m)
}
var xxx_messageInfo_ResourceKey proto.InternalMessageInfo
func (m *ResourceKey) GetType() ResourceType {
if m != nil {
return m.Type
}
return ResourceType_UNKNOWN_RESOURCE_TYPE
}
func (m *ResourceKey) GetId() string {
if m != nil {
return m.Id
}
return ""
}
type ResourceReference struct {
Key *ResourceKey `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
Relationship Relationship `protobuf:"varint,2,opt,name=relationship,proto3,enum=api.Relationship" json:"relationship,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *ResourceReference) Reset() { *m = ResourceReference{} }
func (m *ResourceReference) String() string { return proto.CompactTextString(m) }
func (*ResourceReference) ProtoMessage() {}
func (*ResourceReference) Descriptor() ([]byte, []int) {
return fileDescriptor_resource_reference_876ea904b7b7aed8, []int{1}
}
func (m *ResourceReference) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ResourceReference.Unmarshal(m, b)
}
func (m *ResourceReference) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ResourceReference.Marshal(b, m, deterministic)
}
func (dst *ResourceReference) XXX_Merge(src proto.Message) {
xxx_messageInfo_ResourceReference.Merge(dst, src)
}
func (m *ResourceReference) XXX_Size() int {
return xxx_messageInfo_ResourceReference.Size(m)
}
func (m *ResourceReference) XXX_DiscardUnknown() {
xxx_messageInfo_ResourceReference.DiscardUnknown(m)
}
var xxx_messageInfo_ResourceReference proto.InternalMessageInfo
func (m *ResourceReference) GetKey() *ResourceKey {
if m != nil {
return m.Key
}
return nil
}
func (m *ResourceReference) GetName() string {
if m != nil {
return m.Name
}
return ""
}
func (m *ResourceReference) GetRelationship() Relationship {
if m != nil {
return m.Relationship
}
return Relationship_UNKNOWN_RELATIONSHIP
}
func init() {
proto.RegisterType((*ResourceKey)(nil), "api.ResourceKey")
proto.RegisterType((*ResourceReference)(nil), "api.ResourceReference")
proto.RegisterEnum("api.ResourceType", ResourceType_name, ResourceType_value)
proto.RegisterEnum("api.Relationship", Relationship_name, Relationship_value)
}
func init() {
proto.RegisterFile("backend/api/resource_reference.proto", fileDescriptor_resource_reference_876ea904b7b7aed8)
}
var fileDescriptor_resource_reference_876ea904b7b7aed8 = []byte{
// 366 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x91, 0xc1, 0x6b, 0x9c, 0x40,
0x14, 0xc6, 0xa3, 0x6e, 0x9a, 0xee, 0xdb, 0xed, 0x32, 0x79, 0xa4, 0x60, 0x6f, 0x61, 0x69, 0x21,
0xe4, 0xa0, 0x90, 0x90, 0x7b, 0xcd, 0x76, 0xa0, 0x76, 0x93, 0x51, 0x46, 0xd3, 0xb4, 0xbd, 0x88,
0xba, 0x2f, 0xc9, 0xb0, 0x46, 0x07, 0x57, 0x29, 0x5e, 0xfb, 0x97, 0x97, 0x48, 0xc4, 0xec, 0x6d,
0x86, 0xdf, 0xc7, 0xf7, 0xfb, 0xe0, 0xc1, 0xe7, 0x2c, 0xcd, 0xb7, 0x54, 0x6e, 0xdc, 0x54, 0x2b,
0xb7, 0xa6, 0x5d, 0xd5, 0xd6, 0x39, 0x25, 0x35, 0x3d, 0x50, 0x4d, 0x65, 0x4e, 0x8e, 0xae, 0xab,
0xa6, 0x42, 0x2b, 0xd5, 0x6a, 0xf9, 0x0d, 0x66, 0xf2, 0x35, 0xb0, 0xa6, 0x0e, 0xbf, 0xc0, 0xa4,
0xe9, 0x34, 0xd9, 0xc6, 0xa9, 0x71, 0xb6, 0xb8, 0x38, 0x76, 0x52, 0xad, 0x9c, 0x81, 0xc7, 0x9d,
0x26, 0xd9, 0x63, 0x5c, 0x80, 0xa9, 0x36, 0xb6, 0x79, 0x6a, 0x9c, 0x4d, 0xa5, 0xa9, 0x36, 0xcb,
0x7f, 0x06, 0x1c, 0x0f, 0x31, 0x39, 0x68, 0x70, 0x09, 0xd6, 0x96, 0xba, 0xbe, 0x6b, 0x76, 0xc1,
0xf6, 0xba, 0xd6, 0xd4, 0xc9, 0x17, 0x88, 0x08, 0x93, 0x32, 0x7d, 0x26, 0xdb, 0xea, 0xbb, 0xfa,
0x37, 0x5e, 0xc1, 0xbc, 0xa6, 0x22, 0x6d, 0x54, 0x55, 0xee, 0x9e, 0x94, 0xee, 0x3d, 0xe3, 0x98,
0x11, 0xc8, 0xbd, 0xd8, 0x79, 0x0b, 0xf3, 0xb7, 0x53, 0xf1, 0x13, 0x7c, 0xbc, 0x13, 0x6b, 0x11,
0xdc, 0x8b, 0x44, 0xf2, 0x28, 0xb8, 0x93, 0x2b, 0x9e, 0xc4, 0xbf, 0x43, 0xce, 0x0e, 0x70, 0x01,
0xc0, 0x7f, 0x85, 0x5c, 0xfa, 0xb7, 0x5c, 0xc4, 0xcc, 0xc0, 0x23, 0xb0, 0x7e, 0x04, 0xd7, 0xcc,
0xc4, 0x39, 0xbc, 0x0f, 0xfd, 0x90, 0xdf, 0xf8, 0x82, 0x33, 0x0b, 0x4f, 0x80, 0x0d, 0xbf, 0xe4,
0x27, 0x97, 0x91, 0x1f, 0x08, 0x36, 0xc1, 0x0f, 0x30, 0x15, 0xde, 0x2d, 0x8f, 0x42, 0x6f, 0xc5,
0xd9, 0xe1, 0xf9, 0xd7, 0x17, 0xed, 0x38, 0x03, 0x6d, 0x38, 0x19, 0xb5, 0x37, 0x5e, 0xec, 0x07,
0x22, 0xfa, 0xee, 0x87, 0xec, 0x00, 0xa7, 0x70, 0x18, 0xdc, 0x0b, 0x2e, 0x99, 0x81, 0x33, 0x38,
0x5a, 0x49, 0xee, 0xc5, 0x81, 0x64, 0xe6, 0xf5, 0xd5, 0x9f, 0xcb, 0x47, 0xd5, 0x3c, 0xb5, 0x99,
0x93, 0x57, 0xcf, 0xee, 0xb6, 0xcd, 0xe8, 0xa1, 0xa8, 0xfe, 0xba, 0x5a, 0x69, 0x2a, 0x54, 0x49,
0x3b, 0xf7, 0xed, 0x39, 0x1f, 0xab, 0x24, 0x2f, 0x14, 0x95, 0x4d, 0xf6, 0xae, 0x3f, 0xe3, 0xe5,
0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xa3, 0x58, 0x92, 0x1b, 0xee, 0x01, 0x00, 0x00,
}

View File

@ -0,0 +1,17 @@
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// +build ignore
package ignore

1610
backend/api/go_client/run.pb.go generated Executable file

File diff suppressed because it is too large Load Diff

608
backend/api/go_client/run.pb.gw.go generated Executable file
View File

@ -0,0 +1,608 @@
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
// source: backend/api/run.proto
/*
Package go_client is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
*/
package go_client
import (
"context"
"io"
"net/http"
"github.com/golang/protobuf/proto"
"github.com/grpc-ecosystem/grpc-gateway/runtime"
"github.com/grpc-ecosystem/grpc-gateway/utilities"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/grpclog"
"google.golang.org/grpc/status"
)
var _ codes.Code
var _ io.Reader
var _ status.Status
var _ = runtime.String
var _ = utilities.NewDoubleArray
func request_RunService_CreateRun_0(ctx context.Context, marshaler runtime.Marshaler, client RunServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq CreateRunRequest
var metadata runtime.ServerMetadata
newReader, berr := utilities.IOReaderFactory(req.Body)
if berr != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
}
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Run); err != nil && err != io.EOF {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.CreateRun(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func request_RunService_GetRun_0(ctx context.Context, marshaler runtime.Marshaler, client RunServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq GetRunRequest
var metadata runtime.ServerMetadata
var (
val string
ok bool
err error
_ = err
)
val, ok = pathParams["run_id"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "run_id")
}
protoReq.RunId, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "run_id", err)
}
msg, err := client.GetRun(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
var (
filter_RunService_ListRuns_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
)
func request_RunService_ListRuns_0(ctx context.Context, marshaler runtime.Marshaler, client RunServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq ListRunsRequest
var metadata runtime.ServerMetadata
if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_RunService_ListRuns_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.ListRuns(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func request_RunService_ArchiveRun_0(ctx context.Context, marshaler runtime.Marshaler, client RunServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq ArchiveRunRequest
var metadata runtime.ServerMetadata
var (
val string
ok bool
err error
_ = err
)
val, ok = pathParams["id"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id")
}
protoReq.Id, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err)
}
msg, err := client.ArchiveRun(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func request_RunService_UnarchiveRun_0(ctx context.Context, marshaler runtime.Marshaler, client RunServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq UnarchiveRunRequest
var metadata runtime.ServerMetadata
var (
val string
ok bool
err error
_ = err
)
val, ok = pathParams["id"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id")
}
protoReq.Id, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err)
}
msg, err := client.UnarchiveRun(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func request_RunService_DeleteRun_0(ctx context.Context, marshaler runtime.Marshaler, client RunServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq DeleteRunRequest
var metadata runtime.ServerMetadata
var (
val string
ok bool
err error
_ = err
)
val, ok = pathParams["id"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id")
}
protoReq.Id, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err)
}
msg, err := client.DeleteRun(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func request_RunService_ReportRunMetrics_0(ctx context.Context, marshaler runtime.Marshaler, client RunServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq ReportRunMetricsRequest
var metadata runtime.ServerMetadata
newReader, berr := utilities.IOReaderFactory(req.Body)
if berr != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
}
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
var (
val string
ok bool
err error
_ = err
)
val, ok = pathParams["run_id"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "run_id")
}
protoReq.RunId, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "run_id", err)
}
msg, err := client.ReportRunMetrics(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func request_RunService_ReadArtifact_0(ctx context.Context, marshaler runtime.Marshaler, client RunServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq ReadArtifactRequest
var metadata runtime.ServerMetadata
var (
val string
ok bool
err error
_ = err
)
val, ok = pathParams["run_id"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "run_id")
}
protoReq.RunId, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "run_id", err)
}
val, ok = pathParams["node_id"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "node_id")
}
protoReq.NodeId, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "node_id", err)
}
val, ok = pathParams["artifact_name"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "artifact_name")
}
protoReq.ArtifactName, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "artifact_name", err)
}
msg, err := client.ReadArtifact(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func request_RunService_TerminateRun_0(ctx context.Context, marshaler runtime.Marshaler, client RunServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq TerminateRunRequest
var metadata runtime.ServerMetadata
var (
val string
ok bool
err error
_ = err
)
val, ok = pathParams["run_id"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "run_id")
}
protoReq.RunId, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "run_id", err)
}
msg, err := client.TerminateRun(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func request_RunService_RetryRun_0(ctx context.Context, marshaler runtime.Marshaler, client RunServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq RetryRunRequest
var metadata runtime.ServerMetadata
var (
val string
ok bool
err error
_ = err
)
val, ok = pathParams["run_id"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "run_id")
}
protoReq.RunId, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "run_id", err)
}
msg, err := client.RetryRun(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
// RegisterRunServiceHandlerFromEndpoint is same as RegisterRunServiceHandler but
// automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterRunServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) {
conn, err := grpc.Dial(endpoint, opts...)
if err != nil {
return err
}
defer func() {
if err != nil {
if cerr := conn.Close(); cerr != nil {
grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
}
return
}
go func() {
<-ctx.Done()
if cerr := conn.Close(); cerr != nil {
grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
}
}()
}()
return RegisterRunServiceHandler(ctx, mux, conn)
}
// RegisterRunServiceHandler registers the http handlers for service RunService to "mux".
// The handlers forward requests to the grpc endpoint over "conn".
func RegisterRunServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {
return RegisterRunServiceHandlerClient(ctx, mux, NewRunServiceClient(conn))
}
// RegisterRunServiceHandlerClient registers the http handlers for service RunService
// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "RunServiceClient".
// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "RunServiceClient"
// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in
// "RunServiceClient" to call the correct interceptors.
func RegisterRunServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client RunServiceClient) error {
mux.Handle("POST", pattern_RunService_CreateRun_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateContext(ctx, mux, req)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_RunService_CreateRun_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_RunService_CreateRun_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_RunService_GetRun_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateContext(ctx, mux, req)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_RunService_GetRun_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_RunService_GetRun_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_RunService_ListRuns_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateContext(ctx, mux, req)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_RunService_ListRuns_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_RunService_ListRuns_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("POST", pattern_RunService_ArchiveRun_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateContext(ctx, mux, req)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_RunService_ArchiveRun_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_RunService_ArchiveRun_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("POST", pattern_RunService_UnarchiveRun_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateContext(ctx, mux, req)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_RunService_UnarchiveRun_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_RunService_UnarchiveRun_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("DELETE", pattern_RunService_DeleteRun_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateContext(ctx, mux, req)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_RunService_DeleteRun_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_RunService_DeleteRun_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("POST", pattern_RunService_ReportRunMetrics_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateContext(ctx, mux, req)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_RunService_ReportRunMetrics_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_RunService_ReportRunMetrics_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_RunService_ReadArtifact_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateContext(ctx, mux, req)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_RunService_ReadArtifact_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_RunService_ReadArtifact_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("POST", pattern_RunService_TerminateRun_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateContext(ctx, mux, req)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_RunService_TerminateRun_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_RunService_TerminateRun_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("POST", pattern_RunService_RetryRun_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateContext(ctx, mux, req)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_RunService_RetryRun_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_RunService_RetryRun_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
return nil
}
var (
pattern_RunService_CreateRun_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"apis", "v1beta1", "runs"}, ""))
pattern_RunService_GetRun_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"apis", "v1beta1", "runs", "run_id"}, ""))
pattern_RunService_ListRuns_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"apis", "v1beta1", "runs"}, ""))
pattern_RunService_ArchiveRun_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"apis", "v1beta1", "runs", "id"}, "archive"))
pattern_RunService_UnarchiveRun_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"apis", "v1beta1", "runs", "id"}, "unarchive"))
pattern_RunService_DeleteRun_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"apis", "v1beta1", "runs", "id"}, ""))
pattern_RunService_ReportRunMetrics_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"apis", "v1beta1", "runs", "run_id"}, "reportMetrics"))
pattern_RunService_ReadArtifact_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4, 1, 0, 4, 1, 5, 5, 2, 6, 1, 0, 4, 1, 5, 7}, []string{"apis", "v1beta1", "runs", "run_id", "nodes", "node_id", "artifacts", "artifact_name"}, "read"))
pattern_RunService_TerminateRun_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"apis", "v1beta1", "runs", "run_id", "terminate"}, ""))
pattern_RunService_RetryRun_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"apis", "v1beta1", "runs", "run_id", "retry"}, ""))
)
var (
forward_RunService_CreateRun_0 = runtime.ForwardResponseMessage
forward_RunService_GetRun_0 = runtime.ForwardResponseMessage
forward_RunService_ListRuns_0 = runtime.ForwardResponseMessage
forward_RunService_ArchiveRun_0 = runtime.ForwardResponseMessage
forward_RunService_UnarchiveRun_0 = runtime.ForwardResponseMessage
forward_RunService_DeleteRun_0 = runtime.ForwardResponseMessage
forward_RunService_ReportRunMetrics_0 = runtime.ForwardResponseMessage
forward_RunService_ReadArtifact_0 = runtime.ForwardResponseMessage
forward_RunService_TerminateRun_0 = runtime.ForwardResponseMessage
forward_RunService_RetryRun_0 = runtime.ForwardResponseMessage
)

305
backend/api/go_client/visualization.pb.go generated Executable file
View File

@ -0,0 +1,305 @@
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: backend/api/visualization.proto
package go_client // import "github.com/kubeflow/pipelines/backend/api/go_client"
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import _ "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger/options"
import _ "google.golang.org/genproto/googleapis/api/annotations"
import (
context "golang.org/x/net/context"
grpc "google.golang.org/grpc"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
type Visualization_Type int32
const (
Visualization_ROC_CURVE Visualization_Type = 0
Visualization_TFDV Visualization_Type = 1
Visualization_TFMA Visualization_Type = 2
Visualization_TABLE Visualization_Type = 3
Visualization_CUSTOM Visualization_Type = 4
)
var Visualization_Type_name = map[int32]string{
0: "ROC_CURVE",
1: "TFDV",
2: "TFMA",
3: "TABLE",
4: "CUSTOM",
}
var Visualization_Type_value = map[string]int32{
"ROC_CURVE": 0,
"TFDV": 1,
"TFMA": 2,
"TABLE": 3,
"CUSTOM": 4,
}
func (x Visualization_Type) String() string {
return proto.EnumName(Visualization_Type_name, int32(x))
}
func (Visualization_Type) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_visualization_5c1ff36cbdec23a0, []int{1, 0}
}
type CreateVisualizationRequest struct {
Visualization *Visualization `protobuf:"bytes,1,opt,name=visualization,proto3" json:"visualization,omitempty"`
Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *CreateVisualizationRequest) Reset() { *m = CreateVisualizationRequest{} }
func (m *CreateVisualizationRequest) String() string { return proto.CompactTextString(m) }
func (*CreateVisualizationRequest) ProtoMessage() {}
func (*CreateVisualizationRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_visualization_5c1ff36cbdec23a0, []int{0}
}
func (m *CreateVisualizationRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_CreateVisualizationRequest.Unmarshal(m, b)
}
func (m *CreateVisualizationRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_CreateVisualizationRequest.Marshal(b, m, deterministic)
}
func (dst *CreateVisualizationRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_CreateVisualizationRequest.Merge(dst, src)
}
func (m *CreateVisualizationRequest) XXX_Size() int {
return xxx_messageInfo_CreateVisualizationRequest.Size(m)
}
func (m *CreateVisualizationRequest) XXX_DiscardUnknown() {
xxx_messageInfo_CreateVisualizationRequest.DiscardUnknown(m)
}
var xxx_messageInfo_CreateVisualizationRequest proto.InternalMessageInfo
func (m *CreateVisualizationRequest) GetVisualization() *Visualization {
if m != nil {
return m.Visualization
}
return nil
}
func (m *CreateVisualizationRequest) GetNamespace() string {
if m != nil {
return m.Namespace
}
return ""
}
type Visualization struct {
Type Visualization_Type `protobuf:"varint,1,opt,name=type,proto3,enum=api.Visualization_Type" json:"type,omitempty"`
Source string `protobuf:"bytes,2,opt,name=source,proto3" json:"source,omitempty"`
Arguments string `protobuf:"bytes,3,opt,name=arguments,proto3" json:"arguments,omitempty"`
Html string `protobuf:"bytes,4,opt,name=html,proto3" json:"html,omitempty"`
Error string `protobuf:"bytes,5,opt,name=error,proto3" json:"error,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *Visualization) Reset() { *m = Visualization{} }
func (m *Visualization) String() string { return proto.CompactTextString(m) }
func (*Visualization) ProtoMessage() {}
func (*Visualization) Descriptor() ([]byte, []int) {
return fileDescriptor_visualization_5c1ff36cbdec23a0, []int{1}
}
func (m *Visualization) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Visualization.Unmarshal(m, b)
}
func (m *Visualization) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Visualization.Marshal(b, m, deterministic)
}
func (dst *Visualization) XXX_Merge(src proto.Message) {
xxx_messageInfo_Visualization.Merge(dst, src)
}
func (m *Visualization) XXX_Size() int {
return xxx_messageInfo_Visualization.Size(m)
}
func (m *Visualization) XXX_DiscardUnknown() {
xxx_messageInfo_Visualization.DiscardUnknown(m)
}
var xxx_messageInfo_Visualization proto.InternalMessageInfo
func (m *Visualization) GetType() Visualization_Type {
if m != nil {
return m.Type
}
return Visualization_ROC_CURVE
}
func (m *Visualization) GetSource() string {
if m != nil {
return m.Source
}
return ""
}
func (m *Visualization) GetArguments() string {
if m != nil {
return m.Arguments
}
return ""
}
func (m *Visualization) GetHtml() string {
if m != nil {
return m.Html
}
return ""
}
func (m *Visualization) GetError() string {
if m != nil {
return m.Error
}
return ""
}
func init() {
proto.RegisterType((*CreateVisualizationRequest)(nil), "api.CreateVisualizationRequest")
proto.RegisterType((*Visualization)(nil), "api.Visualization")
proto.RegisterEnum("api.Visualization_Type", Visualization_Type_name, Visualization_Type_value)
}
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConn
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion4
// VisualizationServiceClient is the client API for VisualizationService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type VisualizationServiceClient interface {
CreateVisualization(ctx context.Context, in *CreateVisualizationRequest, opts ...grpc.CallOption) (*Visualization, error)
}
type visualizationServiceClient struct {
cc *grpc.ClientConn
}
func NewVisualizationServiceClient(cc *grpc.ClientConn) VisualizationServiceClient {
return &visualizationServiceClient{cc}
}
func (c *visualizationServiceClient) CreateVisualization(ctx context.Context, in *CreateVisualizationRequest, opts ...grpc.CallOption) (*Visualization, error) {
out := new(Visualization)
err := c.cc.Invoke(ctx, "/api.VisualizationService/CreateVisualization", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// VisualizationServiceServer is the server API for VisualizationService service.
type VisualizationServiceServer interface {
CreateVisualization(context.Context, *CreateVisualizationRequest) (*Visualization, error)
}
func RegisterVisualizationServiceServer(s *grpc.Server, srv VisualizationServiceServer) {
s.RegisterService(&_VisualizationService_serviceDesc, srv)
}
func _VisualizationService_CreateVisualization_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CreateVisualizationRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(VisualizationServiceServer).CreateVisualization(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/api.VisualizationService/CreateVisualization",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(VisualizationServiceServer).CreateVisualization(ctx, req.(*CreateVisualizationRequest))
}
return interceptor(ctx, in, info, handler)
}
var _VisualizationService_serviceDesc = grpc.ServiceDesc{
ServiceName: "api.VisualizationService",
HandlerType: (*VisualizationServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "CreateVisualization",
Handler: _VisualizationService_CreateVisualization_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "backend/api/visualization.proto",
}
func init() {
proto.RegisterFile("backend/api/visualization.proto", fileDescriptor_visualization_5c1ff36cbdec23a0)
}
var fileDescriptor_visualization_5c1ff36cbdec23a0 = []byte{
// 482 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x52, 0xc1, 0x6e, 0xd3, 0x40,
0x10, 0xad, 0x13, 0x27, 0x34, 0x53, 0x02, 0x61, 0x5b, 0x51, 0xcb, 0x0a, 0x4a, 0xe4, 0x53, 0x24,
0xa8, 0xad, 0xa6, 0x17, 0xe0, 0x02, 0x49, 0x28, 0x27, 0xa2, 0x4a, 0x4e, 0x9a, 0x43, 0x2f, 0xd5,
0xda, 0x9d, 0x3a, 0xab, 0x3a, 0xde, 0x65, 0x77, 0x9d, 0xaa, 0x20, 0x2e, 0x48, 0x9c, 0xb8, 0xc1,
0x2f, 0xf0, 0x47, 0xdc, 0x39, 0xf1, 0x21, 0x28, 0x9b, 0x28, 0xc4, 0x6a, 0x7b, 0xf2, 0xee, 0xec,
0x9b, 0xf7, 0xc6, 0x6f, 0x1e, 0xb4, 0x22, 0x1a, 0x5f, 0x61, 0x76, 0x11, 0x50, 0xc1, 0x82, 0x39,
0x53, 0x39, 0x4d, 0xd9, 0x27, 0xaa, 0x19, 0xcf, 0x7c, 0x21, 0xb9, 0xe6, 0xa4, 0x4c, 0x05, 0x73,
0x9b, 0x09, 0xe7, 0x49, 0x8a, 0x06, 0x44, 0xb3, 0x8c, 0x6b, 0x83, 0x50, 0x4b, 0x88, 0xbb, 0xbf,
0xc9, 0x81, 0x52, 0x72, 0xb9, 0x7a, 0x78, 0x61, 0x3e, 0xf1, 0x41, 0x82, 0xd9, 0x81, 0xba, 0xa6,
0x49, 0x82, 0x32, 0xe0, 0xc2, 0xb4, 0xde, 0xa6, 0xf1, 0x34, 0xb8, 0x03, 0x89, 0x54, 0xe3, 0x64,
0x73, 0x8c, 0x10, 0x3f, 0xe6, 0xa8, 0x34, 0x79, 0x09, 0xf5, 0xc2, 0x78, 0x8e, 0xd5, 0xb6, 0x3a,
0x3b, 0x5d, 0xe2, 0x53, 0xc1, 0xfc, 0x62, 0x47, 0x11, 0x48, 0x9a, 0x50, 0xcb, 0xe8, 0x0c, 0x95,
0xa0, 0x31, 0x3a, 0xa5, 0xb6, 0xd5, 0xa9, 0x85, 0xff, 0x0b, 0xde, 0x1f, 0x0b, 0xea, 0x85, 0x76,
0xf2, 0x1c, 0x6c, 0x7d, 0x23, 0xd0, 0x08, 0x3c, 0xea, 0xee, 0xdf, 0x16, 0xf0, 0xc7, 0x37, 0x02,
0x43, 0x03, 0x22, 0x4f, 0xa1, 0xaa, 0x78, 0x2e, 0xd7, 0xcc, 0xab, 0xdb, 0x42, 0x94, 0xca, 0x24,
0x9f, 0x61, 0xa6, 0x95, 0x53, 0x5e, 0x8a, 0xae, 0x0b, 0x84, 0x80, 0x3d, 0xd5, 0xb3, 0xd4, 0xb1,
0xcd, 0x83, 0x39, 0x93, 0x3d, 0xa8, 0x18, 0xef, 0x9c, 0x8a, 0x29, 0x2e, 0x2f, 0xde, 0x5b, 0xb0,
0x17, 0x6a, 0xa4, 0x0e, 0xb5, 0xf0, 0x64, 0x70, 0x3e, 0x38, 0x0d, 0x27, 0xc7, 0x8d, 0x2d, 0xb2,
0x0d, 0xf6, 0xf8, 0xfd, 0xbb, 0x49, 0xc3, 0x5a, 0x9e, 0x86, 0xbd, 0x46, 0x89, 0xd4, 0xa0, 0x32,
0xee, 0xf5, 0x3f, 0x1c, 0x37, 0xca, 0x04, 0xa0, 0x3a, 0x38, 0x1d, 0x8d, 0x4f, 0x86, 0x0d, 0xbb,
0xfb, 0xcb, 0x82, 0xbd, 0xc2, 0xf8, 0x23, 0x94, 0x73, 0x16, 0x23, 0xf9, 0x6e, 0xc1, 0xee, 0x1d,
0x86, 0x93, 0x96, 0xf9, 0xe3, 0xfb, 0x57, 0xe1, 0xde, 0xe1, 0xb9, 0xf7, 0xe6, 0xeb, 0xef, 0xbf,
0x3f, 0x4b, 0xaf, 0xbc, 0xce, 0x22, 0x04, 0x2a, 0x98, 0x1f, 0x46, 0xa8, 0xe9, 0x61, 0x31, 0x51,
0x2a, 0xf8, 0xbc, 0xf6, 0xfd, 0xcb, 0xeb, 0xe2, 0x96, 0xfa, 0xdf, 0xac, 0x1f, 0xbd, 0x61, 0xd8,
0x84, 0x07, 0x17, 0x78, 0x49, 0xf3, 0x54, 0x93, 0x27, 0xe4, 0x31, 0xd4, 0xdd, 0x1d, 0xa3, 0x35,
0xd2, 0x54, 0xe7, 0xea, 0xac, 0x05, 0xcf, 0xa0, 0xda, 0x47, 0x2a, 0x51, 0x92, 0xdd, 0xed, 0x92,
0x5b, 0xa7, 0xb9, 0x9e, 0x72, 0xb9, 0xa2, 0x68, 0x97, 0xa2, 0x87, 0x00, 0x6b, 0xc0, 0xd6, 0xd9,
0x51, 0xc2, 0xf4, 0x34, 0x8f, 0xfc, 0x98, 0xcf, 0x82, 0xab, 0x3c, 0xc2, 0xcb, 0x94, 0x5f, 0x07,
0x82, 0x09, 0x4c, 0x59, 0x86, 0x2a, 0xd8, 0x4c, 0x6d, 0xc2, 0xcf, 0xe3, 0x94, 0x61, 0xa6, 0xa3,
0xaa, 0x09, 0xe3, 0xd1, 0xbf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xf8, 0x50, 0x9c, 0xbc, 0x19, 0x03,
0x00, 0x00,
}

147
backend/api/go_client/visualization.pb.gw.go generated Executable file
View File

@ -0,0 +1,147 @@
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
// source: backend/api/visualization.proto
/*
Package go_client is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
*/
package go_client
import (
"context"
"io"
"net/http"
"github.com/golang/protobuf/proto"
"github.com/grpc-ecosystem/grpc-gateway/runtime"
"github.com/grpc-ecosystem/grpc-gateway/utilities"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/grpclog"
"google.golang.org/grpc/status"
)
var _ codes.Code
var _ io.Reader
var _ status.Status
var _ = runtime.String
var _ = utilities.NewDoubleArray
func request_VisualizationService_CreateVisualization_0(ctx context.Context, marshaler runtime.Marshaler, client VisualizationServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq CreateVisualizationRequest
var metadata runtime.ServerMetadata
newReader, berr := utilities.IOReaderFactory(req.Body)
if berr != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
}
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Visualization); err != nil && err != io.EOF {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
var (
val string
ok bool
err error
_ = err
)
val, ok = pathParams["namespace"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "namespace")
}
protoReq.Namespace, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "namespace", err)
}
msg, err := client.CreateVisualization(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
// RegisterVisualizationServiceHandlerFromEndpoint is same as RegisterVisualizationServiceHandler but
// automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterVisualizationServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) {
conn, err := grpc.Dial(endpoint, opts...)
if err != nil {
return err
}
defer func() {
if err != nil {
if cerr := conn.Close(); cerr != nil {
grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
}
return
}
go func() {
<-ctx.Done()
if cerr := conn.Close(); cerr != nil {
grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
}
}()
}()
return RegisterVisualizationServiceHandler(ctx, mux, conn)
}
// RegisterVisualizationServiceHandler registers the http handlers for service VisualizationService to "mux".
// The handlers forward requests to the grpc endpoint over "conn".
func RegisterVisualizationServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {
return RegisterVisualizationServiceHandlerClient(ctx, mux, NewVisualizationServiceClient(conn))
}
// RegisterVisualizationServiceHandlerClient registers the http handlers for service VisualizationService
// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "VisualizationServiceClient".
// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "VisualizationServiceClient"
// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in
// "VisualizationServiceClient" to call the correct interceptors.
func RegisterVisualizationServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client VisualizationServiceClient) error {
mux.Handle("POST", pattern_VisualizationService_CreateVisualization_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateContext(ctx, mux, req)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_VisualizationService_CreateVisualization_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_VisualizationService_CreateVisualization_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
return nil
}
var (
pattern_VisualizationService_CreateVisualization_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"apis", "v1beta1", "visualizations", "namespace"}, ""))
)
var (
forward_VisualizationService_CreateVisualization_0 = runtime.ForwardResponseMessage
)

View File

@ -0,0 +1,14 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library")
go_library(
name = "go_default_library",
srcs = ["experiment_client.go"],
importpath = "github.com/kubeflow/pipelines/backend/api/go_http_client/experiment_client",
visibility = ["//visibility:public"],
deps = [
"//backend/api/go_http_client/experiment_client/experiment_service:go_default_library",
"@com_github_go_openapi_runtime//:go_default_library",
"@com_github_go_openapi_runtime//client:go_default_library",
"@com_github_go_openapi_strfmt//:go_default_library",
],
)

View File

@ -0,0 +1,131 @@
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Code generated by go-swagger; DO NOT EDIT.
package experiment_client
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"github.com/go-openapi/runtime"
httptransport "github.com/go-openapi/runtime/client"
strfmt "github.com/go-openapi/strfmt"
"github.com/kubeflow/pipelines/backend/api/go_http_client/experiment_client/experiment_service"
)
// Default experiment HTTP client.
var Default = NewHTTPClient(nil)
const (
// DefaultHost is the default Host
// found in Meta (info) section of spec file
DefaultHost string = "localhost"
// DefaultBasePath is the default BasePath
// found in Meta (info) section of spec file
DefaultBasePath string = "/"
)
// DefaultSchemes are the default schemes found in Meta (info) section of spec file
var DefaultSchemes = []string{"http", "https"}
// NewHTTPClient creates a new experiment HTTP client.
func NewHTTPClient(formats strfmt.Registry) *Experiment {
return NewHTTPClientWithConfig(formats, nil)
}
// NewHTTPClientWithConfig creates a new experiment HTTP client,
// using a customizable transport config.
func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *Experiment {
// ensure nullable parameters have default
if cfg == nil {
cfg = DefaultTransportConfig()
}
// create transport and client
transport := httptransport.New(cfg.Host, cfg.BasePath, cfg.Schemes)
return New(transport, formats)
}
// New creates a new experiment client
func New(transport runtime.ClientTransport, formats strfmt.Registry) *Experiment {
// ensure nullable parameters have default
if formats == nil {
formats = strfmt.Default
}
cli := new(Experiment)
cli.Transport = transport
cli.ExperimentService = experiment_service.New(transport, formats)
return cli
}
// DefaultTransportConfig creates a TransportConfig with the
// default settings taken from the meta section of the spec file.
func DefaultTransportConfig() *TransportConfig {
return &TransportConfig{
Host: DefaultHost,
BasePath: DefaultBasePath,
Schemes: DefaultSchemes,
}
}
// TransportConfig contains the transport related info,
// found in the meta section of the spec file.
type TransportConfig struct {
Host string
BasePath string
Schemes []string
}
// WithHost overrides the default host,
// provided by the meta section of the spec file.
func (cfg *TransportConfig) WithHost(host string) *TransportConfig {
cfg.Host = host
return cfg
}
// WithBasePath overrides the default basePath,
// provided by the meta section of the spec file.
func (cfg *TransportConfig) WithBasePath(basePath string) *TransportConfig {
cfg.BasePath = basePath
return cfg
}
// WithSchemes overrides the default schemes,
// provided by the meta section of the spec file.
func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig {
cfg.Schemes = schemes
return cfg
}
// Experiment is a client for experiment
type Experiment struct {
ExperimentService *experiment_service.Client
Transport runtime.ClientTransport
}
// SetTransport changes the transport on the client and all its subresources
func (c *Experiment) SetTransport(transport runtime.ClientTransport) {
c.Transport = transport
c.ExperimentService.SetTransport(transport)
}

View File

@ -0,0 +1,30 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library")
go_library(
name = "go_default_library",
srcs = [
"archive_experiment_parameters.go",
"archive_experiment_responses.go",
"create_experiment_parameters.go",
"create_experiment_responses.go",
"delete_experiment_parameters.go",
"delete_experiment_responses.go",
"experiment_service_client.go",
"get_experiment_parameters.go",
"get_experiment_responses.go",
"list_experiment_parameters.go",
"list_experiment_responses.go",
"unarchive_experiment_parameters.go",
"unarchive_experiment_responses.go",
],
importpath = "github.com/kubeflow/pipelines/backend/api/go_http_client/experiment_client/experiment_service",
visibility = ["//visibility:public"],
deps = [
"//backend/api/go_http_client/experiment_model:go_default_library",
"@com_github_go_openapi_errors//:go_default_library",
"@com_github_go_openapi_runtime//:go_default_library",
"@com_github_go_openapi_runtime//client:go_default_library",
"@com_github_go_openapi_strfmt//:go_default_library",
"@com_github_go_openapi_swag//:go_default_library",
],
)

View File

@ -0,0 +1,147 @@
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Code generated by go-swagger; DO NOT EDIT.
package experiment_service
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"net/http"
"time"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.com/go-openapi/runtime/client"
strfmt "github.com/go-openapi/strfmt"
)
// NewArchiveExperimentParams creates a new ArchiveExperimentParams object
// with the default values initialized.
func NewArchiveExperimentParams() *ArchiveExperimentParams {
var ()
return &ArchiveExperimentParams{
timeout: cr.DefaultTimeout,
}
}
// NewArchiveExperimentParamsWithTimeout creates a new ArchiveExperimentParams object
// with the default values initialized, and the ability to set a timeout on a request
func NewArchiveExperimentParamsWithTimeout(timeout time.Duration) *ArchiveExperimentParams {
var ()
return &ArchiveExperimentParams{
timeout: timeout,
}
}
// NewArchiveExperimentParamsWithContext creates a new ArchiveExperimentParams object
// with the default values initialized, and the ability to set a context for a request
func NewArchiveExperimentParamsWithContext(ctx context.Context) *ArchiveExperimentParams {
var ()
return &ArchiveExperimentParams{
Context: ctx,
}
}
// NewArchiveExperimentParamsWithHTTPClient creates a new ArchiveExperimentParams object
// with the default values initialized, and the ability to set a custom HTTPClient for a request
func NewArchiveExperimentParamsWithHTTPClient(client *http.Client) *ArchiveExperimentParams {
var ()
return &ArchiveExperimentParams{
HTTPClient: client,
}
}
/*ArchiveExperimentParams contains all the parameters to send to the API endpoint
for the archive experiment operation typically these are written to a http.Request
*/
type ArchiveExperimentParams struct {
/*ID*/
ID string
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithTimeout adds the timeout to the archive experiment params
func (o *ArchiveExperimentParams) WithTimeout(timeout time.Duration) *ArchiveExperimentParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the archive experiment params
func (o *ArchiveExperimentParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the archive experiment params
func (o *ArchiveExperimentParams) WithContext(ctx context.Context) *ArchiveExperimentParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the archive experiment params
func (o *ArchiveExperimentParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the archive experiment params
func (o *ArchiveExperimentParams) WithHTTPClient(client *http.Client) *ArchiveExperimentParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the archive experiment params
func (o *ArchiveExperimentParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithID adds the id to the archive experiment params
func (o *ArchiveExperimentParams) WithID(id string) *ArchiveExperimentParams {
o.SetID(id)
return o
}
// SetID adds the id to the archive experiment params
func (o *ArchiveExperimentParams) SetID(id string) {
o.ID = id
}
// WriteToRequest writes these params to a swagger request
func (o *ArchiveExperimentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
// path param id
if err := r.SetPathParam("id", o.ID); err != nil {
return err
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@ -0,0 +1,124 @@
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Code generated by go-swagger; DO NOT EDIT.
package experiment_service
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"fmt"
"io"
"github.com/go-openapi/runtime"
strfmt "github.com/go-openapi/strfmt"
experiment_model "github.com/kubeflow/pipelines/backend/api/go_http_client/experiment_model"
)
// ArchiveExperimentReader is a Reader for the ArchiveExperiment structure.
type ArchiveExperimentReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *ArchiveExperimentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewArchiveExperimentOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
default:
result := NewArchiveExperimentDefault(response.Code())
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
if response.Code()/100 == 2 {
return result, nil
}
return nil, result
}
}
// NewArchiveExperimentOK creates a ArchiveExperimentOK with default headers values
func NewArchiveExperimentOK() *ArchiveExperimentOK {
return &ArchiveExperimentOK{}
}
/*ArchiveExperimentOK handles this case with default header values.
A successful response.
*/
type ArchiveExperimentOK struct {
Payload interface{}
}
func (o *ArchiveExperimentOK) Error() string {
return fmt.Sprintf("[POST /apis/v1beta1/experiments/{id}:archive][%d] archiveExperimentOK %+v", 200, o.Payload)
}
func (o *ArchiveExperimentOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// response payload
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewArchiveExperimentDefault creates a ArchiveExperimentDefault with default headers values
func NewArchiveExperimentDefault(code int) *ArchiveExperimentDefault {
return &ArchiveExperimentDefault{
_statusCode: code,
}
}
/*ArchiveExperimentDefault handles this case with default header values.
ArchiveExperimentDefault archive experiment default
*/
type ArchiveExperimentDefault struct {
_statusCode int
Payload *experiment_model.APIStatus
}
// Code gets the status code for the archive experiment default response
func (o *ArchiveExperimentDefault) Code() int {
return o._statusCode
}
func (o *ArchiveExperimentDefault) Error() string {
return fmt.Sprintf("[POST /apis/v1beta1/experiments/{id}:archive][%d] ArchiveExperiment default %+v", o._statusCode, o.Payload)
}
func (o *ArchiveExperimentDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(experiment_model.APIStatus)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}

View File

@ -0,0 +1,153 @@
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Code generated by go-swagger; DO NOT EDIT.
package experiment_service
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"net/http"
"time"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.com/go-openapi/runtime/client"
strfmt "github.com/go-openapi/strfmt"
experiment_model "github.com/kubeflow/pipelines/backend/api/go_http_client/experiment_model"
)
// NewCreateExperimentParams creates a new CreateExperimentParams object
// with the default values initialized.
func NewCreateExperimentParams() *CreateExperimentParams {
var ()
return &CreateExperimentParams{
timeout: cr.DefaultTimeout,
}
}
// NewCreateExperimentParamsWithTimeout creates a new CreateExperimentParams object
// with the default values initialized, and the ability to set a timeout on a request
func NewCreateExperimentParamsWithTimeout(timeout time.Duration) *CreateExperimentParams {
var ()
return &CreateExperimentParams{
timeout: timeout,
}
}
// NewCreateExperimentParamsWithContext creates a new CreateExperimentParams object
// with the default values initialized, and the ability to set a context for a request
func NewCreateExperimentParamsWithContext(ctx context.Context) *CreateExperimentParams {
var ()
return &CreateExperimentParams{
Context: ctx,
}
}
// NewCreateExperimentParamsWithHTTPClient creates a new CreateExperimentParams object
// with the default values initialized, and the ability to set a custom HTTPClient for a request
func NewCreateExperimentParamsWithHTTPClient(client *http.Client) *CreateExperimentParams {
var ()
return &CreateExperimentParams{
HTTPClient: client,
}
}
/*CreateExperimentParams contains all the parameters to send to the API endpoint
for the create experiment operation typically these are written to a http.Request
*/
type CreateExperimentParams struct {
/*Body
The experiment to be created.
*/
Body *experiment_model.APIExperiment
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithTimeout adds the timeout to the create experiment params
func (o *CreateExperimentParams) WithTimeout(timeout time.Duration) *CreateExperimentParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the create experiment params
func (o *CreateExperimentParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the create experiment params
func (o *CreateExperimentParams) WithContext(ctx context.Context) *CreateExperimentParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the create experiment params
func (o *CreateExperimentParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the create experiment params
func (o *CreateExperimentParams) WithHTTPClient(client *http.Client) *CreateExperimentParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the create experiment params
func (o *CreateExperimentParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithBody adds the body to the create experiment params
func (o *CreateExperimentParams) WithBody(body *experiment_model.APIExperiment) *CreateExperimentParams {
o.SetBody(body)
return o
}
// SetBody adds the body to the create experiment params
func (o *CreateExperimentParams) SetBody(body *experiment_model.APIExperiment) {
o.Body = body
}
// WriteToRequest writes these params to a swagger request
func (o *CreateExperimentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if o.Body != nil {
if err := r.SetBodyParam(o.Body); err != nil {
return err
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@ -0,0 +1,126 @@
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Code generated by go-swagger; DO NOT EDIT.
package experiment_service
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"fmt"
"io"
"github.com/go-openapi/runtime"
strfmt "github.com/go-openapi/strfmt"
experiment_model "github.com/kubeflow/pipelines/backend/api/go_http_client/experiment_model"
)
// CreateExperimentReader is a Reader for the CreateExperiment structure.
type CreateExperimentReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *CreateExperimentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewCreateExperimentOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
default:
result := NewCreateExperimentDefault(response.Code())
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
if response.Code()/100 == 2 {
return result, nil
}
return nil, result
}
}
// NewCreateExperimentOK creates a CreateExperimentOK with default headers values
func NewCreateExperimentOK() *CreateExperimentOK {
return &CreateExperimentOK{}
}
/*CreateExperimentOK handles this case with default header values.
A successful response.
*/
type CreateExperimentOK struct {
Payload *experiment_model.APIExperiment
}
func (o *CreateExperimentOK) Error() string {
return fmt.Sprintf("[POST /apis/v1beta1/experiments][%d] createExperimentOK %+v", 200, o.Payload)
}
func (o *CreateExperimentOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(experiment_model.APIExperiment)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewCreateExperimentDefault creates a CreateExperimentDefault with default headers values
func NewCreateExperimentDefault(code int) *CreateExperimentDefault {
return &CreateExperimentDefault{
_statusCode: code,
}
}
/*CreateExperimentDefault handles this case with default header values.
CreateExperimentDefault create experiment default
*/
type CreateExperimentDefault struct {
_statusCode int
Payload *experiment_model.APIStatus
}
// Code gets the status code for the create experiment default response
func (o *CreateExperimentDefault) Code() int {
return o._statusCode
}
func (o *CreateExperimentDefault) Error() string {
return fmt.Sprintf("[POST /apis/v1beta1/experiments][%d] CreateExperiment default %+v", o._statusCode, o.Payload)
}
func (o *CreateExperimentDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(experiment_model.APIStatus)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}

View File

@ -0,0 +1,150 @@
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Code generated by go-swagger; DO NOT EDIT.
package experiment_service
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"net/http"
"time"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.com/go-openapi/runtime/client"
strfmt "github.com/go-openapi/strfmt"
)
// NewDeleteExperimentParams creates a new DeleteExperimentParams object
// with the default values initialized.
func NewDeleteExperimentParams() *DeleteExperimentParams {
var ()
return &DeleteExperimentParams{
timeout: cr.DefaultTimeout,
}
}
// NewDeleteExperimentParamsWithTimeout creates a new DeleteExperimentParams object
// with the default values initialized, and the ability to set a timeout on a request
func NewDeleteExperimentParamsWithTimeout(timeout time.Duration) *DeleteExperimentParams {
var ()
return &DeleteExperimentParams{
timeout: timeout,
}
}
// NewDeleteExperimentParamsWithContext creates a new DeleteExperimentParams object
// with the default values initialized, and the ability to set a context for a request
func NewDeleteExperimentParamsWithContext(ctx context.Context) *DeleteExperimentParams {
var ()
return &DeleteExperimentParams{
Context: ctx,
}
}
// NewDeleteExperimentParamsWithHTTPClient creates a new DeleteExperimentParams object
// with the default values initialized, and the ability to set a custom HTTPClient for a request
func NewDeleteExperimentParamsWithHTTPClient(client *http.Client) *DeleteExperimentParams {
var ()
return &DeleteExperimentParams{
HTTPClient: client,
}
}
/*DeleteExperimentParams contains all the parameters to send to the API endpoint
for the delete experiment operation typically these are written to a http.Request
*/
type DeleteExperimentParams struct {
/*ID
The ID of the experiment to be deleted.
*/
ID string
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithTimeout adds the timeout to the delete experiment params
func (o *DeleteExperimentParams) WithTimeout(timeout time.Duration) *DeleteExperimentParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the delete experiment params
func (o *DeleteExperimentParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the delete experiment params
func (o *DeleteExperimentParams) WithContext(ctx context.Context) *DeleteExperimentParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the delete experiment params
func (o *DeleteExperimentParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the delete experiment params
func (o *DeleteExperimentParams) WithHTTPClient(client *http.Client) *DeleteExperimentParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the delete experiment params
func (o *DeleteExperimentParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithID adds the id to the delete experiment params
func (o *DeleteExperimentParams) WithID(id string) *DeleteExperimentParams {
o.SetID(id)
return o
}
// SetID adds the id to the delete experiment params
func (o *DeleteExperimentParams) SetID(id string) {
o.ID = id
}
// WriteToRequest writes these params to a swagger request
func (o *DeleteExperimentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
// path param id
if err := r.SetPathParam("id", o.ID); err != nil {
return err
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@ -0,0 +1,124 @@
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Code generated by go-swagger; DO NOT EDIT.
package experiment_service
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"fmt"
"io"
"github.com/go-openapi/runtime"
strfmt "github.com/go-openapi/strfmt"
experiment_model "github.com/kubeflow/pipelines/backend/api/go_http_client/experiment_model"
)
// DeleteExperimentReader is a Reader for the DeleteExperiment structure.
type DeleteExperimentReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *DeleteExperimentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewDeleteExperimentOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
default:
result := NewDeleteExperimentDefault(response.Code())
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
if response.Code()/100 == 2 {
return result, nil
}
return nil, result
}
}
// NewDeleteExperimentOK creates a DeleteExperimentOK with default headers values
func NewDeleteExperimentOK() *DeleteExperimentOK {
return &DeleteExperimentOK{}
}
/*DeleteExperimentOK handles this case with default header values.
A successful response.
*/
type DeleteExperimentOK struct {
Payload interface{}
}
func (o *DeleteExperimentOK) Error() string {
return fmt.Sprintf("[DELETE /apis/v1beta1/experiments/{id}][%d] deleteExperimentOK %+v", 200, o.Payload)
}
func (o *DeleteExperimentOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// response payload
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewDeleteExperimentDefault creates a DeleteExperimentDefault with default headers values
func NewDeleteExperimentDefault(code int) *DeleteExperimentDefault {
return &DeleteExperimentDefault{
_statusCode: code,
}
}
/*DeleteExperimentDefault handles this case with default header values.
DeleteExperimentDefault delete experiment default
*/
type DeleteExperimentDefault struct {
_statusCode int
Payload *experiment_model.APIStatus
}
// Code gets the status code for the delete experiment default response
func (o *DeleteExperimentDefault) Code() int {
return o._statusCode
}
func (o *DeleteExperimentDefault) Error() string {
return fmt.Sprintf("[DELETE /apis/v1beta1/experiments/{id}][%d] DeleteExperiment default %+v", o._statusCode, o.Payload)
}
func (o *DeleteExperimentDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(experiment_model.APIStatus)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}

View File

@ -0,0 +1,218 @@
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Code generated by go-swagger; DO NOT EDIT.
package experiment_service
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"github.com/go-openapi/runtime"
strfmt "github.com/go-openapi/strfmt"
)
// New creates a new experiment service API client.
func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client {
return &Client{transport: transport, formats: formats}
}
/*
Client for experiment service API
*/
type Client struct {
transport runtime.ClientTransport
formats strfmt.Registry
}
/*
ArchiveExperiment archives an experiment
*/
func (a *Client) ArchiveExperiment(params *ArchiveExperimentParams, authInfo runtime.ClientAuthInfoWriter) (*ArchiveExperimentOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewArchiveExperimentParams()
}
result, err := a.transport.Submit(&runtime.ClientOperation{
ID: "ArchiveExperiment",
Method: "POST",
PathPattern: "/apis/v1beta1/experiments/{id}:archive",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &ArchiveExperimentReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
})
if err != nil {
return nil, err
}
return result.(*ArchiveExperimentOK), nil
}
/*
CreateExperiment creates a new experiment
*/
func (a *Client) CreateExperiment(params *CreateExperimentParams, authInfo runtime.ClientAuthInfoWriter) (*CreateExperimentOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewCreateExperimentParams()
}
result, err := a.transport.Submit(&runtime.ClientOperation{
ID: "CreateExperiment",
Method: "POST",
PathPattern: "/apis/v1beta1/experiments",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &CreateExperimentReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
})
if err != nil {
return nil, err
}
return result.(*CreateExperimentOK), nil
}
/*
DeleteExperiment deletes an experiment
*/
func (a *Client) DeleteExperiment(params *DeleteExperimentParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteExperimentOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewDeleteExperimentParams()
}
result, err := a.transport.Submit(&runtime.ClientOperation{
ID: "DeleteExperiment",
Method: "DELETE",
PathPattern: "/apis/v1beta1/experiments/{id}",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &DeleteExperimentReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
})
if err != nil {
return nil, err
}
return result.(*DeleteExperimentOK), nil
}
/*
GetExperiment finds a specific experiment by ID
*/
func (a *Client) GetExperiment(params *GetExperimentParams, authInfo runtime.ClientAuthInfoWriter) (*GetExperimentOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewGetExperimentParams()
}
result, err := a.transport.Submit(&runtime.ClientOperation{
ID: "GetExperiment",
Method: "GET",
PathPattern: "/apis/v1beta1/experiments/{id}",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &GetExperimentReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
})
if err != nil {
return nil, err
}
return result.(*GetExperimentOK), nil
}
/*
ListExperiment finds all experiments
*/
func (a *Client) ListExperiment(params *ListExperimentParams, authInfo runtime.ClientAuthInfoWriter) (*ListExperimentOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewListExperimentParams()
}
result, err := a.transport.Submit(&runtime.ClientOperation{
ID: "ListExperiment",
Method: "GET",
PathPattern: "/apis/v1beta1/experiments",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &ListExperimentReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
})
if err != nil {
return nil, err
}
return result.(*ListExperimentOK), nil
}
/*
UnarchiveExperiment restores an archived experiment
*/
func (a *Client) UnarchiveExperiment(params *UnarchiveExperimentParams, authInfo runtime.ClientAuthInfoWriter) (*UnarchiveExperimentOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewUnarchiveExperimentParams()
}
result, err := a.transport.Submit(&runtime.ClientOperation{
ID: "UnarchiveExperiment",
Method: "POST",
PathPattern: "/apis/v1beta1/experiments/{id}:unarchive",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &UnarchiveExperimentReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
})
if err != nil {
return nil, err
}
return result.(*UnarchiveExperimentOK), nil
}
// SetTransport changes the transport on the client
func (a *Client) SetTransport(transport runtime.ClientTransport) {
a.transport = transport
}

View File

@ -0,0 +1,150 @@
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Code generated by go-swagger; DO NOT EDIT.
package experiment_service
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"net/http"
"time"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.com/go-openapi/runtime/client"
strfmt "github.com/go-openapi/strfmt"
)
// NewGetExperimentParams creates a new GetExperimentParams object
// with the default values initialized.
func NewGetExperimentParams() *GetExperimentParams {
var ()
return &GetExperimentParams{
timeout: cr.DefaultTimeout,
}
}
// NewGetExperimentParamsWithTimeout creates a new GetExperimentParams object
// with the default values initialized, and the ability to set a timeout on a request
func NewGetExperimentParamsWithTimeout(timeout time.Duration) *GetExperimentParams {
var ()
return &GetExperimentParams{
timeout: timeout,
}
}
// NewGetExperimentParamsWithContext creates a new GetExperimentParams object
// with the default values initialized, and the ability to set a context for a request
func NewGetExperimentParamsWithContext(ctx context.Context) *GetExperimentParams {
var ()
return &GetExperimentParams{
Context: ctx,
}
}
// NewGetExperimentParamsWithHTTPClient creates a new GetExperimentParams object
// with the default values initialized, and the ability to set a custom HTTPClient for a request
func NewGetExperimentParamsWithHTTPClient(client *http.Client) *GetExperimentParams {
var ()
return &GetExperimentParams{
HTTPClient: client,
}
}
/*GetExperimentParams contains all the parameters to send to the API endpoint
for the get experiment operation typically these are written to a http.Request
*/
type GetExperimentParams struct {
/*ID
The ID of the experiment to be retrieved.
*/
ID string
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithTimeout adds the timeout to the get experiment params
func (o *GetExperimentParams) WithTimeout(timeout time.Duration) *GetExperimentParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the get experiment params
func (o *GetExperimentParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the get experiment params
func (o *GetExperimentParams) WithContext(ctx context.Context) *GetExperimentParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the get experiment params
func (o *GetExperimentParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the get experiment params
func (o *GetExperimentParams) WithHTTPClient(client *http.Client) *GetExperimentParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the get experiment params
func (o *GetExperimentParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithID adds the id to the get experiment params
func (o *GetExperimentParams) WithID(id string) *GetExperimentParams {
o.SetID(id)
return o
}
// SetID adds the id to the get experiment params
func (o *GetExperimentParams) SetID(id string) {
o.ID = id
}
// WriteToRequest writes these params to a swagger request
func (o *GetExperimentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
// path param id
if err := r.SetPathParam("id", o.ID); err != nil {
return err
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@ -0,0 +1,126 @@
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Code generated by go-swagger; DO NOT EDIT.
package experiment_service
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"fmt"
"io"
"github.com/go-openapi/runtime"
strfmt "github.com/go-openapi/strfmt"
experiment_model "github.com/kubeflow/pipelines/backend/api/go_http_client/experiment_model"
)
// GetExperimentReader is a Reader for the GetExperiment structure.
type GetExperimentReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *GetExperimentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewGetExperimentOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
default:
result := NewGetExperimentDefault(response.Code())
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
if response.Code()/100 == 2 {
return result, nil
}
return nil, result
}
}
// NewGetExperimentOK creates a GetExperimentOK with default headers values
func NewGetExperimentOK() *GetExperimentOK {
return &GetExperimentOK{}
}
/*GetExperimentOK handles this case with default header values.
A successful response.
*/
type GetExperimentOK struct {
Payload *experiment_model.APIExperiment
}
func (o *GetExperimentOK) Error() string {
return fmt.Sprintf("[GET /apis/v1beta1/experiments/{id}][%d] getExperimentOK %+v", 200, o.Payload)
}
func (o *GetExperimentOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(experiment_model.APIExperiment)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetExperimentDefault creates a GetExperimentDefault with default headers values
func NewGetExperimentDefault(code int) *GetExperimentDefault {
return &GetExperimentDefault{
_statusCode: code,
}
}
/*GetExperimentDefault handles this case with default header values.
GetExperimentDefault get experiment default
*/
type GetExperimentDefault struct {
_statusCode int
Payload *experiment_model.APIStatus
}
// Code gets the status code for the get experiment default response
func (o *GetExperimentDefault) Code() int {
return o._statusCode
}
func (o *GetExperimentDefault) Error() string {
return fmt.Sprintf("[GET /apis/v1beta1/experiments/{id}][%d] GetExperiment default %+v", o._statusCode, o.Payload)
}
func (o *GetExperimentDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(experiment_model.APIStatus)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}

View File

@ -0,0 +1,331 @@
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Code generated by go-swagger; DO NOT EDIT.
package experiment_service
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"net/http"
"time"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.com/go-openapi/runtime/client"
"github.com/go-openapi/swag"
strfmt "github.com/go-openapi/strfmt"
)
// NewListExperimentParams creates a new ListExperimentParams object
// with the default values initialized.
func NewListExperimentParams() *ListExperimentParams {
var (
resourceReferenceKeyTypeDefault = string("UNKNOWN_RESOURCE_TYPE")
)
return &ListExperimentParams{
ResourceReferenceKeyType: &resourceReferenceKeyTypeDefault,
timeout: cr.DefaultTimeout,
}
}
// NewListExperimentParamsWithTimeout creates a new ListExperimentParams object
// with the default values initialized, and the ability to set a timeout on a request
func NewListExperimentParamsWithTimeout(timeout time.Duration) *ListExperimentParams {
var (
resourceReferenceKeyTypeDefault = string("UNKNOWN_RESOURCE_TYPE")
)
return &ListExperimentParams{
ResourceReferenceKeyType: &resourceReferenceKeyTypeDefault,
timeout: timeout,
}
}
// NewListExperimentParamsWithContext creates a new ListExperimentParams object
// with the default values initialized, and the ability to set a context for a request
func NewListExperimentParamsWithContext(ctx context.Context) *ListExperimentParams {
var (
resourceReferenceKeyTypeDefault = string("UNKNOWN_RESOURCE_TYPE")
)
return &ListExperimentParams{
ResourceReferenceKeyType: &resourceReferenceKeyTypeDefault,
Context: ctx,
}
}
// NewListExperimentParamsWithHTTPClient creates a new ListExperimentParams object
// with the default values initialized, and the ability to set a custom HTTPClient for a request
func NewListExperimentParamsWithHTTPClient(client *http.Client) *ListExperimentParams {
var (
resourceReferenceKeyTypeDefault = string("UNKNOWN_RESOURCE_TYPE")
)
return &ListExperimentParams{
ResourceReferenceKeyType: &resourceReferenceKeyTypeDefault,
HTTPClient: client,
}
}
/*ListExperimentParams contains all the parameters to send to the API endpoint
for the list experiment operation typically these are written to a http.Request
*/
type ListExperimentParams struct {
/*Filter
A url-encoded, JSON-serialized Filter protocol buffer (see
[filter.proto](https://github.com/kubeflow/pipelines/
blob/master/backend/api/filter.proto)).
*/
Filter *string
/*PageSize*/
PageSize *int32
/*PageToken*/
PageToken *string
/*ResourceReferenceKeyID
The ID of the resource that referred to.
*/
ResourceReferenceKeyID *string
/*ResourceReferenceKeyType
The type of the resource that referred to.
*/
ResourceReferenceKeyType *string
/*SortBy
Can be format of "field_name", "field_name asc" or "field_name des"
Ascending by default.
*/
SortBy *string
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithTimeout adds the timeout to the list experiment params
func (o *ListExperimentParams) WithTimeout(timeout time.Duration) *ListExperimentParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the list experiment params
func (o *ListExperimentParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the list experiment params
func (o *ListExperimentParams) WithContext(ctx context.Context) *ListExperimentParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the list experiment params
func (o *ListExperimentParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the list experiment params
func (o *ListExperimentParams) WithHTTPClient(client *http.Client) *ListExperimentParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the list experiment params
func (o *ListExperimentParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithFilter adds the filter to the list experiment params
func (o *ListExperimentParams) WithFilter(filter *string) *ListExperimentParams {
o.SetFilter(filter)
return o
}
// SetFilter adds the filter to the list experiment params
func (o *ListExperimentParams) SetFilter(filter *string) {
o.Filter = filter
}
// WithPageSize adds the pageSize to the list experiment params
func (o *ListExperimentParams) WithPageSize(pageSize *int32) *ListExperimentParams {
o.SetPageSize(pageSize)
return o
}
// SetPageSize adds the pageSize to the list experiment params
func (o *ListExperimentParams) SetPageSize(pageSize *int32) {
o.PageSize = pageSize
}
// WithPageToken adds the pageToken to the list experiment params
func (o *ListExperimentParams) WithPageToken(pageToken *string) *ListExperimentParams {
o.SetPageToken(pageToken)
return o
}
// SetPageToken adds the pageToken to the list experiment params
func (o *ListExperimentParams) SetPageToken(pageToken *string) {
o.PageToken = pageToken
}
// WithResourceReferenceKeyID adds the resourceReferenceKeyID to the list experiment params
func (o *ListExperimentParams) WithResourceReferenceKeyID(resourceReferenceKeyID *string) *ListExperimentParams {
o.SetResourceReferenceKeyID(resourceReferenceKeyID)
return o
}
// SetResourceReferenceKeyID adds the resourceReferenceKeyId to the list experiment params
func (o *ListExperimentParams) SetResourceReferenceKeyID(resourceReferenceKeyID *string) {
o.ResourceReferenceKeyID = resourceReferenceKeyID
}
// WithResourceReferenceKeyType adds the resourceReferenceKeyType to the list experiment params
func (o *ListExperimentParams) WithResourceReferenceKeyType(resourceReferenceKeyType *string) *ListExperimentParams {
o.SetResourceReferenceKeyType(resourceReferenceKeyType)
return o
}
// SetResourceReferenceKeyType adds the resourceReferenceKeyType to the list experiment params
func (o *ListExperimentParams) SetResourceReferenceKeyType(resourceReferenceKeyType *string) {
o.ResourceReferenceKeyType = resourceReferenceKeyType
}
// WithSortBy adds the sortBy to the list experiment params
func (o *ListExperimentParams) WithSortBy(sortBy *string) *ListExperimentParams {
o.SetSortBy(sortBy)
return o
}
// SetSortBy adds the sortBy to the list experiment params
func (o *ListExperimentParams) SetSortBy(sortBy *string) {
o.SortBy = sortBy
}
// WriteToRequest writes these params to a swagger request
func (o *ListExperimentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if o.Filter != nil {
// query param filter
var qrFilter string
if o.Filter != nil {
qrFilter = *o.Filter
}
qFilter := qrFilter
if qFilter != "" {
if err := r.SetQueryParam("filter", qFilter); err != nil {
return err
}
}
}
if o.PageSize != nil {
// query param page_size
var qrPageSize int32
if o.PageSize != nil {
qrPageSize = *o.PageSize
}
qPageSize := swag.FormatInt32(qrPageSize)
if qPageSize != "" {
if err := r.SetQueryParam("page_size", qPageSize); err != nil {
return err
}
}
}
if o.PageToken != nil {
// query param page_token
var qrPageToken string
if o.PageToken != nil {
qrPageToken = *o.PageToken
}
qPageToken := qrPageToken
if qPageToken != "" {
if err := r.SetQueryParam("page_token", qPageToken); err != nil {
return err
}
}
}
if o.ResourceReferenceKeyID != nil {
// query param resource_reference_key.id
var qrResourceReferenceKeyID string
if o.ResourceReferenceKeyID != nil {
qrResourceReferenceKeyID = *o.ResourceReferenceKeyID
}
qResourceReferenceKeyID := qrResourceReferenceKeyID
if qResourceReferenceKeyID != "" {
if err := r.SetQueryParam("resource_reference_key.id", qResourceReferenceKeyID); err != nil {
return err
}
}
}
if o.ResourceReferenceKeyType != nil {
// query param resource_reference_key.type
var qrResourceReferenceKeyType string
if o.ResourceReferenceKeyType != nil {
qrResourceReferenceKeyType = *o.ResourceReferenceKeyType
}
qResourceReferenceKeyType := qrResourceReferenceKeyType
if qResourceReferenceKeyType != "" {
if err := r.SetQueryParam("resource_reference_key.type", qResourceReferenceKeyType); err != nil {
return err
}
}
}
if o.SortBy != nil {
// query param sort_by
var qrSortBy string
if o.SortBy != nil {
qrSortBy = *o.SortBy
}
qSortBy := qrSortBy
if qSortBy != "" {
if err := r.SetQueryParam("sort_by", qSortBy); err != nil {
return err
}
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@ -0,0 +1,126 @@
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Code generated by go-swagger; DO NOT EDIT.
package experiment_service
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"fmt"
"io"
"github.com/go-openapi/runtime"
strfmt "github.com/go-openapi/strfmt"
experiment_model "github.com/kubeflow/pipelines/backend/api/go_http_client/experiment_model"
)
// ListExperimentReader is a Reader for the ListExperiment structure.
type ListExperimentReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *ListExperimentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewListExperimentOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
default:
result := NewListExperimentDefault(response.Code())
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
if response.Code()/100 == 2 {
return result, nil
}
return nil, result
}
}
// NewListExperimentOK creates a ListExperimentOK with default headers values
func NewListExperimentOK() *ListExperimentOK {
return &ListExperimentOK{}
}
/*ListExperimentOK handles this case with default header values.
A successful response.
*/
type ListExperimentOK struct {
Payload *experiment_model.APIListExperimentsResponse
}
func (o *ListExperimentOK) Error() string {
return fmt.Sprintf("[GET /apis/v1beta1/experiments][%d] listExperimentOK %+v", 200, o.Payload)
}
func (o *ListExperimentOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(experiment_model.APIListExperimentsResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewListExperimentDefault creates a ListExperimentDefault with default headers values
func NewListExperimentDefault(code int) *ListExperimentDefault {
return &ListExperimentDefault{
_statusCode: code,
}
}
/*ListExperimentDefault handles this case with default header values.
ListExperimentDefault list experiment default
*/
type ListExperimentDefault struct {
_statusCode int
Payload *experiment_model.APIStatus
}
// Code gets the status code for the list experiment default response
func (o *ListExperimentDefault) Code() int {
return o._statusCode
}
func (o *ListExperimentDefault) Error() string {
return fmt.Sprintf("[GET /apis/v1beta1/experiments][%d] ListExperiment default %+v", o._statusCode, o.Payload)
}
func (o *ListExperimentDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(experiment_model.APIStatus)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}

View File

@ -0,0 +1,147 @@
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Code generated by go-swagger; DO NOT EDIT.
package experiment_service
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"net/http"
"time"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.com/go-openapi/runtime/client"
strfmt "github.com/go-openapi/strfmt"
)
// NewUnarchiveExperimentParams creates a new UnarchiveExperimentParams object
// with the default values initialized.
func NewUnarchiveExperimentParams() *UnarchiveExperimentParams {
var ()
return &UnarchiveExperimentParams{
timeout: cr.DefaultTimeout,
}
}
// NewUnarchiveExperimentParamsWithTimeout creates a new UnarchiveExperimentParams object
// with the default values initialized, and the ability to set a timeout on a request
func NewUnarchiveExperimentParamsWithTimeout(timeout time.Duration) *UnarchiveExperimentParams {
var ()
return &UnarchiveExperimentParams{
timeout: timeout,
}
}
// NewUnarchiveExperimentParamsWithContext creates a new UnarchiveExperimentParams object
// with the default values initialized, and the ability to set a context for a request
func NewUnarchiveExperimentParamsWithContext(ctx context.Context) *UnarchiveExperimentParams {
var ()
return &UnarchiveExperimentParams{
Context: ctx,
}
}
// NewUnarchiveExperimentParamsWithHTTPClient creates a new UnarchiveExperimentParams object
// with the default values initialized, and the ability to set a custom HTTPClient for a request
func NewUnarchiveExperimentParamsWithHTTPClient(client *http.Client) *UnarchiveExperimentParams {
var ()
return &UnarchiveExperimentParams{
HTTPClient: client,
}
}
/*UnarchiveExperimentParams contains all the parameters to send to the API endpoint
for the unarchive experiment operation typically these are written to a http.Request
*/
type UnarchiveExperimentParams struct {
/*ID*/
ID string
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithTimeout adds the timeout to the unarchive experiment params
func (o *UnarchiveExperimentParams) WithTimeout(timeout time.Duration) *UnarchiveExperimentParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the unarchive experiment params
func (o *UnarchiveExperimentParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the unarchive experiment params
func (o *UnarchiveExperimentParams) WithContext(ctx context.Context) *UnarchiveExperimentParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the unarchive experiment params
func (o *UnarchiveExperimentParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the unarchive experiment params
func (o *UnarchiveExperimentParams) WithHTTPClient(client *http.Client) *UnarchiveExperimentParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the unarchive experiment params
func (o *UnarchiveExperimentParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithID adds the id to the unarchive experiment params
func (o *UnarchiveExperimentParams) WithID(id string) *UnarchiveExperimentParams {
o.SetID(id)
return o
}
// SetID adds the id to the unarchive experiment params
func (o *UnarchiveExperimentParams) SetID(id string) {
o.ID = id
}
// WriteToRequest writes these params to a swagger request
func (o *UnarchiveExperimentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
// path param id
if err := r.SetPathParam("id", o.ID); err != nil {
return err
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@ -0,0 +1,124 @@
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Code generated by go-swagger; DO NOT EDIT.
package experiment_service
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"fmt"
"io"
"github.com/go-openapi/runtime"
strfmt "github.com/go-openapi/strfmt"
experiment_model "github.com/kubeflow/pipelines/backend/api/go_http_client/experiment_model"
)
// UnarchiveExperimentReader is a Reader for the UnarchiveExperiment structure.
type UnarchiveExperimentReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *UnarchiveExperimentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewUnarchiveExperimentOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
default:
result := NewUnarchiveExperimentDefault(response.Code())
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
if response.Code()/100 == 2 {
return result, nil
}
return nil, result
}
}
// NewUnarchiveExperimentOK creates a UnarchiveExperimentOK with default headers values
func NewUnarchiveExperimentOK() *UnarchiveExperimentOK {
return &UnarchiveExperimentOK{}
}
/*UnarchiveExperimentOK handles this case with default header values.
A successful response.
*/
type UnarchiveExperimentOK struct {
Payload interface{}
}
func (o *UnarchiveExperimentOK) Error() string {
return fmt.Sprintf("[POST /apis/v1beta1/experiments/{id}:unarchive][%d] unarchiveExperimentOK %+v", 200, o.Payload)
}
func (o *UnarchiveExperimentOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// response payload
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewUnarchiveExperimentDefault creates a UnarchiveExperimentDefault with default headers values
func NewUnarchiveExperimentDefault(code int) *UnarchiveExperimentDefault {
return &UnarchiveExperimentDefault{
_statusCode: code,
}
}
/*UnarchiveExperimentDefault handles this case with default header values.
UnarchiveExperimentDefault unarchive experiment default
*/
type UnarchiveExperimentDefault struct {
_statusCode int
Payload *experiment_model.APIStatus
}
// Code gets the status code for the unarchive experiment default response
func (o *UnarchiveExperimentDefault) Code() int {
return o._statusCode
}
func (o *UnarchiveExperimentDefault) Error() string {
return fmt.Sprintf("[POST /apis/v1beta1/experiments/{id}:unarchive][%d] UnarchiveExperiment default %+v", o._statusCode, o.Payload)
}
func (o *UnarchiveExperimentDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(experiment_model.APIStatus)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}

View File

@ -0,0 +1,24 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library")
go_library(
name = "go_default_library",
srcs = [
"api_experiment.go",
"api_list_experiments_response.go",
"api_relationship.go",
"api_resource_key.go",
"api_resource_reference.go",
"api_resource_type.go",
"api_status.go",
"experiment_storage_state.go",
"protobuf_any.go",
],
importpath = "github.com/kubeflow/pipelines/backend/api/go_http_client/experiment_model",
visibility = ["//visibility:public"],
deps = [
"@com_github_go_openapi_errors//:go_default_library",
"@com_github_go_openapi_strfmt//:go_default_library",
"@com_github_go_openapi_swag//:go_default_library",
"@com_github_go_openapi_validate//:go_default_library",
],
)

View File

@ -0,0 +1,149 @@
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Code generated by go-swagger; DO NOT EDIT.
package experiment_model
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"strconv"
strfmt "github.com/go-openapi/strfmt"
"github.com/go-openapi/errors"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
)
// APIExperiment api experiment
// swagger:model apiExperiment
type APIExperiment struct {
// Output. The time that the experiment created.
// Format: date-time
CreatedAt strfmt.DateTime `json:"created_at,omitempty"`
// Optional input field. Describing the purpose of the experiment
Description string `json:"description,omitempty"`
// Output. Unique experiment ID. Generated by API server.
ID string `json:"id,omitempty"`
// Required input field. Unique experiment name provided by user.
Name string `json:"name,omitempty"`
// Optional input field. Specify which resource this run belongs to.
// For Experiment, the only valid resource reference is a single Namespace.
ResourceReferences []*APIResourceReference `json:"resource_references"`
// storage state
StorageState ExperimentStorageState `json:"storage_state,omitempty"`
}
// Validate validates this api experiment
func (m *APIExperiment) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateCreatedAt(formats); err != nil {
res = append(res, err)
}
if err := m.validateResourceReferences(formats); err != nil {
res = append(res, err)
}
if err := m.validateStorageState(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIExperiment) validateCreatedAt(formats strfmt.Registry) error {
if swag.IsZero(m.CreatedAt) { // not required
return nil
}
if err := validate.FormatOf("created_at", "body", "date-time", m.CreatedAt.String(), formats); err != nil {
return err
}
return nil
}
func (m *APIExperiment) validateResourceReferences(formats strfmt.Registry) error {
if swag.IsZero(m.ResourceReferences) { // not required
return nil
}
for i := 0; i < len(m.ResourceReferences); i++ {
if swag.IsZero(m.ResourceReferences[i]) { // not required
continue
}
if m.ResourceReferences[i] != nil {
if err := m.ResourceReferences[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("resource_references" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *APIExperiment) validateStorageState(formats strfmt.Registry) error {
if swag.IsZero(m.StorageState) { // not required
return nil
}
if err := m.StorageState.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("storage_state")
}
return err
}
return nil
}
// MarshalBinary interface implementation
func (m *APIExperiment) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APIExperiment) UnmarshalBinary(b []byte) error {
var res APIExperiment
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@ -0,0 +1,100 @@
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Code generated by go-swagger; DO NOT EDIT.
package experiment_model
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"strconv"
strfmt "github.com/go-openapi/strfmt"
"github.com/go-openapi/errors"
"github.com/go-openapi/swag"
)
// APIListExperimentsResponse api list experiments response
// swagger:model apiListExperimentsResponse
type APIListExperimentsResponse struct {
// A list of experiments returned.
Experiments []*APIExperiment `json:"experiments"`
// The token to list the next page of experiments.
NextPageToken string `json:"next_page_token,omitempty"`
// The total number of experiments for the given query.
TotalSize int32 `json:"total_size,omitempty"`
}
// Validate validates this api list experiments response
func (m *APIListExperimentsResponse) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateExperiments(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIListExperimentsResponse) validateExperiments(formats strfmt.Registry) error {
if swag.IsZero(m.Experiments) { // not required
return nil
}
for i := 0; i < len(m.Experiments); i++ {
if swag.IsZero(m.Experiments[i]) { // not required
continue
}
if m.Experiments[i] != nil {
if err := m.Experiments[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("experiments" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// MarshalBinary interface implementation
func (m *APIListExperimentsResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APIListExperimentsResponse) UnmarshalBinary(b []byte) error {
var res APIListExperimentsResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@ -0,0 +1,80 @@
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Code generated by go-swagger; DO NOT EDIT.
package experiment_model
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"encoding/json"
strfmt "github.com/go-openapi/strfmt"
"github.com/go-openapi/errors"
"github.com/go-openapi/validate"
)
// APIRelationship api relationship
// swagger:model apiRelationship
type APIRelationship string
const (
// APIRelationshipUNKNOWNRELATIONSHIP captures enum value "UNKNOWN_RELATIONSHIP"
APIRelationshipUNKNOWNRELATIONSHIP APIRelationship = "UNKNOWN_RELATIONSHIP"
// APIRelationshipOWNER captures enum value "OWNER"
APIRelationshipOWNER APIRelationship = "OWNER"
// APIRelationshipCREATOR captures enum value "CREATOR"
APIRelationshipCREATOR APIRelationship = "CREATOR"
)
// for schema
var apiRelationshipEnum []interface{}
func init() {
var res []APIRelationship
if err := json.Unmarshal([]byte(`["UNKNOWN_RELATIONSHIP","OWNER","CREATOR"]`), &res); err != nil {
panic(err)
}
for _, v := range res {
apiRelationshipEnum = append(apiRelationshipEnum, v)
}
}
func (m APIRelationship) validateAPIRelationshipEnum(path, location string, value APIRelationship) error {
if err := validate.Enum(path, location, value, apiRelationshipEnum); err != nil {
return err
}
return nil
}
// Validate validates this api relationship
func (m APIRelationship) Validate(formats strfmt.Registry) error {
var res []error
// value enum
if err := m.validateAPIRelationshipEnum("", "body", m); err != nil {
return err
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@ -0,0 +1,86 @@
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Code generated by go-swagger; DO NOT EDIT.
package experiment_model
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
strfmt "github.com/go-openapi/strfmt"
"github.com/go-openapi/errors"
"github.com/go-openapi/swag"
)
// APIResourceKey api resource key
// swagger:model apiResourceKey
type APIResourceKey struct {
// The ID of the resource that referred to.
ID string `json:"id,omitempty"`
// The type of the resource that referred to.
Type APIResourceType `json:"type,omitempty"`
}
// Validate validates this api resource key
func (m *APIResourceKey) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateType(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIResourceKey) validateType(formats strfmt.Registry) error {
if swag.IsZero(m.Type) { // not required
return nil
}
if err := m.Type.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("type")
}
return err
}
return nil
}
// MarshalBinary interface implementation
func (m *APIResourceKey) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APIResourceKey) UnmarshalBinary(b []byte) error {
var res APIResourceKey
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@ -0,0 +1,111 @@
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Code generated by go-swagger; DO NOT EDIT.
package experiment_model
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
strfmt "github.com/go-openapi/strfmt"
"github.com/go-openapi/errors"
"github.com/go-openapi/swag"
)
// APIResourceReference api resource reference
// swagger:model apiResourceReference
type APIResourceReference struct {
// key
Key *APIResourceKey `json:"key,omitempty"`
// The name of the resource that referred to.
Name string `json:"name,omitempty"`
// Required field. The relationship from referred resource to the object.
Relationship APIRelationship `json:"relationship,omitempty"`
}
// Validate validates this api resource reference
func (m *APIResourceReference) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateKey(formats); err != nil {
res = append(res, err)
}
if err := m.validateRelationship(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIResourceReference) validateKey(formats strfmt.Registry) error {
if swag.IsZero(m.Key) { // not required
return nil
}
if m.Key != nil {
if err := m.Key.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("key")
}
return err
}
}
return nil
}
func (m *APIResourceReference) validateRelationship(formats strfmt.Registry) error {
if swag.IsZero(m.Relationship) { // not required
return nil
}
if err := m.Relationship.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("relationship")
}
return err
}
return nil
}
// MarshalBinary interface implementation
func (m *APIResourceReference) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APIResourceReference) UnmarshalBinary(b []byte) error {
var res APIResourceReference
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@ -0,0 +1,89 @@
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Code generated by go-swagger; DO NOT EDIT.
package experiment_model
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"encoding/json"
strfmt "github.com/go-openapi/strfmt"
"github.com/go-openapi/errors"
"github.com/go-openapi/validate"
)
// APIResourceType api resource type
// swagger:model apiResourceType
type APIResourceType string
const (
// APIResourceTypeUNKNOWNRESOURCETYPE captures enum value "UNKNOWN_RESOURCE_TYPE"
APIResourceTypeUNKNOWNRESOURCETYPE APIResourceType = "UNKNOWN_RESOURCE_TYPE"
// APIResourceTypeEXPERIMENT captures enum value "EXPERIMENT"
APIResourceTypeEXPERIMENT APIResourceType = "EXPERIMENT"
// APIResourceTypeJOB captures enum value "JOB"
APIResourceTypeJOB APIResourceType = "JOB"
// APIResourceTypePIPELINE captures enum value "PIPELINE"
APIResourceTypePIPELINE APIResourceType = "PIPELINE"
// APIResourceTypePIPELINEVERSION captures enum value "PIPELINE_VERSION"
APIResourceTypePIPELINEVERSION APIResourceType = "PIPELINE_VERSION"
// APIResourceTypeNAMESPACE captures enum value "NAMESPACE"
APIResourceTypeNAMESPACE APIResourceType = "NAMESPACE"
)
// for schema
var apiResourceTypeEnum []interface{}
func init() {
var res []APIResourceType
if err := json.Unmarshal([]byte(`["UNKNOWN_RESOURCE_TYPE","EXPERIMENT","JOB","PIPELINE","PIPELINE_VERSION","NAMESPACE"]`), &res); err != nil {
panic(err)
}
for _, v := range res {
apiResourceTypeEnum = append(apiResourceTypeEnum, v)
}
}
func (m APIResourceType) validateAPIResourceTypeEnum(path, location string, value APIResourceType) error {
if err := validate.Enum(path, location, value, apiResourceTypeEnum); err != nil {
return err
}
return nil
}
// Validate validates this api resource type
func (m APIResourceType) Validate(formats strfmt.Registry) error {
var res []error
// value enum
if err := m.validateAPIResourceTypeEnum("", "body", m); err != nil {
return err
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@ -0,0 +1,100 @@
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Code generated by go-swagger; DO NOT EDIT.
package experiment_model
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"strconv"
strfmt "github.com/go-openapi/strfmt"
"github.com/go-openapi/errors"
"github.com/go-openapi/swag"
)
// APIStatus api status
// swagger:model apiStatus
type APIStatus struct {
// code
Code int32 `json:"code,omitempty"`
// details
Details []*ProtobufAny `json:"details"`
// error
Error string `json:"error,omitempty"`
}
// Validate validates this api status
func (m *APIStatus) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateDetails(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIStatus) validateDetails(formats strfmt.Registry) error {
if swag.IsZero(m.Details) { // not required
return nil
}
for i := 0; i < len(m.Details); i++ {
if swag.IsZero(m.Details[i]) { // not required
continue
}
if m.Details[i] != nil {
if err := m.Details[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("details" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// MarshalBinary interface implementation
func (m *APIStatus) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APIStatus) UnmarshalBinary(b []byte) error {
var res APIStatus
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@ -0,0 +1,80 @@
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Code generated by go-swagger; DO NOT EDIT.
package experiment_model
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"encoding/json"
strfmt "github.com/go-openapi/strfmt"
"github.com/go-openapi/errors"
"github.com/go-openapi/validate"
)
// ExperimentStorageState experiment storage state
// swagger:model ExperimentStorageState
type ExperimentStorageState string
const (
// ExperimentStorageStateSTORAGESTATEUNSPECIFIED captures enum value "STORAGESTATE_UNSPECIFIED"
ExperimentStorageStateSTORAGESTATEUNSPECIFIED ExperimentStorageState = "STORAGESTATE_UNSPECIFIED"
// ExperimentStorageStateSTORAGESTATEAVAILABLE captures enum value "STORAGESTATE_AVAILABLE"
ExperimentStorageStateSTORAGESTATEAVAILABLE ExperimentStorageState = "STORAGESTATE_AVAILABLE"
// ExperimentStorageStateSTORAGESTATEARCHIVED captures enum value "STORAGESTATE_ARCHIVED"
ExperimentStorageStateSTORAGESTATEARCHIVED ExperimentStorageState = "STORAGESTATE_ARCHIVED"
)
// for schema
var experimentStorageStateEnum []interface{}
func init() {
var res []ExperimentStorageState
if err := json.Unmarshal([]byte(`["STORAGESTATE_UNSPECIFIED","STORAGESTATE_AVAILABLE","STORAGESTATE_ARCHIVED"]`), &res); err != nil {
panic(err)
}
for _, v := range res {
experimentStorageStateEnum = append(experimentStorageStateEnum, v)
}
}
func (m ExperimentStorageState) validateExperimentStorageStateEnum(path, location string, value ExperimentStorageState) error {
if err := validate.Enum(path, location, value, experimentStorageStateEnum); err != nil {
return err
}
return nil
}
// Validate validates this experiment storage state
func (m ExperimentStorageState) Validate(formats strfmt.Registry) error {
var res []error
// value enum
if err := m.validateExperimentStorageStateEnum("", "body", m); err != nil {
return err
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@ -0,0 +1,185 @@
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Code generated by go-swagger; DO NOT EDIT.
package experiment_model
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
strfmt "github.com/go-openapi/strfmt"
"github.com/go-openapi/errors"
"github.com/go-openapi/swag"
)
// ProtobufAny `Any` contains an arbitrary serialized protocol buffer message along with a
// URL that describes the type of the serialized message.
//
// Protobuf library provides support to pack/unpack Any values in the form
// of utility functions or additional generated methods of the Any type.
//
// Example 1: Pack and unpack a message in C++.
//
// Foo foo = ...;
// Any any;
// any.PackFrom(foo);
// ...
// if (any.UnpackTo(&foo)) {
// ...
// }
//
// Example 2: Pack and unpack a message in Java.
//
// Foo foo = ...;
// Any any = Any.pack(foo);
// ...
// if (any.is(Foo.class)) {
// foo = any.unpack(Foo.class);
// }
//
// Example 3: Pack and unpack a message in Python.
//
// foo = Foo(...)
// any = Any()
// any.Pack(foo)
// ...
// if any.Is(Foo.DESCRIPTOR):
// any.Unpack(foo)
// ...
//
// Example 4: Pack and unpack a message in Go
//
// foo := &pb.Foo{...}
// any, err := ptypes.MarshalAny(foo)
// ...
// foo := &pb.Foo{}
// if err := ptypes.UnmarshalAny(any, foo); err != nil {
// ...
// }
//
// The pack methods provided by protobuf library will by default use
// 'type.googleapis.com/full.type.name' as the type URL and the unpack
// methods only use the fully qualified type name after the last '/'
// in the type URL, for example "foo.bar.com/x/y.z" will yield type
// name "y.z".
//
//
// JSON
// ====
// The JSON representation of an `Any` value uses the regular
// representation of the deserialized, embedded message, with an
// additional field `@type` which contains the type URL. Example:
//
// package google.profile;
// message Person {
// string first_name = 1;
// string last_name = 2;
// }
//
// {
// "@type": "type.googleapis.com/google.profile.Person",
// "firstName": <string>,
// "lastName": <string>
// }
//
// If the embedded message type is well-known and has a custom JSON
// representation, that representation will be embedded adding a field
// `value` which holds the custom JSON in addition to the `@type`
// field. Example (for message [google.protobuf.Duration][]):
//
// {
// "@type": "type.googleapis.com/google.protobuf.Duration",
// "value": "1.212s"
// }
// swagger:model protobufAny
type ProtobufAny struct {
// A URL/resource name that uniquely identifies the type of the serialized
// protocol buffer message. The last segment of the URL's path must represent
// the fully qualified name of the type (as in
// `path/google.protobuf.Duration`). The name should be in a canonical form
// (e.g., leading "." is not accepted).
//
// In practice, teams usually precompile into the binary all types that they
// expect it to use in the context of Any. However, for URLs which use the
// scheme `http`, `https`, or no scheme, one can optionally set up a type
// server that maps type URLs to message definitions as follows:
//
// * If no scheme is provided, `https` is assumed.
// * An HTTP GET on the URL must yield a [google.protobuf.Type][]
// value in binary format, or produce an error.
// * Applications are allowed to cache lookup results based on the
// URL, or have them precompiled into a binary to avoid any
// lookup. Therefore, binary compatibility needs to be preserved
// on changes to types. (Use versioned type names to manage
// breaking changes.)
//
// Note: this functionality is not currently available in the official
// protobuf release, and it is not used for type URLs beginning with
// type.googleapis.com.
//
// Schemes other than `http`, `https` (or the empty scheme) might be
// used with implementation specific semantics.
TypeURL string `json:"type_url,omitempty"`
// Must be a valid serialized protocol buffer of the above specified type.
// Format: byte
Value strfmt.Base64 `json:"value,omitempty"`
}
// Validate validates this protobuf any
func (m *ProtobufAny) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateValue(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *ProtobufAny) validateValue(formats strfmt.Registry) error {
if swag.IsZero(m.Value) { // not required
return nil
}
// Format "byte" (base64 string) is already validated when unmarshalled
return nil
}
// MarshalBinary interface implementation
func (m *ProtobufAny) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *ProtobufAny) UnmarshalBinary(b []byte) error {
var res ProtobufAny
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@ -0,0 +1,14 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library")
go_library(
name = "go_default_library",
srcs = ["job_client.go"],
importpath = "github.com/kubeflow/pipelines/backend/api/go_http_client/job_client",
visibility = ["//visibility:public"],
deps = [
"//backend/api/go_http_client/job_client/job_service:go_default_library",
"@com_github_go_openapi_runtime//:go_default_library",
"@com_github_go_openapi_runtime//client:go_default_library",
"@com_github_go_openapi_strfmt//:go_default_library",
],
)

View File

@ -0,0 +1,131 @@
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Code generated by go-swagger; DO NOT EDIT.
package job_client
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"github.com/go-openapi/runtime"
httptransport "github.com/go-openapi/runtime/client"
strfmt "github.com/go-openapi/strfmt"
"github.com/kubeflow/pipelines/backend/api/go_http_client/job_client/job_service"
)
// Default job HTTP client.
var Default = NewHTTPClient(nil)
const (
// DefaultHost is the default Host
// found in Meta (info) section of spec file
DefaultHost string = "localhost"
// DefaultBasePath is the default BasePath
// found in Meta (info) section of spec file
DefaultBasePath string = "/"
)
// DefaultSchemes are the default schemes found in Meta (info) section of spec file
var DefaultSchemes = []string{"http", "https"}
// NewHTTPClient creates a new job HTTP client.
func NewHTTPClient(formats strfmt.Registry) *Job {
return NewHTTPClientWithConfig(formats, nil)
}
// NewHTTPClientWithConfig creates a new job HTTP client,
// using a customizable transport config.
func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *Job {
// ensure nullable parameters have default
if cfg == nil {
cfg = DefaultTransportConfig()
}
// create transport and client
transport := httptransport.New(cfg.Host, cfg.BasePath, cfg.Schemes)
return New(transport, formats)
}
// New creates a new job client
func New(transport runtime.ClientTransport, formats strfmt.Registry) *Job {
// ensure nullable parameters have default
if formats == nil {
formats = strfmt.Default
}
cli := new(Job)
cli.Transport = transport
cli.JobService = job_service.New(transport, formats)
return cli
}
// DefaultTransportConfig creates a TransportConfig with the
// default settings taken from the meta section of the spec file.
func DefaultTransportConfig() *TransportConfig {
return &TransportConfig{
Host: DefaultHost,
BasePath: DefaultBasePath,
Schemes: DefaultSchemes,
}
}
// TransportConfig contains the transport related info,
// found in the meta section of the spec file.
type TransportConfig struct {
Host string
BasePath string
Schemes []string
}
// WithHost overrides the default host,
// provided by the meta section of the spec file.
func (cfg *TransportConfig) WithHost(host string) *TransportConfig {
cfg.Host = host
return cfg
}
// WithBasePath overrides the default basePath,
// provided by the meta section of the spec file.
func (cfg *TransportConfig) WithBasePath(basePath string) *TransportConfig {
cfg.BasePath = basePath
return cfg
}
// WithSchemes overrides the default schemes,
// provided by the meta section of the spec file.
func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig {
cfg.Schemes = schemes
return cfg
}
// Job is a client for job
type Job struct {
JobService *job_service.Client
Transport runtime.ClientTransport
}
// SetTransport changes the transport on the client and all its subresources
func (c *Job) SetTransport(transport runtime.ClientTransport) {
c.Transport = transport
c.JobService.SetTransport(transport)
}

View File

@ -0,0 +1,30 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library")
go_library(
name = "go_default_library",
srcs = [
"create_job_parameters.go",
"create_job_responses.go",
"delete_job_parameters.go",
"delete_job_responses.go",
"disable_job_parameters.go",
"disable_job_responses.go",
"enable_job_parameters.go",
"enable_job_responses.go",
"get_job_parameters.go",
"get_job_responses.go",
"job_service_client.go",
"list_jobs_parameters.go",
"list_jobs_responses.go",
],
importpath = "github.com/kubeflow/pipelines/backend/api/go_http_client/job_client/job_service",
visibility = ["//visibility:public"],
deps = [
"//backend/api/go_http_client/job_model:go_default_library",
"@com_github_go_openapi_errors//:go_default_library",
"@com_github_go_openapi_runtime//:go_default_library",
"@com_github_go_openapi_runtime//client:go_default_library",
"@com_github_go_openapi_strfmt//:go_default_library",
"@com_github_go_openapi_swag//:go_default_library",
],
)

View File

@ -0,0 +1,153 @@
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Code generated by go-swagger; DO NOT EDIT.
package job_service
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"net/http"
"time"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.com/go-openapi/runtime/client"
strfmt "github.com/go-openapi/strfmt"
job_model "github.com/kubeflow/pipelines/backend/api/go_http_client/job_model"
)
// NewCreateJobParams creates a new CreateJobParams object
// with the default values initialized.
func NewCreateJobParams() *CreateJobParams {
var ()
return &CreateJobParams{
timeout: cr.DefaultTimeout,
}
}
// NewCreateJobParamsWithTimeout creates a new CreateJobParams object
// with the default values initialized, and the ability to set a timeout on a request
func NewCreateJobParamsWithTimeout(timeout time.Duration) *CreateJobParams {
var ()
return &CreateJobParams{
timeout: timeout,
}
}
// NewCreateJobParamsWithContext creates a new CreateJobParams object
// with the default values initialized, and the ability to set a context for a request
func NewCreateJobParamsWithContext(ctx context.Context) *CreateJobParams {
var ()
return &CreateJobParams{
Context: ctx,
}
}
// NewCreateJobParamsWithHTTPClient creates a new CreateJobParams object
// with the default values initialized, and the ability to set a custom HTTPClient for a request
func NewCreateJobParamsWithHTTPClient(client *http.Client) *CreateJobParams {
var ()
return &CreateJobParams{
HTTPClient: client,
}
}
/*CreateJobParams contains all the parameters to send to the API endpoint
for the create job operation typically these are written to a http.Request
*/
type CreateJobParams struct {
/*Body
The job to be created
*/
Body *job_model.APIJob
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithTimeout adds the timeout to the create job params
func (o *CreateJobParams) WithTimeout(timeout time.Duration) *CreateJobParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the create job params
func (o *CreateJobParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the create job params
func (o *CreateJobParams) WithContext(ctx context.Context) *CreateJobParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the create job params
func (o *CreateJobParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the create job params
func (o *CreateJobParams) WithHTTPClient(client *http.Client) *CreateJobParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the create job params
func (o *CreateJobParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithBody adds the body to the create job params
func (o *CreateJobParams) WithBody(body *job_model.APIJob) *CreateJobParams {
o.SetBody(body)
return o
}
// SetBody adds the body to the create job params
func (o *CreateJobParams) SetBody(body *job_model.APIJob) {
o.Body = body
}
// WriteToRequest writes these params to a swagger request
func (o *CreateJobParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if o.Body != nil {
if err := r.SetBodyParam(o.Body); err != nil {
return err
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@ -0,0 +1,126 @@
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Code generated by go-swagger; DO NOT EDIT.
package job_service
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"fmt"
"io"
"github.com/go-openapi/runtime"
strfmt "github.com/go-openapi/strfmt"
job_model "github.com/kubeflow/pipelines/backend/api/go_http_client/job_model"
)
// CreateJobReader is a Reader for the CreateJob structure.
type CreateJobReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *CreateJobReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewCreateJobOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
default:
result := NewCreateJobDefault(response.Code())
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
if response.Code()/100 == 2 {
return result, nil
}
return nil, result
}
}
// NewCreateJobOK creates a CreateJobOK with default headers values
func NewCreateJobOK() *CreateJobOK {
return &CreateJobOK{}
}
/*CreateJobOK handles this case with default header values.
A successful response.
*/
type CreateJobOK struct {
Payload *job_model.APIJob
}
func (o *CreateJobOK) Error() string {
return fmt.Sprintf("[POST /apis/v1beta1/jobs][%d] createJobOK %+v", 200, o.Payload)
}
func (o *CreateJobOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(job_model.APIJob)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewCreateJobDefault creates a CreateJobDefault with default headers values
func NewCreateJobDefault(code int) *CreateJobDefault {
return &CreateJobDefault{
_statusCode: code,
}
}
/*CreateJobDefault handles this case with default header values.
CreateJobDefault create job default
*/
type CreateJobDefault struct {
_statusCode int
Payload *job_model.APIStatus
}
// Code gets the status code for the create job default response
func (o *CreateJobDefault) Code() int {
return o._statusCode
}
func (o *CreateJobDefault) Error() string {
return fmt.Sprintf("[POST /apis/v1beta1/jobs][%d] CreateJob default %+v", o._statusCode, o.Payload)
}
func (o *CreateJobDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(job_model.APIStatus)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}

View File

@ -0,0 +1,150 @@
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Code generated by go-swagger; DO NOT EDIT.
package job_service
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"net/http"
"time"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.com/go-openapi/runtime/client"
strfmt "github.com/go-openapi/strfmt"
)
// NewDeleteJobParams creates a new DeleteJobParams object
// with the default values initialized.
func NewDeleteJobParams() *DeleteJobParams {
var ()
return &DeleteJobParams{
timeout: cr.DefaultTimeout,
}
}
// NewDeleteJobParamsWithTimeout creates a new DeleteJobParams object
// with the default values initialized, and the ability to set a timeout on a request
func NewDeleteJobParamsWithTimeout(timeout time.Duration) *DeleteJobParams {
var ()
return &DeleteJobParams{
timeout: timeout,
}
}
// NewDeleteJobParamsWithContext creates a new DeleteJobParams object
// with the default values initialized, and the ability to set a context for a request
func NewDeleteJobParamsWithContext(ctx context.Context) *DeleteJobParams {
var ()
return &DeleteJobParams{
Context: ctx,
}
}
// NewDeleteJobParamsWithHTTPClient creates a new DeleteJobParams object
// with the default values initialized, and the ability to set a custom HTTPClient for a request
func NewDeleteJobParamsWithHTTPClient(client *http.Client) *DeleteJobParams {
var ()
return &DeleteJobParams{
HTTPClient: client,
}
}
/*DeleteJobParams contains all the parameters to send to the API endpoint
for the delete job operation typically these are written to a http.Request
*/
type DeleteJobParams struct {
/*ID
The ID of the job to be deleted
*/
ID string
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithTimeout adds the timeout to the delete job params
func (o *DeleteJobParams) WithTimeout(timeout time.Duration) *DeleteJobParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the delete job params
func (o *DeleteJobParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the delete job params
func (o *DeleteJobParams) WithContext(ctx context.Context) *DeleteJobParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the delete job params
func (o *DeleteJobParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the delete job params
func (o *DeleteJobParams) WithHTTPClient(client *http.Client) *DeleteJobParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the delete job params
func (o *DeleteJobParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithID adds the id to the delete job params
func (o *DeleteJobParams) WithID(id string) *DeleteJobParams {
o.SetID(id)
return o
}
// SetID adds the id to the delete job params
func (o *DeleteJobParams) SetID(id string) {
o.ID = id
}
// WriteToRequest writes these params to a swagger request
func (o *DeleteJobParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
// path param id
if err := r.SetPathParam("id", o.ID); err != nil {
return err
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@ -0,0 +1,124 @@
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Code generated by go-swagger; DO NOT EDIT.
package job_service
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"fmt"
"io"
"github.com/go-openapi/runtime"
strfmt "github.com/go-openapi/strfmt"
job_model "github.com/kubeflow/pipelines/backend/api/go_http_client/job_model"
)
// DeleteJobReader is a Reader for the DeleteJob structure.
type DeleteJobReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *DeleteJobReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewDeleteJobOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
default:
result := NewDeleteJobDefault(response.Code())
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
if response.Code()/100 == 2 {
return result, nil
}
return nil, result
}
}
// NewDeleteJobOK creates a DeleteJobOK with default headers values
func NewDeleteJobOK() *DeleteJobOK {
return &DeleteJobOK{}
}
/*DeleteJobOK handles this case with default header values.
A successful response.
*/
type DeleteJobOK struct {
Payload interface{}
}
func (o *DeleteJobOK) Error() string {
return fmt.Sprintf("[DELETE /apis/v1beta1/jobs/{id}][%d] deleteJobOK %+v", 200, o.Payload)
}
func (o *DeleteJobOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// response payload
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewDeleteJobDefault creates a DeleteJobDefault with default headers values
func NewDeleteJobDefault(code int) *DeleteJobDefault {
return &DeleteJobDefault{
_statusCode: code,
}
}
/*DeleteJobDefault handles this case with default header values.
DeleteJobDefault delete job default
*/
type DeleteJobDefault struct {
_statusCode int
Payload *job_model.APIStatus
}
// Code gets the status code for the delete job default response
func (o *DeleteJobDefault) Code() int {
return o._statusCode
}
func (o *DeleteJobDefault) Error() string {
return fmt.Sprintf("[DELETE /apis/v1beta1/jobs/{id}][%d] DeleteJob default %+v", o._statusCode, o.Payload)
}
func (o *DeleteJobDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(job_model.APIStatus)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}

View File

@ -0,0 +1,150 @@
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Code generated by go-swagger; DO NOT EDIT.
package job_service
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"net/http"
"time"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.com/go-openapi/runtime/client"
strfmt "github.com/go-openapi/strfmt"
)
// NewDisableJobParams creates a new DisableJobParams object
// with the default values initialized.
func NewDisableJobParams() *DisableJobParams {
var ()
return &DisableJobParams{
timeout: cr.DefaultTimeout,
}
}
// NewDisableJobParamsWithTimeout creates a new DisableJobParams object
// with the default values initialized, and the ability to set a timeout on a request
func NewDisableJobParamsWithTimeout(timeout time.Duration) *DisableJobParams {
var ()
return &DisableJobParams{
timeout: timeout,
}
}
// NewDisableJobParamsWithContext creates a new DisableJobParams object
// with the default values initialized, and the ability to set a context for a request
func NewDisableJobParamsWithContext(ctx context.Context) *DisableJobParams {
var ()
return &DisableJobParams{
Context: ctx,
}
}
// NewDisableJobParamsWithHTTPClient creates a new DisableJobParams object
// with the default values initialized, and the ability to set a custom HTTPClient for a request
func NewDisableJobParamsWithHTTPClient(client *http.Client) *DisableJobParams {
var ()
return &DisableJobParams{
HTTPClient: client,
}
}
/*DisableJobParams contains all the parameters to send to the API endpoint
for the disable job operation typically these are written to a http.Request
*/
type DisableJobParams struct {
/*ID
The ID of the job to be disabled
*/
ID string
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithTimeout adds the timeout to the disable job params
func (o *DisableJobParams) WithTimeout(timeout time.Duration) *DisableJobParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the disable job params
func (o *DisableJobParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the disable job params
func (o *DisableJobParams) WithContext(ctx context.Context) *DisableJobParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the disable job params
func (o *DisableJobParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the disable job params
func (o *DisableJobParams) WithHTTPClient(client *http.Client) *DisableJobParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the disable job params
func (o *DisableJobParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithID adds the id to the disable job params
func (o *DisableJobParams) WithID(id string) *DisableJobParams {
o.SetID(id)
return o
}
// SetID adds the id to the disable job params
func (o *DisableJobParams) SetID(id string) {
o.ID = id
}
// WriteToRequest writes these params to a swagger request
func (o *DisableJobParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
// path param id
if err := r.SetPathParam("id", o.ID); err != nil {
return err
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@ -0,0 +1,124 @@
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Code generated by go-swagger; DO NOT EDIT.
package job_service
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"fmt"
"io"
"github.com/go-openapi/runtime"
strfmt "github.com/go-openapi/strfmt"
job_model "github.com/kubeflow/pipelines/backend/api/go_http_client/job_model"
)
// DisableJobReader is a Reader for the DisableJob structure.
type DisableJobReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *DisableJobReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewDisableJobOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
default:
result := NewDisableJobDefault(response.Code())
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
if response.Code()/100 == 2 {
return result, nil
}
return nil, result
}
}
// NewDisableJobOK creates a DisableJobOK with default headers values
func NewDisableJobOK() *DisableJobOK {
return &DisableJobOK{}
}
/*DisableJobOK handles this case with default header values.
A successful response.
*/
type DisableJobOK struct {
Payload interface{}
}
func (o *DisableJobOK) Error() string {
return fmt.Sprintf("[POST /apis/v1beta1/jobs/{id}/disable][%d] disableJobOK %+v", 200, o.Payload)
}
func (o *DisableJobOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// response payload
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewDisableJobDefault creates a DisableJobDefault with default headers values
func NewDisableJobDefault(code int) *DisableJobDefault {
return &DisableJobDefault{
_statusCode: code,
}
}
/*DisableJobDefault handles this case with default header values.
DisableJobDefault disable job default
*/
type DisableJobDefault struct {
_statusCode int
Payload *job_model.APIStatus
}
// Code gets the status code for the disable job default response
func (o *DisableJobDefault) Code() int {
return o._statusCode
}
func (o *DisableJobDefault) Error() string {
return fmt.Sprintf("[POST /apis/v1beta1/jobs/{id}/disable][%d] DisableJob default %+v", o._statusCode, o.Payload)
}
func (o *DisableJobDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(job_model.APIStatus)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}

View File

@ -0,0 +1,150 @@
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Code generated by go-swagger; DO NOT EDIT.
package job_service
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"net/http"
"time"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.com/go-openapi/runtime/client"
strfmt "github.com/go-openapi/strfmt"
)
// NewEnableJobParams creates a new EnableJobParams object
// with the default values initialized.
func NewEnableJobParams() *EnableJobParams {
var ()
return &EnableJobParams{
timeout: cr.DefaultTimeout,
}
}
// NewEnableJobParamsWithTimeout creates a new EnableJobParams object
// with the default values initialized, and the ability to set a timeout on a request
func NewEnableJobParamsWithTimeout(timeout time.Duration) *EnableJobParams {
var ()
return &EnableJobParams{
timeout: timeout,
}
}
// NewEnableJobParamsWithContext creates a new EnableJobParams object
// with the default values initialized, and the ability to set a context for a request
func NewEnableJobParamsWithContext(ctx context.Context) *EnableJobParams {
var ()
return &EnableJobParams{
Context: ctx,
}
}
// NewEnableJobParamsWithHTTPClient creates a new EnableJobParams object
// with the default values initialized, and the ability to set a custom HTTPClient for a request
func NewEnableJobParamsWithHTTPClient(client *http.Client) *EnableJobParams {
var ()
return &EnableJobParams{
HTTPClient: client,
}
}
/*EnableJobParams contains all the parameters to send to the API endpoint
for the enable job operation typically these are written to a http.Request
*/
type EnableJobParams struct {
/*ID
The ID of the job to be enabled
*/
ID string
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithTimeout adds the timeout to the enable job params
func (o *EnableJobParams) WithTimeout(timeout time.Duration) *EnableJobParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the enable job params
func (o *EnableJobParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the enable job params
func (o *EnableJobParams) WithContext(ctx context.Context) *EnableJobParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the enable job params
func (o *EnableJobParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the enable job params
func (o *EnableJobParams) WithHTTPClient(client *http.Client) *EnableJobParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the enable job params
func (o *EnableJobParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithID adds the id to the enable job params
func (o *EnableJobParams) WithID(id string) *EnableJobParams {
o.SetID(id)
return o
}
// SetID adds the id to the enable job params
func (o *EnableJobParams) SetID(id string) {
o.ID = id
}
// WriteToRequest writes these params to a swagger request
func (o *EnableJobParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
// path param id
if err := r.SetPathParam("id", o.ID); err != nil {
return err
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@ -0,0 +1,124 @@
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Code generated by go-swagger; DO NOT EDIT.
package job_service
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"fmt"
"io"
"github.com/go-openapi/runtime"
strfmt "github.com/go-openapi/strfmt"
job_model "github.com/kubeflow/pipelines/backend/api/go_http_client/job_model"
)
// EnableJobReader is a Reader for the EnableJob structure.
type EnableJobReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *EnableJobReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewEnableJobOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
default:
result := NewEnableJobDefault(response.Code())
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
if response.Code()/100 == 2 {
return result, nil
}
return nil, result
}
}
// NewEnableJobOK creates a EnableJobOK with default headers values
func NewEnableJobOK() *EnableJobOK {
return &EnableJobOK{}
}
/*EnableJobOK handles this case with default header values.
A successful response.
*/
type EnableJobOK struct {
Payload interface{}
}
func (o *EnableJobOK) Error() string {
return fmt.Sprintf("[POST /apis/v1beta1/jobs/{id}/enable][%d] enableJobOK %+v", 200, o.Payload)
}
func (o *EnableJobOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// response payload
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewEnableJobDefault creates a EnableJobDefault with default headers values
func NewEnableJobDefault(code int) *EnableJobDefault {
return &EnableJobDefault{
_statusCode: code,
}
}
/*EnableJobDefault handles this case with default header values.
EnableJobDefault enable job default
*/
type EnableJobDefault struct {
_statusCode int
Payload *job_model.APIStatus
}
// Code gets the status code for the enable job default response
func (o *EnableJobDefault) Code() int {
return o._statusCode
}
func (o *EnableJobDefault) Error() string {
return fmt.Sprintf("[POST /apis/v1beta1/jobs/{id}/enable][%d] EnableJob default %+v", o._statusCode, o.Payload)
}
func (o *EnableJobDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(job_model.APIStatus)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}

View File

@ -0,0 +1,150 @@
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Code generated by go-swagger; DO NOT EDIT.
package job_service
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"net/http"
"time"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.com/go-openapi/runtime/client"
strfmt "github.com/go-openapi/strfmt"
)
// NewGetJobParams creates a new GetJobParams object
// with the default values initialized.
func NewGetJobParams() *GetJobParams {
var ()
return &GetJobParams{
timeout: cr.DefaultTimeout,
}
}
// NewGetJobParamsWithTimeout creates a new GetJobParams object
// with the default values initialized, and the ability to set a timeout on a request
func NewGetJobParamsWithTimeout(timeout time.Duration) *GetJobParams {
var ()
return &GetJobParams{
timeout: timeout,
}
}
// NewGetJobParamsWithContext creates a new GetJobParams object
// with the default values initialized, and the ability to set a context for a request
func NewGetJobParamsWithContext(ctx context.Context) *GetJobParams {
var ()
return &GetJobParams{
Context: ctx,
}
}
// NewGetJobParamsWithHTTPClient creates a new GetJobParams object
// with the default values initialized, and the ability to set a custom HTTPClient for a request
func NewGetJobParamsWithHTTPClient(client *http.Client) *GetJobParams {
var ()
return &GetJobParams{
HTTPClient: client,
}
}
/*GetJobParams contains all the parameters to send to the API endpoint
for the get job operation typically these are written to a http.Request
*/
type GetJobParams struct {
/*ID
The ID of the job to be retrieved
*/
ID string
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithTimeout adds the timeout to the get job params
func (o *GetJobParams) WithTimeout(timeout time.Duration) *GetJobParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the get job params
func (o *GetJobParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the get job params
func (o *GetJobParams) WithContext(ctx context.Context) *GetJobParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the get job params
func (o *GetJobParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the get job params
func (o *GetJobParams) WithHTTPClient(client *http.Client) *GetJobParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the get job params
func (o *GetJobParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithID adds the id to the get job params
func (o *GetJobParams) WithID(id string) *GetJobParams {
o.SetID(id)
return o
}
// SetID adds the id to the get job params
func (o *GetJobParams) SetID(id string) {
o.ID = id
}
// WriteToRequest writes these params to a swagger request
func (o *GetJobParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
// path param id
if err := r.SetPathParam("id", o.ID); err != nil {
return err
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@ -0,0 +1,126 @@
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Code generated by go-swagger; DO NOT EDIT.
package job_service
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"fmt"
"io"
"github.com/go-openapi/runtime"
strfmt "github.com/go-openapi/strfmt"
job_model "github.com/kubeflow/pipelines/backend/api/go_http_client/job_model"
)
// GetJobReader is a Reader for the GetJob structure.
type GetJobReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *GetJobReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewGetJobOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
default:
result := NewGetJobDefault(response.Code())
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
if response.Code()/100 == 2 {
return result, nil
}
return nil, result
}
}
// NewGetJobOK creates a GetJobOK with default headers values
func NewGetJobOK() *GetJobOK {
return &GetJobOK{}
}
/*GetJobOK handles this case with default header values.
A successful response.
*/
type GetJobOK struct {
Payload *job_model.APIJob
}
func (o *GetJobOK) Error() string {
return fmt.Sprintf("[GET /apis/v1beta1/jobs/{id}][%d] getJobOK %+v", 200, o.Payload)
}
func (o *GetJobOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(job_model.APIJob)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetJobDefault creates a GetJobDefault with default headers values
func NewGetJobDefault(code int) *GetJobDefault {
return &GetJobDefault{
_statusCode: code,
}
}
/*GetJobDefault handles this case with default header values.
GetJobDefault get job default
*/
type GetJobDefault struct {
_statusCode int
Payload *job_model.APIStatus
}
// Code gets the status code for the get job default response
func (o *GetJobDefault) Code() int {
return o._statusCode
}
func (o *GetJobDefault) Error() string {
return fmt.Sprintf("[GET /apis/v1beta1/jobs/{id}][%d] GetJob default %+v", o._statusCode, o.Payload)
}
func (o *GetJobDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(job_model.APIStatus)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}

View File

@ -0,0 +1,218 @@
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Code generated by go-swagger; DO NOT EDIT.
package job_service
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"github.com/go-openapi/runtime"
strfmt "github.com/go-openapi/strfmt"
)
// New creates a new job service API client.
func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client {
return &Client{transport: transport, formats: formats}
}
/*
Client for job service API
*/
type Client struct {
transport runtime.ClientTransport
formats strfmt.Registry
}
/*
CreateJob creates a new job
*/
func (a *Client) CreateJob(params *CreateJobParams, authInfo runtime.ClientAuthInfoWriter) (*CreateJobOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewCreateJobParams()
}
result, err := a.transport.Submit(&runtime.ClientOperation{
ID: "CreateJob",
Method: "POST",
PathPattern: "/apis/v1beta1/jobs",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &CreateJobReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
})
if err != nil {
return nil, err
}
return result.(*CreateJobOK), nil
}
/*
DeleteJob deletes a job
*/
func (a *Client) DeleteJob(params *DeleteJobParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteJobOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewDeleteJobParams()
}
result, err := a.transport.Submit(&runtime.ClientOperation{
ID: "DeleteJob",
Method: "DELETE",
PathPattern: "/apis/v1beta1/jobs/{id}",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &DeleteJobReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
})
if err != nil {
return nil, err
}
return result.(*DeleteJobOK), nil
}
/*
DisableJob stops a job and all its associated runs the job is not deleted
*/
func (a *Client) DisableJob(params *DisableJobParams, authInfo runtime.ClientAuthInfoWriter) (*DisableJobOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewDisableJobParams()
}
result, err := a.transport.Submit(&runtime.ClientOperation{
ID: "DisableJob",
Method: "POST",
PathPattern: "/apis/v1beta1/jobs/{id}/disable",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &DisableJobReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
})
if err != nil {
return nil, err
}
return result.(*DisableJobOK), nil
}
/*
EnableJob restarts a job that was previously stopped all runs associated with the job will continue
*/
func (a *Client) EnableJob(params *EnableJobParams, authInfo runtime.ClientAuthInfoWriter) (*EnableJobOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewEnableJobParams()
}
result, err := a.transport.Submit(&runtime.ClientOperation{
ID: "EnableJob",
Method: "POST",
PathPattern: "/apis/v1beta1/jobs/{id}/enable",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &EnableJobReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
})
if err != nil {
return nil, err
}
return result.(*EnableJobOK), nil
}
/*
GetJob finds a specific job by ID
*/
func (a *Client) GetJob(params *GetJobParams, authInfo runtime.ClientAuthInfoWriter) (*GetJobOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewGetJobParams()
}
result, err := a.transport.Submit(&runtime.ClientOperation{
ID: "GetJob",
Method: "GET",
PathPattern: "/apis/v1beta1/jobs/{id}",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &GetJobReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
})
if err != nil {
return nil, err
}
return result.(*GetJobOK), nil
}
/*
ListJobs finds all jobs
*/
func (a *Client) ListJobs(params *ListJobsParams, authInfo runtime.ClientAuthInfoWriter) (*ListJobsOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewListJobsParams()
}
result, err := a.transport.Submit(&runtime.ClientOperation{
ID: "ListJobs",
Method: "GET",
PathPattern: "/apis/v1beta1/jobs",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &ListJobsReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
})
if err != nil {
return nil, err
}
return result.(*ListJobsOK), nil
}
// SetTransport changes the transport on the client
func (a *Client) SetTransport(transport runtime.ClientTransport) {
a.transport = transport
}

View File

@ -0,0 +1,331 @@
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Code generated by go-swagger; DO NOT EDIT.
package job_service
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"net/http"
"time"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.com/go-openapi/runtime/client"
"github.com/go-openapi/swag"
strfmt "github.com/go-openapi/strfmt"
)
// NewListJobsParams creates a new ListJobsParams object
// with the default values initialized.
func NewListJobsParams() *ListJobsParams {
var (
resourceReferenceKeyTypeDefault = string("UNKNOWN_RESOURCE_TYPE")
)
return &ListJobsParams{
ResourceReferenceKeyType: &resourceReferenceKeyTypeDefault,
timeout: cr.DefaultTimeout,
}
}
// NewListJobsParamsWithTimeout creates a new ListJobsParams object
// with the default values initialized, and the ability to set a timeout on a request
func NewListJobsParamsWithTimeout(timeout time.Duration) *ListJobsParams {
var (
resourceReferenceKeyTypeDefault = string("UNKNOWN_RESOURCE_TYPE")
)
return &ListJobsParams{
ResourceReferenceKeyType: &resourceReferenceKeyTypeDefault,
timeout: timeout,
}
}
// NewListJobsParamsWithContext creates a new ListJobsParams object
// with the default values initialized, and the ability to set a context for a request
func NewListJobsParamsWithContext(ctx context.Context) *ListJobsParams {
var (
resourceReferenceKeyTypeDefault = string("UNKNOWN_RESOURCE_TYPE")
)
return &ListJobsParams{
ResourceReferenceKeyType: &resourceReferenceKeyTypeDefault,
Context: ctx,
}
}
// NewListJobsParamsWithHTTPClient creates a new ListJobsParams object
// with the default values initialized, and the ability to set a custom HTTPClient for a request
func NewListJobsParamsWithHTTPClient(client *http.Client) *ListJobsParams {
var (
resourceReferenceKeyTypeDefault = string("UNKNOWN_RESOURCE_TYPE")
)
return &ListJobsParams{
ResourceReferenceKeyType: &resourceReferenceKeyTypeDefault,
HTTPClient: client,
}
}
/*ListJobsParams contains all the parameters to send to the API endpoint
for the list jobs operation typically these are written to a http.Request
*/
type ListJobsParams struct {
/*Filter
A url-encoded, JSON-serialized Filter protocol buffer (see
[filter.proto](https://github.com/kubeflow/pipelines/
blob/master/backend/api/filter.proto)).
*/
Filter *string
/*PageSize*/
PageSize *int32
/*PageToken*/
PageToken *string
/*ResourceReferenceKeyID
The ID of the resource that referred to.
*/
ResourceReferenceKeyID *string
/*ResourceReferenceKeyType
The type of the resource that referred to.
*/
ResourceReferenceKeyType *string
/*SortBy
Can be format of "field_name", "field_name asc" or "field_name des".
Ascending by default.
*/
SortBy *string
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithTimeout adds the timeout to the list jobs params
func (o *ListJobsParams) WithTimeout(timeout time.Duration) *ListJobsParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the list jobs params
func (o *ListJobsParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the list jobs params
func (o *ListJobsParams) WithContext(ctx context.Context) *ListJobsParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the list jobs params
func (o *ListJobsParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the list jobs params
func (o *ListJobsParams) WithHTTPClient(client *http.Client) *ListJobsParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the list jobs params
func (o *ListJobsParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithFilter adds the filter to the list jobs params
func (o *ListJobsParams) WithFilter(filter *string) *ListJobsParams {
o.SetFilter(filter)
return o
}
// SetFilter adds the filter to the list jobs params
func (o *ListJobsParams) SetFilter(filter *string) {
o.Filter = filter
}
// WithPageSize adds the pageSize to the list jobs params
func (o *ListJobsParams) WithPageSize(pageSize *int32) *ListJobsParams {
o.SetPageSize(pageSize)
return o
}
// SetPageSize adds the pageSize to the list jobs params
func (o *ListJobsParams) SetPageSize(pageSize *int32) {
o.PageSize = pageSize
}
// WithPageToken adds the pageToken to the list jobs params
func (o *ListJobsParams) WithPageToken(pageToken *string) *ListJobsParams {
o.SetPageToken(pageToken)
return o
}
// SetPageToken adds the pageToken to the list jobs params
func (o *ListJobsParams) SetPageToken(pageToken *string) {
o.PageToken = pageToken
}
// WithResourceReferenceKeyID adds the resourceReferenceKeyID to the list jobs params
func (o *ListJobsParams) WithResourceReferenceKeyID(resourceReferenceKeyID *string) *ListJobsParams {
o.SetResourceReferenceKeyID(resourceReferenceKeyID)
return o
}
// SetResourceReferenceKeyID adds the resourceReferenceKeyId to the list jobs params
func (o *ListJobsParams) SetResourceReferenceKeyID(resourceReferenceKeyID *string) {
o.ResourceReferenceKeyID = resourceReferenceKeyID
}
// WithResourceReferenceKeyType adds the resourceReferenceKeyType to the list jobs params
func (o *ListJobsParams) WithResourceReferenceKeyType(resourceReferenceKeyType *string) *ListJobsParams {
o.SetResourceReferenceKeyType(resourceReferenceKeyType)
return o
}
// SetResourceReferenceKeyType adds the resourceReferenceKeyType to the list jobs params
func (o *ListJobsParams) SetResourceReferenceKeyType(resourceReferenceKeyType *string) {
o.ResourceReferenceKeyType = resourceReferenceKeyType
}
// WithSortBy adds the sortBy to the list jobs params
func (o *ListJobsParams) WithSortBy(sortBy *string) *ListJobsParams {
o.SetSortBy(sortBy)
return o
}
// SetSortBy adds the sortBy to the list jobs params
func (o *ListJobsParams) SetSortBy(sortBy *string) {
o.SortBy = sortBy
}
// WriteToRequest writes these params to a swagger request
func (o *ListJobsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if o.Filter != nil {
// query param filter
var qrFilter string
if o.Filter != nil {
qrFilter = *o.Filter
}
qFilter := qrFilter
if qFilter != "" {
if err := r.SetQueryParam("filter", qFilter); err != nil {
return err
}
}
}
if o.PageSize != nil {
// query param page_size
var qrPageSize int32
if o.PageSize != nil {
qrPageSize = *o.PageSize
}
qPageSize := swag.FormatInt32(qrPageSize)
if qPageSize != "" {
if err := r.SetQueryParam("page_size", qPageSize); err != nil {
return err
}
}
}
if o.PageToken != nil {
// query param page_token
var qrPageToken string
if o.PageToken != nil {
qrPageToken = *o.PageToken
}
qPageToken := qrPageToken
if qPageToken != "" {
if err := r.SetQueryParam("page_token", qPageToken); err != nil {
return err
}
}
}
if o.ResourceReferenceKeyID != nil {
// query param resource_reference_key.id
var qrResourceReferenceKeyID string
if o.ResourceReferenceKeyID != nil {
qrResourceReferenceKeyID = *o.ResourceReferenceKeyID
}
qResourceReferenceKeyID := qrResourceReferenceKeyID
if qResourceReferenceKeyID != "" {
if err := r.SetQueryParam("resource_reference_key.id", qResourceReferenceKeyID); err != nil {
return err
}
}
}
if o.ResourceReferenceKeyType != nil {
// query param resource_reference_key.type
var qrResourceReferenceKeyType string
if o.ResourceReferenceKeyType != nil {
qrResourceReferenceKeyType = *o.ResourceReferenceKeyType
}
qResourceReferenceKeyType := qrResourceReferenceKeyType
if qResourceReferenceKeyType != "" {
if err := r.SetQueryParam("resource_reference_key.type", qResourceReferenceKeyType); err != nil {
return err
}
}
}
if o.SortBy != nil {
// query param sort_by
var qrSortBy string
if o.SortBy != nil {
qrSortBy = *o.SortBy
}
qSortBy := qrSortBy
if qSortBy != "" {
if err := r.SetQueryParam("sort_by", qSortBy); err != nil {
return err
}
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@ -0,0 +1,126 @@
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Code generated by go-swagger; DO NOT EDIT.
package job_service
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"fmt"
"io"
"github.com/go-openapi/runtime"
strfmt "github.com/go-openapi/strfmt"
job_model "github.com/kubeflow/pipelines/backend/api/go_http_client/job_model"
)
// ListJobsReader is a Reader for the ListJobs structure.
type ListJobsReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *ListJobsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewListJobsOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
default:
result := NewListJobsDefault(response.Code())
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
if response.Code()/100 == 2 {
return result, nil
}
return nil, result
}
}
// NewListJobsOK creates a ListJobsOK with default headers values
func NewListJobsOK() *ListJobsOK {
return &ListJobsOK{}
}
/*ListJobsOK handles this case with default header values.
A successful response.
*/
type ListJobsOK struct {
Payload *job_model.APIListJobsResponse
}
func (o *ListJobsOK) Error() string {
return fmt.Sprintf("[GET /apis/v1beta1/jobs][%d] listJobsOK %+v", 200, o.Payload)
}
func (o *ListJobsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(job_model.APIListJobsResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewListJobsDefault creates a ListJobsDefault with default headers values
func NewListJobsDefault(code int) *ListJobsDefault {
return &ListJobsDefault{
_statusCode: code,
}
}
/*ListJobsDefault handles this case with default header values.
ListJobsDefault list jobs default
*/
type ListJobsDefault struct {
_statusCode int
Payload *job_model.APIStatus
}
// Code gets the status code for the list jobs default response
func (o *ListJobsDefault) Code() int {
return o._statusCode
}
func (o *ListJobsDefault) Error() string {
return fmt.Sprintf("[GET /apis/v1beta1/jobs][%d] ListJobs default %+v", o._statusCode, o.Payload)
}
func (o *ListJobsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(job_model.APIStatus)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}

View File

@ -0,0 +1,29 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library")
go_library(
name = "go_default_library",
srcs = [
"api_cron_schedule.go",
"api_job.go",
"api_list_jobs_response.go",
"api_parameter.go",
"api_periodic_schedule.go",
"api_pipeline_spec.go",
"api_relationship.go",
"api_resource_key.go",
"api_resource_reference.go",
"api_resource_type.go",
"api_status.go",
"api_trigger.go",
"job_mode.go",
"protobuf_any.go",
],
importpath = "github.com/kubeflow/pipelines/backend/api/go_http_client/job_model",
visibility = ["//visibility:public"],
deps = [
"@com_github_go_openapi_errors//:go_default_library",
"@com_github_go_openapi_strfmt//:go_default_library",
"@com_github_go_openapi_swag//:go_default_library",
"@com_github_go_openapi_validate//:go_default_library",
],
)

View File

@ -0,0 +1,107 @@
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Code generated by go-swagger; DO NOT EDIT.
package job_model
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
strfmt "github.com/go-openapi/strfmt"
"github.com/go-openapi/errors"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
)
// APICronSchedule CronSchedule allow scheduling the job with unix-like cron
// swagger:model apiCronSchedule
type APICronSchedule struct {
// The cron string. For details how to compose a cron, visit
// ttps://en.wikipedia.org/wiki/Cron
Cron string `json:"cron,omitempty"`
// The end time of the cron job
// Format: date-time
EndTime strfmt.DateTime `json:"end_time,omitempty"`
// The start time of the cron job
// Format: date-time
StartTime strfmt.DateTime `json:"start_time,omitempty"`
}
// Validate validates this api cron schedule
func (m *APICronSchedule) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateEndTime(formats); err != nil {
res = append(res, err)
}
if err := m.validateStartTime(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APICronSchedule) validateEndTime(formats strfmt.Registry) error {
if swag.IsZero(m.EndTime) { // not required
return nil
}
if err := validate.FormatOf("end_time", "body", "date-time", m.EndTime.String(), formats); err != nil {
return err
}
return nil
}
func (m *APICronSchedule) validateStartTime(formats strfmt.Registry) error {
if swag.IsZero(m.StartTime) { // not required
return nil
}
if err := validate.FormatOf("start_time", "body", "date-time", m.StartTime.String(), formats); err != nil {
return err
}
return nil
}
// MarshalBinary interface implementation
func (m *APICronSchedule) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APICronSchedule) UnmarshalBinary(b []byte) error {
var res APICronSchedule
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@ -0,0 +1,246 @@
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Code generated by go-swagger; DO NOT EDIT.
package job_model
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"strconv"
strfmt "github.com/go-openapi/strfmt"
"github.com/go-openapi/errors"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
)
// APIJob api job
// swagger:model apiJob
type APIJob struct {
// Output. The time this job is created.
// Format: date-time
CreatedAt strfmt.DateTime `json:"created_at,omitempty"`
// Optional input field. Describing the purpose of the job
Description string `json:"description,omitempty"`
// Input. Whether the job is enabled or not.
Enabled bool `json:"enabled,omitempty"`
// In case any error happens retrieving a job field, only job ID
// and the error message is returned. Client has the flexibility of choosing
// how to handle error. This is especially useful during listing call.
Error string `json:"error,omitempty"`
// Output. Unique run ID. Generated by API server.
ID string `json:"id,omitempty"`
// Required input field.
// Specify how many runs can be executed concurrently. Rage [1-10]
MaxConcurrency int64 `json:"max_concurrency,omitempty,string"`
// mode
Mode JobMode `json:"mode,omitempty"`
// Required input field. Job name provided by user. Not unique.
Name string `json:"name,omitempty"`
// Optional input field. Whether the job should catch up if behind schedule.
// If true, the job will only schedule the latest interval if behind schedule.
// If false, the job will catch up on each past interval.
NoCatchup bool `json:"no_catchup,omitempty"`
// Required input field.
// Describing what the pipeline manifest and parameters to use
// for the scheduled job.
PipelineSpec *APIPipelineSpec `json:"pipeline_spec,omitempty"`
// Optional input field. Specify which resource this job belongs to.
ResourceReferences []*APIResourceReference `json:"resource_references"`
// Optional input field. Specify which Kubernetes service account this job uses.
ServiceAccount string `json:"service_account,omitempty"`
// Output. The status of the job.
// One of [Enable, Disable, Error]
Status string `json:"status,omitempty"`
// Required input field.
// Specify how a run is triggered. Support cron mode or periodic mode.
Trigger *APITrigger `json:"trigger,omitempty"`
// Output. The last time this job is updated.
// Format: date-time
UpdatedAt strfmt.DateTime `json:"updated_at,omitempty"`
}
// Validate validates this api job
func (m *APIJob) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateCreatedAt(formats); err != nil {
res = append(res, err)
}
if err := m.validateMode(formats); err != nil {
res = append(res, err)
}
if err := m.validatePipelineSpec(formats); err != nil {
res = append(res, err)
}
if err := m.validateResourceReferences(formats); err != nil {
res = append(res, err)
}
if err := m.validateTrigger(formats); err != nil {
res = append(res, err)
}
if err := m.validateUpdatedAt(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIJob) validateCreatedAt(formats strfmt.Registry) error {
if swag.IsZero(m.CreatedAt) { // not required
return nil
}
if err := validate.FormatOf("created_at", "body", "date-time", m.CreatedAt.String(), formats); err != nil {
return err
}
return nil
}
func (m *APIJob) validateMode(formats strfmt.Registry) error {
if swag.IsZero(m.Mode) { // not required
return nil
}
if err := m.Mode.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("mode")
}
return err
}
return nil
}
func (m *APIJob) validatePipelineSpec(formats strfmt.Registry) error {
if swag.IsZero(m.PipelineSpec) { // not required
return nil
}
if m.PipelineSpec != nil {
if err := m.PipelineSpec.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("pipeline_spec")
}
return err
}
}
return nil
}
func (m *APIJob) validateResourceReferences(formats strfmt.Registry) error {
if swag.IsZero(m.ResourceReferences) { // not required
return nil
}
for i := 0; i < len(m.ResourceReferences); i++ {
if swag.IsZero(m.ResourceReferences[i]) { // not required
continue
}
if m.ResourceReferences[i] != nil {
if err := m.ResourceReferences[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("resource_references" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *APIJob) validateTrigger(formats strfmt.Registry) error {
if swag.IsZero(m.Trigger) { // not required
return nil
}
if m.Trigger != nil {
if err := m.Trigger.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("trigger")
}
return err
}
}
return nil
}
func (m *APIJob) validateUpdatedAt(formats strfmt.Registry) error {
if swag.IsZero(m.UpdatedAt) { // not required
return nil
}
if err := validate.FormatOf("updated_at", "body", "date-time", m.UpdatedAt.String(), formats); err != nil {
return err
}
return nil
}
// MarshalBinary interface implementation
func (m *APIJob) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APIJob) UnmarshalBinary(b []byte) error {
var res APIJob
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@ -0,0 +1,100 @@
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Code generated by go-swagger; DO NOT EDIT.
package job_model
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"strconv"
strfmt "github.com/go-openapi/strfmt"
"github.com/go-openapi/errors"
"github.com/go-openapi/swag"
)
// APIListJobsResponse api list jobs response
// swagger:model apiListJobsResponse
type APIListJobsResponse struct {
// A list of jobs returned.
Jobs []*APIJob `json:"jobs"`
// next page token
NextPageToken string `json:"next_page_token,omitempty"`
// total size
TotalSize int32 `json:"total_size,omitempty"`
}
// Validate validates this api list jobs response
func (m *APIListJobsResponse) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateJobs(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIListJobsResponse) validateJobs(formats strfmt.Registry) error {
if swag.IsZero(m.Jobs) { // not required
return nil
}
for i := 0; i < len(m.Jobs); i++ {
if swag.IsZero(m.Jobs[i]) { // not required
continue
}
if m.Jobs[i] != nil {
if err := m.Jobs[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("jobs" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// MarshalBinary interface implementation
func (m *APIListJobsResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APIListJobsResponse) UnmarshalBinary(b []byte) error {
var res APIListJobsResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

Some files were not shown because too many files have changed in this diff Show More