diff --git a/frontend/.eslintrc.yaml b/frontend/.eslintrc.yaml index 7a6f9fd77b..355ced4ed1 100644 --- a/frontend/.eslintrc.yaml +++ b/frontend/.eslintrc.yaml @@ -3,6 +3,7 @@ extends: ignorePatterns: - node_modules/ - src/apis # these are generated api clients + - src/apisv2beta1 # these are generated v2 api clients - '*.test.ts' - '*.test.tsx' - src/generated # proto generated definition diff --git a/frontend/README.md b/frontend/README.md index c04326375c..c1595cae29 100644 --- a/frontend/README.md +++ b/frontend/README.md @@ -144,9 +144,13 @@ If you made any changes to protos (see backend/README), you'll need to regenerate the Typescript client library from swagger. We use swagger-codegen-cli@2.4.7, which you can get [here](https://repo1.maven.org/maven2/io/swagger/swagger-codegen-cli/2.4.7/). -Make sure the jar file is somewhere on your path with the name -swagger-codegen-cli.jar, then run `npm run apis`. - +Make sure to add the jar file to $PATH with the name swagger-codegen-cli.jar, then run `npm run apis` for +v1 api or `npm run apis:v2beta1` for v2 api. +``` +// add jar file to $PATH +JAR_PATH= +export PATH="$JAR_PATH:$PATH" +``` After code generation, you should run `npm run format` to format the output and avoid creating a large PR. ## MLMD components diff --git a/frontend/package.json b/frontend/package.json index 8564119d22..703f26a99f 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -54,6 +54,14 @@ "apis:filter": "java -jar swagger-codegen-cli.jar generate -i ../backend/api/swagger/filter.swagger.json -l typescript-fetch -o ./src/apis/filter -c ./swagger-config.json", "apis:visualization": "java -jar swagger-codegen-cli.jar generate -i ../backend/api/swagger/visualization.swagger.json -l typescript-fetch -o ./src/apis/visualization -c ./swagger-config.json", "apis:auth": "java -jar swagger-codegen-cli.jar generate -i ../backend/api/swagger/auth.swagger.json -l typescript-fetch -o ./server/src/generated/apis/auth -c ./swagger-config.json", + "apis:v2beta1": "npm run apis:v2beta1:experiment && npm run apis:v2beta1:recurringrun && npm run apis:v2beta1:pipeline && npm run apis:v2beta1:run && npm run apis:v2beta1:filter && npm run apis:v2beta1:visualization && npm run apis:v2beta1:auth", + "apis:v2beta1:experiment": "java -jar swagger-codegen-cli.jar generate -i ../backend/api/v2beta1/swagger/experiment.swagger.json -l typescript-fetch -o ./src/apisv2beta1/experiment -c ./swagger-config.json", + "apis:v2beta1:recurringrun": "java -jar swagger-codegen-cli.jar generate -i ../backend/api/v2beta1/swagger/recurring_run.swagger.json -l typescript-fetch -o ./src/apisv2beta1/recurringrun -c ./swagger-config.json", + "apis:v2beta1:pipeline": "java -jar swagger-codegen-cli.jar generate -i ../backend/api/v2beta1/swagger/pipeline.swagger.json -l typescript-fetch -o ./src/apisv2beta1/pipeline -c ./swagger-config.json", + "apis:v2beta1:run": "java -jar swagger-codegen-cli.jar generate -i ../backend/api/v2beta1/swagger/run.swagger.json -l typescript-fetch -o ./src/apisv2beta1/run -c ./swagger-config.json", + "apis:v2beta1:filter": "java -jar swagger-codegen-cli.jar generate -i ../backend/api/v2beta1/swagger/filter.swagger.json -l typescript-fetch -o ./src/apisv2beta1/filter -c ./swagger-config.json", + "apis:v2beta1:visualization": "java -jar swagger-codegen-cli.jar generate -i ../backend/api/v2beta1/swagger/visualization.swagger.json -l typescript-fetch -o ./src/apisv2beta1/visualization -c ./swagger-config.json", + "apis:v2beta1:auth": "java -jar swagger-codegen-cli.jar generate -i ../backend/api/v2beta1/swagger/auth.swagger.json -l typescript-fetch -o ./server/src/generated/apisv2beta1/auth -c ./swagger-config.json", "build:tailwind": "npx tailwindcss build -i src/tailwind.css -o src/build/tailwind.output.css", "prestart": "npm run build:tailwind", "prebuild": "npm run build:tailwind", diff --git a/frontend/server/src/generated/apisv2beta1/auth/.gitignore b/frontend/server/src/generated/apisv2beta1/auth/.gitignore new file mode 100644 index 0000000000..35e2fb2b02 --- /dev/null +++ b/frontend/server/src/generated/apisv2beta1/auth/.gitignore @@ -0,0 +1,3 @@ +wwwroot/*.js +node_modules +typings diff --git a/frontend/server/src/generated/apisv2beta1/auth/.swagger-codegen-ignore b/frontend/server/src/generated/apisv2beta1/auth/.swagger-codegen-ignore new file mode 100644 index 0000000000..c5fa491b4c --- /dev/null +++ b/frontend/server/src/generated/apisv2beta1/auth/.swagger-codegen-ignore @@ -0,0 +1,23 @@ +# Swagger Codegen Ignore +# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/frontend/server/src/generated/apisv2beta1/auth/.swagger-codegen/VERSION b/frontend/server/src/generated/apisv2beta1/auth/.swagger-codegen/VERSION new file mode 100644 index 0000000000..48a6b508dc --- /dev/null +++ b/frontend/server/src/generated/apisv2beta1/auth/.swagger-codegen/VERSION @@ -0,0 +1 @@ +2.4.7 \ No newline at end of file diff --git a/frontend/server/src/generated/apisv2beta1/auth/api.ts b/frontend/server/src/generated/apisv2beta1/auth/api.ts new file mode 100644 index 0000000000..76967f8fed --- /dev/null +++ b/frontend/server/src/generated/apisv2beta1/auth/api.ts @@ -0,0 +1,319 @@ +/// +// tslint:disable +/** + * backend/api/v2beta1/auth.proto + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * OpenAPI spec version: version not set + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +import * as url from 'url'; +import * as portableFetch from 'portable-fetch'; +import { Configuration } from './configuration'; + +const BASE_PATH = 'http://localhost'.replace(/\/+$/, ''); + +/** + * + * @export + */ +export const COLLECTION_FORMATS = { + csv: ',', + ssv: ' ', + tsv: '\t', + pipes: '|', +}; + +/** + * + * @export + * @interface FetchAPI + */ +export interface FetchAPI { + (url: string, init?: any): Promise; +} + +/** + * + * @export + * @interface FetchArgs + */ +export interface FetchArgs { + url: string; + options: any; +} + +/** + * + * @export + * @class BaseAPI + */ +export class BaseAPI { + protected configuration: Configuration; + + constructor( + configuration?: Configuration, + protected basePath: string = BASE_PATH, + protected fetch: FetchAPI = portableFetch, + ) { + if (configuration) { + this.configuration = configuration; + this.basePath = configuration.basePath || this.basePath; + } + } +} + +/** + * + * @export + * @class RequiredError + * @extends {Error} + */ +export class RequiredError extends Error { + name: 'RequiredError'; + constructor(public field: string, msg?: string) { + super(msg); + } +} + +/** + * Type of resources in pipelines system. + * @export + * @enum {string} + */ +export enum AuthorizeRequestResources { + UNASSIGNEDRESOURCES = 'UNASSIGNED_RESOURCES', + VIEWERS = 'VIEWERS', +} + +/** + * Type of verbs that act on the resources. + * @export + * @enum {string} + */ +export enum AuthorizeRequestVerb { + UNASSIGNEDVERB = 'UNASSIGNED_VERB', + CREATE = 'CREATE', + GET = 'GET', + DELETE = 'DELETE', +} + +/** + * The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors). + * @export + * @interface GooglerpcStatus + */ +export interface GooglerpcStatus { + /** + * The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. + * @type {number} + * @memberof GooglerpcStatus + */ + code?: number; + /** + * A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. + * @type {string} + * @memberof GooglerpcStatus + */ + message?: string; + /** + * A list of messages that carry the error details. There is a common set of message types for APIs to use. + * @type {Array} + * @memberof GooglerpcStatus + */ + details?: Array; +} + +/** + * `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 := anypb.New(foo) if err != nil { ... } ... foo := &pb.Foo{} if err := any.UnmarshalTo(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\": , \"lastName\": } 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\" } + * @export + * @interface ProtobufAny + */ +export interface ProtobufAny { + /** + * A URL/resource name that uniquely identifies the type of the serialized protocol buffer message. This string must contain at least one \"/\" character. 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. + * @type {string} + * @memberof ProtobufAny + */ + type_url?: string; + /** + * Must be a valid serialized protocol buffer of the above specified type. + * @type {string} + * @memberof ProtobufAny + */ + value?: string; +} + +/** + * AuthServiceApi - fetch parameter creator + * @export + */ +export const AuthServiceApiFetchParamCreator = function(configuration?: Configuration) { + return { + /** + * + * @param {string} [namespace] + * @param {'UNASSIGNED_RESOURCES' | 'VIEWERS'} [resources] + * @param {'UNASSIGNED_VERB' | 'CREATE' | 'GET' | 'DELETE'} [verb] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + authorize( + namespace?: string, + resources?: 'UNASSIGNED_RESOURCES' | 'VIEWERS', + verb?: 'UNASSIGNED_VERB' | 'CREATE' | 'GET' | 'DELETE', + options: any = {}, + ): FetchArgs { + const localVarPath = `/apis/v2beta1/auth`; + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'GET' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = + typeof configuration.apiKey === 'function' + ? configuration.apiKey('authorization') + : configuration.apiKey; + localVarHeaderParameter['authorization'] = localVarApiKeyValue; + } + + if (namespace !== undefined) { + localVarQueryParameter['namespace'] = namespace; + } + + if (resources !== undefined) { + localVarQueryParameter['resources'] = resources; + } + + if (verb !== undefined) { + localVarQueryParameter['verb'] = verb; + } + + localVarUrlObj.query = Object.assign( + {}, + localVarUrlObj.query, + localVarQueryParameter, + options.query, + ); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + }; +}; + +/** + * AuthServiceApi - functional programming interface + * @export + */ +export const AuthServiceApiFp = function(configuration?: Configuration) { + return { + /** + * + * @param {string} [namespace] + * @param {'UNASSIGNED_RESOURCES' | 'VIEWERS'} [resources] + * @param {'UNASSIGNED_VERB' | 'CREATE' | 'GET' | 'DELETE'} [verb] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + authorize( + namespace?: string, + resources?: 'UNASSIGNED_RESOURCES' | 'VIEWERS', + verb?: 'UNASSIGNED_VERB' | 'CREATE' | 'GET' | 'DELETE', + options?: any, + ): (fetch?: FetchAPI, basePath?: string) => Promise { + const localVarFetchArgs = AuthServiceApiFetchParamCreator(configuration).authorize( + namespace, + resources, + verb, + options, + ); + return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(response => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }; + }, + }; +}; + +/** + * AuthServiceApi - factory interface + * @export + */ +export const AuthServiceApiFactory = function( + configuration?: Configuration, + fetch?: FetchAPI, + basePath?: string, +) { + return { + /** + * + * @param {string} [namespace] + * @param {'UNASSIGNED_RESOURCES' | 'VIEWERS'} [resources] + * @param {'UNASSIGNED_VERB' | 'CREATE' | 'GET' | 'DELETE'} [verb] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + authorize( + namespace?: string, + resources?: 'UNASSIGNED_RESOURCES' | 'VIEWERS', + verb?: 'UNASSIGNED_VERB' | 'CREATE' | 'GET' | 'DELETE', + options?: any, + ) { + return AuthServiceApiFp(configuration).authorize( + namespace, + resources, + verb, + options, + )(fetch, basePath); + }, + }; +}; + +/** + * AuthServiceApi - object-oriented interface + * @export + * @class AuthServiceApi + * @extends {BaseAPI} + */ +export class AuthServiceApi extends BaseAPI { + /** + * + * @param {string} [namespace] + * @param {'UNASSIGNED_RESOURCES' | 'VIEWERS'} [resources] + * @param {'UNASSIGNED_VERB' | 'CREATE' | 'GET' | 'DELETE'} [verb] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof AuthServiceApi + */ + public authorize( + namespace?: string, + resources?: 'UNASSIGNED_RESOURCES' | 'VIEWERS', + verb?: 'UNASSIGNED_VERB' | 'CREATE' | 'GET' | 'DELETE', + options?: any, + ) { + return AuthServiceApiFp(this.configuration).authorize( + namespace, + resources, + verb, + options, + )(this.fetch, this.basePath); + } +} diff --git a/frontend/server/src/generated/apisv2beta1/auth/configuration.ts b/frontend/server/src/generated/apisv2beta1/auth/configuration.ts new file mode 100644 index 0000000000..c4983ab9e1 --- /dev/null +++ b/frontend/server/src/generated/apisv2beta1/auth/configuration.ts @@ -0,0 +1,65 @@ +// tslint:disable +/** + * backend/api/v2beta1/auth.proto + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * OpenAPI spec version: version not set + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +export interface ConfigurationParameters { + apiKey?: string | ((name: string) => string); + username?: string; + password?: string; + accessToken?: string | ((name: string, scopes?: string[]) => string); + basePath?: string; +} + +export class Configuration { + /** + * parameter for apiKey security + * @param name security name + * @memberof Configuration + */ + apiKey?: string | ((name: string) => string); + /** + * parameter for basic security + * + * @type {string} + * @memberof Configuration + */ + username?: string; + /** + * parameter for basic security + * + * @type {string} + * @memberof Configuration + */ + password?: string; + /** + * parameter for oauth2 security + * @param name security name + * @param scopes oauth2 scope + * @memberof Configuration + */ + accessToken?: string | ((name: string, scopes?: string[]) => string); + /** + * override base path + * + * @type {string} + * @memberof Configuration + */ + basePath?: string; + + constructor(param: ConfigurationParameters = {}) { + this.apiKey = param.apiKey; + this.username = param.username; + this.password = param.password; + this.accessToken = param.accessToken; + this.basePath = param.basePath; + } +} diff --git a/frontend/server/src/generated/apisv2beta1/auth/custom.d.ts b/frontend/server/src/generated/apisv2beta1/auth/custom.d.ts new file mode 100644 index 0000000000..4c611cc321 --- /dev/null +++ b/frontend/server/src/generated/apisv2beta1/auth/custom.d.ts @@ -0,0 +1,2 @@ +declare module 'portable-fetch'; +declare module 'url'; diff --git a/frontend/server/src/generated/apisv2beta1/auth/git_push.sh b/frontend/server/src/generated/apisv2beta1/auth/git_push.sh new file mode 100644 index 0000000000..a1ff4c9bcb --- /dev/null +++ b/frontend/server/src/generated/apisv2beta1/auth/git_push.sh @@ -0,0 +1,51 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=`git remote` +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/frontend/server/src/generated/apisv2beta1/auth/index.ts b/frontend/server/src/generated/apisv2beta1/auth/index.ts new file mode 100644 index 0000000000..df7b98fe96 --- /dev/null +++ b/frontend/server/src/generated/apisv2beta1/auth/index.ts @@ -0,0 +1,15 @@ +// tslint:disable +/** + * backend/api/v2beta1/auth.proto + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * OpenAPI spec version: version not set + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +export * from './api'; +export * from './configuration'; diff --git a/frontend/src/apisv2beta1/experiment/.gitignore b/frontend/src/apisv2beta1/experiment/.gitignore new file mode 100644 index 0000000000..35e2fb2b02 --- /dev/null +++ b/frontend/src/apisv2beta1/experiment/.gitignore @@ -0,0 +1,3 @@ +wwwroot/*.js +node_modules +typings diff --git a/frontend/src/apisv2beta1/experiment/.swagger-codegen-ignore b/frontend/src/apisv2beta1/experiment/.swagger-codegen-ignore new file mode 100644 index 0000000000..c5fa491b4c --- /dev/null +++ b/frontend/src/apisv2beta1/experiment/.swagger-codegen-ignore @@ -0,0 +1,23 @@ +# Swagger Codegen Ignore +# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/frontend/src/apisv2beta1/experiment/.swagger-codegen/VERSION b/frontend/src/apisv2beta1/experiment/.swagger-codegen/VERSION new file mode 100644 index 0000000000..48a6b508dc --- /dev/null +++ b/frontend/src/apisv2beta1/experiment/.swagger-codegen/VERSION @@ -0,0 +1 @@ +2.4.7 \ No newline at end of file diff --git a/frontend/src/apisv2beta1/experiment/api.ts b/frontend/src/apisv2beta1/experiment/api.ts new file mode 100644 index 0000000000..be41f60e6b --- /dev/null +++ b/frontend/src/apisv2beta1/experiment/api.ts @@ -0,0 +1,808 @@ +/// +// tslint:disable +/** + * backend/api/v2beta1/experiment.proto + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * OpenAPI spec version: version not set + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +import * as url from 'url'; +import * as portableFetch from 'portable-fetch'; +import { Configuration } from './configuration'; + +const BASE_PATH = 'http://localhost'.replace(/\/+$/, ''); + +/** + * + * @export + */ +export const COLLECTION_FORMATS = { + csv: ',', + ssv: ' ', + tsv: '\t', + pipes: '|', +}; + +/** + * + * @export + * @interface FetchAPI + */ +export interface FetchAPI { + (url: string, init?: any): Promise; +} + +/** + * + * @export + * @interface FetchArgs + */ +export interface FetchArgs { + url: string; + options: any; +} + +/** + * + * @export + * @class BaseAPI + */ +export class BaseAPI { + protected configuration: Configuration; + + constructor( + configuration?: Configuration, + protected basePath: string = BASE_PATH, + protected fetch: FetchAPI = portableFetch, + ) { + if (configuration) { + this.configuration = configuration; + this.basePath = configuration.basePath || this.basePath; + } + } +} + +/** + * + * @export + * @class RequiredError + * @extends {Error} + */ +export class RequiredError extends Error { + name: 'RequiredError'; + constructor(public field: string, msg?: string) { + super(msg); + } +} + +/** + * + * @export + * @interface V2beta1Experiment + */ +export interface V2beta1Experiment { + /** + * Output. Unique experiment ID. Generated by API server. + * @type {string} + * @memberof V2beta1Experiment + */ + experiment_id?: string; + /** + * Required input field. Unique experiment name provided by user. + * @type {string} + * @memberof V2beta1Experiment + */ + display_name?: string; + /** + * Optional input field. Describes the purpose of the experiment. + * @type {string} + * @memberof V2beta1Experiment + */ + description?: string; + /** + * Output. The time that the experiment was created. + * @type {Date} + * @memberof V2beta1Experiment + */ + created_at?: Date; + /** + * Optional input field. Specify the namespace this experiment belongs to. + * @type {string} + * @memberof V2beta1Experiment + */ + namespace?: string; + /** + * Output. Specifies whether this experiment is in archived or available state. + * @type {V2beta1ExperimentStorageState} + * @memberof V2beta1Experiment + */ + storage_state?: V2beta1ExperimentStorageState; +} + +/** + * Describes whether an entity is available or archived. - STORAGE_STATE_UNSPECIFIED: Default state. This state in not used - AVAILABLE: Entity is available. - ARCHIVED: Entity is archived. + * @export + * @enum {string} + */ +export enum V2beta1ExperimentStorageState { + STORAGESTATEUNSPECIFIED = 'STORAGE_STATE_UNSPECIFIED', + AVAILABLE = 'AVAILABLE', + ARCHIVED = 'ARCHIVED', +} + +/** + * + * @export + * @interface V2beta1ListExperimentsResponse + */ +export interface V2beta1ListExperimentsResponse { + /** + * A list of experiments returned. + * @type {Array} + * @memberof V2beta1ListExperimentsResponse + */ + experiments?: Array; + /** + * The number of experiments for the given query. + * @type {number} + * @memberof V2beta1ListExperimentsResponse + */ + total_size?: number; + /** + * The token to list the next page of experiments. + * @type {string} + * @memberof V2beta1ListExperimentsResponse + */ + next_page_token?: string; +} + +/** + * ExperimentServiceApi - fetch parameter creator + * @export + */ +export const ExperimentServiceApiFetchParamCreator = function(configuration?: Configuration) { + return { + /** + * + * @summary Archives an experiment and the experiment's runs and recurring runs. + * @param {string} experiment_id The ID of the experiment to be archived. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + archiveExperiment(experiment_id: string, options: any = {}): FetchArgs { + // verify required parameter 'experiment_id' is not null or undefined + if (experiment_id === null || experiment_id === undefined) { + throw new RequiredError( + 'experiment_id', + 'Required parameter experiment_id was null or undefined when calling archiveExperiment.', + ); + } + const localVarPath = `/apis/v2beta1/experiments/{experiment_id}:archive`.replace( + `{${'experiment_id'}}`, + encodeURIComponent(String(experiment_id)), + ); + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'POST' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + localVarUrlObj.query = Object.assign( + {}, + localVarUrlObj.query, + localVarQueryParameter, + options.query, + ); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Creates a new experiment. + * @param {V2beta1Experiment} body The experiment to be created. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createExperiment(body: V2beta1Experiment, options: any = {}): FetchArgs { + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError( + 'body', + 'Required parameter body was null or undefined when calling createExperiment.', + ); + } + const localVarPath = `/apis/v2beta1/experiments`; + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'POST' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarUrlObj.query = Object.assign( + {}, + localVarUrlObj.query, + localVarQueryParameter, + options.query, + ); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + const needsSerialization = + 'V2beta1Experiment' !== 'string' || + localVarRequestOptions.headers['Content-Type'] === 'application/json'; + localVarRequestOptions.body = needsSerialization ? JSON.stringify(body || {}) : body || ''; + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Deletes an experiment without deleting the experiment's runs and recurring runs. To avoid unexpected behaviors, delete an experiment's runs and recurring runs before deleting the experiment. + * @param {string} experiment_id The ID of the experiment to be deleted. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteExperiment(experiment_id: string, options: any = {}): FetchArgs { + // verify required parameter 'experiment_id' is not null or undefined + if (experiment_id === null || experiment_id === undefined) { + throw new RequiredError( + 'experiment_id', + 'Required parameter experiment_id was null or undefined when calling deleteExperiment.', + ); + } + const localVarPath = `/apis/v2beta1/experiments/{experiment_id}`.replace( + `{${'experiment_id'}}`, + encodeURIComponent(String(experiment_id)), + ); + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'DELETE' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + localVarUrlObj.query = Object.assign( + {}, + localVarUrlObj.query, + localVarQueryParameter, + options.query, + ); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Finds a specific experiment by ID. + * @param {string} experiment_id The ID of the experiment to be retrieved. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getExperiment(experiment_id: string, options: any = {}): FetchArgs { + // verify required parameter 'experiment_id' is not null or undefined + if (experiment_id === null || experiment_id === undefined) { + throw new RequiredError( + 'experiment_id', + 'Required parameter experiment_id was null or undefined when calling getExperiment.', + ); + } + const localVarPath = `/apis/v2beta1/experiments/{experiment_id}`.replace( + `{${'experiment_id'}}`, + encodeURIComponent(String(experiment_id)), + ); + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'GET' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + localVarUrlObj.query = Object.assign( + {}, + localVarUrlObj.query, + localVarQueryParameter, + options.query, + ); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Finds all experiments. Supports pagination, and sorting on certain fields. + * @param {string} [page_token] A page token to request the next page of results. The token is acquried from the nextPageToken field of the response from the previous ListExperiments call or can be omitted when fetching the first page. + * @param {number} [page_size] The number of experiments to be listed per page. If there are more experiments than this number, the response message will contain a nextPageToken field you can use to fetch the next page. + * @param {string} [sort_by] Can be format of \"field_name\", \"field_name asc\" or \"field_name desc\" Ascending by default. + * @param {string} [filter] A url-encoded, JSON-serialized Filter protocol buffer (see [filter.proto](https://github.com/kubeflow/pipelines/blob/master/backend/api/v2beta1/api/filter.proto)). + * @param {string} [namespace] Which namespace to filter the experiments on. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listExperiments( + page_token?: string, + page_size?: number, + sort_by?: string, + filter?: string, + namespace?: string, + options: any = {}, + ): FetchArgs { + const localVarPath = `/apis/v2beta1/experiments`; + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'GET' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + if (page_token !== undefined) { + localVarQueryParameter['page_token'] = page_token; + } + + if (page_size !== undefined) { + localVarQueryParameter['page_size'] = page_size; + } + + if (sort_by !== undefined) { + localVarQueryParameter['sort_by'] = sort_by; + } + + if (filter !== undefined) { + localVarQueryParameter['filter'] = filter; + } + + if (namespace !== undefined) { + localVarQueryParameter['namespace'] = namespace; + } + + localVarUrlObj.query = Object.assign( + {}, + localVarUrlObj.query, + localVarQueryParameter, + options.query, + ); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Restores an archived experiment. The experiment's archived runs and recurring runs will stay archived. + * @param {string} experiment_id The ID of the experiment to be restored. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + unarchiveExperiment(experiment_id: string, options: any = {}): FetchArgs { + // verify required parameter 'experiment_id' is not null or undefined + if (experiment_id === null || experiment_id === undefined) { + throw new RequiredError( + 'experiment_id', + 'Required parameter experiment_id was null or undefined when calling unarchiveExperiment.', + ); + } + const localVarPath = `/apis/v2beta1/experiments/{experiment_id}:unarchive`.replace( + `{${'experiment_id'}}`, + encodeURIComponent(String(experiment_id)), + ); + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'POST' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + localVarUrlObj.query = Object.assign( + {}, + localVarUrlObj.query, + localVarQueryParameter, + options.query, + ); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + }; +}; + +/** + * ExperimentServiceApi - functional programming interface + * @export + */ +export const ExperimentServiceApiFp = function(configuration?: Configuration) { + return { + /** + * + * @summary Archives an experiment and the experiment's runs and recurring runs. + * @param {string} experiment_id The ID of the experiment to be archived. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + archiveExperiment( + experiment_id: string, + options?: any, + ): (fetch?: FetchAPI, basePath?: string) => Promise { + const localVarFetchArgs = ExperimentServiceApiFetchParamCreator( + configuration, + ).archiveExperiment(experiment_id, options); + return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(response => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }; + }, + /** + * + * @summary Creates a new experiment. + * @param {V2beta1Experiment} body The experiment to be created. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createExperiment( + body: V2beta1Experiment, + options?: any, + ): (fetch?: FetchAPI, basePath?: string) => Promise { + const localVarFetchArgs = ExperimentServiceApiFetchParamCreator( + configuration, + ).createExperiment(body, options); + return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(response => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }; + }, + /** + * + * @summary Deletes an experiment without deleting the experiment's runs and recurring runs. To avoid unexpected behaviors, delete an experiment's runs and recurring runs before deleting the experiment. + * @param {string} experiment_id The ID of the experiment to be deleted. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteExperiment( + experiment_id: string, + options?: any, + ): (fetch?: FetchAPI, basePath?: string) => Promise { + const localVarFetchArgs = ExperimentServiceApiFetchParamCreator( + configuration, + ).deleteExperiment(experiment_id, options); + return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(response => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }; + }, + /** + * + * @summary Finds a specific experiment by ID. + * @param {string} experiment_id The ID of the experiment to be retrieved. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getExperiment( + experiment_id: string, + options?: any, + ): (fetch?: FetchAPI, basePath?: string) => Promise { + const localVarFetchArgs = ExperimentServiceApiFetchParamCreator(configuration).getExperiment( + experiment_id, + options, + ); + return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(response => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }; + }, + /** + * + * @summary Finds all experiments. Supports pagination, and sorting on certain fields. + * @param {string} [page_token] A page token to request the next page of results. The token is acquried from the nextPageToken field of the response from the previous ListExperiments call or can be omitted when fetching the first page. + * @param {number} [page_size] The number of experiments to be listed per page. If there are more experiments than this number, the response message will contain a nextPageToken field you can use to fetch the next page. + * @param {string} [sort_by] Can be format of \"field_name\", \"field_name asc\" or \"field_name desc\" Ascending by default. + * @param {string} [filter] A url-encoded, JSON-serialized Filter protocol buffer (see [filter.proto](https://github.com/kubeflow/pipelines/blob/master/backend/api/v2beta1/api/filter.proto)). + * @param {string} [namespace] Which namespace to filter the experiments on. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listExperiments( + page_token?: string, + page_size?: number, + sort_by?: string, + filter?: string, + namespace?: string, + options?: any, + ): (fetch?: FetchAPI, basePath?: string) => Promise { + const localVarFetchArgs = ExperimentServiceApiFetchParamCreator( + configuration, + ).listExperiments(page_token, page_size, sort_by, filter, namespace, options); + return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(response => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }; + }, + /** + * + * @summary Restores an archived experiment. The experiment's archived runs and recurring runs will stay archived. + * @param {string} experiment_id The ID of the experiment to be restored. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + unarchiveExperiment( + experiment_id: string, + options?: any, + ): (fetch?: FetchAPI, basePath?: string) => Promise { + const localVarFetchArgs = ExperimentServiceApiFetchParamCreator( + configuration, + ).unarchiveExperiment(experiment_id, options); + return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(response => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }; + }, + }; +}; + +/** + * ExperimentServiceApi - factory interface + * @export + */ +export const ExperimentServiceApiFactory = function( + configuration?: Configuration, + fetch?: FetchAPI, + basePath?: string, +) { + return { + /** + * + * @summary Archives an experiment and the experiment's runs and recurring runs. + * @param {string} experiment_id The ID of the experiment to be archived. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + archiveExperiment(experiment_id: string, options?: any) { + return ExperimentServiceApiFp(configuration).archiveExperiment(experiment_id, options)( + fetch, + basePath, + ); + }, + /** + * + * @summary Creates a new experiment. + * @param {V2beta1Experiment} body The experiment to be created. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createExperiment(body: V2beta1Experiment, options?: any) { + return ExperimentServiceApiFp(configuration).createExperiment(body, options)(fetch, basePath); + }, + /** + * + * @summary Deletes an experiment without deleting the experiment's runs and recurring runs. To avoid unexpected behaviors, delete an experiment's runs and recurring runs before deleting the experiment. + * @param {string} experiment_id The ID of the experiment to be deleted. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteExperiment(experiment_id: string, options?: any) { + return ExperimentServiceApiFp(configuration).deleteExperiment(experiment_id, options)( + fetch, + basePath, + ); + }, + /** + * + * @summary Finds a specific experiment by ID. + * @param {string} experiment_id The ID of the experiment to be retrieved. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getExperiment(experiment_id: string, options?: any) { + return ExperimentServiceApiFp(configuration).getExperiment(experiment_id, options)( + fetch, + basePath, + ); + }, + /** + * + * @summary Finds all experiments. Supports pagination, and sorting on certain fields. + * @param {string} [page_token] A page token to request the next page of results. The token is acquried from the nextPageToken field of the response from the previous ListExperiments call or can be omitted when fetching the first page. + * @param {number} [page_size] The number of experiments to be listed per page. If there are more experiments than this number, the response message will contain a nextPageToken field you can use to fetch the next page. + * @param {string} [sort_by] Can be format of \"field_name\", \"field_name asc\" or \"field_name desc\" Ascending by default. + * @param {string} [filter] A url-encoded, JSON-serialized Filter protocol buffer (see [filter.proto](https://github.com/kubeflow/pipelines/blob/master/backend/api/v2beta1/api/filter.proto)). + * @param {string} [namespace] Which namespace to filter the experiments on. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listExperiments( + page_token?: string, + page_size?: number, + sort_by?: string, + filter?: string, + namespace?: string, + options?: any, + ) { + return ExperimentServiceApiFp(configuration).listExperiments( + page_token, + page_size, + sort_by, + filter, + namespace, + options, + )(fetch, basePath); + }, + /** + * + * @summary Restores an archived experiment. The experiment's archived runs and recurring runs will stay archived. + * @param {string} experiment_id The ID of the experiment to be restored. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + unarchiveExperiment(experiment_id: string, options?: any) { + return ExperimentServiceApiFp(configuration).unarchiveExperiment(experiment_id, options)( + fetch, + basePath, + ); + }, + }; +}; + +/** + * ExperimentServiceApi - object-oriented interface + * @export + * @class ExperimentServiceApi + * @extends {BaseAPI} + */ +export class ExperimentServiceApi extends BaseAPI { + /** + * + * @summary Archives an experiment and the experiment's runs and recurring runs. + * @param {string} experiment_id The ID of the experiment to be archived. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ExperimentServiceApi + */ + public archiveExperiment(experiment_id: string, options?: any) { + return ExperimentServiceApiFp(this.configuration).archiveExperiment(experiment_id, options)( + this.fetch, + this.basePath, + ); + } + + /** + * + * @summary Creates a new experiment. + * @param {V2beta1Experiment} body The experiment to be created. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ExperimentServiceApi + */ + public createExperiment(body: V2beta1Experiment, options?: any) { + return ExperimentServiceApiFp(this.configuration).createExperiment(body, options)( + this.fetch, + this.basePath, + ); + } + + /** + * + * @summary Deletes an experiment without deleting the experiment's runs and recurring runs. To avoid unexpected behaviors, delete an experiment's runs and recurring runs before deleting the experiment. + * @param {string} experiment_id The ID of the experiment to be deleted. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ExperimentServiceApi + */ + public deleteExperiment(experiment_id: string, options?: any) { + return ExperimentServiceApiFp(this.configuration).deleteExperiment(experiment_id, options)( + this.fetch, + this.basePath, + ); + } + + /** + * + * @summary Finds a specific experiment by ID. + * @param {string} experiment_id The ID of the experiment to be retrieved. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ExperimentServiceApi + */ + public getExperiment(experiment_id: string, options?: any) { + return ExperimentServiceApiFp(this.configuration).getExperiment(experiment_id, options)( + this.fetch, + this.basePath, + ); + } + + /** + * + * @summary Finds all experiments. Supports pagination, and sorting on certain fields. + * @param {string} [page_token] A page token to request the next page of results. The token is acquried from the nextPageToken field of the response from the previous ListExperiments call or can be omitted when fetching the first page. + * @param {number} [page_size] The number of experiments to be listed per page. If there are more experiments than this number, the response message will contain a nextPageToken field you can use to fetch the next page. + * @param {string} [sort_by] Can be format of \"field_name\", \"field_name asc\" or \"field_name desc\" Ascending by default. + * @param {string} [filter] A url-encoded, JSON-serialized Filter protocol buffer (see [filter.proto](https://github.com/kubeflow/pipelines/blob/master/backend/api/v2beta1/api/filter.proto)). + * @param {string} [namespace] Which namespace to filter the experiments on. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ExperimentServiceApi + */ + public listExperiments( + page_token?: string, + page_size?: number, + sort_by?: string, + filter?: string, + namespace?: string, + options?: any, + ) { + return ExperimentServiceApiFp(this.configuration).listExperiments( + page_token, + page_size, + sort_by, + filter, + namespace, + options, + )(this.fetch, this.basePath); + } + + /** + * + * @summary Restores an archived experiment. The experiment's archived runs and recurring runs will stay archived. + * @param {string} experiment_id The ID of the experiment to be restored. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ExperimentServiceApi + */ + public unarchiveExperiment(experiment_id: string, options?: any) { + return ExperimentServiceApiFp(this.configuration).unarchiveExperiment(experiment_id, options)( + this.fetch, + this.basePath, + ); + } +} diff --git a/frontend/src/apisv2beta1/experiment/configuration.ts b/frontend/src/apisv2beta1/experiment/configuration.ts new file mode 100644 index 0000000000..6cc8bbd74e --- /dev/null +++ b/frontend/src/apisv2beta1/experiment/configuration.ts @@ -0,0 +1,65 @@ +// tslint:disable +/** + * backend/api/v2beta1/experiment.proto + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * OpenAPI spec version: version not set + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +export interface ConfigurationParameters { + apiKey?: string | ((name: string) => string); + username?: string; + password?: string; + accessToken?: string | ((name: string, scopes?: string[]) => string); + basePath?: string; +} + +export class Configuration { + /** + * parameter for apiKey security + * @param name security name + * @memberof Configuration + */ + apiKey?: string | ((name: string) => string); + /** + * parameter for basic security + * + * @type {string} + * @memberof Configuration + */ + username?: string; + /** + * parameter for basic security + * + * @type {string} + * @memberof Configuration + */ + password?: string; + /** + * parameter for oauth2 security + * @param name security name + * @param scopes oauth2 scope + * @memberof Configuration + */ + accessToken?: string | ((name: string, scopes?: string[]) => string); + /** + * override base path + * + * @type {string} + * @memberof Configuration + */ + basePath?: string; + + constructor(param: ConfigurationParameters = {}) { + this.apiKey = param.apiKey; + this.username = param.username; + this.password = param.password; + this.accessToken = param.accessToken; + this.basePath = param.basePath; + } +} diff --git a/frontend/src/apisv2beta1/experiment/custom.d.ts b/frontend/src/apisv2beta1/experiment/custom.d.ts new file mode 100644 index 0000000000..4c611cc321 --- /dev/null +++ b/frontend/src/apisv2beta1/experiment/custom.d.ts @@ -0,0 +1,2 @@ +declare module 'portable-fetch'; +declare module 'url'; diff --git a/frontend/src/apisv2beta1/experiment/git_push.sh b/frontend/src/apisv2beta1/experiment/git_push.sh new file mode 100644 index 0000000000..a1ff4c9bcb --- /dev/null +++ b/frontend/src/apisv2beta1/experiment/git_push.sh @@ -0,0 +1,51 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=`git remote` +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/frontend/src/apisv2beta1/experiment/index.ts b/frontend/src/apisv2beta1/experiment/index.ts new file mode 100644 index 0000000000..1cffc1a1a1 --- /dev/null +++ b/frontend/src/apisv2beta1/experiment/index.ts @@ -0,0 +1,15 @@ +// tslint:disable +/** + * backend/api/v2beta1/experiment.proto + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * OpenAPI spec version: version not set + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +export * from './api'; +export * from './configuration'; diff --git a/frontend/src/apisv2beta1/filter/.gitignore b/frontend/src/apisv2beta1/filter/.gitignore new file mode 100644 index 0000000000..35e2fb2b02 --- /dev/null +++ b/frontend/src/apisv2beta1/filter/.gitignore @@ -0,0 +1,3 @@ +wwwroot/*.js +node_modules +typings diff --git a/frontend/src/apisv2beta1/filter/.swagger-codegen-ignore b/frontend/src/apisv2beta1/filter/.swagger-codegen-ignore new file mode 100644 index 0000000000..c5fa491b4c --- /dev/null +++ b/frontend/src/apisv2beta1/filter/.swagger-codegen-ignore @@ -0,0 +1,23 @@ +# Swagger Codegen Ignore +# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/frontend/src/apisv2beta1/filter/.swagger-codegen/VERSION b/frontend/src/apisv2beta1/filter/.swagger-codegen/VERSION new file mode 100644 index 0000000000..48a6b508dc --- /dev/null +++ b/frontend/src/apisv2beta1/filter/.swagger-codegen/VERSION @@ -0,0 +1 @@ +2.4.7 \ No newline at end of file diff --git a/frontend/src/apisv2beta1/filter/api.ts b/frontend/src/apisv2beta1/filter/api.ts new file mode 100644 index 0000000000..9b1c76f3ac --- /dev/null +++ b/frontend/src/apisv2beta1/filter/api.ts @@ -0,0 +1,217 @@ +/// +// tslint:disable +/** + * backend/api/v2beta1/filter.proto + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * OpenAPI spec version: version not set + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +import * as url from 'url'; +import * as portableFetch from 'portable-fetch'; +import { Configuration } from './configuration'; + +const BASE_PATH = 'http://localhost'.replace(/\/+$/, ''); + +/** + * + * @export + */ +export const COLLECTION_FORMATS = { + csv: ',', + ssv: ' ', + tsv: '\t', + pipes: '|', +}; + +/** + * + * @export + * @interface FetchAPI + */ +export interface FetchAPI { + (url: string, init?: any): Promise; +} + +/** + * + * @export + * @interface FetchArgs + */ +export interface FetchArgs { + url: string; + options: any; +} + +/** + * + * @export + * @class BaseAPI + */ +export class BaseAPI { + protected configuration: Configuration; + + constructor( + configuration?: Configuration, + protected basePath: string = BASE_PATH, + protected fetch: FetchAPI = portableFetch, + ) { + if (configuration) { + this.configuration = configuration; + this.basePath = configuration.basePath || this.basePath; + } + } +} + +/** + * + * @export + * @class RequiredError + * @extends {Error} + */ +export class RequiredError extends Error { + name: 'RequiredError'; + constructor(public field: string, msg?: string) { + super(msg); + } +} + +/** + * List of integers. + * @export + * @interface PredicateIntValues + */ +export interface PredicateIntValues { + /** + * + * @type {Array} + * @memberof PredicateIntValues + */ + values?: Array; +} + +/** + * List of long integers. + * @export + * @interface PredicateLongValues + */ +export interface PredicateLongValues { + /** + * + * @type {Array} + * @memberof PredicateLongValues + */ + values?: Array; +} + +/** + * List of strings. + * @export + * @interface PredicateStringValues + */ +export interface PredicateStringValues { + /** + * + * @type {Array} + * @memberof PredicateStringValues + */ + values?: Array; +} + +/** + * 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' } } } + * @export + * @interface V2beta1Filter + */ +export interface V2beta1Filter { + /** + * All predicates are AND-ed when this filter is applied. + * @type {Array} + * @memberof V2beta1Filter + */ + predicates?: Array; +} + +/** + * Predicate captures individual conditions that must be true for a resource being filtered. + * @export + * @interface V2beta1Predicate + */ +export interface V2beta1Predicate { + /** + * + * @type {V2beta1PredicateOperation} + * @memberof V2beta1Predicate + */ + operation?: V2beta1PredicateOperation; + /** + * Key for the operation (first argument). + * @type {string} + * @memberof V2beta1Predicate + */ + key?: string; + /** + * Integer. + * @type {number} + * @memberof V2beta1Predicate + */ + int_value?: number; + /** + * Long integer. + * @type {string} + * @memberof V2beta1Predicate + */ + long_value?: string; + /** + * String. + * @type {string} + * @memberof V2beta1Predicate + */ + string_value?: string; + /** + * Timestamp values will be converted to Unix time (seconds since the epoch) prior to being used in a filtering operation. + * @type {Date} + * @memberof V2beta1Predicate + */ + timestamp_value?: Date; + /** + * Array values below are only meant to be used by the IN operator. + * @type {PredicateIntValues} + * @memberof V2beta1Predicate + */ + int_values?: PredicateIntValues; + /** + * List of long integers. + * @type {PredicateLongValues} + * @memberof V2beta1Predicate + */ + long_values?: PredicateLongValues; + /** + * List of strings. + * @type {PredicateStringValues} + * @memberof V2beta1Predicate + */ + string_values?: PredicateStringValues; +} + +/** + * Operation is the operation to apply. - OPERATION_UNSPECIFIED: Default operation. This operation is not used. - EQUALS: Operation on scalar values. Only applies to one of |int_value|, |long_value|, |string_value| or |timestamp_value|. - NOT_EQUALS: Negated EQUALS. - GREATER_THAN: Greater than operation. - GREATER_THAN_EQUALS: Greater than or equals operation. - LESS_THAN: Less than operation. - LESS_THAN_EQUALS: Less than or equals operation - IN: Checks if the value is a member of a given array, which should be one of |int_values|, |long_values| or |string_values|. - IS_SUBSTRING: Checks if the value contains |string_value| as a substring match. Only applies to |string_value|. + * @export + * @enum {string} + */ +export enum V2beta1PredicateOperation { + OPERATIONUNSPECIFIED = 'OPERATION_UNSPECIFIED', + EQUALS = 'EQUALS', + NOTEQUALS = 'NOT_EQUALS', + GREATERTHAN = 'GREATER_THAN', + GREATERTHANEQUALS = 'GREATER_THAN_EQUALS', + LESSTHAN = 'LESS_THAN', + LESSTHANEQUALS = 'LESS_THAN_EQUALS', + IN = 'IN', + ISSUBSTRING = 'IS_SUBSTRING', +} diff --git a/frontend/src/apisv2beta1/filter/configuration.ts b/frontend/src/apisv2beta1/filter/configuration.ts new file mode 100644 index 0000000000..e45f24f702 --- /dev/null +++ b/frontend/src/apisv2beta1/filter/configuration.ts @@ -0,0 +1,65 @@ +// tslint:disable +/** + * backend/api/v2beta1/filter.proto + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * OpenAPI spec version: version not set + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +export interface ConfigurationParameters { + apiKey?: string | ((name: string) => string); + username?: string; + password?: string; + accessToken?: string | ((name: string, scopes?: string[]) => string); + basePath?: string; +} + +export class Configuration { + /** + * parameter for apiKey security + * @param name security name + * @memberof Configuration + */ + apiKey?: string | ((name: string) => string); + /** + * parameter for basic security + * + * @type {string} + * @memberof Configuration + */ + username?: string; + /** + * parameter for basic security + * + * @type {string} + * @memberof Configuration + */ + password?: string; + /** + * parameter for oauth2 security + * @param name security name + * @param scopes oauth2 scope + * @memberof Configuration + */ + accessToken?: string | ((name: string, scopes?: string[]) => string); + /** + * override base path + * + * @type {string} + * @memberof Configuration + */ + basePath?: string; + + constructor(param: ConfigurationParameters = {}) { + this.apiKey = param.apiKey; + this.username = param.username; + this.password = param.password; + this.accessToken = param.accessToken; + this.basePath = param.basePath; + } +} diff --git a/frontend/src/apisv2beta1/filter/custom.d.ts b/frontend/src/apisv2beta1/filter/custom.d.ts new file mode 100644 index 0000000000..4c611cc321 --- /dev/null +++ b/frontend/src/apisv2beta1/filter/custom.d.ts @@ -0,0 +1,2 @@ +declare module 'portable-fetch'; +declare module 'url'; diff --git a/frontend/src/apisv2beta1/filter/git_push.sh b/frontend/src/apisv2beta1/filter/git_push.sh new file mode 100644 index 0000000000..a1ff4c9bcb --- /dev/null +++ b/frontend/src/apisv2beta1/filter/git_push.sh @@ -0,0 +1,51 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=`git remote` +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/frontend/src/apisv2beta1/filter/index.ts b/frontend/src/apisv2beta1/filter/index.ts new file mode 100644 index 0000000000..cfdbd4bee7 --- /dev/null +++ b/frontend/src/apisv2beta1/filter/index.ts @@ -0,0 +1,15 @@ +// tslint:disable +/** + * backend/api/v2beta1/filter.proto + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * OpenAPI spec version: version not set + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +export * from './api'; +export * from './configuration'; diff --git a/frontend/src/apisv2beta1/pipeline/.gitignore b/frontend/src/apisv2beta1/pipeline/.gitignore new file mode 100644 index 0000000000..35e2fb2b02 --- /dev/null +++ b/frontend/src/apisv2beta1/pipeline/.gitignore @@ -0,0 +1,3 @@ +wwwroot/*.js +node_modules +typings diff --git a/frontend/src/apisv2beta1/pipeline/.swagger-codegen-ignore b/frontend/src/apisv2beta1/pipeline/.swagger-codegen-ignore new file mode 100644 index 0000000000..c5fa491b4c --- /dev/null +++ b/frontend/src/apisv2beta1/pipeline/.swagger-codegen-ignore @@ -0,0 +1,23 @@ +# Swagger Codegen Ignore +# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/frontend/src/apisv2beta1/pipeline/.swagger-codegen/VERSION b/frontend/src/apisv2beta1/pipeline/.swagger-codegen/VERSION new file mode 100644 index 0000000000..48a6b508dc --- /dev/null +++ b/frontend/src/apisv2beta1/pipeline/.swagger-codegen/VERSION @@ -0,0 +1 @@ +2.4.7 \ No newline at end of file diff --git a/frontend/src/apisv2beta1/pipeline/api.ts b/frontend/src/apisv2beta1/pipeline/api.ts new file mode 100644 index 0000000000..d663a3913d --- /dev/null +++ b/frontend/src/apisv2beta1/pipeline/api.ts @@ -0,0 +1,1488 @@ +/// +// tslint:disable +/** + * backend/api/v2beta1/pipeline.proto + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * OpenAPI spec version: version not set + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +import * as url from 'url'; +import * as portableFetch from 'portable-fetch'; +import { Configuration } from './configuration'; + +const BASE_PATH = 'http://localhost'.replace(/\/+$/, ''); + +/** + * + * @export + */ +export const COLLECTION_FORMATS = { + csv: ',', + ssv: ' ', + tsv: '\t', + pipes: '|', +}; + +/** + * + * @export + * @interface FetchAPI + */ +export interface FetchAPI { + (url: string, init?: any): Promise; +} + +/** + * + * @export + * @interface FetchArgs + */ +export interface FetchArgs { + url: string; + options: any; +} + +/** + * + * @export + * @class BaseAPI + */ +export class BaseAPI { + protected configuration: Configuration; + + constructor( + configuration?: Configuration, + protected basePath: string = BASE_PATH, + protected fetch: FetchAPI = portableFetch, + ) { + if (configuration) { + this.configuration = configuration; + this.basePath = configuration.basePath || this.basePath; + } + } +} + +/** + * + * @export + * @class RequiredError + * @extends {Error} + */ +export class RequiredError extends Error { + name: 'RequiredError'; + constructor(public field: string, msg?: string) { + super(msg); + } +} + +/** + * The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors). + * @export + * @interface GooglerpcStatus + */ +export interface GooglerpcStatus { + /** + * The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. + * @type {number} + * @memberof GooglerpcStatus + */ + code?: number; + /** + * A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. + * @type {string} + * @memberof GooglerpcStatus + */ + message?: string; + /** + * A list of messages that carry the error details. There is a common set of message types for APIs to use. + * @type {Array} + * @memberof GooglerpcStatus + */ + details?: Array; +} + +/** + * `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 := anypb.New(foo) if err != nil { ... } ... foo := &pb.Foo{} if err := any.UnmarshalTo(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\": , \"lastName\": } 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\" } + * @export + * @interface ProtobufAny + */ +export interface ProtobufAny { + /** + * A URL/resource name that uniquely identifies the type of the serialized protocol buffer message. This string must contain at least one \"/\" character. 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. + * @type {string} + * @memberof ProtobufAny + */ + type_url?: string; + /** + * Must be a valid serialized protocol buffer of the above specified type. + * @type {string} + * @memberof ProtobufAny + */ + value?: string; +} + +/** + * `ListValue` is a wrapper around a repeated field of values. The JSON representation for `ListValue` is JSON array. + * @export + * @interface ProtobufListValue + */ +export interface ProtobufListValue { + /** + * Repeated field of dynamically typed values. + * @type {Array} + * @memberof ProtobufListValue + */ + values?: Array; +} + +/** + * `NullValue` is a singleton enumeration to represent the null value for the `Value` type union. The JSON representation for `NullValue` is JSON `null`. - NULL_VALUE: Null value. + * @export + * @enum {string} + */ +export enum ProtobufNullValue { + NULLVALUE = 'NULL_VALUE', +} + +/** + * `Struct` represents a structured data value, consisting of fields which map to dynamically typed values. In some languages, `Struct` might be supported by a native representation. For example, in scripting languages like JS a struct is represented as an object. The details of that representation are described together with the proto support for the language. The JSON representation for `Struct` is JSON object. + * @export + * @interface ProtobufStruct + */ +export interface ProtobufStruct { + /** + * Unordered map of dynamically typed values. + * @type {{ [key: string]: ProtobufValue; }} + * @memberof ProtobufStruct + */ + fields?: { [key: string]: ProtobufValue }; +} + +/** + * `Value` represents a dynamically typed value which can be either null, a number, a string, a boolean, a recursive struct value, or a list of values. A producer of value is expected to set one of that variants, absence of any variant indicates an error. The JSON representation for `Value` is JSON value. + * @export + * @interface ProtobufValue + */ +export interface ProtobufValue { + /** + * Represents a null value. + * @type {ProtobufNullValue} + * @memberof ProtobufValue + */ + null_value?: ProtobufNullValue; + /** + * Represents a double value. + * @type {number} + * @memberof ProtobufValue + */ + number_value?: number; + /** + * Represents a string value. + * @type {string} + * @memberof ProtobufValue + */ + string_value?: string; + /** + * Represents a boolean value. + * @type {boolean} + * @memberof ProtobufValue + */ + bool_value?: boolean; + /** + * Represents a structured value. + * @type {ProtobufStruct} + * @memberof ProtobufValue + */ + struct_value?: ProtobufStruct; + /** + * Represents a repeated `Value`. + * @type {ProtobufListValue} + * @memberof ProtobufValue + */ + list_value?: ProtobufListValue; +} + +/** + * + * @export + * @interface V2beta1ListPipelineVersionsResponse + */ +export interface V2beta1ListPipelineVersionsResponse { + /** + * Returned pipeline versions. + * @type {Array} + * @memberof V2beta1ListPipelineVersionsResponse + */ + pipeline_versions?: Array; + /** + * The token to list the next page of pipeline versions. + * @type {string} + * @memberof V2beta1ListPipelineVersionsResponse + */ + next_page_token?: string; + /** + * The total number of pipeline versions for the given query. + * @type {number} + * @memberof V2beta1ListPipelineVersionsResponse + */ + total_size?: number; +} + +/** + * + * @export + * @interface V2beta1ListPipelinesResponse + */ +export interface V2beta1ListPipelinesResponse { + /** + * Returned pipelines. + * @type {Array} + * @memberof V2beta1ListPipelinesResponse + */ + pipelines?: Array; + /** + * The total number of pipelines for the given query. + * @type {number} + * @memberof V2beta1ListPipelinesResponse + */ + total_size?: number; + /** + * The token to list the next page of pipelines. This token can be used on the next ListPipelinesRequest. + * @type {string} + * @memberof V2beta1ListPipelinesResponse + */ + next_page_token?: string; +} + +/** + * + * @export + * @interface V2beta1Pipeline + */ +export interface V2beta1Pipeline { + /** + * Output. Unique pipeline ID. Generated by API server. + * @type {string} + * @memberof V2beta1Pipeline + */ + pipeline_id?: string; + /** + * Required input field. Pipeline name provided by user. + * @type {string} + * @memberof V2beta1Pipeline + */ + display_name?: string; + /** + * Optional input field. A short description of the pipeline. + * @type {string} + * @memberof V2beta1Pipeline + */ + description?: string; + /** + * Output. Creation time of the pipeline. + * @type {Date} + * @memberof V2beta1Pipeline + */ + created_at?: Date; + /** + * Input. A namespace this pipeline belongs to. Causes error if user is not authorized to access the specified namespace. If not specified in CreatePipeline, default namespace is used. + * @type {string} + * @memberof V2beta1Pipeline + */ + namespace?: string; + /** + * In case any error happens retrieving a pipeline field, only pipeline ID, and the error message is returned. Client has the flexibility of choosing how to handle the error. This is especially useful during listing call. + * @type {GooglerpcStatus} + * @memberof V2beta1Pipeline + */ + error?: GooglerpcStatus; +} + +/** + * + * @export + * @interface V2beta1PipelineVersion + */ +export interface V2beta1PipelineVersion { + /** + * Required input field. Unique ID of the parent pipeline. + * @type {string} + * @memberof V2beta1PipelineVersion + */ + pipeline_id?: string; + /** + * Output. Unique pipeline version ID. Generated by API server. + * @type {string} + * @memberof V2beta1PipelineVersion + */ + pipeline_version_id?: string; + /** + * Required input field. Pipeline version name provided by user. + * @type {string} + * @memberof V2beta1PipelineVersion + */ + display_name?: string; + /** + * Optional input field. Short description of the pipeline version. + * @type {string} + * @memberof V2beta1PipelineVersion + */ + description?: string; + /** + * Output. Creation time of the pipeline version. + * @type {Date} + * @memberof V2beta1PipelineVersion + */ + created_at?: Date; + /** + * Required input field. Pipeline version package url. When calling CreatePipelineVersion, one needs to provide one package file location. + * @type {V2beta1Url} + * @memberof V2beta1PipelineVersion + */ + package_url?: V2beta1Url; + /** + * Required input field. Specifies the pipeline spec for the pipeline version. + * @type {ProtobufStruct} + * @memberof V2beta1PipelineVersion + */ + pipeline_spec?: ProtobufStruct; + /** + * In case any error happens retrieving a pipeline version field, only pipeline ID, pipeline version ID, and the error message are returned. Client has the flexibility of choosing how to handle the error. This is especially useful during List() calls. + * @type {GooglerpcStatus} + * @memberof V2beta1PipelineVersion + */ + error?: GooglerpcStatus; +} + +/** + * + * @export + * @interface V2beta1Url + */ +export interface V2beta1Url { + /** + * URL of the pipeline version definition. + * @type {string} + * @memberof V2beta1Url + */ + pipeline_url?: string; +} + +/** + * PipelineServiceApi - fetch parameter creator + * @export + */ +export const PipelineServiceApiFetchParamCreator = function(configuration?: Configuration) { + return { + /** + * + * @summary Creates a pipeline. + * @param {V2beta1Pipeline} body Required input. Pipeline that needs to be created. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createPipeline(body: V2beta1Pipeline, options: any = {}): FetchArgs { + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError( + 'body', + 'Required parameter body was null or undefined when calling createPipeline.', + ); + } + const localVarPath = `/apis/v2beta1/pipelines`; + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'POST' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = + typeof configuration.apiKey === 'function' + ? configuration.apiKey('authorization') + : configuration.apiKey; + localVarHeaderParameter['authorization'] = localVarApiKeyValue; + } + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarUrlObj.query = Object.assign( + {}, + localVarUrlObj.query, + localVarQueryParameter, + options.query, + ); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + const needsSerialization = + 'V2beta1Pipeline' !== 'string' || + localVarRequestOptions.headers['Content-Type'] === 'application/json'; + localVarRequestOptions.body = needsSerialization ? JSON.stringify(body || {}) : body || ''; + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Adds a pipeline version to the specified pipeline ID. + * @param {string} pipeline_id Required input. ID of the parent pipeline. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createPipelineVersion(pipeline_id: string, options: any = {}): FetchArgs { + // verify required parameter 'pipeline_id' is not null or undefined + if (pipeline_id === null || pipeline_id === undefined) { + throw new RequiredError( + 'pipeline_id', + 'Required parameter pipeline_id was null or undefined when calling createPipelineVersion.', + ); + } + const localVarPath = `/apis/v2beta1/pipelines/{pipeline_id}/versions`.replace( + `{${'pipeline_id'}}`, + encodeURIComponent(String(pipeline_id)), + ); + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'POST' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = + typeof configuration.apiKey === 'function' + ? configuration.apiKey('authorization') + : configuration.apiKey; + localVarHeaderParameter['authorization'] = localVarApiKeyValue; + } + + localVarUrlObj.query = Object.assign( + {}, + localVarUrlObj.query, + localVarQueryParameter, + options.query, + ); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Deletes an empty pipeline by ID. Returns error if the pipeline has pipeline versions. + * @param {string} pipeline_id Required input. ID of the pipeline to be deleted. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deletePipeline(pipeline_id: string, options: any = {}): FetchArgs { + // verify required parameter 'pipeline_id' is not null or undefined + if (pipeline_id === null || pipeline_id === undefined) { + throw new RequiredError( + 'pipeline_id', + 'Required parameter pipeline_id was null or undefined when calling deletePipeline.', + ); + } + const localVarPath = `/apis/v2beta1/pipelines/{pipeline_id}`.replace( + `{${'pipeline_id'}}`, + encodeURIComponent(String(pipeline_id)), + ); + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'DELETE' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = + typeof configuration.apiKey === 'function' + ? configuration.apiKey('authorization') + : configuration.apiKey; + localVarHeaderParameter['authorization'] = localVarApiKeyValue; + } + + localVarUrlObj.query = Object.assign( + {}, + localVarUrlObj.query, + localVarQueryParameter, + options.query, + ); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Deletes a specific pipeline version by pipeline version ID and pipeline ID. + * @param {string} pipeline_id Required input. ID of the parent pipeline. + * @param {string} pipeline_version_id Required input. The ID of the pipeline version to be deleted. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deletePipelineVersion( + pipeline_id: string, + pipeline_version_id: string, + options: any = {}, + ): FetchArgs { + // verify required parameter 'pipeline_id' is not null or undefined + if (pipeline_id === null || pipeline_id === undefined) { + throw new RequiredError( + 'pipeline_id', + 'Required parameter pipeline_id was null or undefined when calling deletePipelineVersion.', + ); + } + // verify required parameter 'pipeline_version_id' is not null or undefined + if (pipeline_version_id === null || pipeline_version_id === undefined) { + throw new RequiredError( + 'pipeline_version_id', + 'Required parameter pipeline_version_id was null or undefined when calling deletePipelineVersion.', + ); + } + const localVarPath = `/apis/v2beta1/pipelines/{pipeline_id}/versions/{pipeline_version_id}` + .replace(`{${'pipeline_id'}}`, encodeURIComponent(String(pipeline_id))) + .replace(`{${'pipeline_version_id'}}`, encodeURIComponent(String(pipeline_version_id))); + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'DELETE' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = + typeof configuration.apiKey === 'function' + ? configuration.apiKey('authorization') + : configuration.apiKey; + localVarHeaderParameter['authorization'] = localVarApiKeyValue; + } + + localVarUrlObj.query = Object.assign( + {}, + localVarUrlObj.query, + localVarQueryParameter, + options.query, + ); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Finds a specific pipeline by ID. + * @param {string} pipeline_id Required input. The ID of the pipeline to be retrieved. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getPipeline(pipeline_id: string, options: any = {}): FetchArgs { + // verify required parameter 'pipeline_id' is not null or undefined + if (pipeline_id === null || pipeline_id === undefined) { + throw new RequiredError( + 'pipeline_id', + 'Required parameter pipeline_id was null or undefined when calling getPipeline.', + ); + } + const localVarPath = `/apis/v2beta1/pipelines/{pipeline_id}`.replace( + `{${'pipeline_id'}}`, + encodeURIComponent(String(pipeline_id)), + ); + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'GET' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = + typeof configuration.apiKey === 'function' + ? configuration.apiKey('authorization') + : configuration.apiKey; + localVarHeaderParameter['authorization'] = localVarApiKeyValue; + } + + localVarUrlObj.query = Object.assign( + {}, + localVarUrlObj.query, + localVarQueryParameter, + options.query, + ); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Finds a specific pipeline by name and namespace. + * @param {string} name Required input. Name of the pipeline to be retrieved. + * @param {string} [namespace] Optional input. Namespace of the pipeline. It could be empty if default namespaces needs to be used or if multi-user support is turned off. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getPipelineByName(name: string, namespace?: string, options: any = {}): FetchArgs { + // verify required parameter 'name' is not null or undefined + if (name === null || name === undefined) { + throw new RequiredError( + 'name', + 'Required parameter name was null or undefined when calling getPipelineByName.', + ); + } + const localVarPath = `/apis/v2beta1/pipelines/names/{name}`.replace( + `{${'name'}}`, + encodeURIComponent(String(name)), + ); + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'GET' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = + typeof configuration.apiKey === 'function' + ? configuration.apiKey('authorization') + : configuration.apiKey; + localVarHeaderParameter['authorization'] = localVarApiKeyValue; + } + + if (namespace !== undefined) { + localVarQueryParameter['namespace'] = namespace; + } + + localVarUrlObj.query = Object.assign( + {}, + localVarUrlObj.query, + localVarQueryParameter, + options.query, + ); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Gets a pipeline version by pipeline version ID and pipeline ID. + * @param {string} pipeline_id Required input. ID of the parent pipeline. + * @param {string} pipeline_version_id Required input. ID of the pipeline version to be retrieved. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getPipelineVersion( + pipeline_id: string, + pipeline_version_id: string, + options: any = {}, + ): FetchArgs { + // verify required parameter 'pipeline_id' is not null or undefined + if (pipeline_id === null || pipeline_id === undefined) { + throw new RequiredError( + 'pipeline_id', + 'Required parameter pipeline_id was null or undefined when calling getPipelineVersion.', + ); + } + // verify required parameter 'pipeline_version_id' is not null or undefined + if (pipeline_version_id === null || pipeline_version_id === undefined) { + throw new RequiredError( + 'pipeline_version_id', + 'Required parameter pipeline_version_id was null or undefined when calling getPipelineVersion.', + ); + } + const localVarPath = `/apis/v2beta1/pipelines/{pipeline_id}/versions/{pipeline_version_id}` + .replace(`{${'pipeline_id'}}`, encodeURIComponent(String(pipeline_id))) + .replace(`{${'pipeline_version_id'}}`, encodeURIComponent(String(pipeline_version_id))); + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'GET' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = + typeof configuration.apiKey === 'function' + ? configuration.apiKey('authorization') + : configuration.apiKey; + localVarHeaderParameter['authorization'] = localVarApiKeyValue; + } + + localVarUrlObj.query = Object.assign( + {}, + localVarUrlObj.query, + localVarQueryParameter, + options.query, + ); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Lists all pipeline versions of a given pipeline ID. + * @param {string} pipeline_id Required input. ID of the parent pipeline. + * @param {string} [page_token] A page token to request the results page. + * @param {number} [page_size] The number of pipeline versions to be listed per page. If there are more pipeline versions than this number, the response message will contain a valid value in the nextPageToken field. + * @param {string} [sort_by] Sorting order in form of \"field_name\", \"field_name asc\" or \"field_name desc\". Ascending by default. + * @param {string} [filter] A url-encoded, JSON-serialized filter protocol buffer (see [filter.proto](https://github.com/kubeflow/pipelines/blob/master/backend/api/filter.proto)). + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listPipelineVersions( + pipeline_id: string, + page_token?: string, + page_size?: number, + sort_by?: string, + filter?: string, + options: any = {}, + ): FetchArgs { + // verify required parameter 'pipeline_id' is not null or undefined + if (pipeline_id === null || pipeline_id === undefined) { + throw new RequiredError( + 'pipeline_id', + 'Required parameter pipeline_id was null or undefined when calling listPipelineVersions.', + ); + } + const localVarPath = `/apis/v2beta1/pipelines/{pipeline_id}/versions`.replace( + `{${'pipeline_id'}}`, + encodeURIComponent(String(pipeline_id)), + ); + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'GET' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = + typeof configuration.apiKey === 'function' + ? configuration.apiKey('authorization') + : configuration.apiKey; + localVarHeaderParameter['authorization'] = localVarApiKeyValue; + } + + if (page_token !== undefined) { + localVarQueryParameter['page_token'] = page_token; + } + + if (page_size !== undefined) { + localVarQueryParameter['page_size'] = page_size; + } + + if (sort_by !== undefined) { + localVarQueryParameter['sort_by'] = sort_by; + } + + if (filter !== undefined) { + localVarQueryParameter['filter'] = filter; + } + + localVarUrlObj.query = Object.assign( + {}, + localVarUrlObj.query, + localVarQueryParameter, + options.query, + ); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Finds all pipelines within a namespace. + * @param {string} [namespace] Optional input. Namespace for the pipelines. + * @param {string} [page_token] A page token to request the results page. + * @param {number} [page_size] The number of pipelines to be listed per page. If there are more pipelines than this number, the response message will contain a valid value in the nextPageToken field. + * @param {string} [sort_by] Sorting order in form of \"field_name\", \"field_name asc\" or \"field_name desc\". Ascending by default. + * @param {string} [filter] A url-encoded, JSON-serialized filter protocol buffer (see [filter.proto](https://github.com/kubeflow/pipelines/blob/master/backend/api/filter.proto)). + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listPipelines( + namespace?: string, + page_token?: string, + page_size?: number, + sort_by?: string, + filter?: string, + options: any = {}, + ): FetchArgs { + const localVarPath = `/apis/v2beta1/pipelines`; + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'GET' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = + typeof configuration.apiKey === 'function' + ? configuration.apiKey('authorization') + : configuration.apiKey; + localVarHeaderParameter['authorization'] = localVarApiKeyValue; + } + + if (namespace !== undefined) { + localVarQueryParameter['namespace'] = namespace; + } + + if (page_token !== undefined) { + localVarQueryParameter['page_token'] = page_token; + } + + if (page_size !== undefined) { + localVarQueryParameter['page_size'] = page_size; + } + + if (sort_by !== undefined) { + localVarQueryParameter['sort_by'] = sort_by; + } + + if (filter !== undefined) { + localVarQueryParameter['filter'] = filter; + } + + localVarUrlObj.query = Object.assign( + {}, + localVarUrlObj.query, + localVarQueryParameter, + options.query, + ); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + }; +}; + +/** + * PipelineServiceApi - functional programming interface + * @export + */ +export const PipelineServiceApiFp = function(configuration?: Configuration) { + return { + /** + * + * @summary Creates a pipeline. + * @param {V2beta1Pipeline} body Required input. Pipeline that needs to be created. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createPipeline( + body: V2beta1Pipeline, + options?: any, + ): (fetch?: FetchAPI, basePath?: string) => Promise { + const localVarFetchArgs = PipelineServiceApiFetchParamCreator(configuration).createPipeline( + body, + options, + ); + return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(response => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }; + }, + /** + * + * @summary Adds a pipeline version to the specified pipeline ID. + * @param {string} pipeline_id Required input. ID of the parent pipeline. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createPipelineVersion( + pipeline_id: string, + options?: any, + ): (fetch?: FetchAPI, basePath?: string) => Promise { + const localVarFetchArgs = PipelineServiceApiFetchParamCreator( + configuration, + ).createPipelineVersion(pipeline_id, options); + return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(response => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }; + }, + /** + * + * @summary Deletes an empty pipeline by ID. Returns error if the pipeline has pipeline versions. + * @param {string} pipeline_id Required input. ID of the pipeline to be deleted. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deletePipeline( + pipeline_id: string, + options?: any, + ): (fetch?: FetchAPI, basePath?: string) => Promise { + const localVarFetchArgs = PipelineServiceApiFetchParamCreator(configuration).deletePipeline( + pipeline_id, + options, + ); + return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(response => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }; + }, + /** + * + * @summary Deletes a specific pipeline version by pipeline version ID and pipeline ID. + * @param {string} pipeline_id Required input. ID of the parent pipeline. + * @param {string} pipeline_version_id Required input. The ID of the pipeline version to be deleted. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deletePipelineVersion( + pipeline_id: string, + pipeline_version_id: string, + options?: any, + ): (fetch?: FetchAPI, basePath?: string) => Promise { + const localVarFetchArgs = PipelineServiceApiFetchParamCreator( + configuration, + ).deletePipelineVersion(pipeline_id, pipeline_version_id, options); + return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(response => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }; + }, + /** + * + * @summary Finds a specific pipeline by ID. + * @param {string} pipeline_id Required input. The ID of the pipeline to be retrieved. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getPipeline( + pipeline_id: string, + options?: any, + ): (fetch?: FetchAPI, basePath?: string) => Promise { + const localVarFetchArgs = PipelineServiceApiFetchParamCreator(configuration).getPipeline( + pipeline_id, + options, + ); + return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(response => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }; + }, + /** + * + * @summary Finds a specific pipeline by name and namespace. + * @param {string} name Required input. Name of the pipeline to be retrieved. + * @param {string} [namespace] Optional input. Namespace of the pipeline. It could be empty if default namespaces needs to be used or if multi-user support is turned off. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getPipelineByName( + name: string, + namespace?: string, + options?: any, + ): (fetch?: FetchAPI, basePath?: string) => Promise { + const localVarFetchArgs = PipelineServiceApiFetchParamCreator( + configuration, + ).getPipelineByName(name, namespace, options); + return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(response => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }; + }, + /** + * + * @summary Gets a pipeline version by pipeline version ID and pipeline ID. + * @param {string} pipeline_id Required input. ID of the parent pipeline. + * @param {string} pipeline_version_id Required input. ID of the pipeline version to be retrieved. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getPipelineVersion( + pipeline_id: string, + pipeline_version_id: string, + options?: any, + ): (fetch?: FetchAPI, basePath?: string) => Promise { + const localVarFetchArgs = PipelineServiceApiFetchParamCreator( + configuration, + ).getPipelineVersion(pipeline_id, pipeline_version_id, options); + return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(response => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }; + }, + /** + * + * @summary Lists all pipeline versions of a given pipeline ID. + * @param {string} pipeline_id Required input. ID of the parent pipeline. + * @param {string} [page_token] A page token to request the results page. + * @param {number} [page_size] The number of pipeline versions to be listed per page. If there are more pipeline versions than this number, the response message will contain a valid value in the nextPageToken field. + * @param {string} [sort_by] Sorting order in form of \"field_name\", \"field_name asc\" or \"field_name desc\". Ascending by default. + * @param {string} [filter] A url-encoded, JSON-serialized filter protocol buffer (see [filter.proto](https://github.com/kubeflow/pipelines/blob/master/backend/api/filter.proto)). + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listPipelineVersions( + pipeline_id: string, + page_token?: string, + page_size?: number, + sort_by?: string, + filter?: string, + options?: any, + ): (fetch?: FetchAPI, basePath?: string) => Promise { + const localVarFetchArgs = PipelineServiceApiFetchParamCreator( + configuration, + ).listPipelineVersions(pipeline_id, page_token, page_size, sort_by, filter, options); + return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(response => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }; + }, + /** + * + * @summary Finds all pipelines within a namespace. + * @param {string} [namespace] Optional input. Namespace for the pipelines. + * @param {string} [page_token] A page token to request the results page. + * @param {number} [page_size] The number of pipelines to be listed per page. If there are more pipelines than this number, the response message will contain a valid value in the nextPageToken field. + * @param {string} [sort_by] Sorting order in form of \"field_name\", \"field_name asc\" or \"field_name desc\". Ascending by default. + * @param {string} [filter] A url-encoded, JSON-serialized filter protocol buffer (see [filter.proto](https://github.com/kubeflow/pipelines/blob/master/backend/api/filter.proto)). + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listPipelines( + namespace?: string, + page_token?: string, + page_size?: number, + sort_by?: string, + filter?: string, + options?: any, + ): (fetch?: FetchAPI, basePath?: string) => Promise { + const localVarFetchArgs = PipelineServiceApiFetchParamCreator(configuration).listPipelines( + namespace, + page_token, + page_size, + sort_by, + filter, + options, + ); + return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(response => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }; + }, + }; +}; + +/** + * PipelineServiceApi - factory interface + * @export + */ +export const PipelineServiceApiFactory = function( + configuration?: Configuration, + fetch?: FetchAPI, + basePath?: string, +) { + return { + /** + * + * @summary Creates a pipeline. + * @param {V2beta1Pipeline} body Required input. Pipeline that needs to be created. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createPipeline(body: V2beta1Pipeline, options?: any) { + return PipelineServiceApiFp(configuration).createPipeline(body, options)(fetch, basePath); + }, + /** + * + * @summary Adds a pipeline version to the specified pipeline ID. + * @param {string} pipeline_id Required input. ID of the parent pipeline. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createPipelineVersion(pipeline_id: string, options?: any) { + return PipelineServiceApiFp(configuration).createPipelineVersion(pipeline_id, options)( + fetch, + basePath, + ); + }, + /** + * + * @summary Deletes an empty pipeline by ID. Returns error if the pipeline has pipeline versions. + * @param {string} pipeline_id Required input. ID of the pipeline to be deleted. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deletePipeline(pipeline_id: string, options?: any) { + return PipelineServiceApiFp(configuration).deletePipeline(pipeline_id, options)( + fetch, + basePath, + ); + }, + /** + * + * @summary Deletes a specific pipeline version by pipeline version ID and pipeline ID. + * @param {string} pipeline_id Required input. ID of the parent pipeline. + * @param {string} pipeline_version_id Required input. The ID of the pipeline version to be deleted. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deletePipelineVersion(pipeline_id: string, pipeline_version_id: string, options?: any) { + return PipelineServiceApiFp(configuration).deletePipelineVersion( + pipeline_id, + pipeline_version_id, + options, + )(fetch, basePath); + }, + /** + * + * @summary Finds a specific pipeline by ID. + * @param {string} pipeline_id Required input. The ID of the pipeline to be retrieved. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getPipeline(pipeline_id: string, options?: any) { + return PipelineServiceApiFp(configuration).getPipeline(pipeline_id, options)(fetch, basePath); + }, + /** + * + * @summary Finds a specific pipeline by name and namespace. + * @param {string} name Required input. Name of the pipeline to be retrieved. + * @param {string} [namespace] Optional input. Namespace of the pipeline. It could be empty if default namespaces needs to be used or if multi-user support is turned off. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getPipelineByName(name: string, namespace?: string, options?: any) { + return PipelineServiceApiFp(configuration).getPipelineByName( + name, + namespace, + options, + )(fetch, basePath); + }, + /** + * + * @summary Gets a pipeline version by pipeline version ID and pipeline ID. + * @param {string} pipeline_id Required input. ID of the parent pipeline. + * @param {string} pipeline_version_id Required input. ID of the pipeline version to be retrieved. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getPipelineVersion(pipeline_id: string, pipeline_version_id: string, options?: any) { + return PipelineServiceApiFp(configuration).getPipelineVersion( + pipeline_id, + pipeline_version_id, + options, + )(fetch, basePath); + }, + /** + * + * @summary Lists all pipeline versions of a given pipeline ID. + * @param {string} pipeline_id Required input. ID of the parent pipeline. + * @param {string} [page_token] A page token to request the results page. + * @param {number} [page_size] The number of pipeline versions to be listed per page. If there are more pipeline versions than this number, the response message will contain a valid value in the nextPageToken field. + * @param {string} [sort_by] Sorting order in form of \"field_name\", \"field_name asc\" or \"field_name desc\". Ascending by default. + * @param {string} [filter] A url-encoded, JSON-serialized filter protocol buffer (see [filter.proto](https://github.com/kubeflow/pipelines/blob/master/backend/api/filter.proto)). + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listPipelineVersions( + pipeline_id: string, + page_token?: string, + page_size?: number, + sort_by?: string, + filter?: string, + options?: any, + ) { + return PipelineServiceApiFp(configuration).listPipelineVersions( + pipeline_id, + page_token, + page_size, + sort_by, + filter, + options, + )(fetch, basePath); + }, + /** + * + * @summary Finds all pipelines within a namespace. + * @param {string} [namespace] Optional input. Namespace for the pipelines. + * @param {string} [page_token] A page token to request the results page. + * @param {number} [page_size] The number of pipelines to be listed per page. If there are more pipelines than this number, the response message will contain a valid value in the nextPageToken field. + * @param {string} [sort_by] Sorting order in form of \"field_name\", \"field_name asc\" or \"field_name desc\". Ascending by default. + * @param {string} [filter] A url-encoded, JSON-serialized filter protocol buffer (see [filter.proto](https://github.com/kubeflow/pipelines/blob/master/backend/api/filter.proto)). + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listPipelines( + namespace?: string, + page_token?: string, + page_size?: number, + sort_by?: string, + filter?: string, + options?: any, + ) { + return PipelineServiceApiFp(configuration).listPipelines( + namespace, + page_token, + page_size, + sort_by, + filter, + options, + )(fetch, basePath); + }, + }; +}; + +/** + * PipelineServiceApi - object-oriented interface + * @export + * @class PipelineServiceApi + * @extends {BaseAPI} + */ +export class PipelineServiceApi extends BaseAPI { + /** + * + * @summary Creates a pipeline. + * @param {V2beta1Pipeline} body Required input. Pipeline that needs to be created. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PipelineServiceApi + */ + public createPipeline(body: V2beta1Pipeline, options?: any) { + return PipelineServiceApiFp(this.configuration).createPipeline(body, options)( + this.fetch, + this.basePath, + ); + } + + /** + * + * @summary Adds a pipeline version to the specified pipeline ID. + * @param {string} pipeline_id Required input. ID of the parent pipeline. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PipelineServiceApi + */ + public createPipelineVersion(pipeline_id: string, options?: any) { + return PipelineServiceApiFp(this.configuration).createPipelineVersion(pipeline_id, options)( + this.fetch, + this.basePath, + ); + } + + /** + * + * @summary Deletes an empty pipeline by ID. Returns error if the pipeline has pipeline versions. + * @param {string} pipeline_id Required input. ID of the pipeline to be deleted. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PipelineServiceApi + */ + public deletePipeline(pipeline_id: string, options?: any) { + return PipelineServiceApiFp(this.configuration).deletePipeline(pipeline_id, options)( + this.fetch, + this.basePath, + ); + } + + /** + * + * @summary Deletes a specific pipeline version by pipeline version ID and pipeline ID. + * @param {string} pipeline_id Required input. ID of the parent pipeline. + * @param {string} pipeline_version_id Required input. The ID of the pipeline version to be deleted. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PipelineServiceApi + */ + public deletePipelineVersion(pipeline_id: string, pipeline_version_id: string, options?: any) { + return PipelineServiceApiFp(this.configuration).deletePipelineVersion( + pipeline_id, + pipeline_version_id, + options, + )(this.fetch, this.basePath); + } + + /** + * + * @summary Finds a specific pipeline by ID. + * @param {string} pipeline_id Required input. The ID of the pipeline to be retrieved. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PipelineServiceApi + */ + public getPipeline(pipeline_id: string, options?: any) { + return PipelineServiceApiFp(this.configuration).getPipeline(pipeline_id, options)( + this.fetch, + this.basePath, + ); + } + + /** + * + * @summary Finds a specific pipeline by name and namespace. + * @param {string} name Required input. Name of the pipeline to be retrieved. + * @param {string} [namespace] Optional input. Namespace of the pipeline. It could be empty if default namespaces needs to be used or if multi-user support is turned off. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PipelineServiceApi + */ + public getPipelineByName(name: string, namespace?: string, options?: any) { + return PipelineServiceApiFp(this.configuration).getPipelineByName( + name, + namespace, + options, + )(this.fetch, this.basePath); + } + + /** + * + * @summary Gets a pipeline version by pipeline version ID and pipeline ID. + * @param {string} pipeline_id Required input. ID of the parent pipeline. + * @param {string} pipeline_version_id Required input. ID of the pipeline version to be retrieved. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PipelineServiceApi + */ + public getPipelineVersion(pipeline_id: string, pipeline_version_id: string, options?: any) { + return PipelineServiceApiFp(this.configuration).getPipelineVersion( + pipeline_id, + pipeline_version_id, + options, + )(this.fetch, this.basePath); + } + + /** + * + * @summary Lists all pipeline versions of a given pipeline ID. + * @param {string} pipeline_id Required input. ID of the parent pipeline. + * @param {string} [page_token] A page token to request the results page. + * @param {number} [page_size] The number of pipeline versions to be listed per page. If there are more pipeline versions than this number, the response message will contain a valid value in the nextPageToken field. + * @param {string} [sort_by] Sorting order in form of \"field_name\", \"field_name asc\" or \"field_name desc\". Ascending by default. + * @param {string} [filter] A url-encoded, JSON-serialized filter protocol buffer (see [filter.proto](https://github.com/kubeflow/pipelines/blob/master/backend/api/filter.proto)). + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PipelineServiceApi + */ + public listPipelineVersions( + pipeline_id: string, + page_token?: string, + page_size?: number, + sort_by?: string, + filter?: string, + options?: any, + ) { + return PipelineServiceApiFp(this.configuration).listPipelineVersions( + pipeline_id, + page_token, + page_size, + sort_by, + filter, + options, + )(this.fetch, this.basePath); + } + + /** + * + * @summary Finds all pipelines within a namespace. + * @param {string} [namespace] Optional input. Namespace for the pipelines. + * @param {string} [page_token] A page token to request the results page. + * @param {number} [page_size] The number of pipelines to be listed per page. If there are more pipelines than this number, the response message will contain a valid value in the nextPageToken field. + * @param {string} [sort_by] Sorting order in form of \"field_name\", \"field_name asc\" or \"field_name desc\". Ascending by default. + * @param {string} [filter] A url-encoded, JSON-serialized filter protocol buffer (see [filter.proto](https://github.com/kubeflow/pipelines/blob/master/backend/api/filter.proto)). + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PipelineServiceApi + */ + public listPipelines( + namespace?: string, + page_token?: string, + page_size?: number, + sort_by?: string, + filter?: string, + options?: any, + ) { + return PipelineServiceApiFp(this.configuration).listPipelines( + namespace, + page_token, + page_size, + sort_by, + filter, + options, + )(this.fetch, this.basePath); + } +} diff --git a/frontend/src/apisv2beta1/pipeline/configuration.ts b/frontend/src/apisv2beta1/pipeline/configuration.ts new file mode 100644 index 0000000000..b34afe8f6f --- /dev/null +++ b/frontend/src/apisv2beta1/pipeline/configuration.ts @@ -0,0 +1,65 @@ +// tslint:disable +/** + * backend/api/v2beta1/pipeline.proto + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * OpenAPI spec version: version not set + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +export interface ConfigurationParameters { + apiKey?: string | ((name: string) => string); + username?: string; + password?: string; + accessToken?: string | ((name: string, scopes?: string[]) => string); + basePath?: string; +} + +export class Configuration { + /** + * parameter for apiKey security + * @param name security name + * @memberof Configuration + */ + apiKey?: string | ((name: string) => string); + /** + * parameter for basic security + * + * @type {string} + * @memberof Configuration + */ + username?: string; + /** + * parameter for basic security + * + * @type {string} + * @memberof Configuration + */ + password?: string; + /** + * parameter for oauth2 security + * @param name security name + * @param scopes oauth2 scope + * @memberof Configuration + */ + accessToken?: string | ((name: string, scopes?: string[]) => string); + /** + * override base path + * + * @type {string} + * @memberof Configuration + */ + basePath?: string; + + constructor(param: ConfigurationParameters = {}) { + this.apiKey = param.apiKey; + this.username = param.username; + this.password = param.password; + this.accessToken = param.accessToken; + this.basePath = param.basePath; + } +} diff --git a/frontend/src/apisv2beta1/pipeline/custom.d.ts b/frontend/src/apisv2beta1/pipeline/custom.d.ts new file mode 100644 index 0000000000..4c611cc321 --- /dev/null +++ b/frontend/src/apisv2beta1/pipeline/custom.d.ts @@ -0,0 +1,2 @@ +declare module 'portable-fetch'; +declare module 'url'; diff --git a/frontend/src/apisv2beta1/pipeline/git_push.sh b/frontend/src/apisv2beta1/pipeline/git_push.sh new file mode 100644 index 0000000000..a1ff4c9bcb --- /dev/null +++ b/frontend/src/apisv2beta1/pipeline/git_push.sh @@ -0,0 +1,51 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=`git remote` +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/frontend/src/apisv2beta1/pipeline/index.ts b/frontend/src/apisv2beta1/pipeline/index.ts new file mode 100644 index 0000000000..584c64379f --- /dev/null +++ b/frontend/src/apisv2beta1/pipeline/index.ts @@ -0,0 +1,15 @@ +// tslint:disable +/** + * backend/api/v2beta1/pipeline.proto + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * OpenAPI spec version: version not set + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +export * from './api'; +export * from './configuration'; diff --git a/frontend/src/apisv2beta1/recurringrun/.gitignore b/frontend/src/apisv2beta1/recurringrun/.gitignore new file mode 100644 index 0000000000..35e2fb2b02 --- /dev/null +++ b/frontend/src/apisv2beta1/recurringrun/.gitignore @@ -0,0 +1,3 @@ +wwwroot/*.js +node_modules +typings diff --git a/frontend/src/apisv2beta1/recurringrun/.swagger-codegen-ignore b/frontend/src/apisv2beta1/recurringrun/.swagger-codegen-ignore new file mode 100644 index 0000000000..c5fa491b4c --- /dev/null +++ b/frontend/src/apisv2beta1/recurringrun/.swagger-codegen-ignore @@ -0,0 +1,23 @@ +# Swagger Codegen Ignore +# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/frontend/src/apisv2beta1/recurringrun/.swagger-codegen/VERSION b/frontend/src/apisv2beta1/recurringrun/.swagger-codegen/VERSION new file mode 100644 index 0000000000..48a6b508dc --- /dev/null +++ b/frontend/src/apisv2beta1/recurringrun/.swagger-codegen/VERSION @@ -0,0 +1 @@ +2.4.7 \ No newline at end of file diff --git a/frontend/src/apisv2beta1/recurringrun/api.ts b/frontend/src/apisv2beta1/recurringrun/api.ts new file mode 100644 index 0000000000..2d74e5cfb7 --- /dev/null +++ b/frontend/src/apisv2beta1/recurringrun/api.ts @@ -0,0 +1,1128 @@ +/// +// tslint:disable +/** + * backend/api/v2beta1/recurring_run.proto + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * OpenAPI spec version: version not set + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +import * as url from 'url'; +import * as portableFetch from 'portable-fetch'; +import { Configuration } from './configuration'; + +const BASE_PATH = 'http://localhost'.replace(/\/+$/, ''); + +/** + * + * @export + */ +export const COLLECTION_FORMATS = { + csv: ',', + ssv: ' ', + tsv: '\t', + pipes: '|', +}; + +/** + * + * @export + * @interface FetchAPI + */ +export interface FetchAPI { + (url: string, init?: any): Promise; +} + +/** + * + * @export + * @interface FetchArgs + */ +export interface FetchArgs { + url: string; + options: any; +} + +/** + * + * @export + * @class BaseAPI + */ +export class BaseAPI { + protected configuration: Configuration; + + constructor( + configuration?: Configuration, + protected basePath: string = BASE_PATH, + protected fetch: FetchAPI = portableFetch, + ) { + if (configuration) { + this.configuration = configuration; + this.basePath = configuration.basePath || this.basePath; + } + } +} + +/** + * + * @export + * @class RequiredError + * @extends {Error} + */ +export class RequiredError extends Error { + name: 'RequiredError'; + constructor(public field: string, msg?: string) { + super(msg); + } +} + +/** + * The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors). + * @export + * @interface GooglerpcStatus + */ +export interface GooglerpcStatus { + /** + * The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. + * @type {number} + * @memberof GooglerpcStatus + */ + code?: number; + /** + * A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. + * @type {string} + * @memberof GooglerpcStatus + */ + message?: string; + /** + * A list of messages that carry the error details. There is a common set of message types for APIs to use. + * @type {Array} + * @memberof GooglerpcStatus + */ + details?: Array; +} + +/** + * `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 := anypb.New(foo) if err != nil { ... } ... foo := &pb.Foo{} if err := any.UnmarshalTo(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\": , \"lastName\": } 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\" } + * @export + * @interface ProtobufAny + */ +export interface ProtobufAny { + /** + * A URL/resource name that uniquely identifies the type of the serialized protocol buffer message. This string must contain at least one \"/\" character. 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. + * @type {string} + * @memberof ProtobufAny + */ + type_url?: string; + /** + * Must be a valid serialized protocol buffer of the above specified type. + * @type {string} + * @memberof ProtobufAny + */ + value?: string; +} + +/** + * `ListValue` is a wrapper around a repeated field of values. The JSON representation for `ListValue` is JSON array. + * @export + * @interface ProtobufListValue + */ +export interface ProtobufListValue { + /** + * Repeated field of dynamically typed values. + * @type {Array} + * @memberof ProtobufListValue + */ + values?: Array; +} + +/** + * `NullValue` is a singleton enumeration to represent the null value for the `Value` type union. The JSON representation for `NullValue` is JSON `null`. - NULL_VALUE: Null value. + * @export + * @enum {string} + */ +export enum ProtobufNullValue { + NULLVALUE = 'NULL_VALUE', +} + +/** + * `Struct` represents a structured data value, consisting of fields which map to dynamically typed values. In some languages, `Struct` might be supported by a native representation. For example, in scripting languages like JS a struct is represented as an object. The details of that representation are described together with the proto support for the language. The JSON representation for `Struct` is JSON object. + * @export + * @interface ProtobufStruct + */ +export interface ProtobufStruct { + /** + * Unordered map of dynamically typed values. + * @type {{ [key: string]: ProtobufValue; }} + * @memberof ProtobufStruct + */ + fields?: { [key: string]: ProtobufValue }; +} + +/** + * `Value` represents a dynamically typed value which can be either null, a number, a string, a boolean, a recursive struct value, or a list of values. A producer of value is expected to set one of that variants, absence of any variant indicates an error. The JSON representation for `Value` is JSON value. + * @export + * @interface ProtobufValue + */ +export interface ProtobufValue { + /** + * Represents a null value. + * @type {ProtobufNullValue} + * @memberof ProtobufValue + */ + null_value?: ProtobufNullValue; + /** + * Represents a double value. + * @type {number} + * @memberof ProtobufValue + */ + number_value?: number; + /** + * Represents a string value. + * @type {string} + * @memberof ProtobufValue + */ + string_value?: string; + /** + * Represents a boolean value. + * @type {boolean} + * @memberof ProtobufValue + */ + bool_value?: boolean; + /** + * Represents a structured value. + * @type {ProtobufStruct} + * @memberof ProtobufValue + */ + struct_value?: ProtobufStruct; + /** + * Represents a repeated `Value`. + * @type {ProtobufListValue} + * @memberof ProtobufValue + */ + list_value?: ProtobufListValue; +} + +/** + * Required input. User setting to enable or disable the recurring run. Only used for creation of recurring runs. Later updates use enable/disable API. - DISABLE: The recurring run won't schedule any run if disabled. + * @export + * @enum {string} + */ +export enum RecurringRunMode { + MODEUNSPECIFIED = 'MODE_UNSPECIFIED', + ENABLE = 'ENABLE', + DISABLE = 'DISABLE', +} + +/** + * CronSchedule allow scheduling the recurring run with unix-like cron. + * @export + * @interface V2beta1CronSchedule + */ +export interface V2beta1CronSchedule { + /** + * The start time of the cron job. + * @type {Date} + * @memberof V2beta1CronSchedule + */ + start_time?: Date; + /** + * The end time of the cron job. + * @type {Date} + * @memberof V2beta1CronSchedule + */ + end_time?: Date; + /** + * + * @type {string} + * @memberof V2beta1CronSchedule + */ + cron?: string; +} + +/** + * + * @export + * @interface V2beta1ListRecurringRunsResponse + */ +export interface V2beta1ListRecurringRunsResponse { + /** + * A list of recurring runs returned. + * @type {Array} + * @memberof V2beta1ListRecurringRunsResponse + */ + recurringRuns?: Array; + /** + * The total number of recurring runs for the given query. + * @type {number} + * @memberof V2beta1ListRecurringRunsResponse + */ + total_size?: number; + /** + * The token to list the next page of recurring runs. + * @type {string} + * @memberof V2beta1ListRecurringRunsResponse + */ + next_page_token?: string; +} + +/** + * PeriodicSchedule allow scheduling the recurring run periodically with certain interval. + * @export + * @interface V2beta1PeriodicSchedule + */ +export interface V2beta1PeriodicSchedule { + /** + * The start time of the periodic recurring run. + * @type {Date} + * @memberof V2beta1PeriodicSchedule + */ + start_time?: Date; + /** + * The end time of the periodic recurring run. + * @type {Date} + * @memberof V2beta1PeriodicSchedule + */ + end_time?: Date; + /** + * The time interval between the starting time of consecutive recurring runs. + * @type {string} + * @memberof V2beta1PeriodicSchedule + */ + interval_second?: string; +} + +/** + * + * @export + * @interface V2beta1RecurringRun + */ +export interface V2beta1RecurringRun { + /** + * Output. Unique run ID generated by API server. + * @type {string} + * @memberof V2beta1RecurringRun + */ + recurring_run_id?: string; + /** + * Required input field. Recurring run name provided by user. Not unique. + * @type {string} + * @memberof V2beta1RecurringRun + */ + display_name?: string; + /** + * Optional input field. Describes the purpose of the recurring run. + * @type {string} + * @memberof V2beta1RecurringRun + */ + description?: string; + /** + * The ID of the pipeline version used for creating runs. + * @type {string} + * @memberof V2beta1RecurringRun + */ + pipeline_version_id?: string; + /** + * The pipeline spec. + * @type {ProtobufStruct} + * @memberof V2beta1RecurringRun + */ + pipeline_spec?: ProtobufStruct; + /** + * Runtime config of the pipeline. + * @type {V2beta1RuntimeConfig} + * @memberof V2beta1RecurringRun + */ + runtime_config?: V2beta1RuntimeConfig; + /** + * Optional input field. Specifies which Kubernetes service account this recurring run uses. + * @type {string} + * @memberof V2beta1RecurringRun + */ + service_account?: string; + /** + * Required input field. Specifies how many runs can be executed concurrently. Range [1-10]. + * @type {string} + * @memberof V2beta1RecurringRun + */ + max_concurrency?: string; + /** + * Required input field. Specifies how a run is triggered. Support cron mode or periodic mode. + * @type {V2beta1Trigger} + * @memberof V2beta1RecurringRun + */ + trigger?: V2beta1Trigger; + /** + * + * @type {RecurringRunMode} + * @memberof V2beta1RecurringRun + */ + mode?: RecurringRunMode; + /** + * Output. The time this recurring run was created. + * @type {Date} + * @memberof V2beta1RecurringRun + */ + created_at?: Date; + /** + * Output. The last time this recurring run was updated. + * @type {Date} + * @memberof V2beta1RecurringRun + */ + updated_at?: Date; + /** + * + * @type {V2beta1RecurringRunStatus} + * @memberof V2beta1RecurringRun + */ + status?: V2beta1RecurringRunStatus; + /** + * In case any error happens retrieving a recurring run field, only recurring run ID and the error message is returned. Client has the flexibility of choosing how to handle the error. This is especially useful during listing call. + * @type {GooglerpcStatus} + * @memberof V2beta1RecurringRun + */ + error?: GooglerpcStatus; + /** + * Optional input field. Whether the recurring run should catch up if behind schedule. If true, the recurring run will only schedule the latest interval if behind schedule. If false, the recurring run will catch up on each past interval. + * @type {boolean} + * @memberof V2beta1RecurringRun + */ + no_catchup?: boolean; + /** + * TODO (gkclat): consider removing this field if it can be obtained from the parent experiment. Output only. Namespace this recurring run belongs to. Derived from the parent experiment. + * @type {string} + * @memberof V2beta1RecurringRun + */ + namespace?: string; + /** + * ID of the parent experiment this recurring run belongs to. + * @type {string} + * @memberof V2beta1RecurringRun + */ + experiment_id?: string; +} + +/** + * Output. The status of the recurring run. + * @export + * @enum {string} + */ +export enum V2beta1RecurringRunStatus { + STATUSUNSPECIFIED = 'STATUS_UNSPECIFIED', + ENABLED = 'ENABLED', + DISABLED = 'DISABLED', +} + +/** + * The runtime config. + * @export + * @interface V2beta1RuntimeConfig + */ +export interface V2beta1RuntimeConfig { + /** + * The runtime parameters of the Pipeline. The parameters will be used to replace the placeholders at runtime. + * @type {{ [key: string]: ProtobufValue; }} + * @memberof V2beta1RuntimeConfig + */ + parameters?: { [key: string]: ProtobufValue }; + /** + * + * @type {string} + * @memberof V2beta1RuntimeConfig + */ + pipeline_root?: string; +} + +/** + * Trigger defines what starts a pipeline run. + * @export + * @interface V2beta1Trigger + */ +export interface V2beta1Trigger { + /** + * + * @type {V2beta1CronSchedule} + * @memberof V2beta1Trigger + */ + cron_schedule?: V2beta1CronSchedule; + /** + * + * @type {V2beta1PeriodicSchedule} + * @memberof V2beta1Trigger + */ + periodic_schedule?: V2beta1PeriodicSchedule; +} + +/** + * RecurringRunServiceApi - fetch parameter creator + * @export + */ +export const RecurringRunServiceApiFetchParamCreator = function(configuration?: Configuration) { + return { + /** + * + * @summary Creates a new recurring run in an experiment, given the experiment ID. + * @param {V2beta1RecurringRun} body The recurring run to be created. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createRecurringRun(body: V2beta1RecurringRun, options: any = {}): FetchArgs { + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError( + 'body', + 'Required parameter body was null or undefined when calling createRecurringRun.', + ); + } + const localVarPath = `/apis/v2beta1/recurringruns`; + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'POST' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarUrlObj.query = Object.assign( + {}, + localVarUrlObj.query, + localVarQueryParameter, + options.query, + ); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + const needsSerialization = + 'V2beta1RecurringRun' !== 'string' || + localVarRequestOptions.headers['Content-Type'] === 'application/json'; + localVarRequestOptions.body = needsSerialization ? JSON.stringify(body || {}) : body || ''; + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Deletes a recurring run. + * @param {string} recurring_run_id The ID of the recurring run to be deleted. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteRecurringRun(recurring_run_id: string, options: any = {}): FetchArgs { + // verify required parameter 'recurring_run_id' is not null or undefined + if (recurring_run_id === null || recurring_run_id === undefined) { + throw new RequiredError( + 'recurring_run_id', + 'Required parameter recurring_run_id was null or undefined when calling deleteRecurringRun.', + ); + } + const localVarPath = `/apis/v2beta1/recurringruns/{recurring_run_id}`.replace( + `{${'recurring_run_id'}}`, + encodeURIComponent(String(recurring_run_id)), + ); + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'DELETE' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + localVarUrlObj.query = Object.assign( + {}, + localVarUrlObj.query, + localVarQueryParameter, + options.query, + ); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Stops a recurring run and all its associated runs. The recurring run is not deleted. + * @param {string} recurring_run_id The ID of the recurring runs to be disabled. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + disableRecurringRun(recurring_run_id: string, options: any = {}): FetchArgs { + // verify required parameter 'recurring_run_id' is not null or undefined + if (recurring_run_id === null || recurring_run_id === undefined) { + throw new RequiredError( + 'recurring_run_id', + 'Required parameter recurring_run_id was null or undefined when calling disableRecurringRun.', + ); + } + const localVarPath = `/apis/v2beta1/recurringruns/{recurring_run_id}:disable`.replace( + `{${'recurring_run_id'}}`, + encodeURIComponent(String(recurring_run_id)), + ); + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'POST' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + localVarUrlObj.query = Object.assign( + {}, + localVarUrlObj.query, + localVarQueryParameter, + options.query, + ); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Restarts a recurring run that was previously stopped. All runs associated with the recurring run will continue. + * @param {string} recurring_run_id The ID of the recurring runs to be enabled. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + enableRecurringRun(recurring_run_id: string, options: any = {}): FetchArgs { + // verify required parameter 'recurring_run_id' is not null or undefined + if (recurring_run_id === null || recurring_run_id === undefined) { + throw new RequiredError( + 'recurring_run_id', + 'Required parameter recurring_run_id was null or undefined when calling enableRecurringRun.', + ); + } + const localVarPath = `/apis/v2beta1/recurringruns/{recurring_run_id}:enable`.replace( + `{${'recurring_run_id'}}`, + encodeURIComponent(String(recurring_run_id)), + ); + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'POST' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + localVarUrlObj.query = Object.assign( + {}, + localVarUrlObj.query, + localVarQueryParameter, + options.query, + ); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Finds a specific recurring run by ID. + * @param {string} recurring_run_id The ID of the recurring run to be retrieved. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getRecurringRun(recurring_run_id: string, options: any = {}): FetchArgs { + // verify required parameter 'recurring_run_id' is not null or undefined + if (recurring_run_id === null || recurring_run_id === undefined) { + throw new RequiredError( + 'recurring_run_id', + 'Required parameter recurring_run_id was null or undefined when calling getRecurringRun.', + ); + } + const localVarPath = `/apis/v2beta1/recurringruns/{recurring_run_id}`.replace( + `{${'recurring_run_id'}}`, + encodeURIComponent(String(recurring_run_id)), + ); + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'GET' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + localVarUrlObj.query = Object.assign( + {}, + localVarUrlObj.query, + localVarQueryParameter, + options.query, + ); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Finds all recurring runs given experiment and namespace. If experiment ID is not specified, find all recurring runs across all experiments. + * @param {string} [page_token] A page token to request the next page of results. The token is acquired from the nextPageToken field of the response from the previous ListRecurringRuns call or can be omitted when fetching the first page. + * @param {number} [page_size] The number of recurring runs to be listed per page. If there are more recurring runs than this number, the response message will contain a nextPageToken field you can use to fetch the next page. + * @param {string} [sort_by] Can be formatted as \"field_name\", \"field_name asc\" or \"field_name desc\". Ascending by default. + * @param {string} [namespace] Optional input. The namespace the recurring runs belong to. + * @param {string} [filter] A url-encoded, JSON-serialized Filter protocol buffer (see [filter.proto](https://github.com/kubeflow/pipelines/blob/master/backend/api/filter.proto)). + * @param {string} [experiment_id] The ID of the experiment to be retrieved. If empty, list recurring runs across all experiments. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listRecurringRuns( + page_token?: string, + page_size?: number, + sort_by?: string, + namespace?: string, + filter?: string, + experiment_id?: string, + options: any = {}, + ): FetchArgs { + const localVarPath = `/apis/v2beta1/recurringruns`; + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'GET' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + if (page_token !== undefined) { + localVarQueryParameter['page_token'] = page_token; + } + + if (page_size !== undefined) { + localVarQueryParameter['page_size'] = page_size; + } + + if (sort_by !== undefined) { + localVarQueryParameter['sort_by'] = sort_by; + } + + if (namespace !== undefined) { + localVarQueryParameter['namespace'] = namespace; + } + + if (filter !== undefined) { + localVarQueryParameter['filter'] = filter; + } + + if (experiment_id !== undefined) { + localVarQueryParameter['experiment_id'] = experiment_id; + } + + localVarUrlObj.query = Object.assign( + {}, + localVarUrlObj.query, + localVarQueryParameter, + options.query, + ); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + }; +}; + +/** + * RecurringRunServiceApi - functional programming interface + * @export + */ +export const RecurringRunServiceApiFp = function(configuration?: Configuration) { + return { + /** + * + * @summary Creates a new recurring run in an experiment, given the experiment ID. + * @param {V2beta1RecurringRun} body The recurring run to be created. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createRecurringRun( + body: V2beta1RecurringRun, + options?: any, + ): (fetch?: FetchAPI, basePath?: string) => Promise { + const localVarFetchArgs = RecurringRunServiceApiFetchParamCreator( + configuration, + ).createRecurringRun(body, options); + return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(response => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }; + }, + /** + * + * @summary Deletes a recurring run. + * @param {string} recurring_run_id The ID of the recurring run to be deleted. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteRecurringRun( + recurring_run_id: string, + options?: any, + ): (fetch?: FetchAPI, basePath?: string) => Promise { + const localVarFetchArgs = RecurringRunServiceApiFetchParamCreator( + configuration, + ).deleteRecurringRun(recurring_run_id, options); + return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(response => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }; + }, + /** + * + * @summary Stops a recurring run and all its associated runs. The recurring run is not deleted. + * @param {string} recurring_run_id The ID of the recurring runs to be disabled. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + disableRecurringRun( + recurring_run_id: string, + options?: any, + ): (fetch?: FetchAPI, basePath?: string) => Promise { + const localVarFetchArgs = RecurringRunServiceApiFetchParamCreator( + configuration, + ).disableRecurringRun(recurring_run_id, options); + return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(response => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }; + }, + /** + * + * @summary Restarts a recurring run that was previously stopped. All runs associated with the recurring run will continue. + * @param {string} recurring_run_id The ID of the recurring runs to be enabled. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + enableRecurringRun( + recurring_run_id: string, + options?: any, + ): (fetch?: FetchAPI, basePath?: string) => Promise { + const localVarFetchArgs = RecurringRunServiceApiFetchParamCreator( + configuration, + ).enableRecurringRun(recurring_run_id, options); + return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(response => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }; + }, + /** + * + * @summary Finds a specific recurring run by ID. + * @param {string} recurring_run_id The ID of the recurring run to be retrieved. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getRecurringRun( + recurring_run_id: string, + options?: any, + ): (fetch?: FetchAPI, basePath?: string) => Promise { + const localVarFetchArgs = RecurringRunServiceApiFetchParamCreator( + configuration, + ).getRecurringRun(recurring_run_id, options); + return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(response => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }; + }, + /** + * + * @summary Finds all recurring runs given experiment and namespace. If experiment ID is not specified, find all recurring runs across all experiments. + * @param {string} [page_token] A page token to request the next page of results. The token is acquired from the nextPageToken field of the response from the previous ListRecurringRuns call or can be omitted when fetching the first page. + * @param {number} [page_size] The number of recurring runs to be listed per page. If there are more recurring runs than this number, the response message will contain a nextPageToken field you can use to fetch the next page. + * @param {string} [sort_by] Can be formatted as \"field_name\", \"field_name asc\" or \"field_name desc\". Ascending by default. + * @param {string} [namespace] Optional input. The namespace the recurring runs belong to. + * @param {string} [filter] A url-encoded, JSON-serialized Filter protocol buffer (see [filter.proto](https://github.com/kubeflow/pipelines/blob/master/backend/api/filter.proto)). + * @param {string} [experiment_id] The ID of the experiment to be retrieved. If empty, list recurring runs across all experiments. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listRecurringRuns( + page_token?: string, + page_size?: number, + sort_by?: string, + namespace?: string, + filter?: string, + experiment_id?: string, + options?: any, + ): (fetch?: FetchAPI, basePath?: string) => Promise { + const localVarFetchArgs = RecurringRunServiceApiFetchParamCreator( + configuration, + ).listRecurringRuns( + page_token, + page_size, + sort_by, + namespace, + filter, + experiment_id, + options, + ); + return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(response => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }; + }, + }; +}; + +/** + * RecurringRunServiceApi - factory interface + * @export + */ +export const RecurringRunServiceApiFactory = function( + configuration?: Configuration, + fetch?: FetchAPI, + basePath?: string, +) { + return { + /** + * + * @summary Creates a new recurring run in an experiment, given the experiment ID. + * @param {V2beta1RecurringRun} body The recurring run to be created. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createRecurringRun(body: V2beta1RecurringRun, options?: any) { + return RecurringRunServiceApiFp(configuration).createRecurringRun(body, options)( + fetch, + basePath, + ); + }, + /** + * + * @summary Deletes a recurring run. + * @param {string} recurring_run_id The ID of the recurring run to be deleted. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteRecurringRun(recurring_run_id: string, options?: any) { + return RecurringRunServiceApiFp(configuration).deleteRecurringRun(recurring_run_id, options)( + fetch, + basePath, + ); + }, + /** + * + * @summary Stops a recurring run and all its associated runs. The recurring run is not deleted. + * @param {string} recurring_run_id The ID of the recurring runs to be disabled. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + disableRecurringRun(recurring_run_id: string, options?: any) { + return RecurringRunServiceApiFp(configuration).disableRecurringRun(recurring_run_id, options)( + fetch, + basePath, + ); + }, + /** + * + * @summary Restarts a recurring run that was previously stopped. All runs associated with the recurring run will continue. + * @param {string} recurring_run_id The ID of the recurring runs to be enabled. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + enableRecurringRun(recurring_run_id: string, options?: any) { + return RecurringRunServiceApiFp(configuration).enableRecurringRun(recurring_run_id, options)( + fetch, + basePath, + ); + }, + /** + * + * @summary Finds a specific recurring run by ID. + * @param {string} recurring_run_id The ID of the recurring run to be retrieved. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getRecurringRun(recurring_run_id: string, options?: any) { + return RecurringRunServiceApiFp(configuration).getRecurringRun(recurring_run_id, options)( + fetch, + basePath, + ); + }, + /** + * + * @summary Finds all recurring runs given experiment and namespace. If experiment ID is not specified, find all recurring runs across all experiments. + * @param {string} [page_token] A page token to request the next page of results. The token is acquired from the nextPageToken field of the response from the previous ListRecurringRuns call or can be omitted when fetching the first page. + * @param {number} [page_size] The number of recurring runs to be listed per page. If there are more recurring runs than this number, the response message will contain a nextPageToken field you can use to fetch the next page. + * @param {string} [sort_by] Can be formatted as \"field_name\", \"field_name asc\" or \"field_name desc\". Ascending by default. + * @param {string} [namespace] Optional input. The namespace the recurring runs belong to. + * @param {string} [filter] A url-encoded, JSON-serialized Filter protocol buffer (see [filter.proto](https://github.com/kubeflow/pipelines/blob/master/backend/api/filter.proto)). + * @param {string} [experiment_id] The ID of the experiment to be retrieved. If empty, list recurring runs across all experiments. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listRecurringRuns( + page_token?: string, + page_size?: number, + sort_by?: string, + namespace?: string, + filter?: string, + experiment_id?: string, + options?: any, + ) { + return RecurringRunServiceApiFp(configuration).listRecurringRuns( + page_token, + page_size, + sort_by, + namespace, + filter, + experiment_id, + options, + )(fetch, basePath); + }, + }; +}; + +/** + * RecurringRunServiceApi - object-oriented interface + * @export + * @class RecurringRunServiceApi + * @extends {BaseAPI} + */ +export class RecurringRunServiceApi extends BaseAPI { + /** + * + * @summary Creates a new recurring run in an experiment, given the experiment ID. + * @param {V2beta1RecurringRun} body The recurring run to be created. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof RecurringRunServiceApi + */ + public createRecurringRun(body: V2beta1RecurringRun, options?: any) { + return RecurringRunServiceApiFp(this.configuration).createRecurringRun(body, options)( + this.fetch, + this.basePath, + ); + } + + /** + * + * @summary Deletes a recurring run. + * @param {string} recurring_run_id The ID of the recurring run to be deleted. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof RecurringRunServiceApi + */ + public deleteRecurringRun(recurring_run_id: string, options?: any) { + return RecurringRunServiceApiFp(this.configuration).deleteRecurringRun( + recurring_run_id, + options, + )(this.fetch, this.basePath); + } + + /** + * + * @summary Stops a recurring run and all its associated runs. The recurring run is not deleted. + * @param {string} recurring_run_id The ID of the recurring runs to be disabled. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof RecurringRunServiceApi + */ + public disableRecurringRun(recurring_run_id: string, options?: any) { + return RecurringRunServiceApiFp(this.configuration).disableRecurringRun( + recurring_run_id, + options, + )(this.fetch, this.basePath); + } + + /** + * + * @summary Restarts a recurring run that was previously stopped. All runs associated with the recurring run will continue. + * @param {string} recurring_run_id The ID of the recurring runs to be enabled. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof RecurringRunServiceApi + */ + public enableRecurringRun(recurring_run_id: string, options?: any) { + return RecurringRunServiceApiFp(this.configuration).enableRecurringRun( + recurring_run_id, + options, + )(this.fetch, this.basePath); + } + + /** + * + * @summary Finds a specific recurring run by ID. + * @param {string} recurring_run_id The ID of the recurring run to be retrieved. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof RecurringRunServiceApi + */ + public getRecurringRun(recurring_run_id: string, options?: any) { + return RecurringRunServiceApiFp(this.configuration).getRecurringRun(recurring_run_id, options)( + this.fetch, + this.basePath, + ); + } + + /** + * + * @summary Finds all recurring runs given experiment and namespace. If experiment ID is not specified, find all recurring runs across all experiments. + * @param {string} [page_token] A page token to request the next page of results. The token is acquired from the nextPageToken field of the response from the previous ListRecurringRuns call or can be omitted when fetching the first page. + * @param {number} [page_size] The number of recurring runs to be listed per page. If there are more recurring runs than this number, the response message will contain a nextPageToken field you can use to fetch the next page. + * @param {string} [sort_by] Can be formatted as \"field_name\", \"field_name asc\" or \"field_name desc\". Ascending by default. + * @param {string} [namespace] Optional input. The namespace the recurring runs belong to. + * @param {string} [filter] A url-encoded, JSON-serialized Filter protocol buffer (see [filter.proto](https://github.com/kubeflow/pipelines/blob/master/backend/api/filter.proto)). + * @param {string} [experiment_id] The ID of the experiment to be retrieved. If empty, list recurring runs across all experiments. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof RecurringRunServiceApi + */ + public listRecurringRuns( + page_token?: string, + page_size?: number, + sort_by?: string, + namespace?: string, + filter?: string, + experiment_id?: string, + options?: any, + ) { + return RecurringRunServiceApiFp(this.configuration).listRecurringRuns( + page_token, + page_size, + sort_by, + namespace, + filter, + experiment_id, + options, + )(this.fetch, this.basePath); + } +} diff --git a/frontend/src/apisv2beta1/recurringrun/configuration.ts b/frontend/src/apisv2beta1/recurringrun/configuration.ts new file mode 100644 index 0000000000..7004c04413 --- /dev/null +++ b/frontend/src/apisv2beta1/recurringrun/configuration.ts @@ -0,0 +1,65 @@ +// tslint:disable +/** + * backend/api/v2beta1/recurring_run.proto + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * OpenAPI spec version: version not set + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +export interface ConfigurationParameters { + apiKey?: string | ((name: string) => string); + username?: string; + password?: string; + accessToken?: string | ((name: string, scopes?: string[]) => string); + basePath?: string; +} + +export class Configuration { + /** + * parameter for apiKey security + * @param name security name + * @memberof Configuration + */ + apiKey?: string | ((name: string) => string); + /** + * parameter for basic security + * + * @type {string} + * @memberof Configuration + */ + username?: string; + /** + * parameter for basic security + * + * @type {string} + * @memberof Configuration + */ + password?: string; + /** + * parameter for oauth2 security + * @param name security name + * @param scopes oauth2 scope + * @memberof Configuration + */ + accessToken?: string | ((name: string, scopes?: string[]) => string); + /** + * override base path + * + * @type {string} + * @memberof Configuration + */ + basePath?: string; + + constructor(param: ConfigurationParameters = {}) { + this.apiKey = param.apiKey; + this.username = param.username; + this.password = param.password; + this.accessToken = param.accessToken; + this.basePath = param.basePath; + } +} diff --git a/frontend/src/apisv2beta1/recurringrun/custom.d.ts b/frontend/src/apisv2beta1/recurringrun/custom.d.ts new file mode 100644 index 0000000000..4c611cc321 --- /dev/null +++ b/frontend/src/apisv2beta1/recurringrun/custom.d.ts @@ -0,0 +1,2 @@ +declare module 'portable-fetch'; +declare module 'url'; diff --git a/frontend/src/apisv2beta1/recurringrun/git_push.sh b/frontend/src/apisv2beta1/recurringrun/git_push.sh new file mode 100644 index 0000000000..a1ff4c9bcb --- /dev/null +++ b/frontend/src/apisv2beta1/recurringrun/git_push.sh @@ -0,0 +1,51 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=`git remote` +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/frontend/src/apisv2beta1/recurringrun/index.ts b/frontend/src/apisv2beta1/recurringrun/index.ts new file mode 100644 index 0000000000..2b1f25203f --- /dev/null +++ b/frontend/src/apisv2beta1/recurringrun/index.ts @@ -0,0 +1,15 @@ +// tslint:disable +/** + * backend/api/v2beta1/recurring_run.proto + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * OpenAPI spec version: version not set + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +export * from './api'; +export * from './configuration'; diff --git a/frontend/src/apisv2beta1/run/.gitignore b/frontend/src/apisv2beta1/run/.gitignore new file mode 100644 index 0000000000..35e2fb2b02 --- /dev/null +++ b/frontend/src/apisv2beta1/run/.gitignore @@ -0,0 +1,3 @@ +wwwroot/*.js +node_modules +typings diff --git a/frontend/src/apisv2beta1/run/.swagger-codegen-ignore b/frontend/src/apisv2beta1/run/.swagger-codegen-ignore new file mode 100644 index 0000000000..c5fa491b4c --- /dev/null +++ b/frontend/src/apisv2beta1/run/.swagger-codegen-ignore @@ -0,0 +1,23 @@ +# Swagger Codegen Ignore +# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/frontend/src/apisv2beta1/run/.swagger-codegen/VERSION b/frontend/src/apisv2beta1/run/.swagger-codegen/VERSION new file mode 100644 index 0000000000..48a6b508dc --- /dev/null +++ b/frontend/src/apisv2beta1/run/.swagger-codegen/VERSION @@ -0,0 +1 @@ +2.4.7 \ No newline at end of file diff --git a/frontend/src/apisv2beta1/run/api.ts b/frontend/src/apisv2beta1/run/api.ts new file mode 100644 index 0000000000..f06dbfb9f0 --- /dev/null +++ b/frontend/src/apisv2beta1/run/api.ts @@ -0,0 +1,1794 @@ +/// +// tslint:disable +/** + * backend/api/v2beta1/run.proto + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * OpenAPI spec version: version not set + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +import * as url from 'url'; +import * as portableFetch from 'portable-fetch'; +import { Configuration } from './configuration'; + +const BASE_PATH = 'http://localhost'.replace(/\/+$/, ''); + +/** + * + * @export + */ +export const COLLECTION_FORMATS = { + csv: ',', + ssv: ' ', + tsv: '\t', + pipes: '|', +}; + +/** + * + * @export + * @interface FetchAPI + */ +export interface FetchAPI { + (url: string, init?: any): Promise; +} + +/** + * + * @export + * @interface FetchArgs + */ +export interface FetchArgs { + url: string; + options: any; +} + +/** + * + * @export + * @class BaseAPI + */ +export class BaseAPI { + protected configuration: Configuration; + + constructor( + configuration?: Configuration, + protected basePath: string = BASE_PATH, + protected fetch: FetchAPI = portableFetch, + ) { + if (configuration) { + this.configuration = configuration; + this.basePath = configuration.basePath || this.basePath; + } + } +} + +/** + * + * @export + * @class RequiredError + * @extends {Error} + */ +export class RequiredError extends Error { + name: 'RequiredError'; + constructor(public field: string, msg?: string) { + super(msg); + } +} + +/** + * The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors). + * @export + * @interface GooglerpcStatus + */ +export interface GooglerpcStatus { + /** + * The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. + * @type {number} + * @memberof GooglerpcStatus + */ + code?: number; + /** + * A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. + * @type {string} + * @memberof GooglerpcStatus + */ + message?: string; + /** + * A list of messages that carry the error details. There is a common set of message types for APIs to use. + * @type {Array} + * @memberof GooglerpcStatus + */ + details?: Array; +} + +/** + * `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 := anypb.New(foo) if err != nil { ... } ... foo := &pb.Foo{} if err := any.UnmarshalTo(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\": , \"lastName\": } 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\" } + * @export + * @interface ProtobufAny + */ +export interface ProtobufAny { + /** + * A URL/resource name that uniquely identifies the type of the serialized protocol buffer message. This string must contain at least one \"/\" character. 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. + * @type {string} + * @memberof ProtobufAny + */ + type_url?: string; + /** + * Must be a valid serialized protocol buffer of the above specified type. + * @type {string} + * @memberof ProtobufAny + */ + value?: string; +} + +/** + * `ListValue` is a wrapper around a repeated field of values. The JSON representation for `ListValue` is JSON array. + * @export + * @interface ProtobufListValue + */ +export interface ProtobufListValue { + /** + * Repeated field of dynamically typed values. + * @type {Array} + * @memberof ProtobufListValue + */ + values?: Array; +} + +/** + * `NullValue` is a singleton enumeration to represent the null value for the `Value` type union. The JSON representation for `NullValue` is JSON `null`. - NULL_VALUE: Null value. + * @export + * @enum {string} + */ +export enum ProtobufNullValue { + NULLVALUE = 'NULL_VALUE', +} + +/** + * `Struct` represents a structured data value, consisting of fields which map to dynamically typed values. In some languages, `Struct` might be supported by a native representation. For example, in scripting languages like JS a struct is represented as an object. The details of that representation are described together with the proto support for the language. The JSON representation for `Struct` is JSON object. + * @export + * @interface ProtobufStruct + */ +export interface ProtobufStruct { + /** + * Unordered map of dynamically typed values. + * @type {{ [key: string]: ProtobufValue; }} + * @memberof ProtobufStruct + */ + fields?: { [key: string]: ProtobufValue }; +} + +/** + * `Value` represents a dynamically typed value which can be either null, a number, a string, a boolean, a recursive struct value, or a list of values. A producer of value is expected to set one of that variants, absence of any variant indicates an error. The JSON representation for `Value` is JSON value. + * @export + * @interface ProtobufValue + */ +export interface ProtobufValue { + /** + * Represents a null value. + * @type {ProtobufNullValue} + * @memberof ProtobufValue + */ + null_value?: ProtobufNullValue; + /** + * Represents a double value. + * @type {number} + * @memberof ProtobufValue + */ + number_value?: number; + /** + * Represents a string value. + * @type {string} + * @memberof ProtobufValue + */ + string_value?: string; + /** + * Represents a boolean value. + * @type {boolean} + * @memberof ProtobufValue + */ + bool_value?: boolean; + /** + * Represents a structured value. + * @type {ProtobufStruct} + * @memberof ProtobufValue + */ + struct_value?: ProtobufStruct; + /** + * Represents a repeated `Value`. + * @type {ProtobufListValue} + * @memberof ProtobufValue + */ + list_value?: ProtobufListValue; +} + +/** + * A list of artifact metadata. + * @export + * @interface V2beta1ArtifactList + */ +export interface V2beta1ArtifactList { + /** + * A list of artifact metadata ids. + * @type {Array} + * @memberof V2beta1ArtifactList + */ + artifact_ids?: Array; +} + +/** + * + * @export + * @interface V2beta1ListRunsResponse + */ +export interface V2beta1ListRunsResponse { + /** + * List of retrieved runs. + * @type {Array} + * @memberof V2beta1ListRunsResponse + */ + runs?: Array; + /** + * The total number of runs for the given query. + * @type {number} + * @memberof V2beta1ListRunsResponse + */ + total_size?: number; + /** + * The token to list the next page of runs. + * @type {string} + * @memberof V2beta1ListRunsResponse + */ + next_page_token?: string; +} + +/** + * Runtime information of a task execution. + * @export + * @interface V2beta1PipelineTaskDetail + */ +export interface V2beta1PipelineTaskDetail { + /** + * ID of the parent run. + * @type {string} + * @memberof V2beta1PipelineTaskDetail + */ + run_id?: string; + /** + * System-generated ID of a task. + * @type {string} + * @memberof V2beta1PipelineTaskDetail + */ + task_id?: string; + /** + * User specified name of a task that is defined in [Pipeline.spec][]. + * @type {string} + * @memberof V2beta1PipelineTaskDetail + */ + display_name?: string; + /** + * Creation time of a task. + * @type {Date} + * @memberof V2beta1PipelineTaskDetail + */ + create_time?: Date; + /** + * Starting time of a task. + * @type {Date} + * @memberof V2beta1PipelineTaskDetail + */ + start_time?: Date; + /** + * Completion time of a task. + * @type {Date} + * @memberof V2beta1PipelineTaskDetail + */ + end_time?: Date; + /** + * Execution information of a task. + * @type {V2beta1PipelineTaskExecutorDetail} + * @memberof V2beta1PipelineTaskDetail + */ + executor_detail?: V2beta1PipelineTaskExecutorDetail; + /** + * Runtime state of a task. + * @type {V2beta1RuntimeState} + * @memberof V2beta1PipelineTaskDetail + */ + state?: V2beta1RuntimeState; + /** + * Execution metadata of a task. + * @type {string} + * @memberof V2beta1PipelineTaskDetail + */ + execution_id?: string; + /** + * The error that occurred during task execution. Only populated when the task is in FAILED or CANCELED state. + * @type {GooglerpcStatus} + * @memberof V2beta1PipelineTaskDetail + */ + error?: GooglerpcStatus; + /** + * Input artifacts of the task. + * @type {{ [key: string]: V2beta1ArtifactList; }} + * @memberof V2beta1PipelineTaskDetail + */ + inputs?: { [key: string]: V2beta1ArtifactList }; + /** + * Output artifacts of the task. + * @type {{ [key: string]: V2beta1ArtifactList; }} + * @memberof V2beta1PipelineTaskDetail + */ + outputs?: { [key: string]: V2beta1ArtifactList }; + /** + * ID of the parent task if the task is within a component scope. Empty if the task is at the root level. + * @type {string} + * @memberof V2beta1PipelineTaskDetail + */ + parent_task_id?: string; + /** + * A sequence of task statuses. This field keeps a record of state transitions. + * @type {Array} + * @memberof V2beta1PipelineTaskDetail + */ + state_history?: Array; +} + +/** + * Runtime information of a pipeline task executor. + * @export + * @interface V2beta1PipelineTaskExecutorDetail + */ +export interface V2beta1PipelineTaskExecutorDetail { + /** + * The name of the job for the main container execution. + * @type {string} + * @memberof V2beta1PipelineTaskExecutorDetail + */ + main_job?: string; + /** + * The name of the job for the pre-caching-check container execution. This job will be available if the Run.pipeline_spec specifies the `pre_caching_check` hook in the lifecycle events. + * @type {string} + * @memberof V2beta1PipelineTaskExecutorDetail + */ + pre_caching_check_job?: string; + /** + * The names of the previously failed job for the main container executions. The list includes the all attempts in chronological order. + * @type {Array} + * @memberof V2beta1PipelineTaskExecutorDetail + */ + failed_main_jobs?: Array; + /** + * The names of the previously failed job for the pre-caching-check container executions. This job will be available if the Run.pipeline_spec specifies the `pre_caching_check` hook in the lifecycle events. The list includes the all attempts in chronological order. + * @type {Array} + * @memberof V2beta1PipelineTaskExecutorDetail + */ + failed_pre_caching_check_jobs?: Array; +} + +/** + * + * @export + * @interface V2beta1ReadArtifactResponse + */ +export interface V2beta1ReadArtifactResponse { + /** + * Byte array of the artifact content. + * @type {string} + * @memberof V2beta1ReadArtifactResponse + */ + data?: string; +} + +/** + * + * @export + * @interface V2beta1Run + */ +export interface V2beta1Run { + /** + * Input. ID of the parent experiment. The default experiment ID will be used if this is not specified. + * @type {string} + * @memberof V2beta1Run + */ + experiment_id?: string; + /** + * Output. Unique run ID. Generated by API server. + * @type {string} + * @memberof V2beta1Run + */ + run_id?: string; + /** + * Required input. Name provided by user, or auto generated if run is created by a recurring run. + * @type {string} + * @memberof V2beta1Run + */ + display_name?: string; + /** + * Output. Specifies whether this run is in archived or available mode. + * @type {V2beta1RunStorageState} + * @memberof V2beta1Run + */ + storage_state?: V2beta1RunStorageState; + /** + * Optional input. Short description of the run. + * @type {string} + * @memberof V2beta1Run + */ + description?: string; + /** + * ID of an existing pipeline version. + * @type {string} + * @memberof V2beta1Run + */ + pipeline_version_id?: string; + /** + * Pipeline spec. + * @type {ProtobufStruct} + * @memberof V2beta1Run + */ + pipeline_spec?: ProtobufStruct; + /** + * Required input. Runtime config of the run. + * @type {V2beta1RuntimeConfig} + * @memberof V2beta1Run + */ + runtime_config?: V2beta1RuntimeConfig; + /** + * Optional input. Specifies which kubernetes service account is used. + * @type {string} + * @memberof V2beta1Run + */ + service_account?: string; + /** + * Output. Creation time of the run. + * @type {Date} + * @memberof V2beta1Run + */ + created_at?: Date; + /** + * Output. When this run is scheduled to start. This could be different from created_at. For example, if a run is from a backfilling job that was supposed to run 2 month ago, the created_at will be 2 month behind scheduled_at. + * @type {Date} + * @memberof V2beta1Run + */ + scheduled_at?: Date; + /** + * Output. Completion of the run. + * @type {Date} + * @memberof V2beta1Run + */ + finished_at?: Date; + /** + * Output. Runtime state of a run. + * @type {V2beta1RuntimeState} + * @memberof V2beta1Run + */ + state?: V2beta1RuntimeState; + /** + * In case any error happens retrieving a run field, only run ID and the error message is returned. Client has the flexibility of choosing how to handle the error. This is especially useful during listing call. + * @type {GooglerpcStatus} + * @memberof V2beta1Run + */ + error?: GooglerpcStatus; + /** + * Output. Runtime details of a run. + * @type {V2beta1RunDetails} + * @memberof V2beta1Run + */ + run_details?: V2beta1RunDetails; + /** + * ID of the recurring run that triggered this run. + * @type {string} + * @memberof V2beta1Run + */ + recurring_run_id?: string; + /** + * Output. A sequence of run statuses. This field keeps a record of state transitions. + * @type {Array} + * @memberof V2beta1Run + */ + state_history?: Array; +} + +/** + * Runtime details of a run. + * @export + * @interface V2beta1RunDetails + */ +export interface V2beta1RunDetails { + /** + * Pipeline context ID of a run. + * @type {string} + * @memberof V2beta1RunDetails + */ + pipeline_context_id?: string; + /** + * Pipeline run context ID of a run. + * @type {string} + * @memberof V2beta1RunDetails + */ + pipeline_run_context_id?: string; + /** + * Runtime details of the tasks that belong to the run. + * @type {Array} + * @memberof V2beta1RunDetails + */ + task_details?: Array; +} + +/** + * Describes whether an entity is available or archived. - STORAGE_STATE_UNSPECIFIED: Default state. This state in not used - AVAILABLE: Entity is available. - ARCHIVED: Entity is archived. + * @export + * @enum {string} + */ +export enum V2beta1RunStorageState { + STORAGESTATEUNSPECIFIED = 'STORAGE_STATE_UNSPECIFIED', + AVAILABLE = 'AVAILABLE', + ARCHIVED = 'ARCHIVED', +} + +/** + * The runtime config. + * @export + * @interface V2beta1RuntimeConfig + */ +export interface V2beta1RuntimeConfig { + /** + * The runtime parameters of the Pipeline. The parameters will be used to replace the placeholders at runtime. + * @type {{ [key: string]: ProtobufValue; }} + * @memberof V2beta1RuntimeConfig + */ + parameters?: { [key: string]: ProtobufValue }; + /** + * + * @type {string} + * @memberof V2beta1RuntimeConfig + */ + pipeline_root?: string; +} + +/** + * Describes the runtime state of an entity. - RUNTIME_STATE_UNSPECIFIED: Default value. This value is not used. - PENDING: Service is preparing to execute an entity. - RUNNING: Entity execution is in progress. - SUCCEEDED: Entity completed successfully. - SKIPPED: Entity has been skipped. For example, due to caching. - FAILED: Entity execution has failed. - CANCELING: Entity is being canceled. From this state, an entity may only change its state to SUCCEEDED, FAILED or CANCELED. - CANCELED: Entity has been canceled. - PAUSED: Entity has been paused. It can be resumed. + * @export + * @enum {string} + */ +export enum V2beta1RuntimeState { + RUNTIMESTATEUNSPECIFIED = 'RUNTIME_STATE_UNSPECIFIED', + PENDING = 'PENDING', + RUNNING = 'RUNNING', + SUCCEEDED = 'SUCCEEDED', + SKIPPED = 'SKIPPED', + FAILED = 'FAILED', + CANCELING = 'CANCELING', + CANCELED = 'CANCELED', + PAUSED = 'PAUSED', +} + +/** + * Timestamped representation of a runtime state with an optional error. + * @export + * @interface V2beta1RuntimeStatus + */ +export interface V2beta1RuntimeStatus { + /** + * Update time of this state. + * @type {Date} + * @memberof V2beta1RuntimeStatus + */ + update_time?: Date; + /** + * The state of a runtime instance. + * @type {V2beta1RuntimeState} + * @memberof V2beta1RuntimeStatus + */ + state?: V2beta1RuntimeState; + /** + * The error that occurred during the state. May be set when the state is any of the non-final states (PENDING/RUNNING/CANCELING) or FAILED state. If the state is FAILED, the error here is final and not going to be retried. If the state is a non-final state, the error indicates that a system-error being retried. + * @type {GooglerpcStatus} + * @memberof V2beta1RuntimeStatus + */ + error?: GooglerpcStatus; +} + +/** + * RunServiceApi - fetch parameter creator + * @export + */ +export const RunServiceApiFetchParamCreator = function(configuration?: Configuration) { + return { + /** + * + * @summary Archives a run in an experiment given by run ID and experiment ID. + * @param {string} experiment_id The ID of the parent experiment. + * @param {string} run_id The ID of the run to be archived. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + archiveRun(experiment_id: string, run_id: string, options: any = {}): FetchArgs { + // verify required parameter 'experiment_id' is not null or undefined + if (experiment_id === null || experiment_id === undefined) { + throw new RequiredError( + 'experiment_id', + 'Required parameter experiment_id was null or undefined when calling archiveRun.', + ); + } + // verify required parameter 'run_id' is not null or undefined + if (run_id === null || run_id === undefined) { + throw new RequiredError( + 'run_id', + 'Required parameter run_id was null or undefined when calling archiveRun.', + ); + } + const localVarPath = `/apis/v2beta1/experiments/{experiment_id}/runs/{run_id}:archive` + .replace(`{${'experiment_id'}}`, encodeURIComponent(String(experiment_id))) + .replace(`{${'run_id'}}`, encodeURIComponent(String(run_id))); + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'POST' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = + typeof configuration.apiKey === 'function' + ? configuration.apiKey('authorization') + : configuration.apiKey; + localVarHeaderParameter['authorization'] = localVarApiKeyValue; + } + + localVarUrlObj.query = Object.assign( + {}, + localVarUrlObj.query, + localVarQueryParameter, + options.query, + ); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Creates a new run in an experiment specified by experiment ID. If experiment ID is not specified, the run is created in the default experiment. + * @param {string} experiment_id The ID of the parent experiment. + * @param {V2beta1Run} body Run to be created. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createRun(experiment_id: string, body: V2beta1Run, options: any = {}): FetchArgs { + // verify required parameter 'experiment_id' is not null or undefined + if (experiment_id === null || experiment_id === undefined) { + throw new RequiredError( + 'experiment_id', + 'Required parameter experiment_id was null or undefined when calling createRun.', + ); + } + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError( + 'body', + 'Required parameter body was null or undefined when calling createRun.', + ); + } + const localVarPath = `/apis/v2beta1/experiments/{experiment_id}/runs`.replace( + `{${'experiment_id'}}`, + encodeURIComponent(String(experiment_id)), + ); + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'POST' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = + typeof configuration.apiKey === 'function' + ? configuration.apiKey('authorization') + : configuration.apiKey; + localVarHeaderParameter['authorization'] = localVarApiKeyValue; + } + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarUrlObj.query = Object.assign( + {}, + localVarUrlObj.query, + localVarQueryParameter, + options.query, + ); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + const needsSerialization = + 'V2beta1Run' !== 'string' || + localVarRequestOptions.headers['Content-Type'] === 'application/json'; + localVarRequestOptions.body = needsSerialization ? JSON.stringify(body || {}) : body || ''; + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Deletes a run in an experiment given by run ID and experiment ID. + * @param {string} experiment_id The ID of the parent experiment. + * @param {string} run_id The ID of the run to be deleted. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteRun(experiment_id: string, run_id: string, options: any = {}): FetchArgs { + // verify required parameter 'experiment_id' is not null or undefined + if (experiment_id === null || experiment_id === undefined) { + throw new RequiredError( + 'experiment_id', + 'Required parameter experiment_id was null or undefined when calling deleteRun.', + ); + } + // verify required parameter 'run_id' is not null or undefined + if (run_id === null || run_id === undefined) { + throw new RequiredError( + 'run_id', + 'Required parameter run_id was null or undefined when calling deleteRun.', + ); + } + const localVarPath = `/apis/v2beta1/experiments/{experiment_id}/runs/{run_id}` + .replace(`{${'experiment_id'}}`, encodeURIComponent(String(experiment_id))) + .replace(`{${'run_id'}}`, encodeURIComponent(String(run_id))); + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'DELETE' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = + typeof configuration.apiKey === 'function' + ? configuration.apiKey('authorization') + : configuration.apiKey; + localVarHeaderParameter['authorization'] = localVarApiKeyValue; + } + + localVarUrlObj.query = Object.assign( + {}, + localVarUrlObj.query, + localVarQueryParameter, + options.query, + ); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Finds a specific run by ID. + * @param {string} experiment_id The ID of the parent experiment. + * @param {string} run_id The ID of the run to be retrieved. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getRun(experiment_id: string, run_id: string, options: any = {}): FetchArgs { + // verify required parameter 'experiment_id' is not null or undefined + if (experiment_id === null || experiment_id === undefined) { + throw new RequiredError( + 'experiment_id', + 'Required parameter experiment_id was null or undefined when calling getRun.', + ); + } + // verify required parameter 'run_id' is not null or undefined + if (run_id === null || run_id === undefined) { + throw new RequiredError( + 'run_id', + 'Required parameter run_id was null or undefined when calling getRun.', + ); + } + const localVarPath = `/apis/v2beta1/experiments/{experiment_id}/runs/{run_id}` + .replace(`{${'experiment_id'}}`, encodeURIComponent(String(experiment_id))) + .replace(`{${'run_id'}}`, encodeURIComponent(String(run_id))); + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'GET' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = + typeof configuration.apiKey === 'function' + ? configuration.apiKey('authorization') + : configuration.apiKey; + localVarHeaderParameter['authorization'] = localVarApiKeyValue; + } + + localVarUrlObj.query = Object.assign( + {}, + localVarUrlObj.query, + localVarQueryParameter, + options.query, + ); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Finds all runs in an experiment given by experiment ID. If experiment id is not specified, finds all runs across all experiments. + * @param {string} experiment_id The ID of the parent experiment. If empty, response includes runs across all experiments. + * @param {string} [namespace] Optional input field. Filters based on the namespace. + * @param {string} [page_token] A page token to request the next page of results. The token is acquired from the nextPageToken field of the response from the previous ListRuns call or can be omitted when fetching the first page. + * @param {number} [page_size] The number of runs to be listed per page. If there are more runs than this number, the response message will contain a nextPageToken field you can use to fetch the next page. + * @param {string} [sort_by] Can be format of \"field_name\", \"field_name asc\" or \"field_name desc\" (Example, \"name asc\" or \"id desc\"). Ascending by default. + * @param {string} [filter] A url-encoded, JSON-serialized Filter protocol buffer (see [filter.proto](https://github.com/kubeflow/pipelines/blob/master/backend/api/filter.proto)). + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listRuns( + experiment_id: string, + namespace?: string, + page_token?: string, + page_size?: number, + sort_by?: string, + filter?: string, + options: any = {}, + ): FetchArgs { + // verify required parameter 'experiment_id' is not null or undefined + if (experiment_id === null || experiment_id === undefined) { + throw new RequiredError( + 'experiment_id', + 'Required parameter experiment_id was null or undefined when calling listRuns.', + ); + } + const localVarPath = `/apis/v2beta1/experiments/{experiment_id}/runs`.replace( + `{${'experiment_id'}}`, + encodeURIComponent(String(experiment_id)), + ); + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'GET' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = + typeof configuration.apiKey === 'function' + ? configuration.apiKey('authorization') + : configuration.apiKey; + localVarHeaderParameter['authorization'] = localVarApiKeyValue; + } + + if (namespace !== undefined) { + localVarQueryParameter['namespace'] = namespace; + } + + if (page_token !== undefined) { + localVarQueryParameter['page_token'] = page_token; + } + + if (page_size !== undefined) { + localVarQueryParameter['page_size'] = page_size; + } + + if (sort_by !== undefined) { + localVarQueryParameter['sort_by'] = sort_by; + } + + if (filter !== undefined) { + localVarQueryParameter['filter'] = filter; + } + + localVarUrlObj.query = Object.assign( + {}, + localVarUrlObj.query, + localVarQueryParameter, + options.query, + ); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Finds artifact data in a run. + * @param {string} experiment_id The ID of the parent experiment. + * @param {string} run_id ID of the run. + * @param {string} node_id ID of the running node. + * @param {string} artifact_name Name of the artifact. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + readArtifact( + experiment_id: string, + run_id: string, + node_id: string, + artifact_name: string, + options: any = {}, + ): FetchArgs { + // verify required parameter 'experiment_id' is not null or undefined + if (experiment_id === null || experiment_id === undefined) { + throw new RequiredError( + 'experiment_id', + 'Required parameter experiment_id was null or undefined when calling readArtifact.', + ); + } + // verify required parameter 'run_id' is not null or undefined + if (run_id === null || run_id === undefined) { + throw new RequiredError( + 'run_id', + 'Required parameter run_id was null or undefined when calling readArtifact.', + ); + } + // verify required parameter 'node_id' is not null or undefined + if (node_id === null || node_id === undefined) { + throw new RequiredError( + 'node_id', + 'Required parameter node_id was null or undefined when calling readArtifact.', + ); + } + // verify required parameter 'artifact_name' is not null or undefined + if (artifact_name === null || artifact_name === undefined) { + throw new RequiredError( + 'artifact_name', + 'Required parameter artifact_name was null or undefined when calling readArtifact.', + ); + } + const localVarPath = `/apis/v2beta1/experiments/{experiment_id}/runs/{run_id}/nodes/{node_id}/artifacts/{artifact_name}:read` + .replace(`{${'experiment_id'}}`, encodeURIComponent(String(experiment_id))) + .replace(`{${'run_id'}}`, encodeURIComponent(String(run_id))) + .replace(`{${'node_id'}}`, encodeURIComponent(String(node_id))) + .replace(`{${'artifact_name'}}`, encodeURIComponent(String(artifact_name))); + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'GET' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = + typeof configuration.apiKey === 'function' + ? configuration.apiKey('authorization') + : configuration.apiKey; + localVarHeaderParameter['authorization'] = localVarApiKeyValue; + } + + localVarUrlObj.query = Object.assign( + {}, + localVarUrlObj.query, + localVarQueryParameter, + options.query, + ); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Re-initiates a failed or terminated run. + * @param {string} experiment_id The ID of the parent experiment. + * @param {string} run_id The ID of the run to be retried. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + retryRun(experiment_id: string, run_id: string, options: any = {}): FetchArgs { + // verify required parameter 'experiment_id' is not null or undefined + if (experiment_id === null || experiment_id === undefined) { + throw new RequiredError( + 'experiment_id', + 'Required parameter experiment_id was null or undefined when calling retryRun.', + ); + } + // verify required parameter 'run_id' is not null or undefined + if (run_id === null || run_id === undefined) { + throw new RequiredError( + 'run_id', + 'Required parameter run_id was null or undefined when calling retryRun.', + ); + } + const localVarPath = `/apis/v2beta1/experiments/{experiment_id}/runs/{run_id}:retry` + .replace(`{${'experiment_id'}}`, encodeURIComponent(String(experiment_id))) + .replace(`{${'run_id'}}`, encodeURIComponent(String(run_id))); + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'POST' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = + typeof configuration.apiKey === 'function' + ? configuration.apiKey('authorization') + : configuration.apiKey; + localVarHeaderParameter['authorization'] = localVarApiKeyValue; + } + + localVarUrlObj.query = Object.assign( + {}, + localVarUrlObj.query, + localVarQueryParameter, + options.query, + ); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Terminates an active run. + * @param {string} experiment_id The ID of the parent experiment. + * @param {string} run_id The ID of the run to be terminated. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + terminateRun(experiment_id: string, run_id: string, options: any = {}): FetchArgs { + // verify required parameter 'experiment_id' is not null or undefined + if (experiment_id === null || experiment_id === undefined) { + throw new RequiredError( + 'experiment_id', + 'Required parameter experiment_id was null or undefined when calling terminateRun.', + ); + } + // verify required parameter 'run_id' is not null or undefined + if (run_id === null || run_id === undefined) { + throw new RequiredError( + 'run_id', + 'Required parameter run_id was null or undefined when calling terminateRun.', + ); + } + const localVarPath = `/apis/v2beta1/experiments/{experiment_id}/runs/{run_id}:terminate` + .replace(`{${'experiment_id'}}`, encodeURIComponent(String(experiment_id))) + .replace(`{${'run_id'}}`, encodeURIComponent(String(run_id))); + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'POST' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = + typeof configuration.apiKey === 'function' + ? configuration.apiKey('authorization') + : configuration.apiKey; + localVarHeaderParameter['authorization'] = localVarApiKeyValue; + } + + localVarUrlObj.query = Object.assign( + {}, + localVarUrlObj.query, + localVarQueryParameter, + options.query, + ); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Restores an archived run in an experiment given by run ID and experiment ID. + * @param {string} experiment_id The ID of the parent experiment. + * @param {string} run_id The ID of the run to be restored. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + unarchiveRun(experiment_id: string, run_id: string, options: any = {}): FetchArgs { + // verify required parameter 'experiment_id' is not null or undefined + if (experiment_id === null || experiment_id === undefined) { + throw new RequiredError( + 'experiment_id', + 'Required parameter experiment_id was null or undefined when calling unarchiveRun.', + ); + } + // verify required parameter 'run_id' is not null or undefined + if (run_id === null || run_id === undefined) { + throw new RequiredError( + 'run_id', + 'Required parameter run_id was null or undefined when calling unarchiveRun.', + ); + } + const localVarPath = `/apis/v2beta1/experiments/{experiment_id}/runs/{run_id}:unarchive` + .replace(`{${'experiment_id'}}`, encodeURIComponent(String(experiment_id))) + .replace(`{${'run_id'}}`, encodeURIComponent(String(run_id))); + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'POST' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = + typeof configuration.apiKey === 'function' + ? configuration.apiKey('authorization') + : configuration.apiKey; + localVarHeaderParameter['authorization'] = localVarApiKeyValue; + } + + localVarUrlObj.query = Object.assign( + {}, + localVarUrlObj.query, + localVarQueryParameter, + options.query, + ); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + }; +}; + +/** + * RunServiceApi - functional programming interface + * @export + */ +export const RunServiceApiFp = function(configuration?: Configuration) { + return { + /** + * + * @summary Archives a run in an experiment given by run ID and experiment ID. + * @param {string} experiment_id The ID of the parent experiment. + * @param {string} run_id The ID of the run to be archived. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + archiveRun( + experiment_id: string, + run_id: string, + options?: any, + ): (fetch?: FetchAPI, basePath?: string) => Promise { + const localVarFetchArgs = RunServiceApiFetchParamCreator(configuration).archiveRun( + experiment_id, + run_id, + options, + ); + return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(response => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }; + }, + /** + * + * @summary Creates a new run in an experiment specified by experiment ID. If experiment ID is not specified, the run is created in the default experiment. + * @param {string} experiment_id The ID of the parent experiment. + * @param {V2beta1Run} body Run to be created. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createRun( + experiment_id: string, + body: V2beta1Run, + options?: any, + ): (fetch?: FetchAPI, basePath?: string) => Promise { + const localVarFetchArgs = RunServiceApiFetchParamCreator(configuration).createRun( + experiment_id, + body, + options, + ); + return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(response => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }; + }, + /** + * + * @summary Deletes a run in an experiment given by run ID and experiment ID. + * @param {string} experiment_id The ID of the parent experiment. + * @param {string} run_id The ID of the run to be deleted. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteRun( + experiment_id: string, + run_id: string, + options?: any, + ): (fetch?: FetchAPI, basePath?: string) => Promise { + const localVarFetchArgs = RunServiceApiFetchParamCreator(configuration).deleteRun( + experiment_id, + run_id, + options, + ); + return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(response => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }; + }, + /** + * + * @summary Finds a specific run by ID. + * @param {string} experiment_id The ID of the parent experiment. + * @param {string} run_id The ID of the run to be retrieved. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getRun( + experiment_id: string, + run_id: string, + options?: any, + ): (fetch?: FetchAPI, basePath?: string) => Promise { + const localVarFetchArgs = RunServiceApiFetchParamCreator(configuration).getRun( + experiment_id, + run_id, + options, + ); + return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(response => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }; + }, + /** + * + * @summary Finds all runs in an experiment given by experiment ID. If experiment id is not specified, finds all runs across all experiments. + * @param {string} experiment_id The ID of the parent experiment. If empty, response includes runs across all experiments. + * @param {string} [namespace] Optional input field. Filters based on the namespace. + * @param {string} [page_token] A page token to request the next page of results. The token is acquired from the nextPageToken field of the response from the previous ListRuns call or can be omitted when fetching the first page. + * @param {number} [page_size] The number of runs to be listed per page. If there are more runs than this number, the response message will contain a nextPageToken field you can use to fetch the next page. + * @param {string} [sort_by] Can be format of \"field_name\", \"field_name asc\" or \"field_name desc\" (Example, \"name asc\" or \"id desc\"). Ascending by default. + * @param {string} [filter] A url-encoded, JSON-serialized Filter protocol buffer (see [filter.proto](https://github.com/kubeflow/pipelines/blob/master/backend/api/filter.proto)). + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listRuns( + experiment_id: string, + namespace?: string, + page_token?: string, + page_size?: number, + sort_by?: string, + filter?: string, + options?: any, + ): (fetch?: FetchAPI, basePath?: string) => Promise { + const localVarFetchArgs = RunServiceApiFetchParamCreator(configuration).listRuns( + experiment_id, + namespace, + page_token, + page_size, + sort_by, + filter, + options, + ); + return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(response => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }; + }, + /** + * + * @summary Finds artifact data in a run. + * @param {string} experiment_id The ID of the parent experiment. + * @param {string} run_id ID of the run. + * @param {string} node_id ID of the running node. + * @param {string} artifact_name Name of the artifact. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + readArtifact( + experiment_id: string, + run_id: string, + node_id: string, + artifact_name: string, + options?: any, + ): (fetch?: FetchAPI, basePath?: string) => Promise { + const localVarFetchArgs = RunServiceApiFetchParamCreator(configuration).readArtifact( + experiment_id, + run_id, + node_id, + artifact_name, + options, + ); + return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(response => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }; + }, + /** + * + * @summary Re-initiates a failed or terminated run. + * @param {string} experiment_id The ID of the parent experiment. + * @param {string} run_id The ID of the run to be retried. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + retryRun( + experiment_id: string, + run_id: string, + options?: any, + ): (fetch?: FetchAPI, basePath?: string) => Promise { + const localVarFetchArgs = RunServiceApiFetchParamCreator(configuration).retryRun( + experiment_id, + run_id, + options, + ); + return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(response => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }; + }, + /** + * + * @summary Terminates an active run. + * @param {string} experiment_id The ID of the parent experiment. + * @param {string} run_id The ID of the run to be terminated. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + terminateRun( + experiment_id: string, + run_id: string, + options?: any, + ): (fetch?: FetchAPI, basePath?: string) => Promise { + const localVarFetchArgs = RunServiceApiFetchParamCreator(configuration).terminateRun( + experiment_id, + run_id, + options, + ); + return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(response => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }; + }, + /** + * + * @summary Restores an archived run in an experiment given by run ID and experiment ID. + * @param {string} experiment_id The ID of the parent experiment. + * @param {string} run_id The ID of the run to be restored. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + unarchiveRun( + experiment_id: string, + run_id: string, + options?: any, + ): (fetch?: FetchAPI, basePath?: string) => Promise { + const localVarFetchArgs = RunServiceApiFetchParamCreator(configuration).unarchiveRun( + experiment_id, + run_id, + options, + ); + return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(response => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }; + }, + }; +}; + +/** + * RunServiceApi - factory interface + * @export + */ +export const RunServiceApiFactory = function( + configuration?: Configuration, + fetch?: FetchAPI, + basePath?: string, +) { + return { + /** + * + * @summary Archives a run in an experiment given by run ID and experiment ID. + * @param {string} experiment_id The ID of the parent experiment. + * @param {string} run_id The ID of the run to be archived. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + archiveRun(experiment_id: string, run_id: string, options?: any) { + return RunServiceApiFp(configuration).archiveRun( + experiment_id, + run_id, + options, + )(fetch, basePath); + }, + /** + * + * @summary Creates a new run in an experiment specified by experiment ID. If experiment ID is not specified, the run is created in the default experiment. + * @param {string} experiment_id The ID of the parent experiment. + * @param {V2beta1Run} body Run to be created. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createRun(experiment_id: string, body: V2beta1Run, options?: any) { + return RunServiceApiFp(configuration).createRun( + experiment_id, + body, + options, + )(fetch, basePath); + }, + /** + * + * @summary Deletes a run in an experiment given by run ID and experiment ID. + * @param {string} experiment_id The ID of the parent experiment. + * @param {string} run_id The ID of the run to be deleted. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteRun(experiment_id: string, run_id: string, options?: any) { + return RunServiceApiFp(configuration).deleteRun( + experiment_id, + run_id, + options, + )(fetch, basePath); + }, + /** + * + * @summary Finds a specific run by ID. + * @param {string} experiment_id The ID of the parent experiment. + * @param {string} run_id The ID of the run to be retrieved. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getRun(experiment_id: string, run_id: string, options?: any) { + return RunServiceApiFp(configuration).getRun(experiment_id, run_id, options)(fetch, basePath); + }, + /** + * + * @summary Finds all runs in an experiment given by experiment ID. If experiment id is not specified, finds all runs across all experiments. + * @param {string} experiment_id The ID of the parent experiment. If empty, response includes runs across all experiments. + * @param {string} [namespace] Optional input field. Filters based on the namespace. + * @param {string} [page_token] A page token to request the next page of results. The token is acquired from the nextPageToken field of the response from the previous ListRuns call or can be omitted when fetching the first page. + * @param {number} [page_size] The number of runs to be listed per page. If there are more runs than this number, the response message will contain a nextPageToken field you can use to fetch the next page. + * @param {string} [sort_by] Can be format of \"field_name\", \"field_name asc\" or \"field_name desc\" (Example, \"name asc\" or \"id desc\"). Ascending by default. + * @param {string} [filter] A url-encoded, JSON-serialized Filter protocol buffer (see [filter.proto](https://github.com/kubeflow/pipelines/blob/master/backend/api/filter.proto)). + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listRuns( + experiment_id: string, + namespace?: string, + page_token?: string, + page_size?: number, + sort_by?: string, + filter?: string, + options?: any, + ) { + return RunServiceApiFp(configuration).listRuns( + experiment_id, + namespace, + page_token, + page_size, + sort_by, + filter, + options, + )(fetch, basePath); + }, + /** + * + * @summary Finds artifact data in a run. + * @param {string} experiment_id The ID of the parent experiment. + * @param {string} run_id ID of the run. + * @param {string} node_id ID of the running node. + * @param {string} artifact_name Name of the artifact. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + readArtifact( + experiment_id: string, + run_id: string, + node_id: string, + artifact_name: string, + options?: any, + ) { + return RunServiceApiFp(configuration).readArtifact( + experiment_id, + run_id, + node_id, + artifact_name, + options, + )(fetch, basePath); + }, + /** + * + * @summary Re-initiates a failed or terminated run. + * @param {string} experiment_id The ID of the parent experiment. + * @param {string} run_id The ID of the run to be retried. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + retryRun(experiment_id: string, run_id: string, options?: any) { + return RunServiceApiFp(configuration).retryRun( + experiment_id, + run_id, + options, + )(fetch, basePath); + }, + /** + * + * @summary Terminates an active run. + * @param {string} experiment_id The ID of the parent experiment. + * @param {string} run_id The ID of the run to be terminated. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + terminateRun(experiment_id: string, run_id: string, options?: any) { + return RunServiceApiFp(configuration).terminateRun( + experiment_id, + run_id, + options, + )(fetch, basePath); + }, + /** + * + * @summary Restores an archived run in an experiment given by run ID and experiment ID. + * @param {string} experiment_id The ID of the parent experiment. + * @param {string} run_id The ID of the run to be restored. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + unarchiveRun(experiment_id: string, run_id: string, options?: any) { + return RunServiceApiFp(configuration).unarchiveRun( + experiment_id, + run_id, + options, + )(fetch, basePath); + }, + }; +}; + +/** + * RunServiceApi - object-oriented interface + * @export + * @class RunServiceApi + * @extends {BaseAPI} + */ +export class RunServiceApi extends BaseAPI { + /** + * + * @summary Archives a run in an experiment given by run ID and experiment ID. + * @param {string} experiment_id The ID of the parent experiment. + * @param {string} run_id The ID of the run to be archived. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof RunServiceApi + */ + public archiveRun(experiment_id: string, run_id: string, options?: any) { + return RunServiceApiFp(this.configuration).archiveRun( + experiment_id, + run_id, + options, + )(this.fetch, this.basePath); + } + + /** + * + * @summary Creates a new run in an experiment specified by experiment ID. If experiment ID is not specified, the run is created in the default experiment. + * @param {string} experiment_id The ID of the parent experiment. + * @param {V2beta1Run} body Run to be created. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof RunServiceApi + */ + public createRun(experiment_id: string, body: V2beta1Run, options?: any) { + return RunServiceApiFp(this.configuration).createRun( + experiment_id, + body, + options, + )(this.fetch, this.basePath); + } + + /** + * + * @summary Deletes a run in an experiment given by run ID and experiment ID. + * @param {string} experiment_id The ID of the parent experiment. + * @param {string} run_id The ID of the run to be deleted. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof RunServiceApi + */ + public deleteRun(experiment_id: string, run_id: string, options?: any) { + return RunServiceApiFp(this.configuration).deleteRun( + experiment_id, + run_id, + options, + )(this.fetch, this.basePath); + } + + /** + * + * @summary Finds a specific run by ID. + * @param {string} experiment_id The ID of the parent experiment. + * @param {string} run_id The ID of the run to be retrieved. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof RunServiceApi + */ + public getRun(experiment_id: string, run_id: string, options?: any) { + return RunServiceApiFp(this.configuration).getRun( + experiment_id, + run_id, + options, + )(this.fetch, this.basePath); + } + + /** + * + * @summary Finds all runs in an experiment given by experiment ID. If experiment id is not specified, finds all runs across all experiments. + * @param {string} experiment_id The ID of the parent experiment. If empty, response includes runs across all experiments. + * @param {string} [namespace] Optional input field. Filters based on the namespace. + * @param {string} [page_token] A page token to request the next page of results. The token is acquired from the nextPageToken field of the response from the previous ListRuns call or can be omitted when fetching the first page. + * @param {number} [page_size] The number of runs to be listed per page. If there are more runs than this number, the response message will contain a nextPageToken field you can use to fetch the next page. + * @param {string} [sort_by] Can be format of \"field_name\", \"field_name asc\" or \"field_name desc\" (Example, \"name asc\" or \"id desc\"). Ascending by default. + * @param {string} [filter] A url-encoded, JSON-serialized Filter protocol buffer (see [filter.proto](https://github.com/kubeflow/pipelines/blob/master/backend/api/filter.proto)). + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof RunServiceApi + */ + public listRuns( + experiment_id: string, + namespace?: string, + page_token?: string, + page_size?: number, + sort_by?: string, + filter?: string, + options?: any, + ) { + return RunServiceApiFp(this.configuration).listRuns( + experiment_id, + namespace, + page_token, + page_size, + sort_by, + filter, + options, + )(this.fetch, this.basePath); + } + + /** + * + * @summary Finds artifact data in a run. + * @param {string} experiment_id The ID of the parent experiment. + * @param {string} run_id ID of the run. + * @param {string} node_id ID of the running node. + * @param {string} artifact_name Name of the artifact. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof RunServiceApi + */ + public readArtifact( + experiment_id: string, + run_id: string, + node_id: string, + artifact_name: string, + options?: any, + ) { + return RunServiceApiFp(this.configuration).readArtifact( + experiment_id, + run_id, + node_id, + artifact_name, + options, + )(this.fetch, this.basePath); + } + + /** + * + * @summary Re-initiates a failed or terminated run. + * @param {string} experiment_id The ID of the parent experiment. + * @param {string} run_id The ID of the run to be retried. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof RunServiceApi + */ + public retryRun(experiment_id: string, run_id: string, options?: any) { + return RunServiceApiFp(this.configuration).retryRun( + experiment_id, + run_id, + options, + )(this.fetch, this.basePath); + } + + /** + * + * @summary Terminates an active run. + * @param {string} experiment_id The ID of the parent experiment. + * @param {string} run_id The ID of the run to be terminated. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof RunServiceApi + */ + public terminateRun(experiment_id: string, run_id: string, options?: any) { + return RunServiceApiFp(this.configuration).terminateRun( + experiment_id, + run_id, + options, + )(this.fetch, this.basePath); + } + + /** + * + * @summary Restores an archived run in an experiment given by run ID and experiment ID. + * @param {string} experiment_id The ID of the parent experiment. + * @param {string} run_id The ID of the run to be restored. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof RunServiceApi + */ + public unarchiveRun(experiment_id: string, run_id: string, options?: any) { + return RunServiceApiFp(this.configuration).unarchiveRun( + experiment_id, + run_id, + options, + )(this.fetch, this.basePath); + } +} diff --git a/frontend/src/apisv2beta1/run/configuration.ts b/frontend/src/apisv2beta1/run/configuration.ts new file mode 100644 index 0000000000..956ba95bab --- /dev/null +++ b/frontend/src/apisv2beta1/run/configuration.ts @@ -0,0 +1,65 @@ +// tslint:disable +/** + * backend/api/v2beta1/run.proto + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * OpenAPI spec version: version not set + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +export interface ConfigurationParameters { + apiKey?: string | ((name: string) => string); + username?: string; + password?: string; + accessToken?: string | ((name: string, scopes?: string[]) => string); + basePath?: string; +} + +export class Configuration { + /** + * parameter for apiKey security + * @param name security name + * @memberof Configuration + */ + apiKey?: string | ((name: string) => string); + /** + * parameter for basic security + * + * @type {string} + * @memberof Configuration + */ + username?: string; + /** + * parameter for basic security + * + * @type {string} + * @memberof Configuration + */ + password?: string; + /** + * parameter for oauth2 security + * @param name security name + * @param scopes oauth2 scope + * @memberof Configuration + */ + accessToken?: string | ((name: string, scopes?: string[]) => string); + /** + * override base path + * + * @type {string} + * @memberof Configuration + */ + basePath?: string; + + constructor(param: ConfigurationParameters = {}) { + this.apiKey = param.apiKey; + this.username = param.username; + this.password = param.password; + this.accessToken = param.accessToken; + this.basePath = param.basePath; + } +} diff --git a/frontend/src/apisv2beta1/run/custom.d.ts b/frontend/src/apisv2beta1/run/custom.d.ts new file mode 100644 index 0000000000..4c611cc321 --- /dev/null +++ b/frontend/src/apisv2beta1/run/custom.d.ts @@ -0,0 +1,2 @@ +declare module 'portable-fetch'; +declare module 'url'; diff --git a/frontend/src/apisv2beta1/run/git_push.sh b/frontend/src/apisv2beta1/run/git_push.sh new file mode 100644 index 0000000000..a1ff4c9bcb --- /dev/null +++ b/frontend/src/apisv2beta1/run/git_push.sh @@ -0,0 +1,51 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=`git remote` +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/frontend/src/apisv2beta1/run/index.ts b/frontend/src/apisv2beta1/run/index.ts new file mode 100644 index 0000000000..bd285ba382 --- /dev/null +++ b/frontend/src/apisv2beta1/run/index.ts @@ -0,0 +1,15 @@ +// tslint:disable +/** + * backend/api/v2beta1/run.proto + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * OpenAPI spec version: version not set + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +export * from './api'; +export * from './configuration'; diff --git a/frontend/src/apisv2beta1/visualization/.gitignore b/frontend/src/apisv2beta1/visualization/.gitignore new file mode 100644 index 0000000000..35e2fb2b02 --- /dev/null +++ b/frontend/src/apisv2beta1/visualization/.gitignore @@ -0,0 +1,3 @@ +wwwroot/*.js +node_modules +typings diff --git a/frontend/src/apisv2beta1/visualization/.swagger-codegen-ignore b/frontend/src/apisv2beta1/visualization/.swagger-codegen-ignore new file mode 100644 index 0000000000..c5fa491b4c --- /dev/null +++ b/frontend/src/apisv2beta1/visualization/.swagger-codegen-ignore @@ -0,0 +1,23 @@ +# Swagger Codegen Ignore +# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/frontend/src/apisv2beta1/visualization/.swagger-codegen/VERSION b/frontend/src/apisv2beta1/visualization/.swagger-codegen/VERSION new file mode 100644 index 0000000000..48a6b508dc --- /dev/null +++ b/frontend/src/apisv2beta1/visualization/.swagger-codegen/VERSION @@ -0,0 +1 @@ +2.4.7 \ No newline at end of file diff --git a/frontend/src/apisv2beta1/visualization/api.ts b/frontend/src/apisv2beta1/visualization/api.ts new file mode 100644 index 0000000000..0348187a3c --- /dev/null +++ b/frontend/src/apisv2beta1/visualization/api.ts @@ -0,0 +1,338 @@ +/// +// tslint:disable +/** + * backend/api/v2beta1/visualization.proto + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * OpenAPI spec version: version not set + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +import * as url from 'url'; +import * as portableFetch from 'portable-fetch'; +import { Configuration } from './configuration'; + +const BASE_PATH = 'http://localhost'.replace(/\/+$/, ''); + +/** + * + * @export + */ +export const COLLECTION_FORMATS = { + csv: ',', + ssv: ' ', + tsv: '\t', + pipes: '|', +}; + +/** + * + * @export + * @interface FetchAPI + */ +export interface FetchAPI { + (url: string, init?: any): Promise; +} + +/** + * + * @export + * @interface FetchArgs + */ +export interface FetchArgs { + url: string; + options: any; +} + +/** + * + * @export + * @class BaseAPI + */ +export class BaseAPI { + protected configuration: Configuration; + + constructor( + configuration?: Configuration, + protected basePath: string = BASE_PATH, + protected fetch: FetchAPI = portableFetch, + ) { + if (configuration) { + this.configuration = configuration; + this.basePath = configuration.basePath || this.basePath; + } + } +} + +/** + * + * @export + * @class RequiredError + * @extends {Error} + */ +export class RequiredError extends Error { + name: 'RequiredError'; + constructor(public field: string, msg?: string) { + super(msg); + } +} + +/** + * The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors). + * @export + * @interface GooglerpcStatus + */ +export interface GooglerpcStatus { + /** + * The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. + * @type {number} + * @memberof GooglerpcStatus + */ + code?: number; + /** + * A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. + * @type {string} + * @memberof GooglerpcStatus + */ + message?: string; + /** + * A list of messages that carry the error details. There is a common set of message types for APIs to use. + * @type {Array} + * @memberof GooglerpcStatus + */ + details?: Array; +} + +/** + * `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 := anypb.New(foo) if err != nil { ... } ... foo := &pb.Foo{} if err := any.UnmarshalTo(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\": , \"lastName\": } 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\" } + * @export + * @interface ProtobufAny + */ +export interface ProtobufAny { + /** + * A URL/resource name that uniquely identifies the type of the serialized protocol buffer message. This string must contain at least one \"/\" character. 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. + * @type {string} + * @memberof ProtobufAny + */ + type_url?: string; + /** + * Must be a valid serialized protocol buffer of the above specified type. + * @type {string} + * @memberof ProtobufAny + */ + value?: string; +} + +/** + * + * @export + * @interface V2beta1Visualization + */ +export interface V2beta1Visualization { + /** + * + * @type {V2beta1VisualizationType} + * @memberof V2beta1Visualization + */ + type?: V2beta1VisualizationType; + /** + * Path pattern of input data to be used during generation of visualizations. This is required when creating the pipeline through CreateVisualization API. + * @type {string} + * @memberof V2beta1Visualization + */ + source?: string; + /** + * Variables to be used during generation of a visualization. This should be provided as a JSON string. This is required when creating the pipeline through CreateVisualization API. + * @type {string} + * @memberof V2beta1Visualization + */ + arguments?: string; + /** + * Output. Generated visualization html. + * @type {string} + * @memberof V2beta1Visualization + */ + html?: string; + /** + * In case any error happens when generating visualizations, only visualization ID and the error message are returned. Client has the flexibility of choosing how to handle the error. + * @type {string} + * @memberof V2beta1Visualization + */ + error?: string; +} + +/** + * Type of visualization to be generated. This is required when creating the pipeline through CreateVisualization API. + * @export + * @enum {string} + */ +export enum V2beta1VisualizationType { + ROCCURVE = 'ROC_CURVE', + TFDV = 'TFDV', + TFMA = 'TFMA', + TABLE = 'TABLE', + CUSTOM = 'CUSTOM', +} + +/** + * VisualizationServiceApi - fetch parameter creator + * @export + */ +export const VisualizationServiceApiFetchParamCreator = function(configuration?: Configuration) { + return { + /** + * + * @param {string} namespace + * @param {V2beta1Visualization} body + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createVisualizationV1( + namespace: string, + body: V2beta1Visualization, + options: any = {}, + ): FetchArgs { + // verify required parameter 'namespace' is not null or undefined + if (namespace === null || namespace === undefined) { + throw new RequiredError( + 'namespace', + 'Required parameter namespace was null or undefined when calling createVisualizationV1.', + ); + } + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError( + 'body', + 'Required parameter body was null or undefined when calling createVisualizationV1.', + ); + } + const localVarPath = `/apis/v2beta1/visualizations/{namespace}`.replace( + `{${'namespace'}}`, + encodeURIComponent(String(namespace)), + ); + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'POST' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = + typeof configuration.apiKey === 'function' + ? configuration.apiKey('authorization') + : configuration.apiKey; + localVarHeaderParameter['authorization'] = localVarApiKeyValue; + } + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarUrlObj.query = Object.assign( + {}, + localVarUrlObj.query, + localVarQueryParameter, + options.query, + ); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + const needsSerialization = + 'V2beta1Visualization' !== 'string' || + localVarRequestOptions.headers['Content-Type'] === 'application/json'; + localVarRequestOptions.body = needsSerialization ? JSON.stringify(body || {}) : body || ''; + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + }; +}; + +/** + * VisualizationServiceApi - functional programming interface + * @export + */ +export const VisualizationServiceApiFp = function(configuration?: Configuration) { + return { + /** + * + * @param {string} namespace + * @param {V2beta1Visualization} body + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createVisualizationV1( + namespace: string, + body: V2beta1Visualization, + options?: any, + ): (fetch?: FetchAPI, basePath?: string) => Promise { + const localVarFetchArgs = VisualizationServiceApiFetchParamCreator( + configuration, + ).createVisualizationV1(namespace, body, options); + return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(response => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }; + }, + }; +}; + +/** + * VisualizationServiceApi - factory interface + * @export + */ +export const VisualizationServiceApiFactory = function( + configuration?: Configuration, + fetch?: FetchAPI, + basePath?: string, +) { + return { + /** + * + * @param {string} namespace + * @param {V2beta1Visualization} body + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createVisualizationV1(namespace: string, body: V2beta1Visualization, options?: any) { + return VisualizationServiceApiFp(configuration).createVisualizationV1( + namespace, + body, + options, + )(fetch, basePath); + }, + }; +}; + +/** + * VisualizationServiceApi - object-oriented interface + * @export + * @class VisualizationServiceApi + * @extends {BaseAPI} + */ +export class VisualizationServiceApi extends BaseAPI { + /** + * + * @param {string} namespace + * @param {V2beta1Visualization} body + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof VisualizationServiceApi + */ + public createVisualizationV1(namespace: string, body: V2beta1Visualization, options?: any) { + return VisualizationServiceApiFp(this.configuration).createVisualizationV1( + namespace, + body, + options, + )(this.fetch, this.basePath); + } +} diff --git a/frontend/src/apisv2beta1/visualization/configuration.ts b/frontend/src/apisv2beta1/visualization/configuration.ts new file mode 100644 index 0000000000..f7d6da0144 --- /dev/null +++ b/frontend/src/apisv2beta1/visualization/configuration.ts @@ -0,0 +1,65 @@ +// tslint:disable +/** + * backend/api/v2beta1/visualization.proto + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * OpenAPI spec version: version not set + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +export interface ConfigurationParameters { + apiKey?: string | ((name: string) => string); + username?: string; + password?: string; + accessToken?: string | ((name: string, scopes?: string[]) => string); + basePath?: string; +} + +export class Configuration { + /** + * parameter for apiKey security + * @param name security name + * @memberof Configuration + */ + apiKey?: string | ((name: string) => string); + /** + * parameter for basic security + * + * @type {string} + * @memberof Configuration + */ + username?: string; + /** + * parameter for basic security + * + * @type {string} + * @memberof Configuration + */ + password?: string; + /** + * parameter for oauth2 security + * @param name security name + * @param scopes oauth2 scope + * @memberof Configuration + */ + accessToken?: string | ((name: string, scopes?: string[]) => string); + /** + * override base path + * + * @type {string} + * @memberof Configuration + */ + basePath?: string; + + constructor(param: ConfigurationParameters = {}) { + this.apiKey = param.apiKey; + this.username = param.username; + this.password = param.password; + this.accessToken = param.accessToken; + this.basePath = param.basePath; + } +} diff --git a/frontend/src/apisv2beta1/visualization/custom.d.ts b/frontend/src/apisv2beta1/visualization/custom.d.ts new file mode 100644 index 0000000000..4c611cc321 --- /dev/null +++ b/frontend/src/apisv2beta1/visualization/custom.d.ts @@ -0,0 +1,2 @@ +declare module 'portable-fetch'; +declare module 'url'; diff --git a/frontend/src/apisv2beta1/visualization/git_push.sh b/frontend/src/apisv2beta1/visualization/git_push.sh new file mode 100644 index 0000000000..a1ff4c9bcb --- /dev/null +++ b/frontend/src/apisv2beta1/visualization/git_push.sh @@ -0,0 +1,51 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=`git remote` +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/frontend/src/apisv2beta1/visualization/index.ts b/frontend/src/apisv2beta1/visualization/index.ts new file mode 100644 index 0000000000..f9009018e1 --- /dev/null +++ b/frontend/src/apisv2beta1/visualization/index.ts @@ -0,0 +1,15 @@ +// tslint:disable +/** + * backend/api/v2beta1/visualization.proto + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * OpenAPI spec version: version not set + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +export * from './api'; +export * from './configuration';