Compare commits
1 commit
developmen
...
plugin-sca
Author | SHA1 | Date | |
---|---|---|---|
![]() |
a8a3026cb1 |
492 changed files with 77464 additions and 39229 deletions
|
@ -1,6 +1,8 @@
|
|||
dist-types
|
||||
.git
|
||||
.yarn/cache
|
||||
.yarn/install-state.gz
|
||||
node_modules
|
||||
packages/*/dist
|
||||
packages/*/src
|
||||
packages/*/node_modules
|
||||
plugins/*/dist
|
||||
plugins/*/node_modules
|
||||
plugins
|
||||
*.local.yaml
|
||||
|
|
51
.github/workflows/build-and-push.yaml
vendored
51
.github/workflows/build-and-push.yaml
vendored
|
@ -1,51 +0,0 @@
|
|||
name: ci
|
||||
|
||||
on: push
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-22.04
|
||||
|
||||
steps:
|
||||
-
|
||||
name: Repository meta
|
||||
id: repository
|
||||
run: |
|
||||
registry=${{ github.server_url }}
|
||||
registry=${registry##http*://}
|
||||
echo "registry=${registry}" >> "$GITHUB_OUTPUT"
|
||||
echo "registry=${registry}"
|
||||
repository="$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]')"
|
||||
echo "repository=${repository}" >> "$GITHUB_OUTPUT"
|
||||
echo "repository=${repository}"
|
||||
-
|
||||
name: Docker meta
|
||||
uses: docker/metadata-action@v5
|
||||
id: docker
|
||||
with:
|
||||
images: ${{ steps.repository.outputs.registry }}/${{ steps.repository.outputs.repository }}
|
||||
-
|
||||
name: Login to registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ${{ steps.repository.outputs.registry }}
|
||||
username: ${{ secrets.PACKAGES_USER }}
|
||||
password: ${{ secrets.PACKAGES_TOKEN }}
|
||||
-
|
||||
name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
with:
|
||||
buildkitd-flags: '--allow-insecure-entitlement network.host'
|
||||
driver-opts: network=host
|
||||
-
|
||||
name: Build and push
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
push: true
|
||||
allow: network.host
|
||||
network: host
|
||||
platforms: linux/amd64,linux/arm64
|
||||
tags: ${{ steps.docker.outputs.tags }}
|
|
@ -1 +0,0 @@
|
|||
nodeLinker: node-modules
|
94
Dockerfile
94
Dockerfile
|
@ -1,94 +0,0 @@
|
|||
# Stage 1 - Create yarn install skeleton layer
|
||||
FROM node:20.18.1 AS packages
|
||||
|
||||
WORKDIR /app
|
||||
COPY package.json yarn.lock ./
|
||||
|
||||
COPY packages packages
|
||||
|
||||
# Comment this out if you don't have any internal plugins
|
||||
COPY plugins plugins
|
||||
|
||||
RUN find packages \! -name "package.json" -mindepth 2 -maxdepth 2 -exec rm -rf {} \+
|
||||
|
||||
# Stage 2 - Install dependencies and build packages
|
||||
FROM node:20.18.1 AS build
|
||||
|
||||
# Required for arm64
|
||||
RUN apt update -y
|
||||
RUN apt install -y python3 make gcc build-essential bash
|
||||
|
||||
USER node
|
||||
WORKDIR /app
|
||||
|
||||
COPY --from=packages --chown=node:node /app .
|
||||
|
||||
RUN --mount=type=cache,target=/home/node/.cache/yarn,sharing=locked,uid=1000,gid=1000 \
|
||||
yarn install --network-timeout 600000
|
||||
|
||||
COPY --chown=node:node . .
|
||||
|
||||
RUN yarn tsc
|
||||
RUN yarn --cwd packages/backend build
|
||||
# If you have not yet migrated to package roles, use the following command instead:
|
||||
# RUN yarn --cwd packages/backend backstage-cli backend:bundle --build-dependencies
|
||||
|
||||
RUN mkdir packages/backend/dist/skeleton packages/backend/dist/bundle \
|
||||
&& tar xzf packages/backend/dist/skeleton.tar.gz -C packages/backend/dist/skeleton \
|
||||
&& tar xzf packages/backend/dist/bundle.tar.gz -C packages/backend/dist/bundle
|
||||
|
||||
# Stage 3 - Build the actual backend image and install production dependencies
|
||||
FROM node:20.18.1
|
||||
|
||||
# Install isolate-vm dependencies, these are needed by the @backstage/plugin-scaffolder-backend.
|
||||
# Install packages needed to get utility binaries
|
||||
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
|
||||
--mount=type=cache,target=/var/lib/apt,sharing=locked \
|
||||
apt-get update && \
|
||||
apt-get install -y --no-install-recommends python3 python3-pip python3-venv g++ build-essential ca-certificates curl
|
||||
|
||||
RUN yarn config set python /usr/bin/python3
|
||||
|
||||
# Add kubectl for the kube apply plugin.
|
||||
# Add mkdocs for the TechDocs plugin.
|
||||
RUN if test "$(uname -m)" = "x86_64"; \
|
||||
then \
|
||||
curl -L -o /usr/local/bin/kubectl https://dl.k8s.io/release/v1.29.9/bin/linux/amd64/kubectl; \
|
||||
fi
|
||||
RUN if test "$(uname -m)" != "x86_64"; \
|
||||
then \
|
||||
curl -L -o /usr/local/bin/kubectl https://dl.k8s.io/release/v1.29.9/bin/linux/arm64/kubectl; \
|
||||
fi
|
||||
RUN chmod +x /usr/local/bin/kubectl
|
||||
|
||||
ENV VIRTUAL_ENV=/opt/venv
|
||||
RUN python3 -m venv $VIRTUAL_ENV
|
||||
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
|
||||
RUN pip3 install 'mkdocs-techdocs-core==1.4.2' 'mkdocs-awesome-pages-plugin==2.10.1'
|
||||
|
||||
# From here on we use the least-privileged `node` user to run the backend.
|
||||
USER node
|
||||
|
||||
# This should create the app dir as `node`.
|
||||
# If it is instead created as `root` then the `tar` command below will
|
||||
# fail: `can't create directory 'packages/': Permission denied`.
|
||||
# If this occurs, then ensure BuildKit is enabled (`DOCKER_BUILDKIT=1`)
|
||||
# so the app dir is correctly created as `node`.
|
||||
WORKDIR /app
|
||||
|
||||
# Copy the install dependencies from the build stage and context
|
||||
COPY --from=build --chown=node:node /app/yarn.lock /app/package.json /app/packages/backend/dist/skeleton/ ./
|
||||
|
||||
RUN --mount=type=cache,target=/home/node/.cache/yarn,sharing=locked,uid=1000,gid=1000 \
|
||||
yarn install --production --network-timeout 600000
|
||||
|
||||
# Copy the built packages from the build stage
|
||||
COPY --from=build --chown=node:node /app/packages/backend/dist/bundle/ ./
|
||||
|
||||
# Copy any other files that we need at runtime
|
||||
COPY --chown=node:node app-config.yaml ./
|
||||
|
||||
# This switches many Node.js dependencies to production mode.
|
||||
ENV NODE_ENV production
|
||||
|
||||
CMD ["node", "packages/backend", "--config", "app-config.yaml"]
|
116
README.md
116
README.md
|
@ -1,116 +1,10 @@
|
|||
# EDP Backstage
|
||||
# [Backstage](https://backstage.io)
|
||||
|
||||
The EDP bespoke version of backstage.
|
||||
This is your newly scaffolded Backstage App, Good Luck!
|
||||
|
||||
With respect to the CNOE stack (where eDF originates from) it is comparable to https://github.com/cnoe-io/backstage-app
|
||||
To start the app, run:
|
||||
|
||||
At the time writing CNOE-backstage-app is "version": "1.28.4"
|
||||
|
||||
## Container Images
|
||||
|
||||
Container images are pushed to the Cefor Container Registry and available [here](https://forgejo.edf-bootstrap.cx.fg1.ffm.osc.live/DevFW-CICD/-/packages/container/backstage-edp/).
|
||||
|
||||
|
||||
## Local Development
|
||||
|
||||
Use of [**edpbuilder**](https://forgejo.edf-bootstrap.cx.fg1.ffm.osc.live/DevFW/edpbuilder.git) is recommended for local setup.
|
||||
|
||||
### Create your local cluster
|
||||
|
||||
Once edpbuilder is installed on your computer, create a stack that you are interested in. For example:
|
||||
|
||||
> Hint: From here on this is the old CNOE README .... no guarantee that this works as described!
|
||||
|
||||
### Update Backstage application config
|
||||
|
||||
Once all ArgoCD applications are healthy, you need to update a few fields in the [app-config.yaml](./app-config.yaml) file.
|
||||
|
||||
#### Update control plane URL
|
||||
|
||||
The control plane port must be updated every time a cluster is created. Run the `kubectl cluster-info` command to get the control plane URL. Once you have your URL, update your `app-config.yaml` file at [this line](https://github.com/cnoe-io/backstage-app/blob/9ee3514e51c1a354b7fe85a90117faf8328bfa0b/app-config.yaml#L122).
|
||||
|
||||
For example:
|
||||
|
||||
```bash
|
||||
$ kubectl cluster-info
|
||||
|
||||
Kubernetes control plane is running at https://127.0.0.1:36463
|
||||
CoreDNS is running at https://127.0.0.1:36463/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy
|
||||
```
|
||||
|
||||
For this particular example output, the `https://127.0.0.1:36463` above is the URL you need to use in your `app-config.yaml`.
|
||||
|
||||
#### Update service account token
|
||||
|
||||
Since tokens are generated each time the backstage service account is created, you need to update this value as well. The command to retrieve the service account token is:
|
||||
|
||||
`kubectl -n backstage exec -it deploy/backstage -- cat /var/run/secrets/kubernetes.io/serviceaccount/token`
|
||||
|
||||
Copy the token value and updated the app-config file at [this line](https://github.com/cnoe-io/backstage-app/blob/main/app-config.yaml#L127).
|
||||
|
||||
For example:
|
||||
|
||||
```bash
|
||||
$ kubectl -n backstage exec -it deploy/backstage -- cat /var/run/secrets/kubernetes.io/serviceaccount/token
|
||||
|
||||
eyJhbGciOiJSUzI1NiIsImtpZCI6IkRxbDRCSnNicjFwekFqdmxwNDc5MHJqeUlFSjhxNHU0LV95OC1s...
|
||||
```
|
||||
|
||||
If you do not want to place the token value in your file, you can use environment variables instead:
|
||||
1. Set [this line](https://github.com/cnoe-io/backstage-app/blob/main/app-config.yaml#L127) value to be `${BACKSTAGE_SA_TOKEN}`.
|
||||
2. Then export the token value:
|
||||
```bash
|
||||
export BACKSTAGE_SA_TOKEN=$(kubectl -n backstage exec -it deploy/backstage -- cat /var/run/secrets/kubernetes.io/serviceaccount/token)
|
||||
```
|
||||
|
||||
#### Update ArgoCD token
|
||||
|
||||
ArgoCD admin passwords are generated on each fresh installation. You need to update the configuration file accordingly. To obtain your password, run: `./idpbuilder get secrets -p argocd`. Then update [this line](https://github.com/cnoe-io/backstage-app/blob/9ee3514e51c1a354b7fe85a90117faf8328bfa0b/app-config.yaml#L136)
|
||||
|
||||
For example:
|
||||
|
||||
```bash
|
||||
$ ./idpbuilder get secrets -p argocd
|
||||
|
||||
---------------------------
|
||||
Name: argocd-initial-admin-secret
|
||||
Namespace: argocd
|
||||
Data:
|
||||
password : abc
|
||||
username : admin
|
||||
```
|
||||
|
||||
#### Update Gitea Credentials
|
||||
|
||||
Gitea admin passwords are generated on each fresh installation as well. To obtain your password, run: `./idpbuilder get secrets -p argocd`.
|
||||
Then update [this line](https://github.com/cnoe-io/backstage-app/blob/9ee3514e51c1a354b7fe85a90117faf8328bfa0b/app-config.yaml#L40) and [this line](https://github.com/cnoe-io/backstage-app/blob/9ee3514e51c1a354b7fe85a90117faf8328bfa0b/app-config.yaml#L44).
|
||||
|
||||
For example:
|
||||
|
||||
```bash
|
||||
$ ./idpbuilder get secrets -p gitea
|
||||
|
||||
---------------------------
|
||||
Name: gitea-credential
|
||||
Namespace: gitea
|
||||
Data:
|
||||
password : abc
|
||||
username : giteaAdmin
|
||||
````
|
||||
|
||||
### Start Backstage processes
|
||||
|
||||
Once the `app-config.yaml` file is updated, you are ready to start your backstage instance. For development purposes, using two terminal windows or tabs is recommended. You can also run them through your favorite IDE.
|
||||
|
||||
In the first terminal tab, install dependencies and start the backend.
|
||||
|
||||
```bash
|
||||
```sh
|
||||
yarn install
|
||||
yarn run start-backend
|
||||
```
|
||||
|
||||
In the first terminal tab, run the frontend.
|
||||
|
||||
```bash
|
||||
yarn run start
|
||||
yarn dev
|
||||
```
|
||||
|
|
|
@ -31,16 +31,17 @@ backend:
|
|||
client: better-sqlite3
|
||||
connection: ':memory:'
|
||||
# workingDirectory: /tmp # Use this to configure a working directory for the scaffolder, defaults to the OS temp-dir
|
||||
|
||||
integrations:
|
||||
gitea:
|
||||
- baseUrl: https://cnoe.localtest.me:8443/gitea
|
||||
host: cnoe.localtest.me:8443
|
||||
- baseUrl: https://gitea.cnoe.localtest.me:8443
|
||||
host: gitea.cnoe.localtest.me:8443
|
||||
username: giteaAdmin
|
||||
password: ${GITEA_PASSWORD}
|
||||
- baseUrl: https://cnoe.localtest.me/gitea
|
||||
host: cnoe.localtest.me
|
||||
password: giteaPassword
|
||||
- baseUrl: https://gitea.cnoe.localtest.me
|
||||
host: gitea.cnoe.localtest.me:8443
|
||||
username: giteaAdmin
|
||||
password: ${GITEA_PASSWORD}
|
||||
password: giteaPassword
|
||||
|
||||
proxy:
|
||||
### Example for how to add a proxy endpoint for the frontend.
|
||||
|
@ -60,18 +61,19 @@ techdocs:
|
|||
runIn: 'docker' # Alternatives - 'local'
|
||||
publisher:
|
||||
type: 'local' # Alternatives - 'googleGcs' or 'awsS3'. Read documentation for using alternatives.
|
||||
|
||||
auth:
|
||||
# see https://backstage.io/docs/auth/ to learn about auth providers
|
||||
environment: local # set this to development to enable SSO
|
||||
session:
|
||||
secret: abcdfkjalskdfjkla
|
||||
providers:
|
||||
guest: {}
|
||||
keycloak-oidc:
|
||||
development:
|
||||
metadataUrl: https://cnoe.localtest.me:8443/keycloak/realms/cnoe/.well-known/openid-configuration
|
||||
metadataUrl: https://keycloak.cnoe.localtest.me:8443/realms/cnoe/.well-known/openid-configuration
|
||||
clientId: backstage
|
||||
clientSecret: ${KEYCLOAK_CLIENT_SECRET}
|
||||
scope: 'openid profile email groups'
|
||||
prompt: auto
|
||||
|
||||
scaffolder:
|
||||
|
@ -88,7 +90,8 @@ catalog:
|
|||
- allow: [ Component, System, API, Resource, Location, Template ]
|
||||
locations:
|
||||
- type: url
|
||||
target: https://cnoe.localtest.me:8443/gitea/giteaAdmin/idpbuilder-localdev-backstage-templates-entities/src/branch/main/catalog-info.yaml
|
||||
target: https://gitea.cnoe.localtest.me:8443/giteaAdmin/entities/src/branch/main/catalog-info.yaml
|
||||
|
||||
# # Local example template
|
||||
# - type: file
|
||||
# target: ../../examples/template/template.yaml
|
||||
|
@ -126,10 +129,10 @@ argocd:
|
|||
appLocatorMethods:
|
||||
- type: 'config'
|
||||
instances:
|
||||
- name: local
|
||||
url: https://cnoe.localtest.me:8443/argocd
|
||||
- name: in-cluster
|
||||
url: https://argocd.cnoe.localtest.me:8443
|
||||
username: admin
|
||||
# replace with your argocd password e.g. kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d
|
||||
password: ${ARGOCD_ADMIN_PASSWORD}
|
||||
argoWorkflows:
|
||||
baseUrl: https://cnoe.localtest.me:8443/argo-workflows
|
||||
baseUrl: https://argo.cnoe.localtest.me:8443
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
{
|
||||
"version": "1.36.1"
|
||||
"version": "1.22.1"
|
||||
}
|
||||
|
|
|
@ -1,35 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
SERVICE_ACCOUNT_DIR="/var/run/secrets/kubernetes.io/serviceaccount"
|
||||
KUBERNETES_SERVICE_SCHEME=$(case $KUBERNETES_SERVICE_PORT in 80|8080|8081) echo "http";; *) echo "https"; esac)
|
||||
KUBERNETES_SERVER_URL="$KUBERNETES_SERVICE_SCHEME"://"$KUBERNETES_SERVICE_HOST":"$KUBERNETES_SERVICE_PORT"
|
||||
KUBERNETES_CLUSTER_CA_FILE="$SERVICE_ACCOUNT_DIR"/ca.crt
|
||||
KUBERNETES_NAMESPACE=$(cat "$SERVICE_ACCOUNT_DIR"/namespace)
|
||||
KUBERNETES_USER_TOKEN=$(cat "$SERVICE_ACCOUNT_DIR"/token)
|
||||
KUBERNETES_CONTEXT="inCluster"
|
||||
|
||||
rm -rf "$HOME"/.kube
|
||||
mkdir -p "$HOME"/.kube
|
||||
cat << EOF > "$HOME"/.kube/config
|
||||
apiVersion: v1
|
||||
kind: Config
|
||||
preferences: {}
|
||||
current-context: $KUBERNETES_CONTEXT
|
||||
clusters:
|
||||
- cluster:
|
||||
server: $KUBERNETES_SERVER_URL
|
||||
certificate-authority: $KUBERNETES_CLUSTER_CA_FILE
|
||||
name: inCluster
|
||||
users:
|
||||
- name: podServiceAccount
|
||||
user:
|
||||
token: $KUBERNETES_USER_TOKEN
|
||||
contexts:
|
||||
- context:
|
||||
cluster: inCluster
|
||||
user: podServiceAccount
|
||||
namespace: $KUBERNETES_NAMESPACE
|
||||
name: $KUBERNETES_CONTEXT
|
||||
EOF
|
||||
|
||||
cnoe-cli "$@"
|
|
@ -31,8 +31,8 @@
|
|||
]
|
||||
},
|
||||
"devDependencies": {
|
||||
"@backstage/cli": "^0.30.0",
|
||||
"@backstage/e2e-test-utils": "^0.1.1",
|
||||
"@backstage/cli": "^0.25.1",
|
||||
"@backstage/e2e-test-utils": "^0.1.0",
|
||||
"@playwright/test": "^1.32.3",
|
||||
"@spotify/prettier-config": "^12.0.0",
|
||||
"concurrently": "^8.0.0",
|
||||
|
|
|
@ -14,33 +14,36 @@
|
|||
"lint": "backstage-cli package lint"
|
||||
},
|
||||
"dependencies": {
|
||||
"@backstage-community/plugin-github-actions": "^0.6.16",
|
||||
"@backstage-community/plugin-tech-radar": "^0.7.4",
|
||||
"@backstage/app-defaults": "^1.5.17",
|
||||
"@backstage/catalog-model": "^1.7.3",
|
||||
"@backstage/cli": "^0.30.0",
|
||||
"@backstage/core-app-api": "^1.15.5",
|
||||
"@backstage/core-components": "^0.16.4",
|
||||
"@backstage/core-plugin-api": "^1.10.4",
|
||||
"@backstage/integration-react": "^1.2.4",
|
||||
"@backstage/plugin-api-docs": "^0.12.4",
|
||||
"@backstage/plugin-catalog": "^1.27.0",
|
||||
"@backstage/plugin-catalog-common": "^1.1.3",
|
||||
"@backstage/plugin-catalog-graph": "^0.4.16",
|
||||
"@backstage/plugin-catalog-import": "^0.12.10",
|
||||
"@backstage/plugin-catalog-react": "^1.15.2",
|
||||
"@backstage/plugin-home": "^0.8.5",
|
||||
"@backstage/plugin-kubernetes": "^0.12.4",
|
||||
"@backstage/plugin-org": "^0.6.36",
|
||||
"@backstage/plugin-permission-react": "^0.4.31",
|
||||
"@backstage/plugin-scaffolder": "^1.28.0",
|
||||
"@backstage/plugin-search": "^1.4.23",
|
||||
"@backstage/plugin-search-react": "^1.8.6",
|
||||
"@backstage/plugin-techdocs": "^1.12.3",
|
||||
"@backstage/plugin-techdocs-module-addons-contrib": "^1.1.21",
|
||||
"@backstage/plugin-techdocs-react": "^1.2.14",
|
||||
"@backstage/plugin-user-settings": "^0.8.19",
|
||||
"@backstage/theme": "^0.6.4",
|
||||
"@backstage/app-defaults": "~1.4.7",
|
||||
"@backstage/catalog-model": "~1.4.3",
|
||||
"@backstage/cli": "~0.25.1",
|
||||
"@backstage/core-app-api": "~1.11.3",
|
||||
"@backstage/core-components": "~0.13.10",
|
||||
"@backstage/core-plugin-api": "~1.8.2",
|
||||
"@backstage/integration-react": "~1.1.23",
|
||||
"@backstage/plugin-api-docs": "~0.10.3",
|
||||
"@backstage/plugin-catalog": "~1.16.1",
|
||||
"@backstage/plugin-catalog-common": "~1.0.20",
|
||||
"@backstage/plugin-catalog-graph": "~0.3.3",
|
||||
"@backstage/plugin-catalog-import": "~0.10.5",
|
||||
"@backstage/plugin-catalog-react": "~1.9.3",
|
||||
"@backstage/plugin-github-actions": "~0.6.10",
|
||||
"@backstage/plugin-home": "~0.6.1",
|
||||
"@backstage/plugin-kubernetes": "~0.11.4",
|
||||
"@backstage/plugin-org": "~0.6.19",
|
||||
"@backstage/plugin-permission-react": "~0.4.19",
|
||||
"@backstage/plugin-scaffolder": "~1.17.1",
|
||||
"@backstage/plugin-search": "~1.4.5",
|
||||
"@backstage/plugin-search-react": "~1.7.5",
|
||||
"@backstage/plugin-tech-radar": "~0.6.12",
|
||||
"@backstage/plugin-techdocs": "~1.9.3",
|
||||
"@backstage/plugin-techdocs-module-addons-contrib": "~1.1.4",
|
||||
"@backstage/plugin-techdocs-react": "~1.1.15",
|
||||
"@backstage/plugin-user-settings": "~0.8.0",
|
||||
"@backstage/theme": "~0.5.0",
|
||||
"@internal/plugin-apache-spark": "^0.1.0",
|
||||
"@internal/plugin-argo-workflows": "^0.1.0",
|
||||
"@internal/plugin-cnoe-ui": "^0.1.0",
|
||||
"@material-ui/core": "^4.12.2",
|
||||
"@material-ui/icons": "^4.9.1",
|
||||
"@roadiehq/backstage-plugin-argo-cd": "^2.5.1",
|
||||
|
@ -52,7 +55,7 @@
|
|||
"react-use": "^17.2.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@backstage/test-utils": "^1.7.5",
|
||||
"@backstage/test-utils": "^1.4.7",
|
||||
"@playwright/test": "^1.32.3",
|
||||
"@testing-library/dom": "^9.0.0",
|
||||
"@testing-library/jest-dom": "^6.0.0",
|
||||
|
|
|
@ -13,7 +13,7 @@ import {
|
|||
import { ScaffolderPage, scaffolderPlugin } from '@backstage/plugin-scaffolder';
|
||||
import { orgPlugin } from '@backstage/plugin-org';
|
||||
import { SearchPage } from '@backstage/plugin-search';
|
||||
import { TechRadarPage } from '@backstage-community/plugin-tech-radar';
|
||||
import { TechRadarPage } from '@backstage/plugin-tech-radar';
|
||||
import {
|
||||
TechDocsIndexPage,
|
||||
techdocsPlugin,
|
||||
|
@ -32,8 +32,18 @@ import { createApp } from '@backstage/app-defaults';
|
|||
import { AppRouter, FlatRoutes } from '@backstage/core-app-api';
|
||||
import { CatalogGraphPage } from '@backstage/plugin-catalog-graph';
|
||||
import { RequirePermission } from '@backstage/plugin-permission-react';
|
||||
import { ThemeProvider } from '@material-ui/core/styles';
|
||||
import CssBaseline from '@material-ui/core/CssBaseline';
|
||||
import { catalogEntityCreatePermission } from '@backstage/plugin-catalog-common/alpha';
|
||||
import LightIcon from '@material-ui/icons/WbSunny';
|
||||
import {
|
||||
CNOEHomepage,
|
||||
cnoeLightTheme,
|
||||
cnoeDarkTheme,
|
||||
} from '@internal/plugin-cnoe-ui';
|
||||
import {configApiRef, useApi} from "@backstage/core-plugin-api";
|
||||
import { ArgoWorkflowsPage } from '@internal/plugin-argo-workflows';
|
||||
import { ApacheSparkPage } from '@internal/plugin-apache-spark';
|
||||
|
||||
const app = createApp({
|
||||
apis,
|
||||
|
@ -56,6 +66,7 @@ const app = createApp({
|
|||
);
|
||||
},
|
||||
},
|
||||
|
||||
bindRoutes({ bind }) {
|
||||
bind(catalogPlugin.externalRoutes, {
|
||||
createComponent: scaffolderPlugin.routes.root,
|
||||
|
@ -72,12 +83,37 @@ const app = createApp({
|
|||
bind(orgPlugin.externalRoutes, {
|
||||
catalogIndex: catalogPlugin.routes.catalogIndex,
|
||||
});
|
||||
}
|
||||
},
|
||||
themes: [
|
||||
{
|
||||
id: 'cnoe-light-theme',
|
||||
title: 'Light Theme',
|
||||
variant: 'light',
|
||||
icon: <LightIcon />,
|
||||
Provider: ({ children }) => (
|
||||
<ThemeProvider theme={cnoeLightTheme}>
|
||||
<CssBaseline>{children}</CssBaseline>
|
||||
</ThemeProvider>
|
||||
),
|
||||
},
|
||||
{
|
||||
id: 'cnoe-dark-theme',
|
||||
title: 'Dark Theme',
|
||||
variant: 'dark',
|
||||
icon: <LightIcon />,
|
||||
Provider: ({ children }) => (
|
||||
<ThemeProvider theme={cnoeDarkTheme}>
|
||||
<CssBaseline>{children}</CssBaseline>
|
||||
</ThemeProvider>
|
||||
),
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
const routes = (
|
||||
<FlatRoutes>
|
||||
<Route path="/" element={<Navigate to="home" />} />
|
||||
<Route path="/" element={<Navigate to="catalog" />} />
|
||||
<Route path="/home" element={<CNOEHomepage />} />
|
||||
<Route path="/catalog" element={<CatalogIndexPage />} />
|
||||
<Route
|
||||
path="/catalog/:namespace/:kind/:name"
|
||||
|
@ -113,6 +149,8 @@ const routes = (
|
|||
</Route>
|
||||
<Route path="/settings" element={<UserSettingsPage />} />
|
||||
<Route path="/catalog-graph" element={<CatalogGraphPage />} />
|
||||
<Route path="/argo-workflows" element={<ArgoWorkflowsPage />} />
|
||||
<Route path="/apache-spark" element={<ApacheSparkPage />} />
|
||||
</FlatRoutes>
|
||||
);
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ import {OAuth2} from "@backstage/core-app-api";
|
|||
export const keycloakOIDCAuthApiRef: ApiRef<
|
||||
OpenIdConnectApi & ProfileInfoApi & BackstageIdentityApi & SessionApi
|
||||
> = createApiRef({
|
||||
id: 'auth.keycloak-oidc',
|
||||
id: 'auth.keycloak-oidc-provider',
|
||||
});
|
||||
export const apis: AnyApiFactory[] = [
|
||||
createApiFactory({
|
||||
|
|
|
@ -5,6 +5,8 @@ import ExtensionIcon from '@material-ui/icons/Extension';
|
|||
import MapIcon from '@material-ui/icons/MyLocation';
|
||||
import LibraryBooks from '@material-ui/icons/LibraryBooks';
|
||||
import CreateComponentIcon from '@material-ui/icons/AddCircleOutline';
|
||||
import LogoFull from './LogoFull';
|
||||
import LogoIcon from './LogoIcon';
|
||||
import {
|
||||
Settings as SidebarSettings,
|
||||
UserSettingsSignInAvatar,
|
||||
|
@ -19,6 +21,7 @@ import {
|
|||
SidebarPage,
|
||||
SidebarScrollWrapper,
|
||||
SidebarSpace,
|
||||
useSidebarOpenState,
|
||||
Link,
|
||||
} from '@backstage/core-components';
|
||||
import MenuIcon from '@material-ui/icons/Menu';
|
||||
|
@ -41,10 +44,12 @@ const useSidebarLogoStyles = makeStyles({
|
|||
|
||||
const SidebarLogo = () => {
|
||||
const classes = useSidebarLogoStyles();
|
||||
const { isOpen } = useSidebarOpenState();
|
||||
|
||||
return (
|
||||
<div className={classes.root}>
|
||||
<Link to="/" underline="none" className={classes.link} aria-label="Home">
|
||||
{isOpen ? <LogoFull /> : <LogoIcon />}
|
||||
</Link>
|
||||
</div>
|
||||
);
|
||||
|
|
|
@ -10,8 +10,11 @@ import {
|
|||
} from '@backstage/plugin-api-docs';
|
||||
import {
|
||||
EntityAboutCard,
|
||||
EntityDependsOnComponentsCard,
|
||||
EntityDependsOnResourcesCard,
|
||||
EntityHasComponentsCard,
|
||||
EntityHasResourcesCard,
|
||||
EntityHasSubcomponentsCard,
|
||||
EntityHasSystemsCard,
|
||||
EntityLayout,
|
||||
EntityLinksCard,
|
||||
|
@ -25,6 +28,10 @@ import {
|
|||
hasRelationWarnings,
|
||||
EntityRelationWarning,
|
||||
} from '@backstage/plugin-catalog';
|
||||
import {
|
||||
isGithubActionsAvailable,
|
||||
EntityGithubActionsContent,
|
||||
} from '@backstage/plugin-github-actions';
|
||||
import {
|
||||
EntityUserProfileCard,
|
||||
EntityGroupProfileCard,
|
||||
|
@ -51,13 +58,19 @@ import {
|
|||
import { TechDocsAddons } from '@backstage/plugin-techdocs-react';
|
||||
import { ReportIssue } from '@backstage/plugin-techdocs-module-addons-contrib';
|
||||
|
||||
import { EntityKubernetesContent, isKubernetesAvailable } from '@backstage/plugin-kubernetes';
|
||||
import { EntityKubernetesContent } from '@backstage/plugin-kubernetes';
|
||||
|
||||
import {
|
||||
EntityArgoCDOverviewCard,
|
||||
isArgocdAvailable
|
||||
} from '@roadiehq/backstage-plugin-argo-cd';
|
||||
|
||||
import {
|
||||
EntityArgoWorkflowsOverviewCard, EntityArgoWorkflowsTemplateOverviewCard,
|
||||
isArgoWorkflowsAvailable,
|
||||
} from '@internal/plugin-argo-workflows';
|
||||
import {ApacheSparkPage, isApacheSparkAvailable} from "@internal/plugin-apache-spark";
|
||||
|
||||
const techdocsContent = (
|
||||
<EntityTechdocsContent>
|
||||
<TechDocsAddons>
|
||||
|
@ -67,7 +80,13 @@ const techdocsContent = (
|
|||
);
|
||||
|
||||
const cicdContent = (
|
||||
// This is an example of how you can implement your company's logic in entity page.
|
||||
// You can for example enforce that all components of type 'service' should use GitHubActions
|
||||
<EntitySwitch>
|
||||
<EntitySwitch.Case if={isGithubActionsAvailable}>
|
||||
<EntityGithubActionsContent />
|
||||
</EntitySwitch.Case>
|
||||
|
||||
<EntitySwitch.Case>
|
||||
<EmptyState
|
||||
title="No CI/CD available for this entity"
|
||||
|
@ -128,12 +147,27 @@ const overviewContent = (
|
|||
</Grid>
|
||||
</EntitySwitch.Case>
|
||||
</EntitySwitch>
|
||||
<EntitySwitch>
|
||||
<EntitySwitch.Case if={e => isArgoWorkflowsAvailable(e)}>
|
||||
<Grid item md={6}>
|
||||
<EntityArgoWorkflowsOverviewCard />
|
||||
</Grid>
|
||||
<Grid item md={6}>
|
||||
<EntityArgoWorkflowsTemplateOverviewCard />
|
||||
</Grid>
|
||||
</EntitySwitch.Case>
|
||||
</EntitySwitch>
|
||||
<Grid item md={6} xs={12}>
|
||||
<EntityCatalogGraphCard variant="gridItem" height={400} />
|
||||
</Grid>
|
||||
|
||||
<Grid item md={4} xs={12}>
|
||||
<EntityLinksCard />
|
||||
</Grid>
|
||||
<Grid item md={8} xs={12}>
|
||||
<EntityHasSubcomponentsCard variant="gridItem" />
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
);
|
||||
|
||||
|
@ -147,10 +181,14 @@ const serviceEntityPage = (
|
|||
{cicdContent}
|
||||
</EntityLayout.Route>
|
||||
|
||||
<EntityLayout.Route path="/kubernetes" title="Kubernetes" if={e => isKubernetesAvailable(e)}>
|
||||
<EntityLayout.Route path="/kubernetes" title="Kubernetes">
|
||||
<EntityKubernetesContent refreshIntervalMs={30000} />
|
||||
</EntityLayout.Route>
|
||||
|
||||
<EntityLayout.Route path="/apache-spark" title="Spark" if={isApacheSparkAvailable}>
|
||||
<ApacheSparkPage />
|
||||
</EntityLayout.Route>
|
||||
|
||||
<EntityLayout.Route path="/api" title="API">
|
||||
<Grid container spacing={3} alignItems="stretch">
|
||||
<Grid item md={6}>
|
||||
|
@ -162,6 +200,17 @@ const serviceEntityPage = (
|
|||
</Grid>
|
||||
</EntityLayout.Route>
|
||||
|
||||
<EntityLayout.Route path="/dependencies" title="Dependencies">
|
||||
<Grid container spacing={3} alignItems="stretch">
|
||||
<Grid item md={6}>
|
||||
<EntityDependsOnComponentsCard variant="gridItem" />
|
||||
</Grid>
|
||||
<Grid item md={6}>
|
||||
<EntityDependsOnResourcesCard variant="gridItem" />
|
||||
</Grid>
|
||||
</Grid>
|
||||
</EntityLayout.Route>
|
||||
|
||||
<EntityLayout.Route path="/docs" title="Docs">
|
||||
{techdocsContent}
|
||||
</EntityLayout.Route>
|
||||
|
@ -178,6 +227,17 @@ const websiteEntityPage = (
|
|||
{cicdContent}
|
||||
</EntityLayout.Route>
|
||||
|
||||
<EntityLayout.Route path="/dependencies" title="Dependencies">
|
||||
<Grid container spacing={3} alignItems="stretch">
|
||||
<Grid item md={6}>
|
||||
<EntityDependsOnComponentsCard variant="gridItem" />
|
||||
</Grid>
|
||||
<Grid item md={6}>
|
||||
<EntityDependsOnResourcesCard variant="gridItem" />
|
||||
</Grid>
|
||||
</Grid>
|
||||
</EntityLayout.Route>
|
||||
|
||||
<EntityLayout.Route path="/docs" title="Docs">
|
||||
{techdocsContent}
|
||||
</EntityLayout.Route>
|
||||
|
@ -228,6 +288,9 @@ const apiPage = (
|
|||
<Grid item md={6} xs={12}>
|
||||
<EntityCatalogGraphCard variant="gridItem" height={400} />
|
||||
</Grid>
|
||||
<Grid item md={4} xs={12}>
|
||||
<EntityLinksCard />
|
||||
</Grid>
|
||||
<Grid container item md={12}>
|
||||
<Grid item md={6}>
|
||||
<EntityProvidingComponentsCard />
|
||||
|
|
|
@ -16,41 +16,34 @@
|
|||
"build-image": "docker build ../.. -f Dockerfile --tag backstage"
|
||||
},
|
||||
"dependencies": {
|
||||
"@backstage/backend-common": "^0.25.0",
|
||||
"@backstage/backend-defaults": "^0.8.1",
|
||||
"@backstage/backend-plugin-api": "^1.2.0",
|
||||
"@backstage/backend-tasks": "^0.6.1",
|
||||
"@backstage/catalog-client": "^1.9.1",
|
||||
"@backstage/catalog-model": "^1.7.3",
|
||||
"@backstage/config": "^1.3.2",
|
||||
"@backstage/errors": "^1.2.7",
|
||||
"@backstage/integration": "^1.16.1",
|
||||
"@backstage/plugin-app-backend": "^0.4.5",
|
||||
"@backstage/plugin-auth-backend": "^0.24.3",
|
||||
"@backstage/plugin-auth-backend-module-guest-provider": "^0.2.5",
|
||||
"@backstage/plugin-auth-backend-module-oidc-provider": "^0.4.0",
|
||||
"@backstage/plugin-auth-node": "^0.6.0",
|
||||
"@backstage/plugin-catalog-backend": "^1.31.0",
|
||||
"@backstage/plugin-catalog-backend-module-scaffolder-entity-model": "^0.2.5",
|
||||
"@backstage/plugin-kubernetes-backend": "^0.19.3",
|
||||
"@backstage/plugin-permission-common": "^0.8.4",
|
||||
"@backstage/plugin-permission-node": "^0.8.8",
|
||||
"@backstage/plugin-proxy-backend": "^0.5.11",
|
||||
"@backstage/plugin-scaffolder-backend": "^1.30.0",
|
||||
"@backstage/plugin-scaffolder-backend-module-gitea": "^0.2.6",
|
||||
"@backstage/plugin-scaffolder-backend-module-github": "^0.6.0",
|
||||
"@backstage/plugin-scaffolder-node": "^0.7.0",
|
||||
"@backstage/plugin-search-backend": "^1.8.2",
|
||||
"@backstage/plugin-search-backend-module-catalog": "^0.3.1",
|
||||
"@backstage/plugin-search-backend-module-pg": "^0.5.41",
|
||||
"@backstage/plugin-search-backend-module-techdocs": "^0.3.6",
|
||||
"@backstage/plugin-search-backend-node": "^1.3.8",
|
||||
"@backstage/plugin-techdocs-backend": "^1.11.6",
|
||||
"@backstage/types": "^1.2.1",
|
||||
"@backstage/backend-common": "~0.20.1",
|
||||
"@backstage/backend-tasks": "~0.5.14",
|
||||
"@backstage/catalog-client": "~1.5.2",
|
||||
"@backstage/catalog-model": "~1.4.3",
|
||||
"@backstage/config": "~1.1.1",
|
||||
"@backstage/errors": "~1.2.3",
|
||||
"@backstage/integration": "~1.8.0",
|
||||
"@backstage/plugin-app-backend": "~0.3.57",
|
||||
"@backstage/plugin-auth-backend": "~0.20.3",
|
||||
"@backstage/plugin-auth-node": "~0.4.3",
|
||||
"@backstage/plugin-catalog-backend": "~1.16.1",
|
||||
"@backstage/plugin-catalog-backend-module-scaffolder-entity-model": "~0.1.6",
|
||||
"@backstage/plugin-kubernetes-backend": "~0.14.1",
|
||||
"@backstage/plugin-permission-common": "~0.7.12",
|
||||
"@backstage/plugin-permission-node": "~0.7.20",
|
||||
"@backstage/plugin-proxy-backend": "~0.4.7",
|
||||
"@backstage/plugin-scaffolder-backend": "~1.20.0",
|
||||
"@backstage/plugin-scaffolder-node": "~0.2.9",
|
||||
"@backstage/plugin-search-backend": "~1.4.9",
|
||||
"@backstage/plugin-search-backend-module-catalog": "~0.1.13",
|
||||
"@backstage/plugin-search-backend-module-pg": "~0.5.18",
|
||||
"@backstage/plugin-search-backend-module-techdocs": "~0.1.13",
|
||||
"@backstage/plugin-search-backend-node": "~1.2.13",
|
||||
"@backstage/plugin-techdocs-backend": "~1.9.2",
|
||||
"@backstage/types": "~1.1.1",
|
||||
"@kubernetes/client-node": "~0.20.0",
|
||||
"@roadiehq/backstage-plugin-argo-cd-backend": "3.1.0",
|
||||
"@roadiehq/scaffolder-backend-module-http-request": "^4.3.5",
|
||||
"@roadiehq/scaffolder-backend-module-utils": "3.0.0",
|
||||
"@roadiehq/backstage-plugin-argo-cd-backend": "~2.14.0",
|
||||
"@roadiehq/scaffolder-backend-module-utils": "~1.13.1",
|
||||
"app": "link:../app",
|
||||
"better-sqlite3": "^9.0.0",
|
||||
"dockerode": "^3.3.1",
|
||||
|
@ -62,7 +55,7 @@
|
|||
"winston": "^3.2.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@backstage/cli": "^0.30.0",
|
||||
"@backstage/cli": "^0.25.1",
|
||||
"@types/dockerode": "^3.3.0",
|
||||
"@types/express": "^4.17.6",
|
||||
"@types/express-serve-static-core": "^4.17.5",
|
||||
|
|
|
@ -1,45 +1,123 @@
|
|||
import { createBackend } from '@backstage/backend-defaults';
|
||||
import { cnoeScaffolderActions } from './plugins/scaffolder';
|
||||
import { authModuleKeycloakOIDCProvider } from './plugins/auth';
|
||||
/*
|
||||
* Hi!
|
||||
*
|
||||
* Note that this is an EXAMPLE Backstage backend. Please check the README.
|
||||
*
|
||||
* Happy hacking!
|
||||
*/
|
||||
|
||||
const backend = createBackend();
|
||||
import Router from 'express-promise-router';
|
||||
import {
|
||||
createServiceBuilder,
|
||||
loadBackendConfig,
|
||||
getRootLogger,
|
||||
useHotMemoize,
|
||||
notFoundHandler,
|
||||
CacheManager,
|
||||
DatabaseManager,
|
||||
HostDiscovery,
|
||||
UrlReaders,
|
||||
ServerTokenManager,
|
||||
} from '@backstage/backend-common';
|
||||
import { TaskScheduler } from '@backstage/backend-tasks';
|
||||
import { Config } from '@backstage/config';
|
||||
import app from './plugins/app';
|
||||
import auth from './plugins/auth';
|
||||
import catalog from './plugins/catalog';
|
||||
import scaffolder from './plugins/scaffolder';
|
||||
import proxy from './plugins/proxy';
|
||||
import techdocs from './plugins/techdocs';
|
||||
import search from './plugins/search';
|
||||
import { PluginEnvironment } from './types';
|
||||
import { ServerPermissionClient } from '@backstage/plugin-permission-node';
|
||||
import { DefaultIdentityClient } from '@backstage/plugin-auth-node';
|
||||
|
||||
// core plugins
|
||||
backend.add(import('@backstage/plugin-app-backend'));
|
||||
backend.add(import('@backstage/plugin-catalog-backend'));
|
||||
backend.add(import('@backstage/plugin-proxy-backend'));
|
||||
backend.add(import('@backstage/plugin-techdocs-backend/alpha'));
|
||||
import kubernetes from './plugins/kubernetes';
|
||||
import argocd from './plugins/argocd';
|
||||
function makeCreateEnv(config: Config) {
|
||||
const root = getRootLogger();
|
||||
const reader = UrlReaders.default({ logger: root, config });
|
||||
const discovery = HostDiscovery.fromConfig(config);
|
||||
const cacheManager = CacheManager.fromConfig(config);
|
||||
const databaseManager = DatabaseManager.fromConfig(config, { logger: root });
|
||||
const tokenManager = ServerTokenManager.noop();
|
||||
const taskScheduler = TaskScheduler.fromConfig(config, { databaseManager });
|
||||
|
||||
// auth plugins
|
||||
backend.add(import('@backstage/plugin-auth-backend'));
|
||||
backend.add(import('@backstage/plugin-auth-backend-module-guest-provider'));
|
||||
const identity = DefaultIdentityClient.create({
|
||||
discovery,
|
||||
});
|
||||
const permissions = ServerPermissionClient.fromConfig(config, {
|
||||
discovery,
|
||||
tokenManager,
|
||||
});
|
||||
|
||||
// scaffolder plugins
|
||||
backend.add(import('@backstage/plugin-scaffolder-backend/alpha'));
|
||||
backend.add(
|
||||
import('@backstage/plugin-catalog-backend-module-scaffolder-entity-model'),
|
||||
);
|
||||
backend.add(import('@backstage/plugin-scaffolder-backend-module-github'));
|
||||
root.info(`Created UrlReader ${reader}`);
|
||||
|
||||
// search plugins
|
||||
backend.add(import('@backstage/plugin-search-backend/alpha'));
|
||||
return (plugin: string): PluginEnvironment => {
|
||||
const logger = root.child({ type: 'plugin', plugin });
|
||||
const database = databaseManager.forPlugin(plugin);
|
||||
const cache = cacheManager.forPlugin(plugin);
|
||||
const scheduler = taskScheduler.forPlugin(plugin);
|
||||
return {
|
||||
logger,
|
||||
database,
|
||||
cache,
|
||||
config,
|
||||
reader,
|
||||
discovery,
|
||||
tokenManager,
|
||||
scheduler,
|
||||
permissions,
|
||||
identity,
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
backend.add(import('@backstage/plugin-search-backend-module-catalog'));
|
||||
backend.add(import('@backstage/plugin-search-backend-module-techdocs/alpha'));
|
||||
async function main() {
|
||||
const config = await loadBackendConfig({
|
||||
argv: process.argv,
|
||||
logger: getRootLogger(),
|
||||
});
|
||||
const createEnv = makeCreateEnv(config);
|
||||
|
||||
// other @backstage plugins
|
||||
backend.add(import('@backstage/plugin-kubernetes-backend'));
|
||||
const catalogEnv = useHotMemoize(module, () => createEnv('catalog'));
|
||||
const scaffolderEnv = useHotMemoize(module, () => createEnv('scaffolder'));
|
||||
const authEnv = useHotMemoize(module, () => createEnv('auth'));
|
||||
const proxyEnv = useHotMemoize(module, () => createEnv('proxy'));
|
||||
const techdocsEnv = useHotMemoize(module, () => createEnv('techdocs'));
|
||||
const searchEnv = useHotMemoize(module, () => createEnv('search'));
|
||||
const appEnv = useHotMemoize(module, () => createEnv('app'));
|
||||
|
||||
// roadie plugins
|
||||
backend.add(import('@roadiehq/scaffolder-backend-module-utils/new-backend'));
|
||||
backend.add(import('./plugins/argocd_index'));
|
||||
const kubernetesEnv = useHotMemoize(module, () => createEnv('kubernetes'));
|
||||
const argocdEnv = useHotMemoize(module, () => createEnv('argocd'));
|
||||
|
||||
backend.add(
|
||||
import('@roadiehq/scaffolder-backend-module-http-request/new-backend'),
|
||||
);
|
||||
const apiRouter = Router();
|
||||
apiRouter.use('/catalog', await catalog(catalogEnv));
|
||||
apiRouter.use('/scaffolder', await scaffolder(scaffolderEnv));
|
||||
apiRouter.use('/auth', await auth(authEnv));
|
||||
apiRouter.use('/techdocs', await techdocs(techdocsEnv));
|
||||
apiRouter.use('/proxy', await proxy(proxyEnv));
|
||||
apiRouter.use('/search', await search(searchEnv));
|
||||
|
||||
// cnoe plugins
|
||||
backend.add(authModuleKeycloakOIDCProvider);
|
||||
backend.add(cnoeScaffolderActions);
|
||||
apiRouter.use('/kubernetes', await kubernetes(kubernetesEnv));
|
||||
apiRouter.use('/argocd', await argocd(argocdEnv));
|
||||
|
||||
backend.start();
|
||||
// Add backends ABOVE this line; this 404 handler is the catch-all fallback
|
||||
apiRouter.use(notFoundHandler());
|
||||
|
||||
const service = createServiceBuilder(module)
|
||||
.loadConfig(config)
|
||||
.addRouter('/api', apiRouter)
|
||||
.addRouter('', await app(appEnv));
|
||||
|
||||
await service.start().catch(err => {
|
||||
console.log(err);
|
||||
process.exit(1);
|
||||
});
|
||||
}
|
||||
|
||||
module.hot?.accept();
|
||||
main().catch(error => {
|
||||
console.error('Backend failed to start up', error);
|
||||
process.exit(1);
|
||||
});
|
||||
|
|
14
packages/backend/src/plugins/app.ts
Normal file
14
packages/backend/src/plugins/app.ts
Normal file
|
@ -0,0 +1,14 @@
|
|||
import { createRouter } from '@backstage/plugin-app-backend';
|
||||
import { Router } from 'express';
|
||||
import { PluginEnvironment } from '../types';
|
||||
|
||||
export default async function createPlugin(
|
||||
env: PluginEnvironment,
|
||||
): Promise<Router> {
|
||||
return await createRouter({
|
||||
logger: env.logger,
|
||||
config: env.config,
|
||||
database: env.database,
|
||||
appPackageName: 'app',
|
||||
});
|
||||
}
|
|
@ -1,58 +1,24 @@
|
|||
import { Config } from '@backstage/config';
|
||||
import { createTemplateAction } from '@backstage/plugin-scaffolder-node';
|
||||
import { examples } from './gitea-actions';
|
||||
import { Logger } from 'winston';
|
||||
import {Config} from "@backstage/config";
|
||||
import {createTemplateAction} from "@backstage/plugin-scaffolder-node";
|
||||
import {examples} from "./gitea-actions";
|
||||
import {Logger} from "winston";
|
||||
|
||||
import { ArgoService } from '@roadiehq/backstage-plugin-argo-cd-backend';
|
||||
|
||||
import { createRouter } from '@roadiehq/backstage-plugin-argo-cd-backend';
|
||||
//import { PluginEnvironment } from '../types';
|
||||
import { PluginEnvironment } from '../types';
|
||||
|
||||
|
||||
/*export default async function createPlugin({
|
||||
logger,
|
||||
config,
|
||||
}: PluginEnvironment) {
|
||||
export default async function createPlugin({
|
||||
logger,
|
||||
config,
|
||||
}: PluginEnvironment) {
|
||||
return await createRouter({ logger, config });
|
||||
}*/
|
||||
}
|
||||
|
||||
import { loggerToWinstonLogger } from '@backstage/backend-common';
|
||||
|
||||
import {
|
||||
coreServices,
|
||||
createBackendPlugin,
|
||||
} from '@backstage/backend-plugin-api';
|
||||
|
||||
export const argocdPlugin = createBackendPlugin({
|
||||
pluginId: 'argocd',
|
||||
register(env) {
|
||||
env.registerInit({
|
||||
deps: {
|
||||
logger: coreServices.logger,
|
||||
config: coreServices.rootConfig,
|
||||
reader: coreServices.urlReader,
|
||||
discovery: coreServices.discovery,
|
||||
auth: coreServices.auth,
|
||||
//tokenManager: coreServices.tokenManager,
|
||||
httpRouter: coreServices.httpRouter,
|
||||
},
|
||||
async init({
|
||||
logger,
|
||||
config,
|
||||
httpRouter,
|
||||
}) {
|
||||
httpRouter.use(
|
||||
await createRouter({
|
||||
logger: loggerToWinstonLogger(logger),
|
||||
config,
|
||||
}),
|
||||
);
|
||||
},
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
|
||||
export function createArgoCDApp(options: { config: Config; logger: Logger }) {
|
||||
export function createArgoCDApp(options: {
|
||||
config: Config;
|
||||
logger: Logger
|
||||
}) {
|
||||
const { config, logger } = options;
|
||||
|
||||
return createTemplateAction<{
|
||||
|
@ -62,22 +28,16 @@ export function createArgoCDApp(options: { config: Config; logger: Logger }) {
|
|||
argoInstance: string;
|
||||
path: string;
|
||||
labelValue?: string;
|
||||
appNamespace: string;
|
||||
appNamespace: string
|
||||
}>({
|
||||
id: 'cnoe:create-argocd-app',
|
||||
description: 'creates argocd app',
|
||||
description:
|
||||
'creates argocd app',
|
||||
examples,
|
||||
schema: {
|
||||
input: {
|
||||
type: 'object',
|
||||
required: [
|
||||
'repoUrl',
|
||||
'projectName',
|
||||
'appName',
|
||||
'argoInstance',
|
||||
'path',
|
||||
'appNamespace',
|
||||
],
|
||||
required: ['repoUrl', 'projectName', 'appName', 'argoInstance', 'path', 'appNamespace'],
|
||||
properties: {
|
||||
repoUrl: {
|
||||
title: 'Repository Location',
|
||||
|
@ -106,12 +66,14 @@ export function createArgoCDApp(options: { config: Config; logger: Logger }) {
|
|||
labelValue: {
|
||||
title: 'for argocd plugin to locate this app',
|
||||
type: 'string',
|
||||
},
|
||||
}
|
||||
},
|
||||
},
|
||||
output: {},
|
||||
output: {
|
||||
},
|
||||
},
|
||||
async handler(ctx) {
|
||||
|
||||
const {
|
||||
repoUrl,
|
||||
projectName,
|
||||
|
@ -119,7 +81,7 @@ export function createArgoCDApp(options: { config: Config; logger: Logger }) {
|
|||
argoInstance,
|
||||
path,
|
||||
labelValue,
|
||||
appNamespace,
|
||||
appNamespace
|
||||
} = ctx.input;
|
||||
|
||||
const argoUserName =
|
||||
|
@ -168,7 +130,7 @@ export function createArgoCDApp(options: { config: Config; logger: Logger }) {
|
|||
sourceRepo: repoUrl,
|
||||
sourcePath: path,
|
||||
labelValue: labelValue ? labelValue : appName,
|
||||
});
|
||||
})
|
||||
},
|
||||
});
|
||||
}
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
export { argocdPlugin as default } from './argocd';
|
|
@ -1,68 +1,57 @@
|
|||
import {
|
||||
createRouter,
|
||||
providers,
|
||||
defaultAuthProviderFactories,
|
||||
} from '@backstage/plugin-auth-backend';
|
||||
import { Router } from 'express';
|
||||
import { PluginEnvironment } from '../types';
|
||||
import {
|
||||
DEFAULT_NAMESPACE,
|
||||
stringifyEntityRef,
|
||||
} from '@backstage/catalog-model';
|
||||
import { JsonArray } from '@backstage/types';
|
||||
import { createBackendModule } from '@backstage/backend-plugin-api';
|
||||
import {
|
||||
authProvidersExtensionPoint,
|
||||
createOAuthProviderFactory,
|
||||
OAuthAuthenticatorResult,
|
||||
} from '@backstage/plugin-auth-node';
|
||||
import {
|
||||
oidcAuthenticator,
|
||||
OidcAuthResult,
|
||||
} from '@backstage/plugin-auth-backend-module-oidc-provider';
|
||||
|
||||
export const authModuleKeycloakOIDCProvider = createBackendModule({
|
||||
pluginId: 'auth',
|
||||
moduleId: 'keycloak-oidc',
|
||||
register(reg) {
|
||||
reg.registerInit({
|
||||
deps: {
|
||||
providers: authProvidersExtensionPoint,
|
||||
},
|
||||
async init({ providers }) {
|
||||
providers.registerProvider({
|
||||
providerId: 'keycloak-oidc',
|
||||
factory: createOAuthProviderFactory({
|
||||
authenticator: oidcAuthenticator,
|
||||
profileTransform: async (
|
||||
input: OAuthAuthenticatorResult<OidcAuthResult>,
|
||||
) => ({
|
||||
profile: {
|
||||
email: input.fullProfile.userinfo.email,
|
||||
picture: input.fullProfile.userinfo.picture,
|
||||
displayName: input.fullProfile.userinfo.name,
|
||||
},
|
||||
}),
|
||||
async signInResolver(info, ctx) {
|
||||
const { profile } = info;
|
||||
if (!profile.displayName) {
|
||||
throw new Error(
|
||||
'Login failed, user profile does not contain a valid name',
|
||||
);
|
||||
}
|
||||
// should use users from catalog
|
||||
const userRef = stringifyEntityRef({
|
||||
kind: 'User',
|
||||
name: info.profile.displayName!,
|
||||
namespace: DEFAULT_NAMESPACE,
|
||||
});
|
||||
export default async function createPlugin(
|
||||
env: PluginEnvironment,
|
||||
): Promise<Router> {
|
||||
const opts = {
|
||||
logger: env.logger,
|
||||
config: env.config,
|
||||
database: env.database,
|
||||
discovery: env.discovery,
|
||||
tokenManager: env.tokenManager,
|
||||
providerFactories: {
|
||||
...defaultAuthProviderFactories,
|
||||
},
|
||||
};
|
||||
|
||||
return ctx.issueToken({
|
||||
claims: {
|
||||
sub: userRef,
|
||||
ent: [userRef],
|
||||
groups:
|
||||
(info.result.fullProfile.userinfo.groups as JsonArray) ||
|
||||
[],
|
||||
},
|
||||
});
|
||||
const envName = env.config
|
||||
.getOptionalConfig('auth')
|
||||
?.getOptionalString('auth');
|
||||
if (envName === 'local') {
|
||||
return await createRouter(opts);
|
||||
}
|
||||
|
||||
const keycloakAuth = (opts.providerFactories['keycloak-oidc'] =
|
||||
providers.oidc.create({
|
||||
signIn: {
|
||||
resolver(info, ctx) {
|
||||
const userRef = stringifyEntityRef({
|
||||
kind: 'User',
|
||||
name: info.result.userinfo.sub,
|
||||
namespace: DEFAULT_NAMESPACE,
|
||||
});
|
||||
return ctx.issueToken({
|
||||
claims: {
|
||||
sub: userRef,
|
||||
ent: [userRef],
|
||||
groups: (info.result.userinfo.groups as JsonArray) || [],
|
||||
},
|
||||
}),
|
||||
});
|
||||
});
|
||||
},
|
||||
},
|
||||
});
|
||||
},
|
||||
});
|
||||
}));
|
||||
opts.providerFactories['keycloak-oidc'] = keycloakAuth;
|
||||
|
||||
return await createRouter(opts);
|
||||
}
|
||||
|
|
14
packages/backend/src/plugins/catalog.ts
Normal file
14
packages/backend/src/plugins/catalog.ts
Normal file
|
@ -0,0 +1,14 @@
|
|||
import { CatalogBuilder } from '@backstage/plugin-catalog-backend';
|
||||
import { ScaffolderEntitiesProcessor } from '@backstage/plugin-catalog-backend-module-scaffolder-entity-model';
|
||||
import { Router } from 'express';
|
||||
import { PluginEnvironment } from '../types';
|
||||
|
||||
export default async function createPlugin(
|
||||
env: PluginEnvironment,
|
||||
): Promise<Router> {
|
||||
const builder = await CatalogBuilder.create(env);
|
||||
builder.addProcessor(new ScaffolderEntitiesProcessor());
|
||||
const { processingEngine, router } = await builder.build();
|
||||
await processingEngine.start();
|
||||
return router;
|
||||
}
|
|
@ -1,16 +1,16 @@
|
|||
// this is necessary until https://github.com/backstage/backstage/pull/21890/ is merged and released.
|
||||
import { InputError } from '@backstage/errors';
|
||||
import { Config } from '@backstage/config';
|
||||
import {
|
||||
getGiteaRequestOptions,
|
||||
GiteaIntegrationConfig,
|
||||
ScmIntegrationRegistry,
|
||||
ScmIntegrations,
|
||||
ScmIntegrationRegistry, ScmIntegrations,
|
||||
} from '@backstage/integration';
|
||||
import {
|
||||
createTemplateAction,
|
||||
getRepoSourceDirectory,
|
||||
initRepoAndPush,
|
||||
TemplateExample,
|
||||
TemplateExample
|
||||
} from '@backstage/plugin-scaffolder-node';
|
||||
import crypto from 'crypto';
|
||||
import yaml from 'yaml';
|
||||
|
@ -290,6 +290,7 @@ const checkGiteaOrg = async (
|
|||
}
|
||||
};
|
||||
|
||||
|
||||
const createGiteaProject = async (
|
||||
config: GiteaIntegrationConfig,
|
||||
options: {
|
||||
|
@ -356,6 +357,8 @@ const createGiteaProject = async (
|
|||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
const generateCommitMessage = (
|
||||
|
@ -505,6 +508,7 @@ export function createPublishGiteaAction(options: {
|
|||
},
|
||||
},
|
||||
async handler(ctx) {
|
||||
|
||||
const {
|
||||
repoUrl,
|
||||
description,
|
||||
|
@ -551,7 +555,7 @@ export function createPublishGiteaAction(options: {
|
|||
: config.getOptionalString('scaffolder.defaultAuthor.email'),
|
||||
};
|
||||
// The owner to be used should be either the org name or user authenticated with the gitea server
|
||||
const repoOwner = owner ? owner : username;
|
||||
const repoOwner = owner ? owner: username
|
||||
const remoteUrl = `${integrationConfig.config.baseUrl}/${repoOwner}/${repo}.git`;
|
||||
const commitResult = await initRepoAndPush({
|
||||
dir: getRepoSourceDirectory(ctx.workspacePath, sourcePath),
|
||||
|
@ -565,8 +569,7 @@ export function createPublishGiteaAction(options: {
|
|||
|
||||
// Check if the gitea repo URL is available before to exit
|
||||
const operationTimeLimit = 5000; // 20 seconds
|
||||
const sleep = (ms: number | undefined) =>
|
||||
new Promise(r => setTimeout(r, ms));
|
||||
const sleep = (ms: number | undefined) => new Promise(r => setTimeout(r, ms));
|
||||
await sleep(operationTimeLimit);
|
||||
// await checkAvailabilityGiteaRepository(
|
||||
// integrationConfig.config, {
|
||||
|
@ -598,3 +601,5 @@ export function createPublishGiteaAction(options: {
|
|||
},
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,43 +1,10 @@
|
|||
import {
|
||||
createTemplateAction,
|
||||
executeShellCommand,
|
||||
} from '@backstage/plugin-scaffolder-node';
|
||||
import { createTemplateAction, executeShellCommand} from '@backstage/plugin-scaffolder-node';
|
||||
import { dumpYaml } from '@kubernetes/client-node';
|
||||
import yaml from 'js-yaml';
|
||||
import { Config } from '@backstage/config';
|
||||
import { resolveSafeChildPath } from '@backstage/backend-common';
|
||||
import fs from 'fs-extra';
|
||||
|
||||
interface Cluster {
|
||||
name: string;
|
||||
cluster: {
|
||||
server: string;
|
||||
'insecure-skip-tls-verify': boolean;
|
||||
'certificate-authority-data'?: string;
|
||||
'certificate-authority'?: string;
|
||||
};
|
||||
}
|
||||
interface Context {
|
||||
name: string;
|
||||
context: {
|
||||
cluster: string;
|
||||
user: string;
|
||||
};
|
||||
}
|
||||
interface User {
|
||||
name: string;
|
||||
user: {
|
||||
token?: string;
|
||||
};
|
||||
}
|
||||
interface ConfFile {
|
||||
apiVersion: string;
|
||||
kind: string;
|
||||
'current-context': string;
|
||||
contexts: Context[];
|
||||
clusters: Cluster[];
|
||||
users: User[];
|
||||
}
|
||||
export const createKubernetesApply = (config: Config) => {
|
||||
return createTemplateAction<{
|
||||
manifestString?: string;
|
||||
|
@ -89,16 +56,16 @@ export const createKubernetesApply = (config: Config) => {
|
|||
},
|
||||
},
|
||||
async handler(ctx) {
|
||||
let manifestPath = resolveSafeChildPath(
|
||||
ctx.workspacePath,
|
||||
'to-be-applied.yaml',
|
||||
);
|
||||
let obj: any;
|
||||
let manifestPath = resolveSafeChildPath(ctx.workspacePath, 'to-be-applied.yaml');
|
||||
if (ctx.input.manifestString) {
|
||||
obj = yaml.load(ctx.input.manifestString)
|
||||
fs.writeFileSync(manifestPath, ctx.input.manifestString, {
|
||||
encoding: 'utf8',
|
||||
mode: '600',
|
||||
});
|
||||
} else if (ctx.input.manifestObject) {
|
||||
obj = ctx.input.manifestObject;
|
||||
fs.writeFileSync(manifestPath, yaml.dump(ctx.input.manifestObject), {
|
||||
encoding: 'utf8',
|
||||
mode: '600',
|
||||
|
@ -108,15 +75,15 @@ export const createKubernetesApply = (config: Config) => {
|
|||
ctx.workspacePath,
|
||||
ctx.input.manifestPath!,
|
||||
);
|
||||
manifestPath = filePath;
|
||||
const fileContent = fs.readFileSync(filePath, 'utf8');
|
||||
manifestPath = filePath
|
||||
obj = yaml.load(fileContent);
|
||||
}
|
||||
const fileContent = fs.readFileSync(manifestPath, 'utf8');
|
||||
const objList: any[] = yaml.loadAll(fileContent);
|
||||
|
||||
if (ctx.input.clusterName) {
|
||||
// Supports SA token authentication only
|
||||
const targetCluster = getClusterConfig(ctx.input.clusterName!, config);
|
||||
const confFile: ConfFile = {
|
||||
const confFile = {
|
||||
apiVersion: 'v1',
|
||||
kind: 'Config',
|
||||
'current-context': ctx.input.clusterName,
|
||||
|
@ -133,9 +100,10 @@ export const createKubernetesApply = (config: Config) => {
|
|||
{
|
||||
name: ctx.input.clusterName,
|
||||
cluster: {
|
||||
'certificate-authority-data': targetCluster.getOptionalString('caData'),
|
||||
'certificate-authority': targetCluster.getOptionalString('caFile'),
|
||||
server: targetCluster.getString('url'),
|
||||
'insecure-skip-tls-verify':
|
||||
!!targetCluster.getOptionalBoolean('skipTLSVerify'),
|
||||
'insecure-skip-tls-verify': !!targetCluster.getOptionalBoolean('skipTLSVerify'),
|
||||
},
|
||||
},
|
||||
],
|
||||
|
@ -148,28 +116,15 @@ export const createKubernetesApply = (config: Config) => {
|
|||
},
|
||||
],
|
||||
};
|
||||
if (!confFile.clusters[0].cluster['insecure-skip-tls-verify']) {
|
||||
let caDataRaw = targetCluster.getOptionalString('caData');
|
||||
if (!confFile.clusters[0].cluster["insecure-skip-tls-verify"]) {
|
||||
let caDataRaw = targetCluster.getOptionalString('caData')
|
||||
if (caDataRaw?.startsWith('-----BEGIN CERTIFICATE-----')) {
|
||||
caDataRaw = Buffer.from(
|
||||
targetCluster.getString('caData'),
|
||||
'utf8',
|
||||
).toString('base64');
|
||||
}
|
||||
confFile.clusters[0].cluster['certificate-authority-data'] =
|
||||
caDataRaw;
|
||||
if (
|
||||
targetCluster.getOptionalString('caFile') &&
|
||||
!(
|
||||
targetCluster.getOptionalString('caFile')?.length === 0 ||
|
||||
targetCluster.getOptionalString('caFile') === null
|
||||
)
|
||||
) {
|
||||
confFile.clusters[0].cluster['certificate-authority'] =
|
||||
targetCluster.getString('caFile');
|
||||
caDataRaw = Buffer.from(targetCluster.getString('caData'), 'utf8').toString(
|
||||
'base64',
|
||||
);
|
||||
}
|
||||
confFile.clusters[0].cluster['certificate-authority-data'] = caDataRaw
|
||||
}
|
||||
|
||||
const confString = dumpYaml(confFile);
|
||||
const confFilePath = resolveSafeChildPath(ctx.workspacePath, 'config');
|
||||
fs.writeFileSync(confFilePath, confString, {
|
||||
|
@ -186,46 +141,22 @@ export const createKubernetesApply = (config: Config) => {
|
|||
args: [manifestPath],
|
||||
logStream: ctx.logStream,
|
||||
});
|
||||
let counter = 1;
|
||||
for (const obj of objList) {
|
||||
let manifestFilePath = resolveSafeChildPath(
|
||||
ctx.workspacePath,
|
||||
'to-be-applied-' + counter.toString() + '.yaml',
|
||||
);
|
||||
fs.writeFileSync(manifestFilePath, yaml.dump(obj), {
|
||||
encoding: 'utf8',
|
||||
mode: '600',
|
||||
if (obj.metadata.generateName !== undefined) {
|
||||
await executeShellCommand({
|
||||
command: 'kubectl',
|
||||
args: ['--kubeconfig', confFilePath, 'create', '-f', manifestPath],
|
||||
logStream: ctx.logStream,
|
||||
});
|
||||
if (obj.metadata.generateName !== undefined) {
|
||||
await executeShellCommand({
|
||||
command: 'kubectl',
|
||||
args: [
|
||||
'--kubeconfig',
|
||||
confFilePath,
|
||||
'create',
|
||||
'-f',
|
||||
manifestFilePath,
|
||||
],
|
||||
logStream: ctx.logStream,
|
||||
});
|
||||
} else {
|
||||
await executeShellCommand({
|
||||
command: 'kubectl',
|
||||
args: [
|
||||
'--kubeconfig',
|
||||
confFilePath,
|
||||
'apply',
|
||||
'-f',
|
||||
manifestFilePath,
|
||||
],
|
||||
logStream: ctx.logStream,
|
||||
});
|
||||
}
|
||||
counter += 1;
|
||||
return;
|
||||
}
|
||||
await executeShellCommand({
|
||||
command: 'kubectl',
|
||||
args: ['--kubeconfig', confFilePath, 'apply', '-f', manifestPath],
|
||||
logStream: ctx.logStream,
|
||||
});
|
||||
return;
|
||||
}
|
||||
throw new Error('please specify a valid cluster name');
|
||||
throw new Error("please specify a valid cluster name")
|
||||
},
|
||||
});
|
||||
};
|
||||
|
@ -252,4 +183,4 @@ function getClusterConfig(name: string, config: Config): Config {
|
|||
throw new Error(`Cluster with name ${name} not found`);
|
||||
}
|
||||
return clusters[0];
|
||||
}
|
||||
}
|
||||
|
|
18
packages/backend/src/plugins/kubernetes.ts
Normal file
18
packages/backend/src/plugins/kubernetes.ts
Normal file
|
@ -0,0 +1,18 @@
|
|||
import { KubernetesBuilder } from '@backstage/plugin-kubernetes-backend';
|
||||
import { Router } from 'express';
|
||||
import { PluginEnvironment } from '../types';
|
||||
import { CatalogClient } from '@backstage/catalog-client';
|
||||
|
||||
export default async function createPlugin(
|
||||
env: PluginEnvironment,
|
||||
): Promise<Router> {
|
||||
const catalogApi = new CatalogClient({ discoveryApi: env.discovery });
|
||||
const { router } = await KubernetesBuilder.createBuilder({
|
||||
logger: env.logger,
|
||||
config: env.config,
|
||||
catalogApi,
|
||||
permissions: env.permissions,
|
||||
}).build();
|
||||
|
||||
return router;
|
||||
}
|
|
@ -30,10 +30,10 @@ export const createSanitizeResource = () => {
|
|||
properties: {
|
||||
sanitized: {
|
||||
type: 'string',
|
||||
description: 'The sanitized yaml string',
|
||||
},
|
||||
},
|
||||
},
|
||||
description: 'The sanitized yaml string'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
async handler(ctx) {
|
||||
const obj = yaml.load(ctx.input.document);
|
||||
|
|
|
@ -1,44 +1,92 @@
|
|||
import { CatalogClient } from '@backstage/catalog-client';
|
||||
import {createBuiltinActions, createRouter} from '@backstage/plugin-scaffolder-backend';
|
||||
import { Router } from 'express';
|
||||
import type { PluginEnvironment } from '../types';
|
||||
import { ScmIntegrations } from '@backstage/integration';
|
||||
import { createPublishGiteaAction } from './gitea-actions';
|
||||
import {createPublishGiteaAction} from "./gitea-actions";
|
||||
import {createArgoCDApp} from "./argocd";
|
||||
|
||||
import {
|
||||
coreServices,
|
||||
createBackendModule,
|
||||
} from '@backstage/backend-plugin-api';
|
||||
import { scaffolderActionsExtensionPoint } from '@backstage/plugin-scaffolder-node/alpha';
|
||||
import { createArgoCDApp } from './argocd';
|
||||
import { getRootLogger } from '@backstage/backend-common';
|
||||
import { createKubernetesApply } from './k8s-apply';
|
||||
import { createSanitizeResource } from './sanitize';
|
||||
import { createVerifyDependency } from './verify';
|
||||
createZipAction,
|
||||
createSleepAction,
|
||||
createWriteFileAction,
|
||||
createAppendFileAction,
|
||||
createMergeJSONAction,
|
||||
createMergeAction,
|
||||
createParseFileAction,
|
||||
createSerializeYamlAction,
|
||||
createSerializeJsonAction,
|
||||
createJSONataAction,
|
||||
createYamlJSONataTransformAction,
|
||||
createJsonJSONataTransformAction,
|
||||
createReplaceInFileAction
|
||||
} from '@roadiehq/scaffolder-backend-module-utils';
|
||||
import {createKubernetesApply} from "./k8s-apply";
|
||||
import {createSanitizeResource} from "./sanitize";
|
||||
import {createVerifyDependency} from "./verify";
|
||||
|
||||
export const cnoeScaffolderActions = createBackendModule({
|
||||
pluginId: 'scaffolder',
|
||||
moduleId: 'cnoe-actions',
|
||||
register(env) {
|
||||
env.registerInit({
|
||||
deps: {
|
||||
scaffolder: scaffolderActionsExtensionPoint,
|
||||
config: coreServices.rootConfig,
|
||||
},
|
||||
async init({ scaffolder, config }) {
|
||||
const integrations = ScmIntegrations.fromConfig(config);
|
||||
const logger = getRootLogger();
|
||||
export default async function createPlugin(
|
||||
env: PluginEnvironment,
|
||||
): Promise<Router> {
|
||||
const catalogClient = new CatalogClient({
|
||||
discoveryApi: env.discovery,
|
||||
});
|
||||
|
||||
scaffolder.addActions(
|
||||
createPublishGiteaAction({
|
||||
integrations,
|
||||
config,
|
||||
}),
|
||||
createArgoCDApp({
|
||||
config,
|
||||
logger,
|
||||
}),
|
||||
createKubernetesApply(config),
|
||||
createSanitizeResource(),
|
||||
createVerifyDependency(),
|
||||
);
|
||||
},
|
||||
});
|
||||
},
|
||||
});
|
||||
const integrations = ScmIntegrations.fromConfig(env.config);
|
||||
const builtInActions = createBuiltinActions({
|
||||
integrations,
|
||||
catalogClient,
|
||||
config: env.config,
|
||||
reader: env.reader,
|
||||
});
|
||||
|
||||
const options = {
|
||||
integrations: integrations,
|
||||
config: env.config,
|
||||
}
|
||||
const argocdOptions = {
|
||||
config: env.config,
|
||||
logger: env.logger
|
||||
}
|
||||
|
||||
const cnoeActions = [
|
||||
createPublishGiteaAction(options),
|
||||
createArgoCDApp(argocdOptions),
|
||||
createKubernetesApply(env.config),
|
||||
createSanitizeResource(),
|
||||
createVerifyDependency()
|
||||
]
|
||||
|
||||
const roadieUtilActions = [
|
||||
createZipAction(),
|
||||
createSleepAction(),
|
||||
createWriteFileAction(),
|
||||
createAppendFileAction(),
|
||||
createMergeJSONAction({}),
|
||||
createMergeAction(),
|
||||
createParseFileAction(),
|
||||
createSerializeYamlAction(),
|
||||
createSerializeJsonAction(),
|
||||
createJSONataAction(),
|
||||
createYamlJSONataTransformAction(),
|
||||
createJsonJSONataTransformAction(),
|
||||
createReplaceInFileAction()
|
||||
]
|
||||
|
||||
const actions = [
|
||||
...builtInActions,
|
||||
...cnoeActions,
|
||||
...roadieUtilActions
|
||||
];
|
||||
|
||||
return await createRouter({
|
||||
actions: actions,
|
||||
logger: env.logger,
|
||||
config: env.config,
|
||||
database: env.database,
|
||||
reader: env.reader,
|
||||
catalogClient,
|
||||
identity: env.identity,
|
||||
permissions: env.permissions,
|
||||
});
|
||||
}
|
||||
|
|
66
packages/backend/src/plugins/search.ts
Normal file
66
packages/backend/src/plugins/search.ts
Normal file
|
@ -0,0 +1,66 @@
|
|||
import { useHotCleanup } from '@backstage/backend-common';
|
||||
import { createRouter } from '@backstage/plugin-search-backend';
|
||||
import {
|
||||
IndexBuilder,
|
||||
LunrSearchEngine,
|
||||
} from '@backstage/plugin-search-backend-node';
|
||||
import { PluginEnvironment } from '../types';
|
||||
import { DefaultCatalogCollatorFactory } from '@backstage/plugin-search-backend-module-catalog';
|
||||
import { DefaultTechDocsCollatorFactory } from '@backstage/plugin-search-backend-module-techdocs';
|
||||
import { Router } from 'express';
|
||||
|
||||
export default async function createPlugin(
|
||||
env: PluginEnvironment,
|
||||
): Promise<Router> {
|
||||
// Initialize a connection to a search engine.
|
||||
const searchEngine = new LunrSearchEngine({
|
||||
logger: env.logger,
|
||||
});
|
||||
const indexBuilder = new IndexBuilder({
|
||||
logger: env.logger,
|
||||
searchEngine,
|
||||
});
|
||||
|
||||
const schedule = env.scheduler.createScheduledTaskRunner({
|
||||
frequency: { minutes: 10 },
|
||||
timeout: { minutes: 15 },
|
||||
// A 3 second delay gives the backend server a chance to initialize before
|
||||
// any collators are executed, which may attempt requests against the API.
|
||||
initialDelay: { seconds: 3 },
|
||||
});
|
||||
|
||||
// Collators are responsible for gathering documents known to plugins. This
|
||||
// collator gathers entities from the software catalog.
|
||||
indexBuilder.addCollator({
|
||||
schedule,
|
||||
factory: DefaultCatalogCollatorFactory.fromConfig(env.config, {
|
||||
discovery: env.discovery,
|
||||
tokenManager: env.tokenManager,
|
||||
}),
|
||||
});
|
||||
|
||||
// collator gathers entities from techdocs.
|
||||
indexBuilder.addCollator({
|
||||
schedule,
|
||||
factory: DefaultTechDocsCollatorFactory.fromConfig(env.config, {
|
||||
discovery: env.discovery,
|
||||
logger: env.logger,
|
||||
tokenManager: env.tokenManager,
|
||||
}),
|
||||
});
|
||||
|
||||
// The scheduler controls when documents are gathered from collators and sent
|
||||
// to the search engine for indexing.
|
||||
const { scheduler } = await indexBuilder.build();
|
||||
scheduler.start();
|
||||
|
||||
useHotCleanup(module, () => scheduler.stop());
|
||||
|
||||
return await createRouter({
|
||||
engine: indexBuilder.getSearchEngine(),
|
||||
types: indexBuilder.getDocumentTypes(),
|
||||
permissions: env.permissions,
|
||||
config: env.config,
|
||||
logger: env.logger,
|
||||
});
|
||||
}
|
51
packages/backend/src/plugins/techdocs.ts
Normal file
51
packages/backend/src/plugins/techdocs.ts
Normal file
|
@ -0,0 +1,51 @@
|
|||
import { DockerContainerRunner } from '@backstage/backend-common';
|
||||
import {
|
||||
createRouter,
|
||||
Generators,
|
||||
Preparers,
|
||||
Publisher,
|
||||
} from '@backstage/plugin-techdocs-backend';
|
||||
import Docker from 'dockerode';
|
||||
import { Router } from 'express';
|
||||
import { PluginEnvironment } from '../types';
|
||||
|
||||
export default async function createPlugin(
|
||||
env: PluginEnvironment,
|
||||
): Promise<Router> {
|
||||
// Preparers are responsible for fetching source files for documentation.
|
||||
const preparers = await Preparers.fromConfig(env.config, {
|
||||
logger: env.logger,
|
||||
reader: env.reader,
|
||||
});
|
||||
|
||||
// Docker client (conditionally) used by the generators, based on techdocs.generators config.
|
||||
const dockerClient = new Docker();
|
||||
const containerRunner = new DockerContainerRunner({ dockerClient });
|
||||
|
||||
// Generators are used for generating documentation sites.
|
||||
const generators = await Generators.fromConfig(env.config, {
|
||||
logger: env.logger,
|
||||
containerRunner,
|
||||
});
|
||||
|
||||
// Publisher is used for
|
||||
// 1. Publishing generated files to storage
|
||||
// 2. Fetching files from storage and passing them to TechDocs frontend.
|
||||
const publisher = await Publisher.fromConfig(env.config, {
|
||||
logger: env.logger,
|
||||
discovery: env.discovery,
|
||||
});
|
||||
|
||||
// checks if the publisher is working and logs the result
|
||||
await publisher.getReadiness();
|
||||
|
||||
return await createRouter({
|
||||
preparers,
|
||||
generators,
|
||||
publisher,
|
||||
logger: env.logger,
|
||||
config: env.config,
|
||||
discovery: env.discovery,
|
||||
cache: env.cache,
|
||||
});
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
import { executeShellCommand } from '@backstage/plugin-scaffolder-node';
|
||||
import { createTemplateAction } from '@backstage/plugin-scaffolder-node';
|
||||
import { Writable } from 'stream';
|
||||
import { createTemplateAction }from '@backstage/plugin-scaffolder-node';
|
||||
import {Writable} from 'stream';
|
||||
|
||||
class ConsoleLogStream extends Writable {
|
||||
data: string;
|
||||
|
@ -11,8 +11,8 @@ class ConsoleLogStream extends Writable {
|
|||
}
|
||||
|
||||
_write(chunk: any, _: any, callback: any) {
|
||||
this.data += chunk.toString(); // Convert the chunk to a string and append it to this.data
|
||||
console.log(this.data);
|
||||
this.data += chunk.toString(); // Convert the chunk to a string and append it to this.data
|
||||
console.log(this.data)
|
||||
callback();
|
||||
}
|
||||
}
|
||||
|
@ -39,31 +39,29 @@ export const createVerifyDependency = () => {
|
|||
},
|
||||
},
|
||||
async handler(ctx) {
|
||||
const verifiers = ctx.input.verifiers;
|
||||
const verifiers = ctx.input.verifiers
|
||||
|
||||
if (verifiers === null || verifiers.length === 0) {
|
||||
ctx.logger.error('no verifier was supplied for the object');
|
||||
return;
|
||||
ctx.logger.error('no verifier was supplied for the object')
|
||||
return
|
||||
}
|
||||
|
||||
const baseCommand = 'cnoe';
|
||||
const baseArguments = ['k8s', 'verify'];
|
||||
const baseCommand = 'cnoe'
|
||||
const baseArguments = ['k8s', 'verify']
|
||||
|
||||
verifiers.forEach((verifier: string) =>
|
||||
baseArguments.push('--config', verifier),
|
||||
);
|
||||
verifiers.forEach((verifier: string) => baseArguments.push("--config", verifier))
|
||||
|
||||
const logStream = new ConsoleLogStream({});
|
||||
await executeShellCommand({
|
||||
command: baseCommand,
|
||||
args: baseArguments,
|
||||
logStream: logStream,
|
||||
})
|
||||
.then(() => ctx.logger.info('verification succeeded'))
|
||||
.catch(error => {
|
||||
ctx.logger.error(error);
|
||||
throw new Error(logStream.data);
|
||||
});
|
||||
}).then(() =>
|
||||
ctx.logger.info("verification succeeded")
|
||||
).catch((error) => {
|
||||
ctx.logger.error(error)
|
||||
throw new Error(logStream.data)
|
||||
});
|
||||
},
|
||||
});
|
||||
};
|
||||
|
|
|
@ -5,8 +5,9 @@ import {
|
|||
PluginDatabaseManager,
|
||||
PluginEndpointDiscovery,
|
||||
TokenManager,
|
||||
} from '@backstage/backend-common/dist'; //TODO: deprecated
|
||||
import { PluginTaskScheduler } from '@backstage/backend-tasks/dist';
|
||||
UrlReader,
|
||||
} from '@backstage/backend-common';
|
||||
import { PluginTaskScheduler } from '@backstage/backend-tasks';
|
||||
import { PermissionEvaluator } from '@backstage/plugin-permission-common';
|
||||
import { IdentityApi } from '@backstage/plugin-auth-node';
|
||||
|
||||
|
@ -15,6 +16,7 @@ export type PluginEnvironment = {
|
|||
database: PluginDatabaseManager;
|
||||
cache: PluginCacheManager;
|
||||
config: Config;
|
||||
reader: UrlReader;
|
||||
discovery: PluginEndpointDiscovery;
|
||||
tokenManager: TokenManager;
|
||||
scheduler: PluginTaskScheduler;
|
||||
|
|
1
plugins/apache-spark/.eslintrc.js
Normal file
1
plugins/apache-spark/.eslintrc.js
Normal file
|
@ -0,0 +1 @@
|
|||
module.exports = require('@backstage/cli/config/eslint-factory')(__dirname);
|
13
plugins/apache-spark/README.md
Normal file
13
plugins/apache-spark/README.md
Normal file
|
@ -0,0 +1,13 @@
|
|||
# apache-spark
|
||||
|
||||
Welcome to the apache-spark plugin!
|
||||
|
||||
_This plugin was created through the Backstage CLI_
|
||||
|
||||
## Getting started
|
||||
|
||||
Your plugin has been added to the example app in this repository, meaning you'll be able to access it by running `yarn start` in the root directory, and then navigating to [/apache-spark](http://localhost:3000/apache-spark).
|
||||
|
||||
You can also serve the plugin in isolation by running `yarn start` in the plugin directory.
|
||||
This method of serving the plugin provides quicker iteration speed and a faster startup and hot reloads.
|
||||
It is only meant for local development, and the setup for it can be found inside the [/dev](./dev) directory.
|
12
plugins/apache-spark/dev/index.tsx
Normal file
12
plugins/apache-spark/dev/index.tsx
Normal file
|
@ -0,0 +1,12 @@
|
|||
import React from 'react';
|
||||
import { createDevApp } from '@backstage/dev-utils';
|
||||
import { apacheSparkPlugin, ApacheSparkPage } from '../src/plugin';
|
||||
|
||||
createDevApp()
|
||||
.registerPlugin(apacheSparkPlugin)
|
||||
.addPage({
|
||||
element: <ApacheSparkPage />,
|
||||
title: 'Root Page',
|
||||
path: '/apache-spark'
|
||||
})
|
||||
.render();
|
51
plugins/apache-spark/package.json
Normal file
51
plugins/apache-spark/package.json
Normal file
|
@ -0,0 +1,51 @@
|
|||
{
|
||||
"name": "@internal/plugin-apache-spark",
|
||||
"version": "0.1.0",
|
||||
"main": "src/index.ts",
|
||||
"types": "src/index.ts",
|
||||
"license": "Apache-2.0",
|
||||
"private": true,
|
||||
"publishConfig": {
|
||||
"access": "public",
|
||||
"main": "dist/index.esm.js",
|
||||
"types": "dist/index.d.ts"
|
||||
},
|
||||
"backstage": {
|
||||
"role": "frontend-plugin"
|
||||
},
|
||||
"sideEffects": false,
|
||||
"scripts": {
|
||||
"start": "backstage-cli package start",
|
||||
"build": "backstage-cli package build",
|
||||
"lint": "backstage-cli package lint",
|
||||
"test": "backstage-cli package test",
|
||||
"clean": "backstage-cli package clean",
|
||||
"prepack": "backstage-cli package prepack",
|
||||
"postpack": "backstage-cli package postpack"
|
||||
},
|
||||
"dependencies": {
|
||||
"@backstage/core-components": "^0.13.8",
|
||||
"@backstage/core-plugin-api": "^1.8.2",
|
||||
"@backstage/theme": "^0.5.0",
|
||||
"@material-ui/core": "^4.9.13",
|
||||
"@material-ui/icons": "^4.9.1",
|
||||
"@material-ui/lab": "^4.0.0-alpha.61",
|
||||
"react-use": "^17.2.4"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "^16.13.1 || ^17.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@backstage/cli": "^0.25.1",
|
||||
"@backstage/core-app-api": "^1.11.3",
|
||||
"@backstage/dev-utils": "^1.0.26",
|
||||
"@backstage/test-utils": "^1.4.7",
|
||||
"@testing-library/jest-dom": "^5.10.1",
|
||||
"@testing-library/react": "^12.1.3",
|
||||
"@testing-library/user-event": "^14.0.0",
|
||||
"msw": "^1.0.0"
|
||||
},
|
||||
"files": [
|
||||
"dist"
|
||||
]
|
||||
}
|
113
plugins/apache-spark/src/api/index.test.ts
Normal file
113
plugins/apache-spark/src/api/index.test.ts
Normal file
|
@ -0,0 +1,113 @@
|
|||
// import { ApacheSparkClient } from './index';
|
||||
// import { ApacheSpark } from './model';
|
||||
//
|
||||
// const mockKubernetesApi = {
|
||||
// proxy: jest.fn(),
|
||||
// getClusters: jest.fn(),
|
||||
// getObjectsByEntity: jest.fn(),
|
||||
// getWorkloadsByEntity: jest.fn(),
|
||||
// getCustomObjectsByEntity: jest.fn(),
|
||||
// };
|
||||
//
|
||||
// describe('ApacheSparkClient', () => {
|
||||
// let apacheSparkClient: ApacheSparkClient;
|
||||
//
|
||||
// beforeEach(() => {
|
||||
// apacheSparkClient = new ApacheSparkClient(mockKubernetesApi);
|
||||
// });
|
||||
//
|
||||
// afterEach(() => {
|
||||
// jest.clearAllMocks();
|
||||
// });
|
||||
//
|
||||
// it('should fetch Spark application logs', async () => {
|
||||
// mockKubernetesApi.proxy.mockResolvedValue({
|
||||
// ok: true,
|
||||
// text: () => {
|
||||
// return 'logs';
|
||||
// },
|
||||
// });
|
||||
// const logs = await apacheSparkClient.getLogs(
|
||||
// 'cluster1',
|
||||
// 'spark-namespace',
|
||||
// 'spark-pod-name',
|
||||
// 'abc',
|
||||
// );
|
||||
// expect(logs).toEqual('logs');
|
||||
// expect(mockKubernetesApi.proxy).toHaveBeenCalledWith({
|
||||
// clusterName: 'cluster1',
|
||||
// path: '/api/v1/namespaces/spark-namespace/pods/spark-pod-name/log?tailLines=1000&container=abc',
|
||||
// });
|
||||
// });
|
||||
//
|
||||
// it('should throw error if Spark application logs are not fetched', async () => {
|
||||
// mockKubernetesApi.proxy.mockResolvedValueOnce({
|
||||
// status: 500,
|
||||
// statusText: 'Internal Server Error',
|
||||
// ok: false,
|
||||
// text: () => {
|
||||
// return 'oh noes';
|
||||
// },
|
||||
// });
|
||||
//
|
||||
// await expect(
|
||||
// apacheSparkClient.getLogs(
|
||||
// 'spark-app-name',
|
||||
// 'spark-namespace',
|
||||
// 'spark-pod-name',
|
||||
// 'abc',
|
||||
// ),
|
||||
// ).rejects.toEqual(
|
||||
// 'failed to fetch logs: 500, Internal Server Error, oh noes',
|
||||
// );
|
||||
// });
|
||||
//
|
||||
// // test getSparkApp method
|
||||
// it('should fetch Spark application', async () => {
|
||||
// // @ts-ignore
|
||||
// const mockResponse: ApacheSpark = {
|
||||
// apiVersion: 'sparkoperator.k8s.io/v1beta2',
|
||||
// kind: 'SparkApplication',
|
||||
// metadata: {
|
||||
// name: 'spark-app-name',
|
||||
// namespace: 'spark-namespace',
|
||||
// labels: {
|
||||
// app: 'spark-app-name',
|
||||
// },
|
||||
// creationTimestamp: '2021-01-01T00:00:00Z',
|
||||
// },
|
||||
// spec: {
|
||||
// image: 'abc',
|
||||
// mainApplicationFile: 'main.py',
|
||||
// mode: 'cluster',
|
||||
// sparkVersion: 'v3.1.1.',
|
||||
// type: 'Python',
|
||||
// driver: {
|
||||
// cores: 1,
|
||||
// },
|
||||
// executor: {
|
||||
// cores: 1,
|
||||
// },
|
||||
// },
|
||||
// status: {
|
||||
// applicationState: {
|
||||
// state: 'RUNNING',
|
||||
// },
|
||||
// },
|
||||
// };
|
||||
//
|
||||
// mockKubernetesApi.proxy.mockResolvedValue({
|
||||
// ok: true,
|
||||
// text: () => {
|
||||
// return JSON.stringify(mockResponse);
|
||||
// },
|
||||
// });
|
||||
//
|
||||
// const application = await apacheSparkClient.getSparkApp(
|
||||
// 'spark-app-name',
|
||||
// 'spark-namespace',
|
||||
// 'abc',
|
||||
// );
|
||||
// expect(application).toEqual(mockResponse);
|
||||
// });
|
||||
// });
|
176
plugins/apache-spark/src/api/index.ts
Normal file
176
plugins/apache-spark/src/api/index.ts
Normal file
|
@ -0,0 +1,176 @@
|
|||
import { createApiRef } from '@backstage/core-plugin-api';
|
||||
import { ApacheSpark, ApacheSparkList, Pod } from './model';
|
||||
import { KubernetesApi } from '@backstage/plugin-kubernetes';
|
||||
|
||||
export const apacheSparkApiRef = createApiRef<ApacheSparkApi>({
|
||||
id: 'plugin.apachespark',
|
||||
});
|
||||
|
||||
const API_VERSION = 'sparkoperator.k8s.io/v1beta2';
|
||||
const SPARK_APP_PLURAL = 'sparkapplications';
|
||||
const K8s_API_TIMEOUT = 'timeoutSeconds';
|
||||
|
||||
export interface ApacheSparkApi {
|
||||
getSparkApps(
|
||||
clusterName: string | undefined,
|
||||
namespace: string | undefined,
|
||||
labels: string | undefined,
|
||||
): Promise<ApacheSparkList>;
|
||||
|
||||
getSparkApp(
|
||||
clusterName: string | undefined,
|
||||
namespace: string | undefined,
|
||||
name: string,
|
||||
): Promise<ApacheSpark>;
|
||||
|
||||
getLogs(
|
||||
clusterName: string | undefined,
|
||||
namespace: string | undefined,
|
||||
podName: string,
|
||||
containerName?: string | undefined,
|
||||
tailLine?: number,
|
||||
): Promise<string>;
|
||||
|
||||
getContainers(
|
||||
clusterName: string | undefined,
|
||||
namespace: string | undefined,
|
||||
podName: string,
|
||||
): Promise<string[]>;
|
||||
}
|
||||
|
||||
export class ApacheSparkClient implements ApacheSparkApi {
|
||||
private kubernetesApi: KubernetesApi;
|
||||
constructor(kubernetesApi: KubernetesApi) {
|
||||
this.kubernetesApi = kubernetesApi;
|
||||
}
|
||||
async getSparkApps(
|
||||
clusterName: string | undefined,
|
||||
namespace: string | undefined,
|
||||
labels: string | undefined,
|
||||
): Promise<ApacheSparkList> {
|
||||
const ns = namespace !== undefined ? namespace : 'default';
|
||||
const path = `/apis/${API_VERSION}/namespaces/${ns}/${SPARK_APP_PLURAL}`;
|
||||
const query = new URLSearchParams({
|
||||
[K8s_API_TIMEOUT]: '30',
|
||||
});
|
||||
if (labels) {
|
||||
query.set('labelSelector', labels);
|
||||
}
|
||||
const resp = await this.kubernetesApi.proxy({
|
||||
clusterName:
|
||||
clusterName !== undefined ? clusterName : await this.getFirstCluster(),
|
||||
path: `${path}?${query.toString()}`,
|
||||
});
|
||||
|
||||
if (!resp.ok) {
|
||||
return Promise.reject(
|
||||
`failed to fetch resources: ${resp.status}, ${
|
||||
resp.statusText
|
||||
}, ${await resp.text()}`,
|
||||
);
|
||||
}
|
||||
const out = JSON.parse(await resp.text());
|
||||
this.removeManagedField(out);
|
||||
return out;
|
||||
}
|
||||
|
||||
async getSparkApp(
|
||||
clusterName: string | undefined,
|
||||
namespace: string | undefined,
|
||||
name: string,
|
||||
): Promise<ApacheSpark> {
|
||||
const ns = namespace !== undefined ? namespace : 'default';
|
||||
const path = `/apis/${API_VERSION}/namespaces/${ns}/${SPARK_APP_PLURAL}/${name}`;
|
||||
const resp = await this.kubernetesApi.proxy({
|
||||
clusterName:
|
||||
clusterName !== undefined ? clusterName : await this.getFirstCluster(),
|
||||
path: `${path}`,
|
||||
});
|
||||
if (!resp.ok) {
|
||||
return Promise.reject(
|
||||
`failed to fetch resources: ${resp.status}, ${
|
||||
resp.statusText
|
||||
}, ${await resp.text()}`,
|
||||
);
|
||||
}
|
||||
const out = JSON.parse(await resp.text());
|
||||
this.removeManagedField(out);
|
||||
return out;
|
||||
}
|
||||
|
||||
async getLogs(
|
||||
clusterName: string | undefined,
|
||||
namespace: string | undefined,
|
||||
podName: string,
|
||||
containerName: string | undefined,
|
||||
tailLine: number = 1000,
|
||||
): Promise<string> {
|
||||
const ns = namespace !== undefined ? namespace : 'default';
|
||||
const path = `/api/v1/namespaces/${ns}/pods/${podName}/log`;
|
||||
const query = new URLSearchParams({
|
||||
tailLines: tailLine.toString(),
|
||||
});
|
||||
if (containerName) {
|
||||
query.set('container', containerName);
|
||||
}
|
||||
|
||||
const resp = await this.kubernetesApi.proxy({
|
||||
clusterName:
|
||||
clusterName !== undefined ? clusterName : await this.getFirstCluster(),
|
||||
path: `${path}?${query.toString()}`,
|
||||
});
|
||||
if (!resp.ok) {
|
||||
return Promise.reject(
|
||||
`failed to fetch logs: ${resp.status}, ${
|
||||
resp.statusText
|
||||
}, ${await resp.text()}`,
|
||||
);
|
||||
}
|
||||
return resp.text();
|
||||
}
|
||||
|
||||
async getContainers(
|
||||
clusterName: string | undefined,
|
||||
namespace: string | undefined,
|
||||
podName: string,
|
||||
): Promise<string[]> {
|
||||
const ns = namespace !== undefined ? namespace : 'default';
|
||||
const path = `/api/v1/namespaces/${ns}/pods/${podName}`;
|
||||
const query = new URLSearchParams({
|
||||
[K8s_API_TIMEOUT]: '30',
|
||||
});
|
||||
const resp = await this.kubernetesApi.proxy({
|
||||
clusterName:
|
||||
clusterName !== undefined ? clusterName : await this.getFirstCluster(),
|
||||
path: `${path}?${query.toString()}`,
|
||||
});
|
||||
if (!resp.ok) {
|
||||
throw new Error(
|
||||
`failed to fetch logs: ${resp.status}, ${
|
||||
resp.statusText
|
||||
}, ${await resp.text()}`,
|
||||
);
|
||||
}
|
||||
const pod = JSON.parse(await resp.text()) as Pod;
|
||||
return pod.spec.containers.map(c => c.name);
|
||||
}
|
||||
|
||||
async getFirstCluster(): Promise<string> {
|
||||
const clusters = await this.kubernetesApi.getClusters();
|
||||
if (clusters.length > 0) {
|
||||
return Promise.resolve(clusters[0].name);
|
||||
}
|
||||
return Promise.reject('no clusters found in configuration');
|
||||
}
|
||||
|
||||
removeManagedField(spark: any) {
|
||||
if (spark.metadata?.hasOwnProperty('managedFields')) {
|
||||
delete spark.metadata.managedFields;
|
||||
}
|
||||
if (spark.items) {
|
||||
for (const i of spark.items) {
|
||||
this.removeManagedField(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
100
plugins/apache-spark/src/api/model.ts
Normal file
100
plugins/apache-spark/src/api/model.ts
Normal file
|
@ -0,0 +1,100 @@
|
|||
export type Metadata = {
|
||||
name: string;
|
||||
namespace?: string;
|
||||
labels?: Record<string, string>;
|
||||
annotations?: Record<string, string>;
|
||||
creationTimestamp: string;
|
||||
managedFields?: any;
|
||||
};
|
||||
|
||||
export type Spec = {
|
||||
arguments?: string[];
|
||||
batchScheduler?: string;
|
||||
driver: {
|
||||
coreLimit?: string;
|
||||
coreRequest?: string;
|
||||
cores?: number;
|
||||
gpu?: {
|
||||
name: string;
|
||||
quantity: number;
|
||||
};
|
||||
labels?: Record<string, string>;
|
||||
memory?: string;
|
||||
memoryOverhead?: string;
|
||||
podName?: string;
|
||||
schedulerName?: string;
|
||||
serviceAccount?: string;
|
||||
};
|
||||
executor: {
|
||||
coreLimit?: string;
|
||||
coreRequest?: string;
|
||||
cores?: number;
|
||||
gpu?: {
|
||||
name: string;
|
||||
quantity: number;
|
||||
};
|
||||
instances?: number;
|
||||
labels?: Record<string, string>;
|
||||
memory?: string;
|
||||
memoryOverhead?: string;
|
||||
schedulerName?: string;
|
||||
serviceAccount?: string;
|
||||
};
|
||||
image: string;
|
||||
mainClass?: string;
|
||||
mainApplicationFile?: string;
|
||||
mode: string;
|
||||
pythonVersion?: string;
|
||||
sparkVersion: string;
|
||||
type: string;
|
||||
};
|
||||
|
||||
export type Status = {
|
||||
applicationState: {
|
||||
errorMessage?: string;
|
||||
state: string;
|
||||
};
|
||||
driverInfo?: {
|
||||
podName: string;
|
||||
webUIAddress: string;
|
||||
webUIIngressAddress: string;
|
||||
webUIIngressName: string;
|
||||
webUIPort: string;
|
||||
webUIServiceName: string;
|
||||
};
|
||||
executionAttempts?: number;
|
||||
executorState?: { [key: string]: string };
|
||||
lastSubmissionAttemptTime?: string;
|
||||
sparkApplicationId?: string;
|
||||
submissionAttempts?: number;
|
||||
submissionID?: string;
|
||||
terminationTime?: string;
|
||||
};
|
||||
|
||||
export type ApacheSpark = {
|
||||
apiVersion: string;
|
||||
kind: string;
|
||||
metadata: Metadata;
|
||||
spec: Spec;
|
||||
status: Status;
|
||||
};
|
||||
|
||||
export type ApacheSparkList = {
|
||||
apiVersion: string;
|
||||
kind: string;
|
||||
items?: ApacheSpark[];
|
||||
};
|
||||
|
||||
export type Pod = {
|
||||
apiVersion: string;
|
||||
kind: string;
|
||||
metadata: Metadata;
|
||||
spec: PodSpec;
|
||||
};
|
||||
|
||||
export type PodSpec = {
|
||||
containers: {
|
||||
image: string;
|
||||
name: string;
|
||||
}[];
|
||||
};
|
|
@ -0,0 +1,83 @@
|
|||
import React from 'react';
|
||||
import { render, screen } from '@testing-library/react';
|
||||
import { useApi } from '@backstage/core-plugin-api';
|
||||
import { useEntity } from '@backstage/plugin-catalog-react';
|
||||
import useAsync from 'react-use/lib/useAsync';
|
||||
import { ApacheSpark } from '../../api/model';
|
||||
import { ApacheSparkDriverLogs } from './ApacheSparkLogs';
|
||||
import {
|
||||
APACHE_SPARK_LABEL_SELECTOR_ANNOTATION,
|
||||
CLUSTER_NAME_ANNOTATION,
|
||||
K8S_NAMESPACE_ANNOTATION,
|
||||
} from '../../consts';
|
||||
|
||||
jest.mock('@backstage/core-plugin-api');
|
||||
jest.mock('react-use/lib/useAsync');
|
||||
jest.mock('@backstage/plugin-catalog-react');
|
||||
|
||||
jest.mock('@backstage/core-components', () => ({
|
||||
LogViewer: (props: { text: string }) => {
|
||||
return <div>{props.text}</div>;
|
||||
},
|
||||
}));
|
||||
|
||||
describe('ApacheSparkDriverLogs', () => {
|
||||
const mockUseApi = useApi as jest.MockedFunction<typeof useApi>;
|
||||
const mockUseAsync = useAsync as jest.MockedFunction<typeof useAsync>;
|
||||
const mockUseEntity = useEntity as jest.MockedFunction<typeof useEntity>;
|
||||
const mockGetLogs = jest.fn();
|
||||
const mockSparkApp = {
|
||||
status: {
|
||||
driverInfo: {
|
||||
podName: 'test-pod',
|
||||
},
|
||||
},
|
||||
} as ApacheSpark;
|
||||
|
||||
beforeEach(() => {
|
||||
mockUseApi.mockReturnValue({
|
||||
getLogs: mockGetLogs,
|
||||
});
|
||||
mockUseEntity.mockReturnValue({
|
||||
entity: {
|
||||
apiVersion: 'version',
|
||||
kind: 'kind',
|
||||
metadata: {
|
||||
name: 'name',
|
||||
namespace: 'ns1',
|
||||
annotations: {
|
||||
[K8S_NAMESPACE_ANNOTATION]: 'k8s-ns',
|
||||
[CLUSTER_NAME_ANNOTATION]: 'my-cluster',
|
||||
[APACHE_SPARK_LABEL_SELECTOR_ANNOTATION]: 'env=test',
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
jest.clearAllMocks();
|
||||
});
|
||||
|
||||
it('should render error message if there is an error', () => {
|
||||
mockUseAsync.mockReturnValue({
|
||||
value: undefined,
|
||||
loading: false,
|
||||
error: new Error('Test error'),
|
||||
});
|
||||
|
||||
render(<ApacheSparkDriverLogs sparkApp={mockSparkApp} />);
|
||||
expect(screen.getByText('Error: Test error')).toBeInTheDocument();
|
||||
expect(screen.getByRole('alert')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('should render the log viewer with the fetched logs', async () => {
|
||||
mockUseAsync.mockReturnValue({
|
||||
value: 'test logs',
|
||||
loading: false,
|
||||
error: undefined,
|
||||
});
|
||||
render(<ApacheSparkDriverLogs sparkApp={mockSparkApp} />);
|
||||
expect(screen.getByText('test logs')).toBeInTheDocument();
|
||||
});
|
||||
});
|
|
@ -0,0 +1,100 @@
|
|||
import { useApi } from '@backstage/core-plugin-api';
|
||||
import { apacheSparkApiRef } from '../../api';
|
||||
import useAsync from 'react-use/lib/useAsync';
|
||||
import { ApacheSpark } from '../../api/model';
|
||||
import {
|
||||
LogViewer,
|
||||
Progress,
|
||||
Select,
|
||||
SelectedItems,
|
||||
SelectItem,
|
||||
} from '@backstage/core-components';
|
||||
import Alert from '@material-ui/lab/Alert';
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { useEntity } from '@backstage/plugin-catalog-react';
|
||||
import { getAnnotationValues } from '../utils';
|
||||
|
||||
export const ApacheSparkDriverLogs = (props: { sparkApp: ApacheSpark }) => {
|
||||
const apiClient = useApi(apacheSparkApiRef);
|
||||
const { entity } = useEntity();
|
||||
const { ns, clusterName } = getAnnotationValues(entity);
|
||||
|
||||
const { value, loading, error } = useAsync(async (): Promise<string> => {
|
||||
return await apiClient.getLogs(
|
||||
clusterName,
|
||||
ns,
|
||||
props.sparkApp.status.driverInfo?.podName!,
|
||||
'spark-kubernetes-driver',
|
||||
);
|
||||
}, [props]);
|
||||
if (loading) {
|
||||
return <Progress />;
|
||||
} else if (error) {
|
||||
return <Alert severity="error">{`${error}`}</Alert>;
|
||||
}
|
||||
return <LogViewer text={value!} />;
|
||||
};
|
||||
|
||||
const ExecutorLogs = (props: { name: string }) => {
|
||||
const apiClient = useApi(apacheSparkApiRef);
|
||||
const { entity } = useEntity();
|
||||
const [logs, setLogs] = useState('');
|
||||
const { ns, clusterName } = getAnnotationValues(entity);
|
||||
|
||||
useEffect(() => {
|
||||
async function getLogs() {
|
||||
try {
|
||||
const val = await apiClient.getLogs(
|
||||
clusterName,
|
||||
ns,
|
||||
props.name,
|
||||
'spark-kubernetes-executor',
|
||||
);
|
||||
setLogs(val);
|
||||
} catch (e) {
|
||||
if (typeof e === 'string') {
|
||||
setLogs(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (props.name !== '') {
|
||||
getLogs();
|
||||
}
|
||||
}, [apiClient, clusterName, ns, props]);
|
||||
|
||||
return <LogViewer text={logs!} />;
|
||||
};
|
||||
|
||||
export const ApacheSparkExecutorLogs = (props: { sparkApp: ApacheSpark }) => {
|
||||
const [selected, setSelected] = useState('');
|
||||
if (props.sparkApp.status.applicationState.state !== 'RUNNING') {
|
||||
return (
|
||||
<Alert severity="info">
|
||||
Executor logs are only available for Spark Applications in RUNNING state
|
||||
</Alert>
|
||||
);
|
||||
}
|
||||
const executors: SelectItem[] = [{ label: '', value: '' }];
|
||||
for (const key in props.sparkApp.status.executorState) {
|
||||
if (props.sparkApp.status.executorState.hasOwnProperty(key)) {
|
||||
executors.push({ label: key, value: key });
|
||||
}
|
||||
}
|
||||
|
||||
const handleChange = (item: SelectedItems) => {
|
||||
if (typeof item === 'string' && item !== '') {
|
||||
setSelected(item);
|
||||
}
|
||||
};
|
||||
return (
|
||||
<>
|
||||
<Select
|
||||
placeholder="Select One"
|
||||
label="Select a executor"
|
||||
items={executors}
|
||||
onChange={handleChange}
|
||||
/>
|
||||
<ExecutorLogs name={selected} key={selected} />
|
||||
</>
|
||||
);
|
||||
};
|
|
@ -0,0 +1,145 @@
|
|||
import {
|
||||
Progress,
|
||||
StatusError,
|
||||
StatusOK,
|
||||
StatusPending,
|
||||
StatusRunning,
|
||||
Table,
|
||||
TableColumn,
|
||||
} from '@backstage/core-components';
|
||||
import { useApi } from '@backstage/core-plugin-api';
|
||||
import { apacheSparkApiRef } from '../../api';
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import useAsync from 'react-use/lib/useAsync';
|
||||
import { ApacheSpark, ApacheSparkList } from '../../api/model';
|
||||
import Alert from '@material-ui/lab/Alert';
|
||||
import { createStyles, Drawer, makeStyles, Theme } from '@material-ui/core';
|
||||
import { DrawerContent } from '../DetailedDrawer/DetailedDrawer';
|
||||
import { getAnnotationValues } from '../utils';
|
||||
import { useEntity } from '@backstage/plugin-catalog-react';
|
||||
|
||||
type TableData = {
|
||||
id: string;
|
||||
name: string;
|
||||
namespace: string;
|
||||
applicationState?: string;
|
||||
startedAt?: string;
|
||||
finishedAt?: string;
|
||||
raw: ApacheSpark;
|
||||
};
|
||||
|
||||
const columns: TableColumn<TableData>[] = [
|
||||
{
|
||||
title: 'Name',
|
||||
field: 'name',
|
||||
},
|
||||
{ title: 'Namespace', field: 'namespace', type: 'string' },
|
||||
{
|
||||
title: 'Application State',
|
||||
field: 'applicationState',
|
||||
},
|
||||
{
|
||||
title: 'StartTime',
|
||||
field: 'startedAt',
|
||||
type: 'datetime',
|
||||
defaultSort: 'desc',
|
||||
},
|
||||
{ title: 'EndTime', field: 'finishedAt', type: 'datetime' },
|
||||
];
|
||||
|
||||
const useDrawerStyles = makeStyles((theme: Theme) =>
|
||||
createStyles({
|
||||
paper: {
|
||||
width: '60%',
|
||||
padding: theme.spacing(2.5),
|
||||
},
|
||||
}),
|
||||
);
|
||||
|
||||
export const ApacheSparkOverviewTable = () => {
|
||||
const apiClient = useApi(apacheSparkApiRef);
|
||||
const [columnData, setColumnData] = useState([] as TableData[]);
|
||||
const [isOpen, toggleDrawer] = useState(false);
|
||||
const [drawerData, setDrawerData] = useState({} as ApacheSpark);
|
||||
const classes = useDrawerStyles();
|
||||
const { entity } = useEntity();
|
||||
const { ns, clusterName, labelSelector } = getAnnotationValues(entity);
|
||||
|
||||
const { value, loading, error } = useAsync(
|
||||
async (): Promise<ApacheSparkList> => {
|
||||
return await apiClient.getSparkApps(clusterName, ns, labelSelector);
|
||||
},
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
const data = value?.items?.map(val => {
|
||||
let state = {};
|
||||
switch (val.status?.applicationState.state) {
|
||||
case 'RUNNING':
|
||||
state = <StatusRunning>Running</StatusRunning>;
|
||||
break;
|
||||
case 'COMPLETED':
|
||||
state = <StatusOK>COMPLETED</StatusOK>;
|
||||
break;
|
||||
case 'FAILED':
|
||||
state = <StatusError>FAILED</StatusError>;
|
||||
break;
|
||||
default:
|
||||
state = (
|
||||
<StatusPending>
|
||||
'${val.status.applicationState.state}'
|
||||
</StatusPending>
|
||||
);
|
||||
break;
|
||||
}
|
||||
return {
|
||||
id: `${val.metadata.namespace}/${val.metadata.name}`,
|
||||
raw: val,
|
||||
name: val.metadata.name,
|
||||
namespace: val.metadata.namespace,
|
||||
applicationState: state,
|
||||
startedAt: val.metadata.creationTimestamp,
|
||||
finishedAt: val.status?.terminationTime,
|
||||
} as TableData;
|
||||
});
|
||||
if (data && data.length > 0) {
|
||||
setColumnData(data);
|
||||
}
|
||||
}, [value]);
|
||||
if (loading) {
|
||||
return <Progress />;
|
||||
} else if (error) {
|
||||
return <Alert severity="error">{`${error}`}</Alert>;
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<Table
|
||||
options={{
|
||||
padding: 'dense',
|
||||
paging: true,
|
||||
search: true,
|
||||
sorting: true,
|
||||
pageSize: 10,
|
||||
pageSizeOptions: [5, 10, 20, 50],
|
||||
}}
|
||||
onRowClick={(_event, rowData: TableData | undefined) => {
|
||||
setDrawerData(rowData?.raw!);
|
||||
toggleDrawer(true);
|
||||
}}
|
||||
columns={columns}
|
||||
data={columnData}
|
||||
/>
|
||||
<Drawer
|
||||
classes={{
|
||||
paper: classes.paper,
|
||||
}}
|
||||
anchor="right"
|
||||
open={isOpen}
|
||||
onClose={() => toggleDrawer(false)}
|
||||
>
|
||||
<DrawerContent toggleDrawer={toggleDrawer} apacheSpark={drawerData} />
|
||||
</Drawer>
|
||||
</>
|
||||
);
|
||||
};
|
|
@ -0,0 +1,111 @@
|
|||
import { ApacheSpark } from '../../api/model';
|
||||
import {
|
||||
createStyles,
|
||||
IconButton,
|
||||
makeStyles,
|
||||
Theme,
|
||||
Typography,
|
||||
} from '@material-ui/core';
|
||||
import Close from '@material-ui/icons/Close';
|
||||
import React from 'react';
|
||||
import { stringify } from 'yaml';
|
||||
import { CopyTextButton, TabbedLayout } from '@backstage/core-components';
|
||||
import {
|
||||
ApacheSparkDriverLogs,
|
||||
ApacheSparkExecutorLogs,
|
||||
} from '../ApacheSparkLogs/ApacheSparkLogs';
|
||||
import { DrawerOverview } from './DrawerOverview';
|
||||
|
||||
const useDrawerContentStyles = makeStyles((theme: Theme) =>
|
||||
createStyles({
|
||||
header: {
|
||||
display: 'flex',
|
||||
justifyContent: 'space-between',
|
||||
},
|
||||
icon: {
|
||||
fontSize: 20,
|
||||
},
|
||||
content: {
|
||||
height: '80%',
|
||||
backgroundColor: '#EEEEEE',
|
||||
overflow: 'scroll',
|
||||
display: 'flex',
|
||||
flexDirection: 'row',
|
||||
},
|
||||
logs: {
|
||||
height: 500,
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
flexShrink: 0,
|
||||
},
|
||||
logs2: {
|
||||
height: 600,
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
},
|
||||
secondaryAction: {
|
||||
marginLeft: theme.spacing(2.5),
|
||||
},
|
||||
}),
|
||||
);
|
||||
|
||||
export const DrawerContent = ({
|
||||
toggleDrawer,
|
||||
apacheSpark,
|
||||
}: {
|
||||
toggleDrawer: (isOpen: boolean) => void;
|
||||
apacheSpark: ApacheSpark;
|
||||
}) => {
|
||||
const classes = useDrawerContentStyles();
|
||||
const yamlString = stringify(apacheSpark);
|
||||
return (
|
||||
<TabbedLayout>
|
||||
<TabbedLayout.Route path="/" title="Overview">
|
||||
<>
|
||||
<div>
|
||||
<DrawerOverview sparkApp={apacheSpark} />
|
||||
</div>
|
||||
</>
|
||||
</TabbedLayout.Route>
|
||||
<TabbedLayout.Route path="/manifests" title="Manifest">
|
||||
<>
|
||||
<div className={classes.header}>
|
||||
<Typography variant="h6">{apacheSpark.metadata.name}</Typography>
|
||||
<IconButton
|
||||
key="dismiss"
|
||||
title="Close"
|
||||
onClick={() => toggleDrawer(false)}
|
||||
color="inherit"
|
||||
>
|
||||
<Close className={classes.icon} />
|
||||
</IconButton>
|
||||
</div>
|
||||
<div className={classes.content}>
|
||||
<CopyTextButton text={yamlString} tooltipText="Copy" />
|
||||
<pre>{yamlString}</pre>
|
||||
</div>
|
||||
</>
|
||||
</TabbedLayout.Route>
|
||||
<TabbedLayout.Route path="/live-logs" title="Live logs">
|
||||
<>
|
||||
<div className={classes.logs2}>
|
||||
<div className={classes.logs}>
|
||||
<Typography variant="h6">
|
||||
Driver Log for {apacheSpark.metadata.name}
|
||||
</Typography>
|
||||
<ApacheSparkDriverLogs sparkApp={apacheSpark} />
|
||||
</div>
|
||||
</div>
|
||||
<div className={classes.logs2}>
|
||||
<div className={classes.logs}>
|
||||
<Typography variant="h6">
|
||||
Executor Logs for {apacheSpark.metadata.name}
|
||||
</Typography>
|
||||
<ApacheSparkExecutorLogs sparkApp={apacheSpark} />
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
</TabbedLayout.Route>
|
||||
</TabbedLayout>
|
||||
);
|
||||
};
|
|
@ -0,0 +1,103 @@
|
|||
import { createStyles, makeStyles } from '@material-ui/core';
|
||||
import { ApacheSpark } from '../../api/model';
|
||||
import {
|
||||
InfoCard,
|
||||
StatusError,
|
||||
StatusOK,
|
||||
StatusPending,
|
||||
StatusRunning,
|
||||
StructuredMetadataTable,
|
||||
} from '@backstage/core-components';
|
||||
import React from 'react';
|
||||
|
||||
const useStyles = makeStyles(() =>
|
||||
createStyles({
|
||||
content: {
|
||||
justifyContent: 'space-between',
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
padding: '5px',
|
||||
gap: '30px',
|
||||
},
|
||||
}),
|
||||
);
|
||||
|
||||
type generateMetadataOutput = {
|
||||
app: { [key: string]: any };
|
||||
driver: { [key: string]: any };
|
||||
executor: { [key: string]: any };
|
||||
};
|
||||
|
||||
function generateMetadata(sparkApp: ApacheSpark): generateMetadataOutput {
|
||||
const out = {} as generateMetadataOutput;
|
||||
const executor: { [key: string]: any } = {};
|
||||
const app: { [key: string]: any } = {
|
||||
name: sparkApp.metadata.name,
|
||||
namespace: sparkApp.metadata.namespace,
|
||||
status: renderState(sparkApp.status.applicationState.state),
|
||||
image: sparkApp.spec.image,
|
||||
mode: sparkApp.spec.mode,
|
||||
};
|
||||
if (sparkApp.status.applicationState.errorMessage)
|
||||
app['error Message'] = sparkApp.status.applicationState.errorMessage;
|
||||
|
||||
for (const key in sparkApp.status.executorState) {
|
||||
if (sparkApp.status.executorState.hasOwnProperty(key)) {
|
||||
executor[`${key}`] = renderState(sparkApp.status.executorState[key]);
|
||||
}
|
||||
}
|
||||
out.app = app;
|
||||
out.driver = sparkApp.status.driverInfo ? sparkApp.status.driverInfo : {};
|
||||
out.executor = executor;
|
||||
return out;
|
||||
}
|
||||
|
||||
function renderState(state: string): JSX.Element {
|
||||
switch (state) {
|
||||
case 'RUNNING':
|
||||
return <StatusRunning>{state}</StatusRunning>;
|
||||
case 'COMPLETED':
|
||||
return <StatusOK>{state}</StatusOK>;
|
||||
case 'SUBMITTED':
|
||||
case 'PENDING_RERUN':
|
||||
return <StatusPending>{state}</StatusPending>;
|
||||
case 'FAILED':
|
||||
case 'SUBMISSION_FAILED':
|
||||
return <StatusError>{state}</StatusError>;
|
||||
default:
|
||||
return <StatusPending>{state}</StatusPending>;
|
||||
}
|
||||
}
|
||||
|
||||
const upperCaseFirstChar = (s: string) => {
|
||||
if (s.length > 0) {
|
||||
return `${s.charAt(0).toUpperCase()}${s.slice(1)}`;
|
||||
}
|
||||
return s;
|
||||
};
|
||||
|
||||
export const DrawerOverview = (props: { sparkApp: ApacheSpark }) => {
|
||||
const data = generateMetadata(props.sparkApp)
|
||||
return (
|
||||
<div className={useStyles().content}>
|
||||
<InfoCard title="Apache Spark Application">
|
||||
<StructuredMetadataTable
|
||||
metadata={data.app}
|
||||
options={{ titleFormat: upperCaseFirstChar }}
|
||||
/>
|
||||
</InfoCard>
|
||||
<InfoCard title="Driver">
|
||||
<StructuredMetadataTable
|
||||
metadata={data.driver}
|
||||
options={{ titleFormat: upperCaseFirstChar }}
|
||||
/>
|
||||
</InfoCard>
|
||||
<InfoCard title="Executors">
|
||||
<StructuredMetadataTable
|
||||
metadata={data.executor}
|
||||
options={{ titleFormat: upperCaseFirstChar }}
|
||||
/>
|
||||
</InfoCard>
|
||||
</div>
|
||||
);
|
||||
};
|
14
plugins/apache-spark/src/components/Overview/Overview.tsx
Normal file
14
plugins/apache-spark/src/components/Overview/Overview.tsx
Normal file
|
@ -0,0 +1,14 @@
|
|||
import { Content, Header, HeaderLabel, Page } from '@backstage/core-components';
|
||||
import { ApacheSparkOverviewTable } from '../ApacheSparkOverviewTable/ApacheSparkOverviewTable';
|
||||
import React from 'react';
|
||||
|
||||
export const ApacheSparkOverviewPage = () => (
|
||||
<Page themeId="tool">
|
||||
<Header title="Apache Spark">
|
||||
<HeaderLabel label="Lifecycle" value="Alpha" />
|
||||
</Header>
|
||||
<Content>
|
||||
<ApacheSparkOverviewTable />
|
||||
</Content>
|
||||
</Page>
|
||||
);
|
1
plugins/apache-spark/src/components/Overview/index.ts
Normal file
1
plugins/apache-spark/src/components/Overview/index.ts
Normal file
|
@ -0,0 +1 @@
|
|||
export * from './Overview';
|
26
plugins/apache-spark/src/components/utils.ts
Normal file
26
plugins/apache-spark/src/components/utils.ts
Normal file
|
@ -0,0 +1,26 @@
|
|||
import {Entity} from '@backstage/catalog-model';
|
||||
import {
|
||||
APACHE_SPARK_LABEL_SELECTOR_ANNOTATION,
|
||||
CLUSTER_NAME_ANNOTATION,
|
||||
K8S_NAMESPACE_ANNOTATION,
|
||||
} from '../consts';
|
||||
|
||||
export type getAnnotationValuesOutput = {
|
||||
ns: string;
|
||||
clusterName?: string;
|
||||
labelSelector?: string;
|
||||
};
|
||||
|
||||
export function getAnnotationValues(entity: Entity): getAnnotationValuesOutput {
|
||||
const ns =
|
||||
entity.metadata.annotations?.[K8S_NAMESPACE_ANNOTATION] !== undefined
|
||||
? entity.metadata.annotations?.[K8S_NAMESPACE_ANNOTATION]
|
||||
: 'default';
|
||||
const clusterName = entity.metadata.annotations?.[CLUSTER_NAME_ANNOTATION];
|
||||
const labelSelector = entity.metadata?.annotations?.[APACHE_SPARK_LABEL_SELECTOR_ANNOTATION]
|
||||
return {
|
||||
ns: ns,
|
||||
clusterName: clusterName,
|
||||
labelSelector: labelSelector,
|
||||
};
|
||||
}
|
4
plugins/apache-spark/src/consts.ts
Normal file
4
plugins/apache-spark/src/consts.ts
Normal file
|
@ -0,0 +1,4 @@
|
|||
export const APACHE_SPARK_LABEL_SELECTOR_ANNOTATION =
|
||||
'apache-spark.cnoe.io/label-selector';
|
||||
export const CLUSTER_NAME_ANNOTATION = 'apache-spark.cnoe.io/cluster-name';
|
||||
export const K8S_NAMESPACE_ANNOTATION = 'backstage.io/kubernetes-namespace';
|
1
plugins/apache-spark/src/index.ts
Normal file
1
plugins/apache-spark/src/index.ts
Normal file
|
@ -0,0 +1 @@
|
|||
export {apacheSparkPlugin, ApacheSparkPage, isApacheSparkAvailable} from './plugin';
|
7
plugins/apache-spark/src/plugin.test.ts
Normal file
7
plugins/apache-spark/src/plugin.test.ts
Normal file
|
@ -0,0 +1,7 @@
|
|||
// import { apacheSparkPlugin } from './plugin';
|
||||
//
|
||||
// describe('apache-spark', () => {
|
||||
// it('should export plugin', () => {
|
||||
// expect(apacheSparkPlugin).toBeDefined();
|
||||
// });
|
||||
// });
|
42
plugins/apache-spark/src/plugin.ts
Normal file
42
plugins/apache-spark/src/plugin.ts
Normal file
|
@ -0,0 +1,42 @@
|
|||
import {
|
||||
createApiFactory,
|
||||
createPlugin,
|
||||
createRoutableExtension,
|
||||
} from '@backstage/core-plugin-api';
|
||||
|
||||
import {rootRouteRef} from './routes';
|
||||
import {apacheSparkApiRef, ApacheSparkClient} from './api';
|
||||
import {kubernetesApiRef} from '@backstage/plugin-kubernetes';
|
||||
import {Entity} from '@backstage/catalog-model';
|
||||
|
||||
import {
|
||||
APACHE_SPARK_LABEL_SELECTOR_ANNOTATION,
|
||||
} from './consts';
|
||||
|
||||
export const isApacheSparkAvailable = (entity: Entity) =>
|
||||
Boolean(entity.metadata.annotations?.[APACHE_SPARK_LABEL_SELECTOR_ANNOTATION]);
|
||||
|
||||
export const apacheSparkPlugin = createPlugin({
|
||||
id: 'apache-spark',
|
||||
routes: {
|
||||
root: rootRouteRef,
|
||||
},
|
||||
apis: [
|
||||
createApiFactory({
|
||||
api: apacheSparkApiRef,
|
||||
deps: {
|
||||
kubernetesApi: kubernetesApiRef,
|
||||
},
|
||||
factory: ({kubernetesApi}) => new ApacheSparkClient(kubernetesApi),
|
||||
}),
|
||||
],
|
||||
});
|
||||
|
||||
export const ApacheSparkPage = apacheSparkPlugin.provide(
|
||||
createRoutableExtension({
|
||||
name: 'ApacheSparkPage',
|
||||
component: () =>
|
||||
import('./components/Overview').then(m => m.ApacheSparkOverviewPage),
|
||||
mountPoint: rootRouteRef,
|
||||
}),
|
||||
);
|
5
plugins/apache-spark/src/routes.ts
Normal file
5
plugins/apache-spark/src/routes.ts
Normal file
|
@ -0,0 +1,5 @@
|
|||
import { createRouteRef } from '@backstage/core-plugin-api';
|
||||
|
||||
export const rootRouteRef = createRouteRef({
|
||||
id: 'apache-spark',
|
||||
});
|
2
plugins/apache-spark/src/setupTests.ts
Normal file
2
plugins/apache-spark/src/setupTests.ts
Normal file
|
@ -0,0 +1,2 @@
|
|||
import '@testing-library/jest-dom';
|
||||
import 'cross-fetch/polyfill';
|
1
plugins/argo-workflows/.eslintrc.js
Normal file
1
plugins/argo-workflows/.eslintrc.js
Normal file
|
@ -0,0 +1 @@
|
|||
module.exports = require('@backstage/cli/config/eslint-factory')(__dirname);
|
13
plugins/argo-workflows/README.md
Normal file
13
plugins/argo-workflows/README.md
Normal file
|
@ -0,0 +1,13 @@
|
|||
# argo-workflows
|
||||
|
||||
Welcome to the argo-workflows plugin!
|
||||
|
||||
_This plugin was created through the Backstage CLI_
|
||||
|
||||
## Getting started
|
||||
|
||||
Your plugin has been added to the example app in this repository, meaning you'll be able to access it by running `yarn start` in the root directory, and then navigating to [/argo-workflows](http://localhost:3000/argo-workflows).
|
||||
|
||||
You can also serve the plugin in isolation by running `yarn start` in the plugin directory.
|
||||
This method of serving the plugin provides quicker iteration speed and a faster startup and hot reloads.
|
||||
It is only meant for local development, and the setup for it can be found inside the [/dev](./dev) directory.
|
12
plugins/argo-workflows/config.d.ts
vendored
Normal file
12
plugins/argo-workflows/config.d.ts
vendored
Normal file
|
@ -0,0 +1,12 @@
|
|||
export interface Config {
|
||||
/** Optional configurations for the Argo Workflows plugin
|
||||
* @visibility frontend
|
||||
*/
|
||||
argoWorkflows?: {
|
||||
/**
|
||||
* The base url of the Argo Workflows installation.
|
||||
* @visibility frontend
|
||||
*/
|
||||
baseUrl: string;
|
||||
};
|
||||
}
|
12
plugins/argo-workflows/dev/index.tsx
Normal file
12
plugins/argo-workflows/dev/index.tsx
Normal file
|
@ -0,0 +1,12 @@
|
|||
import React from 'react';
|
||||
import { createDevApp } from '@backstage/dev-utils';
|
||||
import { argoWorkflowsPlugin, ArgoWorkflowsPage } from '../src/plugin';
|
||||
|
||||
createDevApp()
|
||||
.registerPlugin(argoWorkflowsPlugin)
|
||||
.addPage({
|
||||
element: <ArgoWorkflowsPage />,
|
||||
title: 'Root Page',
|
||||
path: '/argo-workflows'
|
||||
})
|
||||
.render();
|
53
plugins/argo-workflows/package.json
Normal file
53
plugins/argo-workflows/package.json
Normal file
|
@ -0,0 +1,53 @@
|
|||
{
|
||||
"name": "@internal/plugin-argo-workflows",
|
||||
"version": "0.1.0",
|
||||
"main": "src/index.ts",
|
||||
"types": "src/index.ts",
|
||||
"license": "Apache-2.0",
|
||||
"private": true,
|
||||
"publishConfig": {
|
||||
"access": "public",
|
||||
"main": "dist/index.esm.js",
|
||||
"types": "dist/index.d.ts"
|
||||
},
|
||||
"backstage": {
|
||||
"role": "frontend-plugin"
|
||||
},
|
||||
"sideEffects": false,
|
||||
"scripts": {
|
||||
"start": "backstage-cli package start",
|
||||
"build": "backstage-cli package build",
|
||||
"lint": "backstage-cli package lint",
|
||||
"test": "backstage-cli package test",
|
||||
"clean": "backstage-cli package clean",
|
||||
"prepack": "backstage-cli package prepack",
|
||||
"postpack": "backstage-cli package postpack"
|
||||
},
|
||||
"dependencies": {
|
||||
"@backstage/core-components": "^0.13.8",
|
||||
"@backstage/core-plugin-api": "^1.8.2",
|
||||
"@backstage/theme": "^0.5.0",
|
||||
"@material-ui/core": "^4.9.13",
|
||||
"@material-ui/icons": "^4.9.1",
|
||||
"@material-ui/lab": "^4.0.0-alpha.61",
|
||||
"react-use": "^17.2.4"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "^16.13.1 || ^17.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@backstage/cli": "^0.25.1",
|
||||
"@backstage/core-app-api": "^1.11.3",
|
||||
"@backstage/dev-utils": "^1.0.26",
|
||||
"@backstage/test-utils": "^1.4.7",
|
||||
"@testing-library/jest-dom": "^5.10.1",
|
||||
"@testing-library/react": "^12.1.3",
|
||||
"@testing-library/user-event": "^14.0.0",
|
||||
"msw": "^1.0.0"
|
||||
},
|
||||
"files": [
|
||||
"dist",
|
||||
"config.d.ts"
|
||||
],
|
||||
"configSchema": "config.d.ts"
|
||||
}
|
116
plugins/argo-workflows/src/api/ArgoWorkflows.test.ts
Normal file
116
plugins/argo-workflows/src/api/ArgoWorkflows.test.ts
Normal file
|
@ -0,0 +1,116 @@
|
|||
// import { DiscoveryApi } from "@backstage/core-plugin-api";
|
||||
// import { ArgoWorkflows } from "./ArgoWorkflows";
|
||||
// import { KubernetesApi } from "@backstage/plugin-kubernetes";
|
||||
// import { MockFetchApi } from "@backstage/test-utils";
|
||||
// import { FrontendHostDiscovery } from "@backstage/core-app-api";
|
||||
// import { UserIdentity } from "@backstage/core-components";
|
||||
// import { inProgress } from "../test-data/testResponse";
|
||||
//
|
||||
// describe("ArgoWorkflowsClient", () => {
|
||||
// const mockDiscoveryApi: jest.Mocked<DiscoveryApi> = {
|
||||
// getBaseUrl: jest.fn().mockImplementation((id) => {
|
||||
// return Promise.resolve(`https://backstage.io/${id}`);
|
||||
// }),
|
||||
// };
|
||||
// const noopFetchApi = new MockFetchApi({ baseImplementation: "none" });
|
||||
//
|
||||
// const mockKClient: jest.Mocked<KubernetesApi> = {
|
||||
// getObjectsByEntity: jest.fn(),
|
||||
// getClusters: jest.fn(),
|
||||
// getWorkloadsByEntity: jest.fn(),
|
||||
// getCustomObjectsByEntity: jest.fn(),
|
||||
// proxy: jest.fn(),
|
||||
// };
|
||||
//
|
||||
// beforeAll(() => {
|
||||
// jest
|
||||
// .spyOn(FrontendHostDiscovery.prototype, "getBaseUrl")
|
||||
// .mockImplementation((id) => {
|
||||
// return Promise.resolve(`https://backstage.io/${id}`);
|
||||
// });
|
||||
// jest
|
||||
// .spyOn(UserIdentity.prototype, "getCredentials")
|
||||
// .mockImplementation(() => {
|
||||
// return Promise.resolve({ token: "abc" });
|
||||
// });
|
||||
// });
|
||||
//
|
||||
// afterEach(() => {
|
||||
// jest.clearAllMocks();
|
||||
// });
|
||||
//
|
||||
// it("can fetch from k8s", async () => {
|
||||
// mockKClient.proxy.mockResolvedValue({
|
||||
// status: 200,
|
||||
// ok: true,
|
||||
// text: async () => JSON.stringify(inProgress),
|
||||
// } as Response);
|
||||
//
|
||||
// const a = new ArgoWorkflows(mockDiscoveryApi, mockKClient, noopFetchApi);
|
||||
// const spy = jest.spyOn(mockKClient, "proxy");
|
||||
// const resp = await a.getWorkflowsFromK8s("abc", "default", "my=env");
|
||||
// expect(resp.items.length).toBe(1);
|
||||
// expect(spy).toHaveBeenCalledWith({
|
||||
// clusterName: "abc",
|
||||
// path: "/apis/argoproj.io/v1alpha1/namespaces/default/workflows?timeoutSeconds=30&labelSelector=my%3Denv",
|
||||
// });
|
||||
// });
|
||||
// it("can fetch from default k8s cluster", async () => {
|
||||
// mockKClient.proxy.mockResolvedValue({
|
||||
// status: 200,
|
||||
// ok: true,
|
||||
// text: async () => JSON.stringify(inProgress),
|
||||
// } as Response);
|
||||
// mockKClient.getClusters.mockResolvedValue([
|
||||
// {
|
||||
// name: "cluster-1",
|
||||
// authProvider: "provider-1",
|
||||
// },
|
||||
// ]);
|
||||
//
|
||||
// const a = new ArgoWorkflows(mockDiscoveryApi, mockKClient, noopFetchApi);
|
||||
// const spy = jest.spyOn(a, "getFirstCluster");
|
||||
// const resp = await a.getWorkflowsFromK8s(undefined, "default", "my=env");
|
||||
// expect(resp.items.length).toBe(1);
|
||||
// expect(spy).toHaveBeenCalled();
|
||||
// });
|
||||
// it("rejects when non-ok status returned", async () => {
|
||||
// mockKClient.proxy.mockResolvedValue({
|
||||
// status: 500,
|
||||
// ok: false,
|
||||
// statusText: "something went wrong",
|
||||
// text: async () => "oh no",
|
||||
// } as Response);
|
||||
//
|
||||
// const a = new ArgoWorkflows(mockDiscoveryApi, mockKClient, noopFetchApi);
|
||||
// await expect(
|
||||
// a.getWorkflowsFromK8s("abc", "default", "not used")
|
||||
// ).rejects.toEqual(
|
||||
// "failed to fetch resources: 500, something went wrong, oh no"
|
||||
// );
|
||||
// });
|
||||
// it("can get workflow from proxy", async () => {
|
||||
// const impl = jest.fn().mockResolvedValue({
|
||||
// status: 200,
|
||||
// ok: true,
|
||||
// text: async () => JSON.stringify(inProgress),
|
||||
// });
|
||||
// const fetchApi = new MockFetchApi({ baseImplementation: impl });
|
||||
// const a = new ArgoWorkflows(mockDiscoveryApi, mockKClient, fetchApi);
|
||||
// const resp = await a.getWorkflowsFromProxy("default", "my=env");
|
||||
// expect(resp.items.length).toBe(1);
|
||||
// });
|
||||
// it("rejects when error is returned", async () => {
|
||||
// const impl = jest.fn().mockResolvedValue({
|
||||
// status: 500,
|
||||
// ok: false,
|
||||
// statusText: "something went wrong",
|
||||
// text: async () => "oh no",
|
||||
// });
|
||||
// const fetchApi = new MockFetchApi({ baseImplementation: impl });
|
||||
// const a = new ArgoWorkflows(mockDiscoveryApi, mockKClient, fetchApi);
|
||||
// await expect(a.getWorkflowsFromProxy("default", "my=env")).rejects.toEqual(
|
||||
// "failed to fetch resources: 500, something went wrong, oh no"
|
||||
// );
|
||||
// });
|
||||
// });
|
141
plugins/argo-workflows/src/api/ArgoWorkflows.ts
Normal file
141
plugins/argo-workflows/src/api/ArgoWorkflows.ts
Normal file
|
@ -0,0 +1,141 @@
|
|||
import { DiscoveryApi, FetchApi } from "@backstage/core-plugin-api";
|
||||
import { KubernetesApi } from "@backstage/plugin-kubernetes";
|
||||
import {
|
||||
IoArgoprojWorkflowV1alpha1WorkflowList,
|
||||
IoArgoprojWorkflowV1alpha1WorkflowTemplateList,
|
||||
} from "./generated/api";
|
||||
import { ArgoWorkflowsApi } from "./index";
|
||||
|
||||
const API_VERSION = "argoproj.io/v1alpha1";
|
||||
const WORKFLOW_PLURAL = "workflows";
|
||||
const DEFAULT_WORKFLOW_PROXY = "/argo-workflows/api";
|
||||
const API_LABEL_SELECTOR = "listOptions.labelSelector";
|
||||
const API_TIMEOUT = "listOptions.timeoutSeconds";
|
||||
const K8s_API_TIMEOUT = "timeoutSeconds";
|
||||
|
||||
export class ArgoWorkflows implements ArgoWorkflowsApi {
|
||||
private discoveryApi: DiscoveryApi;
|
||||
private kubernetesApi: KubernetesApi;
|
||||
private fetchApi: FetchApi;
|
||||
|
||||
constructor(
|
||||
discoveryApi: DiscoveryApi,
|
||||
kubernetesApi: KubernetesApi,
|
||||
fetchApi: FetchApi
|
||||
) {
|
||||
this.discoveryApi = discoveryApi;
|
||||
this.kubernetesApi = kubernetesApi;
|
||||
this.fetchApi = fetchApi;
|
||||
}
|
||||
|
||||
async getWorkflowsFromK8s(
|
||||
clusterName: string | undefined,
|
||||
namespace: string,
|
||||
labels: string | undefined
|
||||
): Promise<IoArgoprojWorkflowV1alpha1WorkflowList> {
|
||||
const ns = namespace !== undefined ? namespace : "default";
|
||||
const path = `/apis/${API_VERSION}/namespaces/${ns}/${WORKFLOW_PLURAL}`;
|
||||
const query = new URLSearchParams({
|
||||
[K8s_API_TIMEOUT]: "30",
|
||||
});
|
||||
if (labels) {
|
||||
query.set("labelSelector", labels);
|
||||
}
|
||||
// need limits and pagination
|
||||
const resp = await this.kubernetesApi.proxy({
|
||||
clusterName:
|
||||
clusterName !== undefined ? clusterName : await this.getFirstCluster(),
|
||||
path: `${path}?${query.toString()}`,
|
||||
});
|
||||
|
||||
if (!resp.ok) {
|
||||
return Promise.reject(
|
||||
`failed to fetch resources: ${resp.status}, ${
|
||||
resp.statusText
|
||||
}, ${await resp.text()}`
|
||||
);
|
||||
}
|
||||
// need validation
|
||||
return JSON.parse(
|
||||
await resp.text()
|
||||
) as IoArgoprojWorkflowV1alpha1WorkflowList;
|
||||
}
|
||||
|
||||
getWorkflows(
|
||||
clusterName: string | undefined,
|
||||
namespace: string,
|
||||
labels: string | undefined
|
||||
): Promise<IoArgoprojWorkflowV1alpha1WorkflowList> {
|
||||
if (clusterName) {
|
||||
return this.getWorkflowsFromK8s(clusterName, namespace, labels);
|
||||
}
|
||||
return this.getWorkflowsFromProxy(namespace, labels);
|
||||
}
|
||||
|
||||
async getWorkflowTemplates(
|
||||
clusterName: string | undefined,
|
||||
namespace: string,
|
||||
labels: string | undefined
|
||||
): Promise<IoArgoprojWorkflowV1alpha1WorkflowTemplateList> {
|
||||
if (clusterName) {
|
||||
return Promise.reject("t");
|
||||
}
|
||||
return this.getWorkflowTemplatesFromProxy(namespace, labels);
|
||||
}
|
||||
|
||||
async getWorkflowsFromProxy(
|
||||
namespace: string,
|
||||
labels: string | undefined
|
||||
): Promise<IoArgoprojWorkflowV1alpha1WorkflowList> {
|
||||
const path = `/api/v1/workflows/${namespace}`;
|
||||
const resp = await this.fetchFromPath(path, labels);
|
||||
return await checkAndReturn<IoArgoprojWorkflowV1alpha1WorkflowTemplateList>(
|
||||
resp
|
||||
);
|
||||
}
|
||||
|
||||
async getWorkflowTemplatesFromProxy(
|
||||
namespace: string,
|
||||
labels: string | undefined
|
||||
): Promise<IoArgoprojWorkflowV1alpha1WorkflowTemplateList> {
|
||||
const path = `/api/v1/workflow-templates/${namespace}`;
|
||||
|
||||
const resp = await this.fetchFromPath(path, labels);
|
||||
return await checkAndReturn<IoArgoprojWorkflowV1alpha1WorkflowTemplateList>(
|
||||
resp
|
||||
);
|
||||
}
|
||||
|
||||
async getFirstCluster(): Promise<string> {
|
||||
const clusters = await this.kubernetesApi.getClusters();
|
||||
if (clusters.length > 0) {
|
||||
return Promise.resolve(clusters[0].name);
|
||||
}
|
||||
return Promise.reject("no clusters found in configuration");
|
||||
}
|
||||
|
||||
async fetchFromPath(
|
||||
path: string,
|
||||
labels: string | undefined
|
||||
): Promise<Response> {
|
||||
const proxyUrl = await this.discoveryApi.getBaseUrl("proxy");
|
||||
const url = `${proxyUrl}${DEFAULT_WORKFLOW_PROXY}${path}`;
|
||||
const query = new URLSearchParams({ [API_TIMEOUT]: "30" });
|
||||
if (labels) {
|
||||
query.set(API_LABEL_SELECTOR, labels);
|
||||
}
|
||||
return this.fetchApi.fetch(`${url}?${query.toString()}`, {});
|
||||
}
|
||||
}
|
||||
|
||||
async function checkAndReturn<T>(resp: Response): Promise<T> {
|
||||
if (!resp.ok) {
|
||||
return Promise.reject(
|
||||
`failed to fetch resources: ${resp.status}, ${
|
||||
resp.statusText
|
||||
}, ${await resp.text()}`
|
||||
);
|
||||
}
|
||||
// need validation
|
||||
return Promise.resolve(JSON.parse(await resp.text()) as T);
|
||||
}
|
4
plugins/argo-workflows/src/api/generated/.gitignore
vendored
Normal file
4
plugins/argo-workflows/src/api/generated/.gitignore
vendored
Normal file
|
@ -0,0 +1,4 @@
|
|||
wwwroot/*.js
|
||||
node_modules
|
||||
typings
|
||||
dist
|
|
@ -0,0 +1,23 @@
|
|||
# OpenAPI Generator Ignore
|
||||
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
|
||||
|
||||
# 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 OpenAPI Generator 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
|
|
@ -0,0 +1,397 @@
|
|||
.gitignore
|
||||
.openapi-generator-ignore
|
||||
api.ts
|
||||
api/apis.ts
|
||||
api/archivedWorkflowServiceApi.ts
|
||||
api/artifactServiceApi.ts
|
||||
api/clusterWorkflowTemplateServiceApi.ts
|
||||
api/cronWorkflowServiceApi.ts
|
||||
api/eventServiceApi.ts
|
||||
api/eventSourceServiceApi.ts
|
||||
api/infoServiceApi.ts
|
||||
api/sensorServiceApi.ts
|
||||
api/workflowServiceApi.ts
|
||||
api/workflowTemplateServiceApi.ts
|
||||
git_push.sh
|
||||
model/eventsourceCreateEventSourceRequest.ts
|
||||
model/eventsourceEventSourceWatchEvent.ts
|
||||
model/eventsourceLogEntry.ts
|
||||
model/eventsourceUpdateEventSourceRequest.ts
|
||||
model/googleProtobufAny.ts
|
||||
model/grpcGatewayRuntimeError.ts
|
||||
model/grpcGatewayRuntimeStreamError.ts
|
||||
model/ioArgoprojEventsV1alpha1AMQPConsumeConfig.ts
|
||||
model/ioArgoprojEventsV1alpha1AMQPEventSource.ts
|
||||
model/ioArgoprojEventsV1alpha1AMQPExchangeDeclareConfig.ts
|
||||
model/ioArgoprojEventsV1alpha1AMQPQueueBindConfig.ts
|
||||
model/ioArgoprojEventsV1alpha1AMQPQueueDeclareConfig.ts
|
||||
model/ioArgoprojEventsV1alpha1AWSLambdaTrigger.ts
|
||||
model/ioArgoprojEventsV1alpha1Amount.ts
|
||||
model/ioArgoprojEventsV1alpha1ArgoWorkflowTrigger.ts
|
||||
model/ioArgoprojEventsV1alpha1ArtifactLocation.ts
|
||||
model/ioArgoprojEventsV1alpha1AzureEventHubsTrigger.ts
|
||||
model/ioArgoprojEventsV1alpha1AzureEventsHubEventSource.ts
|
||||
model/ioArgoprojEventsV1alpha1Backoff.ts
|
||||
model/ioArgoprojEventsV1alpha1BasicAuth.ts
|
||||
model/ioArgoprojEventsV1alpha1BitbucketAuth.ts
|
||||
model/ioArgoprojEventsV1alpha1BitbucketBasicAuth.ts
|
||||
model/ioArgoprojEventsV1alpha1BitbucketEventSource.ts
|
||||
model/ioArgoprojEventsV1alpha1BitbucketRepository.ts
|
||||
model/ioArgoprojEventsV1alpha1BitbucketServerEventSource.ts
|
||||
model/ioArgoprojEventsV1alpha1BitbucketServerRepository.ts
|
||||
model/ioArgoprojEventsV1alpha1CalendarEventSource.ts
|
||||
model/ioArgoprojEventsV1alpha1CatchupConfiguration.ts
|
||||
model/ioArgoprojEventsV1alpha1Condition.ts
|
||||
model/ioArgoprojEventsV1alpha1ConditionsResetByTime.ts
|
||||
model/ioArgoprojEventsV1alpha1ConditionsResetCriteria.ts
|
||||
model/ioArgoprojEventsV1alpha1ConfigMapPersistence.ts
|
||||
model/ioArgoprojEventsV1alpha1CustomTrigger.ts
|
||||
model/ioArgoprojEventsV1alpha1DataFilter.ts
|
||||
model/ioArgoprojEventsV1alpha1EmitterEventSource.ts
|
||||
model/ioArgoprojEventsV1alpha1EventContext.ts
|
||||
model/ioArgoprojEventsV1alpha1EventDependency.ts
|
||||
model/ioArgoprojEventsV1alpha1EventDependencyFilter.ts
|
||||
model/ioArgoprojEventsV1alpha1EventDependencyTransformer.ts
|
||||
model/ioArgoprojEventsV1alpha1EventPersistence.ts
|
||||
model/ioArgoprojEventsV1alpha1EventSource.ts
|
||||
model/ioArgoprojEventsV1alpha1EventSourceFilter.ts
|
||||
model/ioArgoprojEventsV1alpha1EventSourceList.ts
|
||||
model/ioArgoprojEventsV1alpha1EventSourceSpec.ts
|
||||
model/ioArgoprojEventsV1alpha1EventSourceStatus.ts
|
||||
model/ioArgoprojEventsV1alpha1ExprFilter.ts
|
||||
model/ioArgoprojEventsV1alpha1FileArtifact.ts
|
||||
model/ioArgoprojEventsV1alpha1FileEventSource.ts
|
||||
model/ioArgoprojEventsV1alpha1GenericEventSource.ts
|
||||
model/ioArgoprojEventsV1alpha1GitArtifact.ts
|
||||
model/ioArgoprojEventsV1alpha1GitCreds.ts
|
||||
model/ioArgoprojEventsV1alpha1GitRemoteConfig.ts
|
||||
model/ioArgoprojEventsV1alpha1GithubAppCreds.ts
|
||||
model/ioArgoprojEventsV1alpha1GithubEventSource.ts
|
||||
model/ioArgoprojEventsV1alpha1GitlabEventSource.ts
|
||||
model/ioArgoprojEventsV1alpha1HDFSEventSource.ts
|
||||
model/ioArgoprojEventsV1alpha1HTTPTrigger.ts
|
||||
model/ioArgoprojEventsV1alpha1Int64OrString.ts
|
||||
model/ioArgoprojEventsV1alpha1K8SResourcePolicy.ts
|
||||
model/ioArgoprojEventsV1alpha1KafkaConsumerGroup.ts
|
||||
model/ioArgoprojEventsV1alpha1KafkaEventSource.ts
|
||||
model/ioArgoprojEventsV1alpha1KafkaTrigger.ts
|
||||
model/ioArgoprojEventsV1alpha1LogTrigger.ts
|
||||
model/ioArgoprojEventsV1alpha1MQTTEventSource.ts
|
||||
model/ioArgoprojEventsV1alpha1Metadata.ts
|
||||
model/ioArgoprojEventsV1alpha1NATSAuth.ts
|
||||
model/ioArgoprojEventsV1alpha1NATSEventsSource.ts
|
||||
model/ioArgoprojEventsV1alpha1NATSTrigger.ts
|
||||
model/ioArgoprojEventsV1alpha1NSQEventSource.ts
|
||||
model/ioArgoprojEventsV1alpha1OpenWhiskTrigger.ts
|
||||
model/ioArgoprojEventsV1alpha1OwnedRepositories.ts
|
||||
model/ioArgoprojEventsV1alpha1PayloadField.ts
|
||||
model/ioArgoprojEventsV1alpha1PubSubEventSource.ts
|
||||
model/ioArgoprojEventsV1alpha1PulsarEventSource.ts
|
||||
model/ioArgoprojEventsV1alpha1PulsarTrigger.ts
|
||||
model/ioArgoprojEventsV1alpha1RateLimit.ts
|
||||
model/ioArgoprojEventsV1alpha1RedisEventSource.ts
|
||||
model/ioArgoprojEventsV1alpha1RedisStreamEventSource.ts
|
||||
model/ioArgoprojEventsV1alpha1Resource.ts
|
||||
model/ioArgoprojEventsV1alpha1ResourceEventSource.ts
|
||||
model/ioArgoprojEventsV1alpha1ResourceFilter.ts
|
||||
model/ioArgoprojEventsV1alpha1S3Artifact.ts
|
||||
model/ioArgoprojEventsV1alpha1S3Bucket.ts
|
||||
model/ioArgoprojEventsV1alpha1S3Filter.ts
|
||||
model/ioArgoprojEventsV1alpha1SASLConfig.ts
|
||||
model/ioArgoprojEventsV1alpha1SNSEventSource.ts
|
||||
model/ioArgoprojEventsV1alpha1SQSEventSource.ts
|
||||
model/ioArgoprojEventsV1alpha1SecureHeader.ts
|
||||
model/ioArgoprojEventsV1alpha1Selector.ts
|
||||
model/ioArgoprojEventsV1alpha1Sensor.ts
|
||||
model/ioArgoprojEventsV1alpha1SensorList.ts
|
||||
model/ioArgoprojEventsV1alpha1SensorSpec.ts
|
||||
model/ioArgoprojEventsV1alpha1SensorStatus.ts
|
||||
model/ioArgoprojEventsV1alpha1Service.ts
|
||||
model/ioArgoprojEventsV1alpha1SlackEventSource.ts
|
||||
model/ioArgoprojEventsV1alpha1SlackTrigger.ts
|
||||
model/ioArgoprojEventsV1alpha1StandardK8STrigger.ts
|
||||
model/ioArgoprojEventsV1alpha1Status.ts
|
||||
model/ioArgoprojEventsV1alpha1StatusPolicy.ts
|
||||
model/ioArgoprojEventsV1alpha1StorageGridEventSource.ts
|
||||
model/ioArgoprojEventsV1alpha1StorageGridFilter.ts
|
||||
model/ioArgoprojEventsV1alpha1StripeEventSource.ts
|
||||
model/ioArgoprojEventsV1alpha1TLSConfig.ts
|
||||
model/ioArgoprojEventsV1alpha1Template.ts
|
||||
model/ioArgoprojEventsV1alpha1TimeFilter.ts
|
||||
model/ioArgoprojEventsV1alpha1Trigger.ts
|
||||
model/ioArgoprojEventsV1alpha1TriggerParameter.ts
|
||||
model/ioArgoprojEventsV1alpha1TriggerParameterSource.ts
|
||||
model/ioArgoprojEventsV1alpha1TriggerPolicy.ts
|
||||
model/ioArgoprojEventsV1alpha1TriggerTemplate.ts
|
||||
model/ioArgoprojEventsV1alpha1URLArtifact.ts
|
||||
model/ioArgoprojEventsV1alpha1ValueFromSource.ts
|
||||
model/ioArgoprojEventsV1alpha1WatchPathConfig.ts
|
||||
model/ioArgoprojEventsV1alpha1WebhookContext.ts
|
||||
model/ioArgoprojEventsV1alpha1WebhookEventSource.ts
|
||||
model/ioArgoprojWorkflowV1alpha1ArchiveStrategy.ts
|
||||
model/ioArgoprojWorkflowV1alpha1Arguments.ts
|
||||
model/ioArgoprojWorkflowV1alpha1ArtGCStatus.ts
|
||||
model/ioArgoprojWorkflowV1alpha1Artifact.ts
|
||||
model/ioArgoprojWorkflowV1alpha1ArtifactGC.ts
|
||||
model/ioArgoprojWorkflowV1alpha1ArtifactGCSpec.ts
|
||||
model/ioArgoprojWorkflowV1alpha1ArtifactGCStatus.ts
|
||||
model/ioArgoprojWorkflowV1alpha1ArtifactLocation.ts
|
||||
model/ioArgoprojWorkflowV1alpha1ArtifactNodeSpec.ts
|
||||
model/ioArgoprojWorkflowV1alpha1ArtifactPaths.ts
|
||||
model/ioArgoprojWorkflowV1alpha1ArtifactRepository.ts
|
||||
model/ioArgoprojWorkflowV1alpha1ArtifactRepositoryRef.ts
|
||||
model/ioArgoprojWorkflowV1alpha1ArtifactRepositoryRefStatus.ts
|
||||
model/ioArgoprojWorkflowV1alpha1ArtifactResult.ts
|
||||
model/ioArgoprojWorkflowV1alpha1ArtifactResultNodeStatus.ts
|
||||
model/ioArgoprojWorkflowV1alpha1ArtifactoryArtifact.ts
|
||||
model/ioArgoprojWorkflowV1alpha1ArtifactoryArtifactRepository.ts
|
||||
model/ioArgoprojWorkflowV1alpha1AzureArtifact.ts
|
||||
model/ioArgoprojWorkflowV1alpha1AzureArtifactRepository.ts
|
||||
model/ioArgoprojWorkflowV1alpha1Backoff.ts
|
||||
model/ioArgoprojWorkflowV1alpha1BasicAuth.ts
|
||||
model/ioArgoprojWorkflowV1alpha1Cache.ts
|
||||
model/ioArgoprojWorkflowV1alpha1ClientCertAuth.ts
|
||||
model/ioArgoprojWorkflowV1alpha1ClusterWorkflowTemplate.ts
|
||||
model/ioArgoprojWorkflowV1alpha1ClusterWorkflowTemplateCreateRequest.ts
|
||||
model/ioArgoprojWorkflowV1alpha1ClusterWorkflowTemplateLintRequest.ts
|
||||
model/ioArgoprojWorkflowV1alpha1ClusterWorkflowTemplateList.ts
|
||||
model/ioArgoprojWorkflowV1alpha1ClusterWorkflowTemplateUpdateRequest.ts
|
||||
model/ioArgoprojWorkflowV1alpha1CollectEventRequest.ts
|
||||
model/ioArgoprojWorkflowV1alpha1Column.ts
|
||||
model/ioArgoprojWorkflowV1alpha1Condition.ts
|
||||
model/ioArgoprojWorkflowV1alpha1ContainerNode.ts
|
||||
model/ioArgoprojWorkflowV1alpha1ContainerSetRetryStrategy.ts
|
||||
model/ioArgoprojWorkflowV1alpha1ContainerSetTemplate.ts
|
||||
model/ioArgoprojWorkflowV1alpha1ContinueOn.ts
|
||||
model/ioArgoprojWorkflowV1alpha1Counter.ts
|
||||
model/ioArgoprojWorkflowV1alpha1CreateCronWorkflowRequest.ts
|
||||
model/ioArgoprojWorkflowV1alpha1CreateS3BucketOptions.ts
|
||||
model/ioArgoprojWorkflowV1alpha1CronWorkflow.ts
|
||||
model/ioArgoprojWorkflowV1alpha1CronWorkflowList.ts
|
||||
model/ioArgoprojWorkflowV1alpha1CronWorkflowResumeRequest.ts
|
||||
model/ioArgoprojWorkflowV1alpha1CronWorkflowSpec.ts
|
||||
model/ioArgoprojWorkflowV1alpha1CronWorkflowStatus.ts
|
||||
model/ioArgoprojWorkflowV1alpha1CronWorkflowSuspendRequest.ts
|
||||
model/ioArgoprojWorkflowV1alpha1DAGTask.ts
|
||||
model/ioArgoprojWorkflowV1alpha1DAGTemplate.ts
|
||||
model/ioArgoprojWorkflowV1alpha1Data.ts
|
||||
model/ioArgoprojWorkflowV1alpha1DataSource.ts
|
||||
model/ioArgoprojWorkflowV1alpha1Event.ts
|
||||
model/ioArgoprojWorkflowV1alpha1ExecutorConfig.ts
|
||||
model/ioArgoprojWorkflowV1alpha1GCSArtifact.ts
|
||||
model/ioArgoprojWorkflowV1alpha1GCSArtifactRepository.ts
|
||||
model/ioArgoprojWorkflowV1alpha1Gauge.ts
|
||||
model/ioArgoprojWorkflowV1alpha1GetUserInfoResponse.ts
|
||||
model/ioArgoprojWorkflowV1alpha1GitArtifact.ts
|
||||
model/ioArgoprojWorkflowV1alpha1HDFSArtifact.ts
|
||||
model/ioArgoprojWorkflowV1alpha1HDFSArtifactRepository.ts
|
||||
model/ioArgoprojWorkflowV1alpha1HTTP.ts
|
||||
model/ioArgoprojWorkflowV1alpha1HTTPArtifact.ts
|
||||
model/ioArgoprojWorkflowV1alpha1HTTPAuth.ts
|
||||
model/ioArgoprojWorkflowV1alpha1HTTPBodySource.ts
|
||||
model/ioArgoprojWorkflowV1alpha1HTTPHeader.ts
|
||||
model/ioArgoprojWorkflowV1alpha1HTTPHeaderSource.ts
|
||||
model/ioArgoprojWorkflowV1alpha1Header.ts
|
||||
model/ioArgoprojWorkflowV1alpha1Histogram.ts
|
||||
model/ioArgoprojWorkflowV1alpha1InfoResponse.ts
|
||||
model/ioArgoprojWorkflowV1alpha1Inputs.ts
|
||||
model/ioArgoprojWorkflowV1alpha1LabelKeys.ts
|
||||
model/ioArgoprojWorkflowV1alpha1LabelValueFrom.ts
|
||||
model/ioArgoprojWorkflowV1alpha1LabelValues.ts
|
||||
model/ioArgoprojWorkflowV1alpha1LifecycleHook.ts
|
||||
model/ioArgoprojWorkflowV1alpha1Link.ts
|
||||
model/ioArgoprojWorkflowV1alpha1LintCronWorkflowRequest.ts
|
||||
model/ioArgoprojWorkflowV1alpha1LogEntry.ts
|
||||
model/ioArgoprojWorkflowV1alpha1ManifestFrom.ts
|
||||
model/ioArgoprojWorkflowV1alpha1MemoizationStatus.ts
|
||||
model/ioArgoprojWorkflowV1alpha1Memoize.ts
|
||||
model/ioArgoprojWorkflowV1alpha1Metadata.ts
|
||||
model/ioArgoprojWorkflowV1alpha1MetricLabel.ts
|
||||
model/ioArgoprojWorkflowV1alpha1Metrics.ts
|
||||
model/ioArgoprojWorkflowV1alpha1Mutex.ts
|
||||
model/ioArgoprojWorkflowV1alpha1MutexHolding.ts
|
||||
model/ioArgoprojWorkflowV1alpha1MutexStatus.ts
|
||||
model/ioArgoprojWorkflowV1alpha1NodeResult.ts
|
||||
model/ioArgoprojWorkflowV1alpha1NodeStatus.ts
|
||||
model/ioArgoprojWorkflowV1alpha1NodeSynchronizationStatus.ts
|
||||
model/ioArgoprojWorkflowV1alpha1OAuth2Auth.ts
|
||||
model/ioArgoprojWorkflowV1alpha1OAuth2EndpointParam.ts
|
||||
model/ioArgoprojWorkflowV1alpha1OSSArtifact.ts
|
||||
model/ioArgoprojWorkflowV1alpha1OSSArtifactRepository.ts
|
||||
model/ioArgoprojWorkflowV1alpha1OSSLifecycleRule.ts
|
||||
model/ioArgoprojWorkflowV1alpha1Outputs.ts
|
||||
model/ioArgoprojWorkflowV1alpha1Parameter.ts
|
||||
model/ioArgoprojWorkflowV1alpha1PodGC.ts
|
||||
model/ioArgoprojWorkflowV1alpha1Prometheus.ts
|
||||
model/ioArgoprojWorkflowV1alpha1RawArtifact.ts
|
||||
model/ioArgoprojWorkflowV1alpha1ResourceTemplate.ts
|
||||
model/ioArgoprojWorkflowV1alpha1ResubmitArchivedWorkflowRequest.ts
|
||||
model/ioArgoprojWorkflowV1alpha1RetryAffinity.ts
|
||||
model/ioArgoprojWorkflowV1alpha1RetryArchivedWorkflowRequest.ts
|
||||
model/ioArgoprojWorkflowV1alpha1RetryStrategy.ts
|
||||
model/ioArgoprojWorkflowV1alpha1S3Artifact.ts
|
||||
model/ioArgoprojWorkflowV1alpha1S3ArtifactRepository.ts
|
||||
model/ioArgoprojWorkflowV1alpha1S3EncryptionOptions.ts
|
||||
model/ioArgoprojWorkflowV1alpha1ScriptTemplate.ts
|
||||
model/ioArgoprojWorkflowV1alpha1SemaphoreHolding.ts
|
||||
model/ioArgoprojWorkflowV1alpha1SemaphoreRef.ts
|
||||
model/ioArgoprojWorkflowV1alpha1SemaphoreStatus.ts
|
||||
model/ioArgoprojWorkflowV1alpha1Sequence.ts
|
||||
model/ioArgoprojWorkflowV1alpha1Submit.ts
|
||||
model/ioArgoprojWorkflowV1alpha1SubmitOpts.ts
|
||||
model/ioArgoprojWorkflowV1alpha1SuspendTemplate.ts
|
||||
model/ioArgoprojWorkflowV1alpha1Synchronization.ts
|
||||
model/ioArgoprojWorkflowV1alpha1SynchronizationStatus.ts
|
||||
model/ioArgoprojWorkflowV1alpha1TTLStrategy.ts
|
||||
model/ioArgoprojWorkflowV1alpha1TarStrategy.ts
|
||||
model/ioArgoprojWorkflowV1alpha1Template.ts
|
||||
model/ioArgoprojWorkflowV1alpha1TemplateRef.ts
|
||||
model/ioArgoprojWorkflowV1alpha1TransformationStep.ts
|
||||
model/ioArgoprojWorkflowV1alpha1UpdateCronWorkflowRequest.ts
|
||||
model/ioArgoprojWorkflowV1alpha1UserContainer.ts
|
||||
model/ioArgoprojWorkflowV1alpha1ValueFrom.ts
|
||||
model/ioArgoprojWorkflowV1alpha1Version.ts
|
||||
model/ioArgoprojWorkflowV1alpha1VolumeClaimGC.ts
|
||||
model/ioArgoprojWorkflowV1alpha1Workflow.ts
|
||||
model/ioArgoprojWorkflowV1alpha1WorkflowCreateRequest.ts
|
||||
model/ioArgoprojWorkflowV1alpha1WorkflowEventBinding.ts
|
||||
model/ioArgoprojWorkflowV1alpha1WorkflowEventBindingList.ts
|
||||
model/ioArgoprojWorkflowV1alpha1WorkflowEventBindingSpec.ts
|
||||
model/ioArgoprojWorkflowV1alpha1WorkflowLevelArtifactGC.ts
|
||||
model/ioArgoprojWorkflowV1alpha1WorkflowLintRequest.ts
|
||||
model/ioArgoprojWorkflowV1alpha1WorkflowList.ts
|
||||
model/ioArgoprojWorkflowV1alpha1WorkflowMetadata.ts
|
||||
model/ioArgoprojWorkflowV1alpha1WorkflowResubmitRequest.ts
|
||||
model/ioArgoprojWorkflowV1alpha1WorkflowResumeRequest.ts
|
||||
model/ioArgoprojWorkflowV1alpha1WorkflowRetryRequest.ts
|
||||
model/ioArgoprojWorkflowV1alpha1WorkflowSetRequest.ts
|
||||
model/ioArgoprojWorkflowV1alpha1WorkflowSpec.ts
|
||||
model/ioArgoprojWorkflowV1alpha1WorkflowStatus.ts
|
||||
model/ioArgoprojWorkflowV1alpha1WorkflowStep.ts
|
||||
model/ioArgoprojWorkflowV1alpha1WorkflowStopRequest.ts
|
||||
model/ioArgoprojWorkflowV1alpha1WorkflowSubmitRequest.ts
|
||||
model/ioArgoprojWorkflowV1alpha1WorkflowSuspendRequest.ts
|
||||
model/ioArgoprojWorkflowV1alpha1WorkflowTaskSetSpec.ts
|
||||
model/ioArgoprojWorkflowV1alpha1WorkflowTaskSetStatus.ts
|
||||
model/ioArgoprojWorkflowV1alpha1WorkflowTemplate.ts
|
||||
model/ioArgoprojWorkflowV1alpha1WorkflowTemplateCreateRequest.ts
|
||||
model/ioArgoprojWorkflowV1alpha1WorkflowTemplateLintRequest.ts
|
||||
model/ioArgoprojWorkflowV1alpha1WorkflowTemplateList.ts
|
||||
model/ioArgoprojWorkflowV1alpha1WorkflowTemplateRef.ts
|
||||
model/ioArgoprojWorkflowV1alpha1WorkflowTemplateUpdateRequest.ts
|
||||
model/ioArgoprojWorkflowV1alpha1WorkflowTerminateRequest.ts
|
||||
model/ioArgoprojWorkflowV1alpha1WorkflowWatchEvent.ts
|
||||
model/ioK8sApiCoreV1AWSElasticBlockStoreVolumeSource.ts
|
||||
model/ioK8sApiCoreV1Affinity.ts
|
||||
model/ioK8sApiCoreV1AzureDiskVolumeSource.ts
|
||||
model/ioK8sApiCoreV1AzureFileVolumeSource.ts
|
||||
model/ioK8sApiCoreV1CSIVolumeSource.ts
|
||||
model/ioK8sApiCoreV1Capabilities.ts
|
||||
model/ioK8sApiCoreV1CephFSVolumeSource.ts
|
||||
model/ioK8sApiCoreV1CinderVolumeSource.ts
|
||||
model/ioK8sApiCoreV1ConfigMapEnvSource.ts
|
||||
model/ioK8sApiCoreV1ConfigMapKeySelector.ts
|
||||
model/ioK8sApiCoreV1ConfigMapProjection.ts
|
||||
model/ioK8sApiCoreV1ConfigMapVolumeSource.ts
|
||||
model/ioK8sApiCoreV1Container.ts
|
||||
model/ioK8sApiCoreV1ContainerPort.ts
|
||||
model/ioK8sApiCoreV1DownwardAPIProjection.ts
|
||||
model/ioK8sApiCoreV1DownwardAPIVolumeFile.ts
|
||||
model/ioK8sApiCoreV1DownwardAPIVolumeSource.ts
|
||||
model/ioK8sApiCoreV1EmptyDirVolumeSource.ts
|
||||
model/ioK8sApiCoreV1EnvFromSource.ts
|
||||
model/ioK8sApiCoreV1EnvVar.ts
|
||||
model/ioK8sApiCoreV1EnvVarSource.ts
|
||||
model/ioK8sApiCoreV1EphemeralVolumeSource.ts
|
||||
model/ioK8sApiCoreV1Event.ts
|
||||
model/ioK8sApiCoreV1EventSeries.ts
|
||||
model/ioK8sApiCoreV1EventSource.ts
|
||||
model/ioK8sApiCoreV1ExecAction.ts
|
||||
model/ioK8sApiCoreV1FCVolumeSource.ts
|
||||
model/ioK8sApiCoreV1FlexVolumeSource.ts
|
||||
model/ioK8sApiCoreV1FlockerVolumeSource.ts
|
||||
model/ioK8sApiCoreV1GCEPersistentDiskVolumeSource.ts
|
||||
model/ioK8sApiCoreV1GRPCAction.ts
|
||||
model/ioK8sApiCoreV1GitRepoVolumeSource.ts
|
||||
model/ioK8sApiCoreV1GlusterfsVolumeSource.ts
|
||||
model/ioK8sApiCoreV1HTTPGetAction.ts
|
||||
model/ioK8sApiCoreV1HTTPHeader.ts
|
||||
model/ioK8sApiCoreV1HostAlias.ts
|
||||
model/ioK8sApiCoreV1HostPathVolumeSource.ts
|
||||
model/ioK8sApiCoreV1ISCSIVolumeSource.ts
|
||||
model/ioK8sApiCoreV1KeyToPath.ts
|
||||
model/ioK8sApiCoreV1Lifecycle.ts
|
||||
model/ioK8sApiCoreV1LifecycleHandler.ts
|
||||
model/ioK8sApiCoreV1LocalObjectReference.ts
|
||||
model/ioK8sApiCoreV1NFSVolumeSource.ts
|
||||
model/ioK8sApiCoreV1NodeAffinity.ts
|
||||
model/ioK8sApiCoreV1NodeSelector.ts
|
||||
model/ioK8sApiCoreV1NodeSelectorRequirement.ts
|
||||
model/ioK8sApiCoreV1NodeSelectorTerm.ts
|
||||
model/ioK8sApiCoreV1ObjectFieldSelector.ts
|
||||
model/ioK8sApiCoreV1ObjectReference.ts
|
||||
model/ioK8sApiCoreV1PersistentVolumeClaim.ts
|
||||
model/ioK8sApiCoreV1PersistentVolumeClaimCondition.ts
|
||||
model/ioK8sApiCoreV1PersistentVolumeClaimSpec.ts
|
||||
model/ioK8sApiCoreV1PersistentVolumeClaimStatus.ts
|
||||
model/ioK8sApiCoreV1PersistentVolumeClaimTemplate.ts
|
||||
model/ioK8sApiCoreV1PersistentVolumeClaimVolumeSource.ts
|
||||
model/ioK8sApiCoreV1PhotonPersistentDiskVolumeSource.ts
|
||||
model/ioK8sApiCoreV1PodAffinity.ts
|
||||
model/ioK8sApiCoreV1PodAffinityTerm.ts
|
||||
model/ioK8sApiCoreV1PodAntiAffinity.ts
|
||||
model/ioK8sApiCoreV1PodDNSConfig.ts
|
||||
model/ioK8sApiCoreV1PodDNSConfigOption.ts
|
||||
model/ioK8sApiCoreV1PodSecurityContext.ts
|
||||
model/ioK8sApiCoreV1PortworxVolumeSource.ts
|
||||
model/ioK8sApiCoreV1PreferredSchedulingTerm.ts
|
||||
model/ioK8sApiCoreV1Probe.ts
|
||||
model/ioK8sApiCoreV1ProjectedVolumeSource.ts
|
||||
model/ioK8sApiCoreV1QuobyteVolumeSource.ts
|
||||
model/ioK8sApiCoreV1RBDVolumeSource.ts
|
||||
model/ioK8sApiCoreV1ResourceFieldSelector.ts
|
||||
model/ioK8sApiCoreV1ResourceRequirements.ts
|
||||
model/ioK8sApiCoreV1SELinuxOptions.ts
|
||||
model/ioK8sApiCoreV1ScaleIOVolumeSource.ts
|
||||
model/ioK8sApiCoreV1SeccompProfile.ts
|
||||
model/ioK8sApiCoreV1SecretEnvSource.ts
|
||||
model/ioK8sApiCoreV1SecretKeySelector.ts
|
||||
model/ioK8sApiCoreV1SecretProjection.ts
|
||||
model/ioK8sApiCoreV1SecretVolumeSource.ts
|
||||
model/ioK8sApiCoreV1SecurityContext.ts
|
||||
model/ioK8sApiCoreV1ServiceAccountTokenProjection.ts
|
||||
model/ioK8sApiCoreV1ServicePort.ts
|
||||
model/ioK8sApiCoreV1StorageOSVolumeSource.ts
|
||||
model/ioK8sApiCoreV1Sysctl.ts
|
||||
model/ioK8sApiCoreV1TCPSocketAction.ts
|
||||
model/ioK8sApiCoreV1Toleration.ts
|
||||
model/ioK8sApiCoreV1TypedLocalObjectReference.ts
|
||||
model/ioK8sApiCoreV1Volume.ts
|
||||
model/ioK8sApiCoreV1VolumeDevice.ts
|
||||
model/ioK8sApiCoreV1VolumeMount.ts
|
||||
model/ioK8sApiCoreV1VolumeProjection.ts
|
||||
model/ioK8sApiCoreV1VsphereVirtualDiskVolumeSource.ts
|
||||
model/ioK8sApiCoreV1WeightedPodAffinityTerm.ts
|
||||
model/ioK8sApiCoreV1WindowsSecurityContextOptions.ts
|
||||
model/ioK8sApiPolicyV1PodDisruptionBudgetSpec.ts
|
||||
model/ioK8sApimachineryPkgApisMetaV1CreateOptions.ts
|
||||
model/ioK8sApimachineryPkgApisMetaV1GroupVersionResource.ts
|
||||
model/ioK8sApimachineryPkgApisMetaV1LabelSelector.ts
|
||||
model/ioK8sApimachineryPkgApisMetaV1LabelSelectorRequirement.ts
|
||||
model/ioK8sApimachineryPkgApisMetaV1ListMeta.ts
|
||||
model/ioK8sApimachineryPkgApisMetaV1ManagedFieldsEntry.ts
|
||||
model/ioK8sApimachineryPkgApisMetaV1ObjectMeta.ts
|
||||
model/ioK8sApimachineryPkgApisMetaV1OwnerReference.ts
|
||||
model/ioK8sApimachineryPkgApisMetaV1StatusCause.ts
|
||||
model/models.ts
|
||||
model/sensorCreateSensorRequest.ts
|
||||
model/sensorLogEntry.ts
|
||||
model/sensorSensorWatchEvent.ts
|
||||
model/sensorUpdateSensorRequest.ts
|
||||
model/streamResultOfEventsourceEventSourceWatchEvent.ts
|
||||
model/streamResultOfEventsourceLogEntry.ts
|
||||
model/streamResultOfIoArgoprojWorkflowV1alpha1LogEntry.ts
|
||||
model/streamResultOfIoArgoprojWorkflowV1alpha1WorkflowWatchEvent.ts
|
||||
model/streamResultOfIoK8sApiCoreV1Event.ts
|
||||
model/streamResultOfSensorLogEntry.ts
|
||||
model/streamResultOfSensorSensorWatchEvent.ts
|
|
@ -0,0 +1 @@
|
|||
6.6.0
|
3
plugins/argo-workflows/src/api/generated/api.ts
Normal file
3
plugins/argo-workflows/src/api/generated/api.ts
Normal file
|
@ -0,0 +1,3 @@
|
|||
// This is the entrypoint for the package
|
||||
export * from './api/apis';
|
||||
export * from './model/models';
|
33
plugins/argo-workflows/src/api/generated/api/apis.ts
Normal file
33
plugins/argo-workflows/src/api/generated/api/apis.ts
Normal file
|
@ -0,0 +1,33 @@
|
|||
// @ts-nocheck
|
||||
export * from './archivedWorkflowServiceApi';
|
||||
import { ArchivedWorkflowServiceApi } from './archivedWorkflowServiceApi';
|
||||
export * from './artifactServiceApi';
|
||||
import { ArtifactServiceApi } from './artifactServiceApi';
|
||||
export * from './clusterWorkflowTemplateServiceApi';
|
||||
import { ClusterWorkflowTemplateServiceApi } from './clusterWorkflowTemplateServiceApi';
|
||||
export * from './cronWorkflowServiceApi';
|
||||
import { CronWorkflowServiceApi } from './cronWorkflowServiceApi';
|
||||
export * from './eventServiceApi';
|
||||
import { EventServiceApi } from './eventServiceApi';
|
||||
export * from './eventSourceServiceApi';
|
||||
import { EventSourceServiceApi } from './eventSourceServiceApi';
|
||||
export * from './infoServiceApi';
|
||||
import { InfoServiceApi } from './infoServiceApi';
|
||||
export * from './sensorServiceApi';
|
||||
import { SensorServiceApi } from './sensorServiceApi';
|
||||
export * from './workflowServiceApi';
|
||||
import { WorkflowServiceApi } from './workflowServiceApi';
|
||||
export * from './workflowTemplateServiceApi';
|
||||
import { WorkflowTemplateServiceApi } from './workflowTemplateServiceApi';
|
||||
import * as http from 'http';
|
||||
|
||||
export class HttpError extends Error {
|
||||
constructor (public response: http.IncomingMessage, public body: any, public statusCode?: number) {
|
||||
super('HTTP request failed');
|
||||
this.name = 'HttpError';
|
||||
}
|
||||
}
|
||||
|
||||
export { RequestFile } from '../model/models';
|
||||
|
||||
export const APIS = [ArchivedWorkflowServiceApi, ArtifactServiceApi, ClusterWorkflowTemplateServiceApi, CronWorkflowServiceApi, EventServiceApi, EventSourceServiceApi, InfoServiceApi, SensorServiceApi, WorkflowServiceApi, WorkflowTemplateServiceApi];
|
|
@ -0,0 +1,714 @@
|
|||
// @ts-nocheck
|
||||
/**
|
||||
* Argo Workflows API
|
||||
* Argo Workflows is an open source container-native workflow engine for orchestrating parallel jobs on Kubernetes. For more information, please see https://argoproj.github.io/argo-workflows/
|
||||
*
|
||||
* The version of the OpenAPI document: VERSION
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
import localVarRequest from 'request';
|
||||
import http from 'http';
|
||||
|
||||
/* tslint:disable:no-unused-locals */
|
||||
import { GrpcGatewayRuntimeError } from '../model/grpcGatewayRuntimeError';
|
||||
import { IoArgoprojWorkflowV1alpha1LabelKeys } from '../model/ioArgoprojWorkflowV1alpha1LabelKeys';
|
||||
import { IoArgoprojWorkflowV1alpha1LabelValues } from '../model/ioArgoprojWorkflowV1alpha1LabelValues';
|
||||
import { IoArgoprojWorkflowV1alpha1ResubmitArchivedWorkflowRequest } from '../model/ioArgoprojWorkflowV1alpha1ResubmitArchivedWorkflowRequest';
|
||||
import { IoArgoprojWorkflowV1alpha1RetryArchivedWorkflowRequest } from '../model/ioArgoprojWorkflowV1alpha1RetryArchivedWorkflowRequest';
|
||||
import { IoArgoprojWorkflowV1alpha1Workflow } from '../model/ioArgoprojWorkflowV1alpha1Workflow';
|
||||
import { IoArgoprojWorkflowV1alpha1WorkflowList } from '../model/ioArgoprojWorkflowV1alpha1WorkflowList';
|
||||
|
||||
import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models';
|
||||
import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models';
|
||||
|
||||
import { HttpError, RequestFile } from './apis';
|
||||
|
||||
let defaultBasePath = 'http://localhost:2746';
|
||||
|
||||
// ===============================================
|
||||
// This file is autogenerated - Please do not edit
|
||||
// ===============================================
|
||||
|
||||
export enum ArchivedWorkflowServiceApiApiKeys {
|
||||
BearerToken,
|
||||
}
|
||||
|
||||
export class ArchivedWorkflowServiceApi {
|
||||
protected _basePath = defaultBasePath;
|
||||
protected _defaultHeaders : any = {};
|
||||
protected _useQuerystring : boolean = false;
|
||||
|
||||
protected authentications = {
|
||||
'default': <Authentication>new VoidAuth(),
|
||||
'BearerToken': new ApiKeyAuth('header', 'Authorization'),
|
||||
}
|
||||
|
||||
protected interceptors: Interceptor[] = [];
|
||||
|
||||
constructor(basePath?: string);
|
||||
constructor(basePathOrUsername: string, password?: string, basePath?: string) {
|
||||
if (password) {
|
||||
if (basePath) {
|
||||
this.basePath = basePath;
|
||||
}
|
||||
} else {
|
||||
if (basePathOrUsername) {
|
||||
this.basePath = basePathOrUsername
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
set useQuerystring(value: boolean) {
|
||||
this._useQuerystring = value;
|
||||
}
|
||||
|
||||
set basePath(basePath: string) {
|
||||
this._basePath = basePath;
|
||||
}
|
||||
|
||||
set defaultHeaders(defaultHeaders: any) {
|
||||
this._defaultHeaders = defaultHeaders;
|
||||
}
|
||||
|
||||
get defaultHeaders() {
|
||||
return this._defaultHeaders;
|
||||
}
|
||||
|
||||
get basePath() {
|
||||
return this._basePath;
|
||||
}
|
||||
|
||||
public setDefaultAuthentication(auth: Authentication) {
|
||||
this.authentications.default = auth;
|
||||
}
|
||||
|
||||
public setApiKey(key: ArchivedWorkflowServiceApiApiKeys, value: string) {
|
||||
(this.authentications as any)[ArchivedWorkflowServiceApiApiKeys[key]].apiKey = value;
|
||||
}
|
||||
|
||||
public addInterceptor(interceptor: Interceptor) {
|
||||
this.interceptors.push(interceptor);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param uid
|
||||
* @param namespace
|
||||
*/
|
||||
public async archivedWorkflowServiceDeleteArchivedWorkflow (uid: string, namespace?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: object; }> {
|
||||
const localVarPath = this.basePath + '/api/v1/archived-workflows/{uid}'
|
||||
.replace('{' + 'uid' + '}', encodeURIComponent(String(uid)));
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
const produces = ['application/json'];
|
||||
// give precedence to 'application/json'
|
||||
if (produces.indexOf('application/json') >= 0) {
|
||||
localVarHeaderParams.Accept = 'application/json';
|
||||
} else {
|
||||
localVarHeaderParams.Accept = produces.join(',');
|
||||
}
|
||||
let localVarFormParams: any = {};
|
||||
|
||||
// verify required parameter 'uid' is not null or undefined
|
||||
if (uid === null || uid === undefined) {
|
||||
throw new Error('Required parameter uid was null or undefined when calling archivedWorkflowServiceDeleteArchivedWorkflow.');
|
||||
}
|
||||
|
||||
if (namespace !== undefined) {
|
||||
localVarQueryParameters['namespace'] = ObjectSerializer.serialize(namespace, "string");
|
||||
}
|
||||
|
||||
(<any>Object).assign(localVarHeaderParams, options.headers);
|
||||
|
||||
let localVarUseFormData = false;
|
||||
|
||||
let localVarRequestOptions: localVarRequest.Options = {
|
||||
method: 'DELETE',
|
||||
qs: localVarQueryParameters,
|
||||
headers: localVarHeaderParams,
|
||||
uri: localVarPath,
|
||||
useQuerystring: this._useQuerystring,
|
||||
json: true,
|
||||
};
|
||||
|
||||
let authenticationPromise = Promise.resolve();
|
||||
if (this.authentications.BearerToken.apiKey) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
||||
|
||||
let interceptorPromise = authenticationPromise;
|
||||
for (const interceptor of this.interceptors) {
|
||||
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
||||
}
|
||||
|
||||
return interceptorPromise.then(() => {
|
||||
if (Object.keys(localVarFormParams).length) {
|
||||
if (localVarUseFormData) {
|
||||
(<any>localVarRequestOptions).formData = localVarFormParams;
|
||||
} else {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.IncomingMessage; body: object; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
||||
body = ObjectSerializer.deserialize(body, "object");
|
||||
resolve({ response: response, body: body });
|
||||
} else {
|
||||
reject(new HttpError(response, body, response.statusCode));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param uid
|
||||
* @param namespace
|
||||
* @param name
|
||||
*/
|
||||
public async archivedWorkflowServiceGetArchivedWorkflow (uid: string, namespace?: string, name?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: IoArgoprojWorkflowV1alpha1Workflow; }> {
|
||||
const localVarPath = this.basePath + '/api/v1/archived-workflows/{uid}'
|
||||
.replace('{' + 'uid' + '}', encodeURIComponent(String(uid)));
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
const produces = ['application/json'];
|
||||
// give precedence to 'application/json'
|
||||
if (produces.indexOf('application/json') >= 0) {
|
||||
localVarHeaderParams.Accept = 'application/json';
|
||||
} else {
|
||||
localVarHeaderParams.Accept = produces.join(',');
|
||||
}
|
||||
let localVarFormParams: any = {};
|
||||
|
||||
// verify required parameter 'uid' is not null or undefined
|
||||
if (uid === null || uid === undefined) {
|
||||
throw new Error('Required parameter uid was null or undefined when calling archivedWorkflowServiceGetArchivedWorkflow.');
|
||||
}
|
||||
|
||||
if (namespace !== undefined) {
|
||||
localVarQueryParameters['namespace'] = ObjectSerializer.serialize(namespace, "string");
|
||||
}
|
||||
|
||||
if (name !== undefined) {
|
||||
localVarQueryParameters['name'] = ObjectSerializer.serialize(name, "string");
|
||||
}
|
||||
|
||||
(<any>Object).assign(localVarHeaderParams, options.headers);
|
||||
|
||||
let localVarUseFormData = false;
|
||||
|
||||
let localVarRequestOptions: localVarRequest.Options = {
|
||||
method: 'GET',
|
||||
qs: localVarQueryParameters,
|
||||
headers: localVarHeaderParams,
|
||||
uri: localVarPath,
|
||||
useQuerystring: this._useQuerystring,
|
||||
json: true,
|
||||
};
|
||||
|
||||
let authenticationPromise = Promise.resolve();
|
||||
if (this.authentications.BearerToken.apiKey) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
||||
|
||||
let interceptorPromise = authenticationPromise;
|
||||
for (const interceptor of this.interceptors) {
|
||||
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
||||
}
|
||||
|
||||
return interceptorPromise.then(() => {
|
||||
if (Object.keys(localVarFormParams).length) {
|
||||
if (localVarUseFormData) {
|
||||
(<any>localVarRequestOptions).formData = localVarFormParams;
|
||||
} else {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.IncomingMessage; body: IoArgoprojWorkflowV1alpha1Workflow; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
||||
body = ObjectSerializer.deserialize(body, "IoArgoprojWorkflowV1alpha1Workflow");
|
||||
resolve({ response: response, body: body });
|
||||
} else {
|
||||
reject(new HttpError(response, body, response.statusCode));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param namespace
|
||||
*/
|
||||
public async archivedWorkflowServiceListArchivedWorkflowLabelKeys (namespace?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: IoArgoprojWorkflowV1alpha1LabelKeys; }> {
|
||||
const localVarPath = this.basePath + '/api/v1/archived-workflows-label-keys';
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
const produces = ['application/json'];
|
||||
// give precedence to 'application/json'
|
||||
if (produces.indexOf('application/json') >= 0) {
|
||||
localVarHeaderParams.Accept = 'application/json';
|
||||
} else {
|
||||
localVarHeaderParams.Accept = produces.join(',');
|
||||
}
|
||||
let localVarFormParams: any = {};
|
||||
|
||||
if (namespace !== undefined) {
|
||||
localVarQueryParameters['namespace'] = ObjectSerializer.serialize(namespace, "string");
|
||||
}
|
||||
|
||||
(<any>Object).assign(localVarHeaderParams, options.headers);
|
||||
|
||||
let localVarUseFormData = false;
|
||||
|
||||
let localVarRequestOptions: localVarRequest.Options = {
|
||||
method: 'GET',
|
||||
qs: localVarQueryParameters,
|
||||
headers: localVarHeaderParams,
|
||||
uri: localVarPath,
|
||||
useQuerystring: this._useQuerystring,
|
||||
json: true,
|
||||
};
|
||||
|
||||
let authenticationPromise = Promise.resolve();
|
||||
if (this.authentications.BearerToken.apiKey) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
||||
|
||||
let interceptorPromise = authenticationPromise;
|
||||
for (const interceptor of this.interceptors) {
|
||||
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
||||
}
|
||||
|
||||
return interceptorPromise.then(() => {
|
||||
if (Object.keys(localVarFormParams).length) {
|
||||
if (localVarUseFormData) {
|
||||
(<any>localVarRequestOptions).formData = localVarFormParams;
|
||||
} else {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.IncomingMessage; body: IoArgoprojWorkflowV1alpha1LabelKeys; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
||||
body = ObjectSerializer.deserialize(body, "IoArgoprojWorkflowV1alpha1LabelKeys");
|
||||
resolve({ response: response, body: body });
|
||||
} else {
|
||||
reject(new HttpError(response, body, response.statusCode));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param listOptionsLabelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. +optional.
|
||||
* @param listOptionsFieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. +optional.
|
||||
* @param listOptionsWatch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. +optional.
|
||||
* @param listOptionsAllowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. +optional.
|
||||
* @param listOptionsResourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset +optional
|
||||
* @param listOptionsResourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset +optional
|
||||
* @param listOptionsTimeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. +optional.
|
||||
* @param listOptionsLimit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.
|
||||
* @param listOptionsContinue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.
|
||||
* @param namespace
|
||||
*/
|
||||
public async archivedWorkflowServiceListArchivedWorkflowLabelValues (listOptionsLabelSelector?: string, listOptionsFieldSelector?: string, listOptionsWatch?: boolean, listOptionsAllowWatchBookmarks?: boolean, listOptionsResourceVersion?: string, listOptionsResourceVersionMatch?: string, listOptionsTimeoutSeconds?: string, listOptionsLimit?: string, listOptionsContinue?: string, namespace?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: IoArgoprojWorkflowV1alpha1LabelValues; }> {
|
||||
const localVarPath = this.basePath + '/api/v1/archived-workflows-label-values';
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
const produces = ['application/json'];
|
||||
// give precedence to 'application/json'
|
||||
if (produces.indexOf('application/json') >= 0) {
|
||||
localVarHeaderParams.Accept = 'application/json';
|
||||
} else {
|
||||
localVarHeaderParams.Accept = produces.join(',');
|
||||
}
|
||||
let localVarFormParams: any = {};
|
||||
|
||||
if (listOptionsLabelSelector !== undefined) {
|
||||
localVarQueryParameters['listOptions.labelSelector'] = ObjectSerializer.serialize(listOptionsLabelSelector, "string");
|
||||
}
|
||||
|
||||
if (listOptionsFieldSelector !== undefined) {
|
||||
localVarQueryParameters['listOptions.fieldSelector'] = ObjectSerializer.serialize(listOptionsFieldSelector, "string");
|
||||
}
|
||||
|
||||
if (listOptionsWatch !== undefined) {
|
||||
localVarQueryParameters['listOptions.watch'] = ObjectSerializer.serialize(listOptionsWatch, "boolean");
|
||||
}
|
||||
|
||||
if (listOptionsAllowWatchBookmarks !== undefined) {
|
||||
localVarQueryParameters['listOptions.allowWatchBookmarks'] = ObjectSerializer.serialize(listOptionsAllowWatchBookmarks, "boolean");
|
||||
}
|
||||
|
||||
if (listOptionsResourceVersion !== undefined) {
|
||||
localVarQueryParameters['listOptions.resourceVersion'] = ObjectSerializer.serialize(listOptionsResourceVersion, "string");
|
||||
}
|
||||
|
||||
if (listOptionsResourceVersionMatch !== undefined) {
|
||||
localVarQueryParameters['listOptions.resourceVersionMatch'] = ObjectSerializer.serialize(listOptionsResourceVersionMatch, "string");
|
||||
}
|
||||
|
||||
if (listOptionsTimeoutSeconds !== undefined) {
|
||||
localVarQueryParameters['listOptions.timeoutSeconds'] = ObjectSerializer.serialize(listOptionsTimeoutSeconds, "string");
|
||||
}
|
||||
|
||||
if (listOptionsLimit !== undefined) {
|
||||
localVarQueryParameters['listOptions.limit'] = ObjectSerializer.serialize(listOptionsLimit, "string");
|
||||
}
|
||||
|
||||
if (listOptionsContinue !== undefined) {
|
||||
localVarQueryParameters['listOptions.continue'] = ObjectSerializer.serialize(listOptionsContinue, "string");
|
||||
}
|
||||
|
||||
if (namespace !== undefined) {
|
||||
localVarQueryParameters['namespace'] = ObjectSerializer.serialize(namespace, "string");
|
||||
}
|
||||
|
||||
(<any>Object).assign(localVarHeaderParams, options.headers);
|
||||
|
||||
let localVarUseFormData = false;
|
||||
|
||||
let localVarRequestOptions: localVarRequest.Options = {
|
||||
method: 'GET',
|
||||
qs: localVarQueryParameters,
|
||||
headers: localVarHeaderParams,
|
||||
uri: localVarPath,
|
||||
useQuerystring: this._useQuerystring,
|
||||
json: true,
|
||||
};
|
||||
|
||||
let authenticationPromise = Promise.resolve();
|
||||
if (this.authentications.BearerToken.apiKey) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
||||
|
||||
let interceptorPromise = authenticationPromise;
|
||||
for (const interceptor of this.interceptors) {
|
||||
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
||||
}
|
||||
|
||||
return interceptorPromise.then(() => {
|
||||
if (Object.keys(localVarFormParams).length) {
|
||||
if (localVarUseFormData) {
|
||||
(<any>localVarRequestOptions).formData = localVarFormParams;
|
||||
} else {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.IncomingMessage; body: IoArgoprojWorkflowV1alpha1LabelValues; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
||||
body = ObjectSerializer.deserialize(body, "IoArgoprojWorkflowV1alpha1LabelValues");
|
||||
resolve({ response: response, body: body });
|
||||
} else {
|
||||
reject(new HttpError(response, body, response.statusCode));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param listOptionsLabelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. +optional.
|
||||
* @param listOptionsFieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. +optional.
|
||||
* @param listOptionsWatch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. +optional.
|
||||
* @param listOptionsAllowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. +optional.
|
||||
* @param listOptionsResourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset +optional
|
||||
* @param listOptionsResourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset +optional
|
||||
* @param listOptionsTimeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. +optional.
|
||||
* @param listOptionsLimit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.
|
||||
* @param listOptionsContinue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.
|
||||
* @param namePrefix
|
||||
* @param namespace
|
||||
*/
|
||||
public async archivedWorkflowServiceListArchivedWorkflows (listOptionsLabelSelector?: string, listOptionsFieldSelector?: string, listOptionsWatch?: boolean, listOptionsAllowWatchBookmarks?: boolean, listOptionsResourceVersion?: string, listOptionsResourceVersionMatch?: string, listOptionsTimeoutSeconds?: string, listOptionsLimit?: string, listOptionsContinue?: string, namePrefix?: string, namespace?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: IoArgoprojWorkflowV1alpha1WorkflowList; }> {
|
||||
const localVarPath = this.basePath + '/api/v1/archived-workflows';
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
const produces = ['application/json'];
|
||||
// give precedence to 'application/json'
|
||||
if (produces.indexOf('application/json') >= 0) {
|
||||
localVarHeaderParams.Accept = 'application/json';
|
||||
} else {
|
||||
localVarHeaderParams.Accept = produces.join(',');
|
||||
}
|
||||
let localVarFormParams: any = {};
|
||||
|
||||
if (listOptionsLabelSelector !== undefined) {
|
||||
localVarQueryParameters['listOptions.labelSelector'] = ObjectSerializer.serialize(listOptionsLabelSelector, "string");
|
||||
}
|
||||
|
||||
if (listOptionsFieldSelector !== undefined) {
|
||||
localVarQueryParameters['listOptions.fieldSelector'] = ObjectSerializer.serialize(listOptionsFieldSelector, "string");
|
||||
}
|
||||
|
||||
if (listOptionsWatch !== undefined) {
|
||||
localVarQueryParameters['listOptions.watch'] = ObjectSerializer.serialize(listOptionsWatch, "boolean");
|
||||
}
|
||||
|
||||
if (listOptionsAllowWatchBookmarks !== undefined) {
|
||||
localVarQueryParameters['listOptions.allowWatchBookmarks'] = ObjectSerializer.serialize(listOptionsAllowWatchBookmarks, "boolean");
|
||||
}
|
||||
|
||||
if (listOptionsResourceVersion !== undefined) {
|
||||
localVarQueryParameters['listOptions.resourceVersion'] = ObjectSerializer.serialize(listOptionsResourceVersion, "string");
|
||||
}
|
||||
|
||||
if (listOptionsResourceVersionMatch !== undefined) {
|
||||
localVarQueryParameters['listOptions.resourceVersionMatch'] = ObjectSerializer.serialize(listOptionsResourceVersionMatch, "string");
|
||||
}
|
||||
|
||||
if (listOptionsTimeoutSeconds !== undefined) {
|
||||
localVarQueryParameters['listOptions.timeoutSeconds'] = ObjectSerializer.serialize(listOptionsTimeoutSeconds, "string");
|
||||
}
|
||||
|
||||
if (listOptionsLimit !== undefined) {
|
||||
localVarQueryParameters['listOptions.limit'] = ObjectSerializer.serialize(listOptionsLimit, "string");
|
||||
}
|
||||
|
||||
if (listOptionsContinue !== undefined) {
|
||||
localVarQueryParameters['listOptions.continue'] = ObjectSerializer.serialize(listOptionsContinue, "string");
|
||||
}
|
||||
|
||||
if (namePrefix !== undefined) {
|
||||
localVarQueryParameters['namePrefix'] = ObjectSerializer.serialize(namePrefix, "string");
|
||||
}
|
||||
|
||||
if (namespace !== undefined) {
|
||||
localVarQueryParameters['namespace'] = ObjectSerializer.serialize(namespace, "string");
|
||||
}
|
||||
|
||||
(<any>Object).assign(localVarHeaderParams, options.headers);
|
||||
|
||||
let localVarUseFormData = false;
|
||||
|
||||
let localVarRequestOptions: localVarRequest.Options = {
|
||||
method: 'GET',
|
||||
qs: localVarQueryParameters,
|
||||
headers: localVarHeaderParams,
|
||||
uri: localVarPath,
|
||||
useQuerystring: this._useQuerystring,
|
||||
json: true,
|
||||
};
|
||||
|
||||
let authenticationPromise = Promise.resolve();
|
||||
if (this.authentications.BearerToken.apiKey) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
||||
|
||||
let interceptorPromise = authenticationPromise;
|
||||
for (const interceptor of this.interceptors) {
|
||||
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
||||
}
|
||||
|
||||
return interceptorPromise.then(() => {
|
||||
if (Object.keys(localVarFormParams).length) {
|
||||
if (localVarUseFormData) {
|
||||
(<any>localVarRequestOptions).formData = localVarFormParams;
|
||||
} else {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.IncomingMessage; body: IoArgoprojWorkflowV1alpha1WorkflowList; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
||||
body = ObjectSerializer.deserialize(body, "IoArgoprojWorkflowV1alpha1WorkflowList");
|
||||
resolve({ response: response, body: body });
|
||||
} else {
|
||||
reject(new HttpError(response, body, response.statusCode));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param uid
|
||||
* @param body
|
||||
*/
|
||||
public async archivedWorkflowServiceResubmitArchivedWorkflow (uid: string, body: IoArgoprojWorkflowV1alpha1ResubmitArchivedWorkflowRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: IoArgoprojWorkflowV1alpha1Workflow; }> {
|
||||
const localVarPath = this.basePath + '/api/v1/archived-workflows/{uid}/resubmit'
|
||||
.replace('{' + 'uid' + '}', encodeURIComponent(String(uid)));
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
const produces = ['application/json'];
|
||||
// give precedence to 'application/json'
|
||||
if (produces.indexOf('application/json') >= 0) {
|
||||
localVarHeaderParams.Accept = 'application/json';
|
||||
} else {
|
||||
localVarHeaderParams.Accept = produces.join(',');
|
||||
}
|
||||
let localVarFormParams: any = {};
|
||||
|
||||
// verify required parameter 'uid' is not null or undefined
|
||||
if (uid === null || uid === undefined) {
|
||||
throw new Error('Required parameter uid was null or undefined when calling archivedWorkflowServiceResubmitArchivedWorkflow.');
|
||||
}
|
||||
|
||||
// verify required parameter 'body' is not null or undefined
|
||||
if (body === null || body === undefined) {
|
||||
throw new Error('Required parameter body was null or undefined when calling archivedWorkflowServiceResubmitArchivedWorkflow.');
|
||||
}
|
||||
|
||||
(<any>Object).assign(localVarHeaderParams, options.headers);
|
||||
|
||||
let localVarUseFormData = false;
|
||||
|
||||
let localVarRequestOptions: localVarRequest.Options = {
|
||||
method: 'PUT',
|
||||
qs: localVarQueryParameters,
|
||||
headers: localVarHeaderParams,
|
||||
uri: localVarPath,
|
||||
useQuerystring: this._useQuerystring,
|
||||
json: true,
|
||||
body: ObjectSerializer.serialize(body, "IoArgoprojWorkflowV1alpha1ResubmitArchivedWorkflowRequest")
|
||||
};
|
||||
|
||||
let authenticationPromise = Promise.resolve();
|
||||
if (this.authentications.BearerToken.apiKey) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
||||
|
||||
let interceptorPromise = authenticationPromise;
|
||||
for (const interceptor of this.interceptors) {
|
||||
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
||||
}
|
||||
|
||||
return interceptorPromise.then(() => {
|
||||
if (Object.keys(localVarFormParams).length) {
|
||||
if (localVarUseFormData) {
|
||||
(<any>localVarRequestOptions).formData = localVarFormParams;
|
||||
} else {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.IncomingMessage; body: IoArgoprojWorkflowV1alpha1Workflow; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
||||
body = ObjectSerializer.deserialize(body, "IoArgoprojWorkflowV1alpha1Workflow");
|
||||
resolve({ response: response, body: body });
|
||||
} else {
|
||||
reject(new HttpError(response, body, response.statusCode));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param uid
|
||||
* @param body
|
||||
*/
|
||||
public async archivedWorkflowServiceRetryArchivedWorkflow (uid: string, body: IoArgoprojWorkflowV1alpha1RetryArchivedWorkflowRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: IoArgoprojWorkflowV1alpha1Workflow; }> {
|
||||
const localVarPath = this.basePath + '/api/v1/archived-workflows/{uid}/retry'
|
||||
.replace('{' + 'uid' + '}', encodeURIComponent(String(uid)));
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
const produces = ['application/json'];
|
||||
// give precedence to 'application/json'
|
||||
if (produces.indexOf('application/json') >= 0) {
|
||||
localVarHeaderParams.Accept = 'application/json';
|
||||
} else {
|
||||
localVarHeaderParams.Accept = produces.join(',');
|
||||
}
|
||||
let localVarFormParams: any = {};
|
||||
|
||||
// verify required parameter 'uid' is not null or undefined
|
||||
if (uid === null || uid === undefined) {
|
||||
throw new Error('Required parameter uid was null or undefined when calling archivedWorkflowServiceRetryArchivedWorkflow.');
|
||||
}
|
||||
|
||||
// verify required parameter 'body' is not null or undefined
|
||||
if (body === null || body === undefined) {
|
||||
throw new Error('Required parameter body was null or undefined when calling archivedWorkflowServiceRetryArchivedWorkflow.');
|
||||
}
|
||||
|
||||
(<any>Object).assign(localVarHeaderParams, options.headers);
|
||||
|
||||
let localVarUseFormData = false;
|
||||
|
||||
let localVarRequestOptions: localVarRequest.Options = {
|
||||
method: 'PUT',
|
||||
qs: localVarQueryParameters,
|
||||
headers: localVarHeaderParams,
|
||||
uri: localVarPath,
|
||||
useQuerystring: this._useQuerystring,
|
||||
json: true,
|
||||
body: ObjectSerializer.serialize(body, "IoArgoprojWorkflowV1alpha1RetryArchivedWorkflowRequest")
|
||||
};
|
||||
|
||||
let authenticationPromise = Promise.resolve();
|
||||
if (this.authentications.BearerToken.apiKey) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
||||
|
||||
let interceptorPromise = authenticationPromise;
|
||||
for (const interceptor of this.interceptors) {
|
||||
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
||||
}
|
||||
|
||||
return interceptorPromise.then(() => {
|
||||
if (Object.keys(localVarFormParams).length) {
|
||||
if (localVarUseFormData) {
|
||||
(<any>localVarRequestOptions).formData = localVarFormParams;
|
||||
} else {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.IncomingMessage; body: IoArgoprojWorkflowV1alpha1Workflow; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
||||
body = ObjectSerializer.deserialize(body, "IoArgoprojWorkflowV1alpha1Workflow");
|
||||
resolve({ response: response, body: body });
|
||||
} else {
|
||||
reject(new HttpError(response, body, response.statusCode));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
|
@ -0,0 +1,558 @@
|
|||
// @ts-nocheck
|
||||
/**
|
||||
* Argo Workflows API
|
||||
* Argo Workflows is an open source container-native workflow engine for orchestrating parallel jobs on Kubernetes. For more information, please see https://argoproj.github.io/argo-workflows/
|
||||
*
|
||||
* The version of the OpenAPI document: VERSION
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
import localVarRequest from 'request';
|
||||
import http from 'http';
|
||||
|
||||
/* tslint:disable:no-unused-locals */
|
||||
import { GrpcGatewayRuntimeError } from '../model/grpcGatewayRuntimeError';
|
||||
|
||||
import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models';
|
||||
import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models';
|
||||
|
||||
import { HttpError, RequestFile } from './apis';
|
||||
|
||||
let defaultBasePath = 'http://localhost:2746';
|
||||
|
||||
// ===============================================
|
||||
// This file is autogenerated - Please do not edit
|
||||
// ===============================================
|
||||
|
||||
export enum ArtifactServiceApiApiKeys {
|
||||
BearerToken,
|
||||
}
|
||||
|
||||
export class ArtifactServiceApi {
|
||||
protected _basePath = defaultBasePath;
|
||||
protected _defaultHeaders : any = {};
|
||||
protected _useQuerystring : boolean = false;
|
||||
|
||||
protected authentications = {
|
||||
'default': <Authentication>new VoidAuth(),
|
||||
'BearerToken': new ApiKeyAuth('header', 'Authorization'),
|
||||
}
|
||||
|
||||
protected interceptors: Interceptor[] = [];
|
||||
|
||||
constructor(basePath?: string);
|
||||
constructor(basePathOrUsername: string, password?: string, basePath?: string) {
|
||||
if (password) {
|
||||
if (basePath) {
|
||||
this.basePath = basePath;
|
||||
}
|
||||
} else {
|
||||
if (basePathOrUsername) {
|
||||
this.basePath = basePathOrUsername
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
set useQuerystring(value: boolean) {
|
||||
this._useQuerystring = value;
|
||||
}
|
||||
|
||||
set basePath(basePath: string) {
|
||||
this._basePath = basePath;
|
||||
}
|
||||
|
||||
set defaultHeaders(defaultHeaders: any) {
|
||||
this._defaultHeaders = defaultHeaders;
|
||||
}
|
||||
|
||||
get defaultHeaders() {
|
||||
return this._defaultHeaders;
|
||||
}
|
||||
|
||||
get basePath() {
|
||||
return this._basePath;
|
||||
}
|
||||
|
||||
public setDefaultAuthentication(auth: Authentication) {
|
||||
this.authentications.default = auth;
|
||||
}
|
||||
|
||||
public setApiKey(key: ArtifactServiceApiApiKeys, value: string) {
|
||||
(this.authentications as any)[ArtifactServiceApiApiKeys[key]].apiKey = value;
|
||||
}
|
||||
|
||||
public addInterceptor(interceptor: Interceptor) {
|
||||
this.interceptors.push(interceptor);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @summary Get an artifact.
|
||||
* @param namespace
|
||||
* @param idDiscriminator
|
||||
* @param id
|
||||
* @param nodeId
|
||||
* @param artifactName
|
||||
* @param artifactDiscriminator
|
||||
*/
|
||||
public async artifactServiceGetArtifactFile (namespace: string, idDiscriminator: 'workflow' | 'archived-workflows ', id: string, nodeId: string, artifactName: string, artifactDiscriminator: 'outputs', options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Buffer; }> {
|
||||
const localVarPath = this.basePath + '/artifact-files/{namespace}/{idDiscriminator}/{id}/{nodeId}/{artifactDiscriminator}/{artifactName}'
|
||||
.replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)))
|
||||
.replace('{' + 'idDiscriminator' + '}', encodeURIComponent(String(idDiscriminator)))
|
||||
.replace('{' + 'id' + '}', encodeURIComponent(String(id)))
|
||||
.replace('{' + 'nodeId' + '}', encodeURIComponent(String(nodeId)))
|
||||
.replace('{' + 'artifactName' + '}', encodeURIComponent(String(artifactName)))
|
||||
.replace('{' + 'artifactDiscriminator' + '}', encodeURIComponent(String(artifactDiscriminator)));
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
const produces = ['application/json'];
|
||||
// give precedence to 'application/json'
|
||||
if (produces.indexOf('application/json') >= 0) {
|
||||
localVarHeaderParams.Accept = 'application/json';
|
||||
} else {
|
||||
localVarHeaderParams.Accept = produces.join(',');
|
||||
}
|
||||
let localVarFormParams: any = {};
|
||||
|
||||
// verify required parameter 'namespace' is not null or undefined
|
||||
if (namespace === null || namespace === undefined) {
|
||||
throw new Error('Required parameter namespace was null or undefined when calling artifactServiceGetArtifactFile.');
|
||||
}
|
||||
|
||||
// verify required parameter 'idDiscriminator' is not null or undefined
|
||||
if (idDiscriminator === null || idDiscriminator === undefined) {
|
||||
throw new Error('Required parameter idDiscriminator was null or undefined when calling artifactServiceGetArtifactFile.');
|
||||
}
|
||||
|
||||
// verify required parameter 'id' is not null or undefined
|
||||
if (id === null || id === undefined) {
|
||||
throw new Error('Required parameter id was null or undefined when calling artifactServiceGetArtifactFile.');
|
||||
}
|
||||
|
||||
// verify required parameter 'nodeId' is not null or undefined
|
||||
if (nodeId === null || nodeId === undefined) {
|
||||
throw new Error('Required parameter nodeId was null or undefined when calling artifactServiceGetArtifactFile.');
|
||||
}
|
||||
|
||||
// verify required parameter 'artifactName' is not null or undefined
|
||||
if (artifactName === null || artifactName === undefined) {
|
||||
throw new Error('Required parameter artifactName was null or undefined when calling artifactServiceGetArtifactFile.');
|
||||
}
|
||||
|
||||
// verify required parameter 'artifactDiscriminator' is not null or undefined
|
||||
if (artifactDiscriminator === null || artifactDiscriminator === undefined) {
|
||||
throw new Error('Required parameter artifactDiscriminator was null or undefined when calling artifactServiceGetArtifactFile.');
|
||||
}
|
||||
|
||||
(<any>Object).assign(localVarHeaderParams, options.headers);
|
||||
|
||||
let localVarUseFormData = false;
|
||||
|
||||
let localVarRequestOptions: localVarRequest.Options = {
|
||||
method: 'GET',
|
||||
qs: localVarQueryParameters,
|
||||
headers: localVarHeaderParams,
|
||||
uri: localVarPath,
|
||||
useQuerystring: this._useQuerystring,
|
||||
encoding: null,
|
||||
};
|
||||
|
||||
let authenticationPromise = Promise.resolve();
|
||||
if (this.authentications.BearerToken.apiKey) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
||||
|
||||
let interceptorPromise = authenticationPromise;
|
||||
for (const interceptor of this.interceptors) {
|
||||
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
||||
}
|
||||
|
||||
return interceptorPromise.then(() => {
|
||||
if (Object.keys(localVarFormParams).length) {
|
||||
if (localVarUseFormData) {
|
||||
(<any>localVarRequestOptions).formData = localVarFormParams;
|
||||
} else {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.IncomingMessage; body: Buffer; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
||||
body = ObjectSerializer.deserialize(body, "Buffer");
|
||||
resolve({ response: response, body: body });
|
||||
} else {
|
||||
reject(new HttpError(response, body, response.statusCode));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @summary Get an input artifact.
|
||||
* @param namespace
|
||||
* @param name
|
||||
* @param nodeId
|
||||
* @param artifactName
|
||||
*/
|
||||
public async artifactServiceGetInputArtifact (namespace: string, name: string, nodeId: string, artifactName: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Buffer; }> {
|
||||
const localVarPath = this.basePath + '/input-artifacts/{namespace}/{name}/{nodeId}/{artifactName}'
|
||||
.replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)))
|
||||
.replace('{' + 'name' + '}', encodeURIComponent(String(name)))
|
||||
.replace('{' + 'nodeId' + '}', encodeURIComponent(String(nodeId)))
|
||||
.replace('{' + 'artifactName' + '}', encodeURIComponent(String(artifactName)));
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
const produces = ['application/json'];
|
||||
// give precedence to 'application/json'
|
||||
if (produces.indexOf('application/json') >= 0) {
|
||||
localVarHeaderParams.Accept = 'application/json';
|
||||
} else {
|
||||
localVarHeaderParams.Accept = produces.join(',');
|
||||
}
|
||||
let localVarFormParams: any = {};
|
||||
|
||||
// verify required parameter 'namespace' is not null or undefined
|
||||
if (namespace === null || namespace === undefined) {
|
||||
throw new Error('Required parameter namespace was null or undefined when calling artifactServiceGetInputArtifact.');
|
||||
}
|
||||
|
||||
// verify required parameter 'name' is not null or undefined
|
||||
if (name === null || name === undefined) {
|
||||
throw new Error('Required parameter name was null or undefined when calling artifactServiceGetInputArtifact.');
|
||||
}
|
||||
|
||||
// verify required parameter 'nodeId' is not null or undefined
|
||||
if (nodeId === null || nodeId === undefined) {
|
||||
throw new Error('Required parameter nodeId was null or undefined when calling artifactServiceGetInputArtifact.');
|
||||
}
|
||||
|
||||
// verify required parameter 'artifactName' is not null or undefined
|
||||
if (artifactName === null || artifactName === undefined) {
|
||||
throw new Error('Required parameter artifactName was null or undefined when calling artifactServiceGetInputArtifact.');
|
||||
}
|
||||
|
||||
(<any>Object).assign(localVarHeaderParams, options.headers);
|
||||
|
||||
let localVarUseFormData = false;
|
||||
|
||||
let localVarRequestOptions: localVarRequest.Options = {
|
||||
method: 'GET',
|
||||
qs: localVarQueryParameters,
|
||||
headers: localVarHeaderParams,
|
||||
uri: localVarPath,
|
||||
useQuerystring: this._useQuerystring,
|
||||
encoding: null,
|
||||
};
|
||||
|
||||
let authenticationPromise = Promise.resolve();
|
||||
if (this.authentications.BearerToken.apiKey) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
||||
|
||||
let interceptorPromise = authenticationPromise;
|
||||
for (const interceptor of this.interceptors) {
|
||||
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
||||
}
|
||||
|
||||
return interceptorPromise.then(() => {
|
||||
if (Object.keys(localVarFormParams).length) {
|
||||
if (localVarUseFormData) {
|
||||
(<any>localVarRequestOptions).formData = localVarFormParams;
|
||||
} else {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.IncomingMessage; body: Buffer; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
||||
body = ObjectSerializer.deserialize(body, "Buffer");
|
||||
resolve({ response: response, body: body });
|
||||
} else {
|
||||
reject(new HttpError(response, body, response.statusCode));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @summary Get an input artifact by UID.
|
||||
* @param uid
|
||||
* @param nodeId
|
||||
* @param artifactName
|
||||
*/
|
||||
public async artifactServiceGetInputArtifactByUID (uid: string, nodeId: string, artifactName: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Buffer; }> {
|
||||
const localVarPath = this.basePath + '/input-artifacts-by-uid/{uid}/{nodeId}/{artifactName}'
|
||||
.replace('{' + 'uid' + '}', encodeURIComponent(String(uid)))
|
||||
.replace('{' + 'nodeId' + '}', encodeURIComponent(String(nodeId)))
|
||||
.replace('{' + 'artifactName' + '}', encodeURIComponent(String(artifactName)));
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
const produces = ['application/json'];
|
||||
// give precedence to 'application/json'
|
||||
if (produces.indexOf('application/json') >= 0) {
|
||||
localVarHeaderParams.Accept = 'application/json';
|
||||
} else {
|
||||
localVarHeaderParams.Accept = produces.join(',');
|
||||
}
|
||||
let localVarFormParams: any = {};
|
||||
|
||||
// verify required parameter 'uid' is not null or undefined
|
||||
if (uid === null || uid === undefined) {
|
||||
throw new Error('Required parameter uid was null or undefined when calling artifactServiceGetInputArtifactByUID.');
|
||||
}
|
||||
|
||||
// verify required parameter 'nodeId' is not null or undefined
|
||||
if (nodeId === null || nodeId === undefined) {
|
||||
throw new Error('Required parameter nodeId was null or undefined when calling artifactServiceGetInputArtifactByUID.');
|
||||
}
|
||||
|
||||
// verify required parameter 'artifactName' is not null or undefined
|
||||
if (artifactName === null || artifactName === undefined) {
|
||||
throw new Error('Required parameter artifactName was null or undefined when calling artifactServiceGetInputArtifactByUID.');
|
||||
}
|
||||
|
||||
(<any>Object).assign(localVarHeaderParams, options.headers);
|
||||
|
||||
let localVarUseFormData = false;
|
||||
|
||||
let localVarRequestOptions: localVarRequest.Options = {
|
||||
method: 'GET',
|
||||
qs: localVarQueryParameters,
|
||||
headers: localVarHeaderParams,
|
||||
uri: localVarPath,
|
||||
useQuerystring: this._useQuerystring,
|
||||
encoding: null,
|
||||
};
|
||||
|
||||
let authenticationPromise = Promise.resolve();
|
||||
if (this.authentications.BearerToken.apiKey) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
||||
|
||||
let interceptorPromise = authenticationPromise;
|
||||
for (const interceptor of this.interceptors) {
|
||||
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
||||
}
|
||||
|
||||
return interceptorPromise.then(() => {
|
||||
if (Object.keys(localVarFormParams).length) {
|
||||
if (localVarUseFormData) {
|
||||
(<any>localVarRequestOptions).formData = localVarFormParams;
|
||||
} else {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.IncomingMessage; body: Buffer; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
||||
body = ObjectSerializer.deserialize(body, "Buffer");
|
||||
resolve({ response: response, body: body });
|
||||
} else {
|
||||
reject(new HttpError(response, body, response.statusCode));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @summary Get an output artifact.
|
||||
* @param namespace
|
||||
* @param name
|
||||
* @param nodeId
|
||||
* @param artifactName
|
||||
*/
|
||||
public async artifactServiceGetOutputArtifact (namespace: string, name: string, nodeId: string, artifactName: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Buffer; }> {
|
||||
const localVarPath = this.basePath + '/artifacts/{namespace}/{name}/{nodeId}/{artifactName}'
|
||||
.replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)))
|
||||
.replace('{' + 'name' + '}', encodeURIComponent(String(name)))
|
||||
.replace('{' + 'nodeId' + '}', encodeURIComponent(String(nodeId)))
|
||||
.replace('{' + 'artifactName' + '}', encodeURIComponent(String(artifactName)));
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
const produces = ['application/json'];
|
||||
// give precedence to 'application/json'
|
||||
if (produces.indexOf('application/json') >= 0) {
|
||||
localVarHeaderParams.Accept = 'application/json';
|
||||
} else {
|
||||
localVarHeaderParams.Accept = produces.join(',');
|
||||
}
|
||||
let localVarFormParams: any = {};
|
||||
|
||||
// verify required parameter 'namespace' is not null or undefined
|
||||
if (namespace === null || namespace === undefined) {
|
||||
throw new Error('Required parameter namespace was null or undefined when calling artifactServiceGetOutputArtifact.');
|
||||
}
|
||||
|
||||
// verify required parameter 'name' is not null or undefined
|
||||
if (name === null || name === undefined) {
|
||||
throw new Error('Required parameter name was null or undefined when calling artifactServiceGetOutputArtifact.');
|
||||
}
|
||||
|
||||
// verify required parameter 'nodeId' is not null or undefined
|
||||
if (nodeId === null || nodeId === undefined) {
|
||||
throw new Error('Required parameter nodeId was null or undefined when calling artifactServiceGetOutputArtifact.');
|
||||
}
|
||||
|
||||
// verify required parameter 'artifactName' is not null or undefined
|
||||
if (artifactName === null || artifactName === undefined) {
|
||||
throw new Error('Required parameter artifactName was null or undefined when calling artifactServiceGetOutputArtifact.');
|
||||
}
|
||||
|
||||
(<any>Object).assign(localVarHeaderParams, options.headers);
|
||||
|
||||
let localVarUseFormData = false;
|
||||
|
||||
let localVarRequestOptions: localVarRequest.Options = {
|
||||
method: 'GET',
|
||||
qs: localVarQueryParameters,
|
||||
headers: localVarHeaderParams,
|
||||
uri: localVarPath,
|
||||
useQuerystring: this._useQuerystring,
|
||||
encoding: null,
|
||||
};
|
||||
|
||||
let authenticationPromise = Promise.resolve();
|
||||
if (this.authentications.BearerToken.apiKey) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
||||
|
||||
let interceptorPromise = authenticationPromise;
|
||||
for (const interceptor of this.interceptors) {
|
||||
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
||||
}
|
||||
|
||||
return interceptorPromise.then(() => {
|
||||
if (Object.keys(localVarFormParams).length) {
|
||||
if (localVarUseFormData) {
|
||||
(<any>localVarRequestOptions).formData = localVarFormParams;
|
||||
} else {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.IncomingMessage; body: Buffer; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
||||
body = ObjectSerializer.deserialize(body, "Buffer");
|
||||
resolve({ response: response, body: body });
|
||||
} else {
|
||||
reject(new HttpError(response, body, response.statusCode));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @summary Get an output artifact by UID.
|
||||
* @param uid
|
||||
* @param nodeId
|
||||
* @param artifactName
|
||||
*/
|
||||
public async artifactServiceGetOutputArtifactByUID (uid: string, nodeId: string, artifactName: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Buffer; }> {
|
||||
const localVarPath = this.basePath + '/artifacts-by-uid/{uid}/{nodeId}/{artifactName}'
|
||||
.replace('{' + 'uid' + '}', encodeURIComponent(String(uid)))
|
||||
.replace('{' + 'nodeId' + '}', encodeURIComponent(String(nodeId)))
|
||||
.replace('{' + 'artifactName' + '}', encodeURIComponent(String(artifactName)));
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
const produces = ['application/json'];
|
||||
// give precedence to 'application/json'
|
||||
if (produces.indexOf('application/json') >= 0) {
|
||||
localVarHeaderParams.Accept = 'application/json';
|
||||
} else {
|
||||
localVarHeaderParams.Accept = produces.join(',');
|
||||
}
|
||||
let localVarFormParams: any = {};
|
||||
|
||||
// verify required parameter 'uid' is not null or undefined
|
||||
if (uid === null || uid === undefined) {
|
||||
throw new Error('Required parameter uid was null or undefined when calling artifactServiceGetOutputArtifactByUID.');
|
||||
}
|
||||
|
||||
// verify required parameter 'nodeId' is not null or undefined
|
||||
if (nodeId === null || nodeId === undefined) {
|
||||
throw new Error('Required parameter nodeId was null or undefined when calling artifactServiceGetOutputArtifactByUID.');
|
||||
}
|
||||
|
||||
// verify required parameter 'artifactName' is not null or undefined
|
||||
if (artifactName === null || artifactName === undefined) {
|
||||
throw new Error('Required parameter artifactName was null or undefined when calling artifactServiceGetOutputArtifactByUID.');
|
||||
}
|
||||
|
||||
(<any>Object).assign(localVarHeaderParams, options.headers);
|
||||
|
||||
let localVarUseFormData = false;
|
||||
|
||||
let localVarRequestOptions: localVarRequest.Options = {
|
||||
method: 'GET',
|
||||
qs: localVarQueryParameters,
|
||||
headers: localVarHeaderParams,
|
||||
uri: localVarPath,
|
||||
useQuerystring: this._useQuerystring,
|
||||
encoding: null,
|
||||
};
|
||||
|
||||
let authenticationPromise = Promise.resolve();
|
||||
if (this.authentications.BearerToken.apiKey) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
||||
|
||||
let interceptorPromise = authenticationPromise;
|
||||
for (const interceptor of this.interceptors) {
|
||||
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
||||
}
|
||||
|
||||
return interceptorPromise.then(() => {
|
||||
if (Object.keys(localVarFormParams).length) {
|
||||
if (localVarUseFormData) {
|
||||
(<any>localVarRequestOptions).formData = localVarFormParams;
|
||||
} else {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.IncomingMessage; body: Buffer; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
||||
body = ObjectSerializer.deserialize(body, "Buffer");
|
||||
resolve({ response: response, body: body });
|
||||
} else {
|
||||
reject(new HttpError(response, body, response.statusCode));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
|
@ -0,0 +1,604 @@
|
|||
// @ts-nocheck
|
||||
/**
|
||||
* Argo Workflows API
|
||||
* Argo Workflows is an open source container-native workflow engine for orchestrating parallel jobs on Kubernetes. For more information, please see https://argoproj.github.io/argo-workflows/
|
||||
*
|
||||
* The version of the OpenAPI document: VERSION
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
import localVarRequest from 'request';
|
||||
import http from 'http';
|
||||
|
||||
/* tslint:disable:no-unused-locals */
|
||||
import { GrpcGatewayRuntimeError } from '../model/grpcGatewayRuntimeError';
|
||||
import { IoArgoprojWorkflowV1alpha1ClusterWorkflowTemplate } from '../model/ioArgoprojWorkflowV1alpha1ClusterWorkflowTemplate';
|
||||
import { IoArgoprojWorkflowV1alpha1ClusterWorkflowTemplateCreateRequest } from '../model/ioArgoprojWorkflowV1alpha1ClusterWorkflowTemplateCreateRequest';
|
||||
import { IoArgoprojWorkflowV1alpha1ClusterWorkflowTemplateLintRequest } from '../model/ioArgoprojWorkflowV1alpha1ClusterWorkflowTemplateLintRequest';
|
||||
import { IoArgoprojWorkflowV1alpha1ClusterWorkflowTemplateList } from '../model/ioArgoprojWorkflowV1alpha1ClusterWorkflowTemplateList';
|
||||
import { IoArgoprojWorkflowV1alpha1ClusterWorkflowTemplateUpdateRequest } from '../model/ioArgoprojWorkflowV1alpha1ClusterWorkflowTemplateUpdateRequest';
|
||||
|
||||
import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models';
|
||||
import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models';
|
||||
|
||||
import { HttpError, RequestFile } from './apis';
|
||||
|
||||
let defaultBasePath = 'http://localhost:2746';
|
||||
|
||||
// ===============================================
|
||||
// This file is autogenerated - Please do not edit
|
||||
// ===============================================
|
||||
|
||||
export enum ClusterWorkflowTemplateServiceApiApiKeys {
|
||||
BearerToken,
|
||||
}
|
||||
|
||||
export class ClusterWorkflowTemplateServiceApi {
|
||||
protected _basePath = defaultBasePath;
|
||||
protected _defaultHeaders : any = {};
|
||||
protected _useQuerystring : boolean = false;
|
||||
|
||||
protected authentications = {
|
||||
'default': <Authentication>new VoidAuth(),
|
||||
'BearerToken': new ApiKeyAuth('header', 'Authorization'),
|
||||
}
|
||||
|
||||
protected interceptors: Interceptor[] = [];
|
||||
|
||||
constructor(basePath?: string);
|
||||
constructor(basePathOrUsername: string, password?: string, basePath?: string) {
|
||||
if (password) {
|
||||
if (basePath) {
|
||||
this.basePath = basePath;
|
||||
}
|
||||
} else {
|
||||
if (basePathOrUsername) {
|
||||
this.basePath = basePathOrUsername
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
set useQuerystring(value: boolean) {
|
||||
this._useQuerystring = value;
|
||||
}
|
||||
|
||||
set basePath(basePath: string) {
|
||||
this._basePath = basePath;
|
||||
}
|
||||
|
||||
set defaultHeaders(defaultHeaders: any) {
|
||||
this._defaultHeaders = defaultHeaders;
|
||||
}
|
||||
|
||||
get defaultHeaders() {
|
||||
return this._defaultHeaders;
|
||||
}
|
||||
|
||||
get basePath() {
|
||||
return this._basePath;
|
||||
}
|
||||
|
||||
public setDefaultAuthentication(auth: Authentication) {
|
||||
this.authentications.default = auth;
|
||||
}
|
||||
|
||||
public setApiKey(key: ClusterWorkflowTemplateServiceApiApiKeys, value: string) {
|
||||
(this.authentications as any)[ClusterWorkflowTemplateServiceApiApiKeys[key]].apiKey = value;
|
||||
}
|
||||
|
||||
public addInterceptor(interceptor: Interceptor) {
|
||||
this.interceptors.push(interceptor);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param body
|
||||
*/
|
||||
public async clusterWorkflowTemplateServiceCreateClusterWorkflowTemplate (body: IoArgoprojWorkflowV1alpha1ClusterWorkflowTemplateCreateRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: IoArgoprojWorkflowV1alpha1ClusterWorkflowTemplate; }> {
|
||||
const localVarPath = this.basePath + '/api/v1/cluster-workflow-templates';
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
const produces = ['application/json'];
|
||||
// give precedence to 'application/json'
|
||||
if (produces.indexOf('application/json') >= 0) {
|
||||
localVarHeaderParams.Accept = 'application/json';
|
||||
} else {
|
||||
localVarHeaderParams.Accept = produces.join(',');
|
||||
}
|
||||
let localVarFormParams: any = {};
|
||||
|
||||
// verify required parameter 'body' is not null or undefined
|
||||
if (body === null || body === undefined) {
|
||||
throw new Error('Required parameter body was null or undefined when calling clusterWorkflowTemplateServiceCreateClusterWorkflowTemplate.');
|
||||
}
|
||||
|
||||
(<any>Object).assign(localVarHeaderParams, options.headers);
|
||||
|
||||
let localVarUseFormData = false;
|
||||
|
||||
let localVarRequestOptions: localVarRequest.Options = {
|
||||
method: 'POST',
|
||||
qs: localVarQueryParameters,
|
||||
headers: localVarHeaderParams,
|
||||
uri: localVarPath,
|
||||
useQuerystring: this._useQuerystring,
|
||||
json: true,
|
||||
body: ObjectSerializer.serialize(body, "IoArgoprojWorkflowV1alpha1ClusterWorkflowTemplateCreateRequest")
|
||||
};
|
||||
|
||||
let authenticationPromise = Promise.resolve();
|
||||
if (this.authentications.BearerToken.apiKey) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
||||
|
||||
let interceptorPromise = authenticationPromise;
|
||||
for (const interceptor of this.interceptors) {
|
||||
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
||||
}
|
||||
|
||||
return interceptorPromise.then(() => {
|
||||
if (Object.keys(localVarFormParams).length) {
|
||||
if (localVarUseFormData) {
|
||||
(<any>localVarRequestOptions).formData = localVarFormParams;
|
||||
} else {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.IncomingMessage; body: IoArgoprojWorkflowV1alpha1ClusterWorkflowTemplate; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
||||
body = ObjectSerializer.deserialize(body, "IoArgoprojWorkflowV1alpha1ClusterWorkflowTemplate");
|
||||
resolve({ response: response, body: body });
|
||||
} else {
|
||||
reject(new HttpError(response, body, response.statusCode));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param name
|
||||
* @param deleteOptionsGracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. +optional.
|
||||
* @param deleteOptionsPreconditionsUid Specifies the target UID. +optional.
|
||||
* @param deleteOptionsPreconditionsResourceVersion Specifies the target ResourceVersion +optional.
|
||||
* @param deleteOptionsOrphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. +optional.
|
||||
* @param deleteOptionsPropagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. +optional.
|
||||
* @param deleteOptionsDryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed +optional.
|
||||
*/
|
||||
public async clusterWorkflowTemplateServiceDeleteClusterWorkflowTemplate (name: string, deleteOptionsGracePeriodSeconds?: string, deleteOptionsPreconditionsUid?: string, deleteOptionsPreconditionsResourceVersion?: string, deleteOptionsOrphanDependents?: boolean, deleteOptionsPropagationPolicy?: string, deleteOptionsDryRun?: Array<string>, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: object; }> {
|
||||
const localVarPath = this.basePath + '/api/v1/cluster-workflow-templates/{name}'
|
||||
.replace('{' + 'name' + '}', encodeURIComponent(String(name)));
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
const produces = ['application/json'];
|
||||
// give precedence to 'application/json'
|
||||
if (produces.indexOf('application/json') >= 0) {
|
||||
localVarHeaderParams.Accept = 'application/json';
|
||||
} else {
|
||||
localVarHeaderParams.Accept = produces.join(',');
|
||||
}
|
||||
let localVarFormParams: any = {};
|
||||
|
||||
// verify required parameter 'name' is not null or undefined
|
||||
if (name === null || name === undefined) {
|
||||
throw new Error('Required parameter name was null or undefined when calling clusterWorkflowTemplateServiceDeleteClusterWorkflowTemplate.');
|
||||
}
|
||||
|
||||
if (deleteOptionsGracePeriodSeconds !== undefined) {
|
||||
localVarQueryParameters['deleteOptions.gracePeriodSeconds'] = ObjectSerializer.serialize(deleteOptionsGracePeriodSeconds, "string");
|
||||
}
|
||||
|
||||
if (deleteOptionsPreconditionsUid !== undefined) {
|
||||
localVarQueryParameters['deleteOptions.preconditions.uid'] = ObjectSerializer.serialize(deleteOptionsPreconditionsUid, "string");
|
||||
}
|
||||
|
||||
if (deleteOptionsPreconditionsResourceVersion !== undefined) {
|
||||
localVarQueryParameters['deleteOptions.preconditions.resourceVersion'] = ObjectSerializer.serialize(deleteOptionsPreconditionsResourceVersion, "string");
|
||||
}
|
||||
|
||||
if (deleteOptionsOrphanDependents !== undefined) {
|
||||
localVarQueryParameters['deleteOptions.orphanDependents'] = ObjectSerializer.serialize(deleteOptionsOrphanDependents, "boolean");
|
||||
}
|
||||
|
||||
if (deleteOptionsPropagationPolicy !== undefined) {
|
||||
localVarQueryParameters['deleteOptions.propagationPolicy'] = ObjectSerializer.serialize(deleteOptionsPropagationPolicy, "string");
|
||||
}
|
||||
|
||||
if (deleteOptionsDryRun !== undefined) {
|
||||
localVarQueryParameters['deleteOptions.dryRun'] = ObjectSerializer.serialize(deleteOptionsDryRun, "Array<string>");
|
||||
}
|
||||
|
||||
(<any>Object).assign(localVarHeaderParams, options.headers);
|
||||
|
||||
let localVarUseFormData = false;
|
||||
|
||||
let localVarRequestOptions: localVarRequest.Options = {
|
||||
method: 'DELETE',
|
||||
qs: localVarQueryParameters,
|
||||
headers: localVarHeaderParams,
|
||||
uri: localVarPath,
|
||||
useQuerystring: this._useQuerystring,
|
||||
json: true,
|
||||
};
|
||||
|
||||
let authenticationPromise = Promise.resolve();
|
||||
if (this.authentications.BearerToken.apiKey) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
||||
|
||||
let interceptorPromise = authenticationPromise;
|
||||
for (const interceptor of this.interceptors) {
|
||||
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
||||
}
|
||||
|
||||
return interceptorPromise.then(() => {
|
||||
if (Object.keys(localVarFormParams).length) {
|
||||
if (localVarUseFormData) {
|
||||
(<any>localVarRequestOptions).formData = localVarFormParams;
|
||||
} else {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.IncomingMessage; body: object; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
||||
body = ObjectSerializer.deserialize(body, "object");
|
||||
resolve({ response: response, body: body });
|
||||
} else {
|
||||
reject(new HttpError(response, body, response.statusCode));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param name
|
||||
* @param getOptionsResourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset +optional
|
||||
*/
|
||||
public async clusterWorkflowTemplateServiceGetClusterWorkflowTemplate (name: string, getOptionsResourceVersion?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: IoArgoprojWorkflowV1alpha1ClusterWorkflowTemplate; }> {
|
||||
const localVarPath = this.basePath + '/api/v1/cluster-workflow-templates/{name}'
|
||||
.replace('{' + 'name' + '}', encodeURIComponent(String(name)));
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
const produces = ['application/json'];
|
||||
// give precedence to 'application/json'
|
||||
if (produces.indexOf('application/json') >= 0) {
|
||||
localVarHeaderParams.Accept = 'application/json';
|
||||
} else {
|
||||
localVarHeaderParams.Accept = produces.join(',');
|
||||
}
|
||||
let localVarFormParams: any = {};
|
||||
|
||||
// verify required parameter 'name' is not null or undefined
|
||||
if (name === null || name === undefined) {
|
||||
throw new Error('Required parameter name was null or undefined when calling clusterWorkflowTemplateServiceGetClusterWorkflowTemplate.');
|
||||
}
|
||||
|
||||
if (getOptionsResourceVersion !== undefined) {
|
||||
localVarQueryParameters['getOptions.resourceVersion'] = ObjectSerializer.serialize(getOptionsResourceVersion, "string");
|
||||
}
|
||||
|
||||
(<any>Object).assign(localVarHeaderParams, options.headers);
|
||||
|
||||
let localVarUseFormData = false;
|
||||
|
||||
let localVarRequestOptions: localVarRequest.Options = {
|
||||
method: 'GET',
|
||||
qs: localVarQueryParameters,
|
||||
headers: localVarHeaderParams,
|
||||
uri: localVarPath,
|
||||
useQuerystring: this._useQuerystring,
|
||||
json: true,
|
||||
};
|
||||
|
||||
let authenticationPromise = Promise.resolve();
|
||||
if (this.authentications.BearerToken.apiKey) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
||||
|
||||
let interceptorPromise = authenticationPromise;
|
||||
for (const interceptor of this.interceptors) {
|
||||
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
||||
}
|
||||
|
||||
return interceptorPromise.then(() => {
|
||||
if (Object.keys(localVarFormParams).length) {
|
||||
if (localVarUseFormData) {
|
||||
(<any>localVarRequestOptions).formData = localVarFormParams;
|
||||
} else {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.IncomingMessage; body: IoArgoprojWorkflowV1alpha1ClusterWorkflowTemplate; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
||||
body = ObjectSerializer.deserialize(body, "IoArgoprojWorkflowV1alpha1ClusterWorkflowTemplate");
|
||||
resolve({ response: response, body: body });
|
||||
} else {
|
||||
reject(new HttpError(response, body, response.statusCode));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param body
|
||||
*/
|
||||
public async clusterWorkflowTemplateServiceLintClusterWorkflowTemplate (body: IoArgoprojWorkflowV1alpha1ClusterWorkflowTemplateLintRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: IoArgoprojWorkflowV1alpha1ClusterWorkflowTemplate; }> {
|
||||
const localVarPath = this.basePath + '/api/v1/cluster-workflow-templates/lint';
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
const produces = ['application/json'];
|
||||
// give precedence to 'application/json'
|
||||
if (produces.indexOf('application/json') >= 0) {
|
||||
localVarHeaderParams.Accept = 'application/json';
|
||||
} else {
|
||||
localVarHeaderParams.Accept = produces.join(',');
|
||||
}
|
||||
let localVarFormParams: any = {};
|
||||
|
||||
// verify required parameter 'body' is not null or undefined
|
||||
if (body === null || body === undefined) {
|
||||
throw new Error('Required parameter body was null or undefined when calling clusterWorkflowTemplateServiceLintClusterWorkflowTemplate.');
|
||||
}
|
||||
|
||||
(<any>Object).assign(localVarHeaderParams, options.headers);
|
||||
|
||||
let localVarUseFormData = false;
|
||||
|
||||
let localVarRequestOptions: localVarRequest.Options = {
|
||||
method: 'POST',
|
||||
qs: localVarQueryParameters,
|
||||
headers: localVarHeaderParams,
|
||||
uri: localVarPath,
|
||||
useQuerystring: this._useQuerystring,
|
||||
json: true,
|
||||
body: ObjectSerializer.serialize(body, "IoArgoprojWorkflowV1alpha1ClusterWorkflowTemplateLintRequest")
|
||||
};
|
||||
|
||||
let authenticationPromise = Promise.resolve();
|
||||
if (this.authentications.BearerToken.apiKey) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
||||
|
||||
let interceptorPromise = authenticationPromise;
|
||||
for (const interceptor of this.interceptors) {
|
||||
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
||||
}
|
||||
|
||||
return interceptorPromise.then(() => {
|
||||
if (Object.keys(localVarFormParams).length) {
|
||||
if (localVarUseFormData) {
|
||||
(<any>localVarRequestOptions).formData = localVarFormParams;
|
||||
} else {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.IncomingMessage; body: IoArgoprojWorkflowV1alpha1ClusterWorkflowTemplate; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
||||
body = ObjectSerializer.deserialize(body, "IoArgoprojWorkflowV1alpha1ClusterWorkflowTemplate");
|
||||
resolve({ response: response, body: body });
|
||||
} else {
|
||||
reject(new HttpError(response, body, response.statusCode));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param listOptionsLabelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. +optional.
|
||||
* @param listOptionsFieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. +optional.
|
||||
* @param listOptionsWatch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. +optional.
|
||||
* @param listOptionsAllowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. +optional.
|
||||
* @param listOptionsResourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset +optional
|
||||
* @param listOptionsResourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset +optional
|
||||
* @param listOptionsTimeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. +optional.
|
||||
* @param listOptionsLimit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.
|
||||
* @param listOptionsContinue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.
|
||||
*/
|
||||
public async clusterWorkflowTemplateServiceListClusterWorkflowTemplates (listOptionsLabelSelector?: string, listOptionsFieldSelector?: string, listOptionsWatch?: boolean, listOptionsAllowWatchBookmarks?: boolean, listOptionsResourceVersion?: string, listOptionsResourceVersionMatch?: string, listOptionsTimeoutSeconds?: string, listOptionsLimit?: string, listOptionsContinue?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: IoArgoprojWorkflowV1alpha1ClusterWorkflowTemplateList; }> {
|
||||
const localVarPath = this.basePath + '/api/v1/cluster-workflow-templates';
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
const produces = ['application/json'];
|
||||
// give precedence to 'application/json'
|
||||
if (produces.indexOf('application/json') >= 0) {
|
||||
localVarHeaderParams.Accept = 'application/json';
|
||||
} else {
|
||||
localVarHeaderParams.Accept = produces.join(',');
|
||||
}
|
||||
let localVarFormParams: any = {};
|
||||
|
||||
if (listOptionsLabelSelector !== undefined) {
|
||||
localVarQueryParameters['listOptions.labelSelector'] = ObjectSerializer.serialize(listOptionsLabelSelector, "string");
|
||||
}
|
||||
|
||||
if (listOptionsFieldSelector !== undefined) {
|
||||
localVarQueryParameters['listOptions.fieldSelector'] = ObjectSerializer.serialize(listOptionsFieldSelector, "string");
|
||||
}
|
||||
|
||||
if (listOptionsWatch !== undefined) {
|
||||
localVarQueryParameters['listOptions.watch'] = ObjectSerializer.serialize(listOptionsWatch, "boolean");
|
||||
}
|
||||
|
||||
if (listOptionsAllowWatchBookmarks !== undefined) {
|
||||
localVarQueryParameters['listOptions.allowWatchBookmarks'] = ObjectSerializer.serialize(listOptionsAllowWatchBookmarks, "boolean");
|
||||
}
|
||||
|
||||
if (listOptionsResourceVersion !== undefined) {
|
||||
localVarQueryParameters['listOptions.resourceVersion'] = ObjectSerializer.serialize(listOptionsResourceVersion, "string");
|
||||
}
|
||||
|
||||
if (listOptionsResourceVersionMatch !== undefined) {
|
||||
localVarQueryParameters['listOptions.resourceVersionMatch'] = ObjectSerializer.serialize(listOptionsResourceVersionMatch, "string");
|
||||
}
|
||||
|
||||
if (listOptionsTimeoutSeconds !== undefined) {
|
||||
localVarQueryParameters['listOptions.timeoutSeconds'] = ObjectSerializer.serialize(listOptionsTimeoutSeconds, "string");
|
||||
}
|
||||
|
||||
if (listOptionsLimit !== undefined) {
|
||||
localVarQueryParameters['listOptions.limit'] = ObjectSerializer.serialize(listOptionsLimit, "string");
|
||||
}
|
||||
|
||||
if (listOptionsContinue !== undefined) {
|
||||
localVarQueryParameters['listOptions.continue'] = ObjectSerializer.serialize(listOptionsContinue, "string");
|
||||
}
|
||||
|
||||
(<any>Object).assign(localVarHeaderParams, options.headers);
|
||||
|
||||
let localVarUseFormData = false;
|
||||
|
||||
let localVarRequestOptions: localVarRequest.Options = {
|
||||
method: 'GET',
|
||||
qs: localVarQueryParameters,
|
||||
headers: localVarHeaderParams,
|
||||
uri: localVarPath,
|
||||
useQuerystring: this._useQuerystring,
|
||||
json: true,
|
||||
};
|
||||
|
||||
let authenticationPromise = Promise.resolve();
|
||||
if (this.authentications.BearerToken.apiKey) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
||||
|
||||
let interceptorPromise = authenticationPromise;
|
||||
for (const interceptor of this.interceptors) {
|
||||
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
||||
}
|
||||
|
||||
return interceptorPromise.then(() => {
|
||||
if (Object.keys(localVarFormParams).length) {
|
||||
if (localVarUseFormData) {
|
||||
(<any>localVarRequestOptions).formData = localVarFormParams;
|
||||
} else {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.IncomingMessage; body: IoArgoprojWorkflowV1alpha1ClusterWorkflowTemplateList; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
||||
body = ObjectSerializer.deserialize(body, "IoArgoprojWorkflowV1alpha1ClusterWorkflowTemplateList");
|
||||
resolve({ response: response, body: body });
|
||||
} else {
|
||||
reject(new HttpError(response, body, response.statusCode));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param name DEPRECATED: This field is ignored.
|
||||
* @param body
|
||||
*/
|
||||
public async clusterWorkflowTemplateServiceUpdateClusterWorkflowTemplate (name: string, body: IoArgoprojWorkflowV1alpha1ClusterWorkflowTemplateUpdateRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: IoArgoprojWorkflowV1alpha1ClusterWorkflowTemplate; }> {
|
||||
const localVarPath = this.basePath + '/api/v1/cluster-workflow-templates/{name}'
|
||||
.replace('{' + 'name' + '}', encodeURIComponent(String(name)));
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
const produces = ['application/json'];
|
||||
// give precedence to 'application/json'
|
||||
if (produces.indexOf('application/json') >= 0) {
|
||||
localVarHeaderParams.Accept = 'application/json';
|
||||
} else {
|
||||
localVarHeaderParams.Accept = produces.join(',');
|
||||
}
|
||||
let localVarFormParams: any = {};
|
||||
|
||||
// verify required parameter 'name' is not null or undefined
|
||||
if (name === null || name === undefined) {
|
||||
throw new Error('Required parameter name was null or undefined when calling clusterWorkflowTemplateServiceUpdateClusterWorkflowTemplate.');
|
||||
}
|
||||
|
||||
// verify required parameter 'body' is not null or undefined
|
||||
if (body === null || body === undefined) {
|
||||
throw new Error('Required parameter body was null or undefined when calling clusterWorkflowTemplateServiceUpdateClusterWorkflowTemplate.');
|
||||
}
|
||||
|
||||
(<any>Object).assign(localVarHeaderParams, options.headers);
|
||||
|
||||
let localVarUseFormData = false;
|
||||
|
||||
let localVarRequestOptions: localVarRequest.Options = {
|
||||
method: 'PUT',
|
||||
qs: localVarQueryParameters,
|
||||
headers: localVarHeaderParams,
|
||||
uri: localVarPath,
|
||||
useQuerystring: this._useQuerystring,
|
||||
json: true,
|
||||
body: ObjectSerializer.serialize(body, "IoArgoprojWorkflowV1alpha1ClusterWorkflowTemplateUpdateRequest")
|
||||
};
|
||||
|
||||
let authenticationPromise = Promise.resolve();
|
||||
if (this.authentications.BearerToken.apiKey) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
||||
|
||||
let interceptorPromise = authenticationPromise;
|
||||
for (const interceptor of this.interceptors) {
|
||||
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
||||
}
|
||||
|
||||
return interceptorPromise.then(() => {
|
||||
if (Object.keys(localVarFormParams).length) {
|
||||
if (localVarUseFormData) {
|
||||
(<any>localVarRequestOptions).formData = localVarFormParams;
|
||||
} else {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.IncomingMessage; body: IoArgoprojWorkflowV1alpha1ClusterWorkflowTemplate; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
||||
body = ObjectSerializer.deserialize(body, "IoArgoprojWorkflowV1alpha1ClusterWorkflowTemplate");
|
||||
resolve({ response: response, body: body });
|
||||
} else {
|
||||
reject(new HttpError(response, body, response.statusCode));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
|
@ -0,0 +1,818 @@
|
|||
// @ts-nocheck
|
||||
/**
|
||||
* Argo Workflows API
|
||||
* Argo Workflows is an open source container-native workflow engine for orchestrating parallel jobs on Kubernetes. For more information, please see https://argoproj.github.io/argo-workflows/
|
||||
*
|
||||
* The version of the OpenAPI document: VERSION
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
import localVarRequest from 'request';
|
||||
import http from 'http';
|
||||
|
||||
/* tslint:disable:no-unused-locals */
|
||||
import { GrpcGatewayRuntimeError } from '../model/grpcGatewayRuntimeError';
|
||||
import { IoArgoprojWorkflowV1alpha1CreateCronWorkflowRequest } from '../model/ioArgoprojWorkflowV1alpha1CreateCronWorkflowRequest';
|
||||
import { IoArgoprojWorkflowV1alpha1CronWorkflow } from '../model/ioArgoprojWorkflowV1alpha1CronWorkflow';
|
||||
import { IoArgoprojWorkflowV1alpha1CronWorkflowList } from '../model/ioArgoprojWorkflowV1alpha1CronWorkflowList';
|
||||
import { IoArgoprojWorkflowV1alpha1CronWorkflowResumeRequest } from '../model/ioArgoprojWorkflowV1alpha1CronWorkflowResumeRequest';
|
||||
import { IoArgoprojWorkflowV1alpha1CronWorkflowSuspendRequest } from '../model/ioArgoprojWorkflowV1alpha1CronWorkflowSuspendRequest';
|
||||
import { IoArgoprojWorkflowV1alpha1LintCronWorkflowRequest } from '../model/ioArgoprojWorkflowV1alpha1LintCronWorkflowRequest';
|
||||
import { IoArgoprojWorkflowV1alpha1UpdateCronWorkflowRequest } from '../model/ioArgoprojWorkflowV1alpha1UpdateCronWorkflowRequest';
|
||||
|
||||
import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models';
|
||||
import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models';
|
||||
|
||||
import { HttpError, RequestFile } from './apis';
|
||||
|
||||
let defaultBasePath = 'http://localhost:2746';
|
||||
|
||||
// ===============================================
|
||||
// This file is autogenerated - Please do not edit
|
||||
// ===============================================
|
||||
|
||||
export enum CronWorkflowServiceApiApiKeys {
|
||||
BearerToken,
|
||||
}
|
||||
|
||||
export class CronWorkflowServiceApi {
|
||||
protected _basePath = defaultBasePath;
|
||||
protected _defaultHeaders : any = {};
|
||||
protected _useQuerystring : boolean = false;
|
||||
|
||||
protected authentications = {
|
||||
'default': <Authentication>new VoidAuth(),
|
||||
'BearerToken': new ApiKeyAuth('header', 'Authorization'),
|
||||
}
|
||||
|
||||
protected interceptors: Interceptor[] = [];
|
||||
|
||||
constructor(basePath?: string);
|
||||
constructor(basePathOrUsername: string, password?: string, basePath?: string) {
|
||||
if (password) {
|
||||
if (basePath) {
|
||||
this.basePath = basePath;
|
||||
}
|
||||
} else {
|
||||
if (basePathOrUsername) {
|
||||
this.basePath = basePathOrUsername
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
set useQuerystring(value: boolean) {
|
||||
this._useQuerystring = value;
|
||||
}
|
||||
|
||||
set basePath(basePath: string) {
|
||||
this._basePath = basePath;
|
||||
}
|
||||
|
||||
set defaultHeaders(defaultHeaders: any) {
|
||||
this._defaultHeaders = defaultHeaders;
|
||||
}
|
||||
|
||||
get defaultHeaders() {
|
||||
return this._defaultHeaders;
|
||||
}
|
||||
|
||||
get basePath() {
|
||||
return this._basePath;
|
||||
}
|
||||
|
||||
public setDefaultAuthentication(auth: Authentication) {
|
||||
this.authentications.default = auth;
|
||||
}
|
||||
|
||||
public setApiKey(key: CronWorkflowServiceApiApiKeys, value: string) {
|
||||
(this.authentications as any)[CronWorkflowServiceApiApiKeys[key]].apiKey = value;
|
||||
}
|
||||
|
||||
public addInterceptor(interceptor: Interceptor) {
|
||||
this.interceptors.push(interceptor);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param namespace
|
||||
* @param body
|
||||
*/
|
||||
public async cronWorkflowServiceCreateCronWorkflow (namespace: string, body: IoArgoprojWorkflowV1alpha1CreateCronWorkflowRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: IoArgoprojWorkflowV1alpha1CronWorkflow; }> {
|
||||
const localVarPath = this.basePath + '/api/v1/cron-workflows/{namespace}'
|
||||
.replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
const produces = ['application/json'];
|
||||
// give precedence to 'application/json'
|
||||
if (produces.indexOf('application/json') >= 0) {
|
||||
localVarHeaderParams.Accept = 'application/json';
|
||||
} else {
|
||||
localVarHeaderParams.Accept = produces.join(',');
|
||||
}
|
||||
let localVarFormParams: any = {};
|
||||
|
||||
// verify required parameter 'namespace' is not null or undefined
|
||||
if (namespace === null || namespace === undefined) {
|
||||
throw new Error('Required parameter namespace was null or undefined when calling cronWorkflowServiceCreateCronWorkflow.');
|
||||
}
|
||||
|
||||
// verify required parameter 'body' is not null or undefined
|
||||
if (body === null || body === undefined) {
|
||||
throw new Error('Required parameter body was null or undefined when calling cronWorkflowServiceCreateCronWorkflow.');
|
||||
}
|
||||
|
||||
(<any>Object).assign(localVarHeaderParams, options.headers);
|
||||
|
||||
let localVarUseFormData = false;
|
||||
|
||||
let localVarRequestOptions: localVarRequest.Options = {
|
||||
method: 'POST',
|
||||
qs: localVarQueryParameters,
|
||||
headers: localVarHeaderParams,
|
||||
uri: localVarPath,
|
||||
useQuerystring: this._useQuerystring,
|
||||
json: true,
|
||||
body: ObjectSerializer.serialize(body, "IoArgoprojWorkflowV1alpha1CreateCronWorkflowRequest")
|
||||
};
|
||||
|
||||
let authenticationPromise = Promise.resolve();
|
||||
if (this.authentications.BearerToken.apiKey) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
||||
|
||||
let interceptorPromise = authenticationPromise;
|
||||
for (const interceptor of this.interceptors) {
|
||||
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
||||
}
|
||||
|
||||
return interceptorPromise.then(() => {
|
||||
if (Object.keys(localVarFormParams).length) {
|
||||
if (localVarUseFormData) {
|
||||
(<any>localVarRequestOptions).formData = localVarFormParams;
|
||||
} else {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.IncomingMessage; body: IoArgoprojWorkflowV1alpha1CronWorkflow; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
||||
body = ObjectSerializer.deserialize(body, "IoArgoprojWorkflowV1alpha1CronWorkflow");
|
||||
resolve({ response: response, body: body });
|
||||
} else {
|
||||
reject(new HttpError(response, body, response.statusCode));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param namespace
|
||||
* @param name
|
||||
* @param deleteOptionsGracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. +optional.
|
||||
* @param deleteOptionsPreconditionsUid Specifies the target UID. +optional.
|
||||
* @param deleteOptionsPreconditionsResourceVersion Specifies the target ResourceVersion +optional.
|
||||
* @param deleteOptionsOrphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. +optional.
|
||||
* @param deleteOptionsPropagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. +optional.
|
||||
* @param deleteOptionsDryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed +optional.
|
||||
*/
|
||||
public async cronWorkflowServiceDeleteCronWorkflow (namespace: string, name: string, deleteOptionsGracePeriodSeconds?: string, deleteOptionsPreconditionsUid?: string, deleteOptionsPreconditionsResourceVersion?: string, deleteOptionsOrphanDependents?: boolean, deleteOptionsPropagationPolicy?: string, deleteOptionsDryRun?: Array<string>, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: object; }> {
|
||||
const localVarPath = this.basePath + '/api/v1/cron-workflows/{namespace}/{name}'
|
||||
.replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)))
|
||||
.replace('{' + 'name' + '}', encodeURIComponent(String(name)));
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
const produces = ['application/json'];
|
||||
// give precedence to 'application/json'
|
||||
if (produces.indexOf('application/json') >= 0) {
|
||||
localVarHeaderParams.Accept = 'application/json';
|
||||
} else {
|
||||
localVarHeaderParams.Accept = produces.join(',');
|
||||
}
|
||||
let localVarFormParams: any = {};
|
||||
|
||||
// verify required parameter 'namespace' is not null or undefined
|
||||
if (namespace === null || namespace === undefined) {
|
||||
throw new Error('Required parameter namespace was null or undefined when calling cronWorkflowServiceDeleteCronWorkflow.');
|
||||
}
|
||||
|
||||
// verify required parameter 'name' is not null or undefined
|
||||
if (name === null || name === undefined) {
|
||||
throw new Error('Required parameter name was null or undefined when calling cronWorkflowServiceDeleteCronWorkflow.');
|
||||
}
|
||||
|
||||
if (deleteOptionsGracePeriodSeconds !== undefined) {
|
||||
localVarQueryParameters['deleteOptions.gracePeriodSeconds'] = ObjectSerializer.serialize(deleteOptionsGracePeriodSeconds, "string");
|
||||
}
|
||||
|
||||
if (deleteOptionsPreconditionsUid !== undefined) {
|
||||
localVarQueryParameters['deleteOptions.preconditions.uid'] = ObjectSerializer.serialize(deleteOptionsPreconditionsUid, "string");
|
||||
}
|
||||
|
||||
if (deleteOptionsPreconditionsResourceVersion !== undefined) {
|
||||
localVarQueryParameters['deleteOptions.preconditions.resourceVersion'] = ObjectSerializer.serialize(deleteOptionsPreconditionsResourceVersion, "string");
|
||||
}
|
||||
|
||||
if (deleteOptionsOrphanDependents !== undefined) {
|
||||
localVarQueryParameters['deleteOptions.orphanDependents'] = ObjectSerializer.serialize(deleteOptionsOrphanDependents, "boolean");
|
||||
}
|
||||
|
||||
if (deleteOptionsPropagationPolicy !== undefined) {
|
||||
localVarQueryParameters['deleteOptions.propagationPolicy'] = ObjectSerializer.serialize(deleteOptionsPropagationPolicy, "string");
|
||||
}
|
||||
|
||||
if (deleteOptionsDryRun !== undefined) {
|
||||
localVarQueryParameters['deleteOptions.dryRun'] = ObjectSerializer.serialize(deleteOptionsDryRun, "Array<string>");
|
||||
}
|
||||
|
||||
(<any>Object).assign(localVarHeaderParams, options.headers);
|
||||
|
||||
let localVarUseFormData = false;
|
||||
|
||||
let localVarRequestOptions: localVarRequest.Options = {
|
||||
method: 'DELETE',
|
||||
qs: localVarQueryParameters,
|
||||
headers: localVarHeaderParams,
|
||||
uri: localVarPath,
|
||||
useQuerystring: this._useQuerystring,
|
||||
json: true,
|
||||
};
|
||||
|
||||
let authenticationPromise = Promise.resolve();
|
||||
if (this.authentications.BearerToken.apiKey) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
||||
|
||||
let interceptorPromise = authenticationPromise;
|
||||
for (const interceptor of this.interceptors) {
|
||||
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
||||
}
|
||||
|
||||
return interceptorPromise.then(() => {
|
||||
if (Object.keys(localVarFormParams).length) {
|
||||
if (localVarUseFormData) {
|
||||
(<any>localVarRequestOptions).formData = localVarFormParams;
|
||||
} else {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.IncomingMessage; body: object; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
||||
body = ObjectSerializer.deserialize(body, "object");
|
||||
resolve({ response: response, body: body });
|
||||
} else {
|
||||
reject(new HttpError(response, body, response.statusCode));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param namespace
|
||||
* @param name
|
||||
* @param getOptionsResourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset +optional
|
||||
*/
|
||||
public async cronWorkflowServiceGetCronWorkflow (namespace: string, name: string, getOptionsResourceVersion?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: IoArgoprojWorkflowV1alpha1CronWorkflow; }> {
|
||||
const localVarPath = this.basePath + '/api/v1/cron-workflows/{namespace}/{name}'
|
||||
.replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)))
|
||||
.replace('{' + 'name' + '}', encodeURIComponent(String(name)));
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
const produces = ['application/json'];
|
||||
// give precedence to 'application/json'
|
||||
if (produces.indexOf('application/json') >= 0) {
|
||||
localVarHeaderParams.Accept = 'application/json';
|
||||
} else {
|
||||
localVarHeaderParams.Accept = produces.join(',');
|
||||
}
|
||||
let localVarFormParams: any = {};
|
||||
|
||||
// verify required parameter 'namespace' is not null or undefined
|
||||
if (namespace === null || namespace === undefined) {
|
||||
throw new Error('Required parameter namespace was null or undefined when calling cronWorkflowServiceGetCronWorkflow.');
|
||||
}
|
||||
|
||||
// verify required parameter 'name' is not null or undefined
|
||||
if (name === null || name === undefined) {
|
||||
throw new Error('Required parameter name was null or undefined when calling cronWorkflowServiceGetCronWorkflow.');
|
||||
}
|
||||
|
||||
if (getOptionsResourceVersion !== undefined) {
|
||||
localVarQueryParameters['getOptions.resourceVersion'] = ObjectSerializer.serialize(getOptionsResourceVersion, "string");
|
||||
}
|
||||
|
||||
(<any>Object).assign(localVarHeaderParams, options.headers);
|
||||
|
||||
let localVarUseFormData = false;
|
||||
|
||||
let localVarRequestOptions: localVarRequest.Options = {
|
||||
method: 'GET',
|
||||
qs: localVarQueryParameters,
|
||||
headers: localVarHeaderParams,
|
||||
uri: localVarPath,
|
||||
useQuerystring: this._useQuerystring,
|
||||
json: true,
|
||||
};
|
||||
|
||||
let authenticationPromise = Promise.resolve();
|
||||
if (this.authentications.BearerToken.apiKey) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
||||
|
||||
let interceptorPromise = authenticationPromise;
|
||||
for (const interceptor of this.interceptors) {
|
||||
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
||||
}
|
||||
|
||||
return interceptorPromise.then(() => {
|
||||
if (Object.keys(localVarFormParams).length) {
|
||||
if (localVarUseFormData) {
|
||||
(<any>localVarRequestOptions).formData = localVarFormParams;
|
||||
} else {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.IncomingMessage; body: IoArgoprojWorkflowV1alpha1CronWorkflow; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
||||
body = ObjectSerializer.deserialize(body, "IoArgoprojWorkflowV1alpha1CronWorkflow");
|
||||
resolve({ response: response, body: body });
|
||||
} else {
|
||||
reject(new HttpError(response, body, response.statusCode));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param namespace
|
||||
* @param body
|
||||
*/
|
||||
public async cronWorkflowServiceLintCronWorkflow (namespace: string, body: IoArgoprojWorkflowV1alpha1LintCronWorkflowRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: IoArgoprojWorkflowV1alpha1CronWorkflow; }> {
|
||||
const localVarPath = this.basePath + '/api/v1/cron-workflows/{namespace}/lint'
|
||||
.replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
const produces = ['application/json'];
|
||||
// give precedence to 'application/json'
|
||||
if (produces.indexOf('application/json') >= 0) {
|
||||
localVarHeaderParams.Accept = 'application/json';
|
||||
} else {
|
||||
localVarHeaderParams.Accept = produces.join(',');
|
||||
}
|
||||
let localVarFormParams: any = {};
|
||||
|
||||
// verify required parameter 'namespace' is not null or undefined
|
||||
if (namespace === null || namespace === undefined) {
|
||||
throw new Error('Required parameter namespace was null or undefined when calling cronWorkflowServiceLintCronWorkflow.');
|
||||
}
|
||||
|
||||
// verify required parameter 'body' is not null or undefined
|
||||
if (body === null || body === undefined) {
|
||||
throw new Error('Required parameter body was null or undefined when calling cronWorkflowServiceLintCronWorkflow.');
|
||||
}
|
||||
|
||||
(<any>Object).assign(localVarHeaderParams, options.headers);
|
||||
|
||||
let localVarUseFormData = false;
|
||||
|
||||
let localVarRequestOptions: localVarRequest.Options = {
|
||||
method: 'POST',
|
||||
qs: localVarQueryParameters,
|
||||
headers: localVarHeaderParams,
|
||||
uri: localVarPath,
|
||||
useQuerystring: this._useQuerystring,
|
||||
json: true,
|
||||
body: ObjectSerializer.serialize(body, "IoArgoprojWorkflowV1alpha1LintCronWorkflowRequest")
|
||||
};
|
||||
|
||||
let authenticationPromise = Promise.resolve();
|
||||
if (this.authentications.BearerToken.apiKey) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
||||
|
||||
let interceptorPromise = authenticationPromise;
|
||||
for (const interceptor of this.interceptors) {
|
||||
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
||||
}
|
||||
|
||||
return interceptorPromise.then(() => {
|
||||
if (Object.keys(localVarFormParams).length) {
|
||||
if (localVarUseFormData) {
|
||||
(<any>localVarRequestOptions).formData = localVarFormParams;
|
||||
} else {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.IncomingMessage; body: IoArgoprojWorkflowV1alpha1CronWorkflow; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
||||
body = ObjectSerializer.deserialize(body, "IoArgoprojWorkflowV1alpha1CronWorkflow");
|
||||
resolve({ response: response, body: body });
|
||||
} else {
|
||||
reject(new HttpError(response, body, response.statusCode));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param namespace
|
||||
* @param listOptionsLabelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. +optional.
|
||||
* @param listOptionsFieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. +optional.
|
||||
* @param listOptionsWatch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. +optional.
|
||||
* @param listOptionsAllowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. +optional.
|
||||
* @param listOptionsResourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset +optional
|
||||
* @param listOptionsResourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset +optional
|
||||
* @param listOptionsTimeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. +optional.
|
||||
* @param listOptionsLimit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.
|
||||
* @param listOptionsContinue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.
|
||||
*/
|
||||
public async cronWorkflowServiceListCronWorkflows (namespace: string, listOptionsLabelSelector?: string, listOptionsFieldSelector?: string, listOptionsWatch?: boolean, listOptionsAllowWatchBookmarks?: boolean, listOptionsResourceVersion?: string, listOptionsResourceVersionMatch?: string, listOptionsTimeoutSeconds?: string, listOptionsLimit?: string, listOptionsContinue?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: IoArgoprojWorkflowV1alpha1CronWorkflowList; }> {
|
||||
const localVarPath = this.basePath + '/api/v1/cron-workflows/{namespace}'
|
||||
.replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
const produces = ['application/json'];
|
||||
// give precedence to 'application/json'
|
||||
if (produces.indexOf('application/json') >= 0) {
|
||||
localVarHeaderParams.Accept = 'application/json';
|
||||
} else {
|
||||
localVarHeaderParams.Accept = produces.join(',');
|
||||
}
|
||||
let localVarFormParams: any = {};
|
||||
|
||||
// verify required parameter 'namespace' is not null or undefined
|
||||
if (namespace === null || namespace === undefined) {
|
||||
throw new Error('Required parameter namespace was null or undefined when calling cronWorkflowServiceListCronWorkflows.');
|
||||
}
|
||||
|
||||
if (listOptionsLabelSelector !== undefined) {
|
||||
localVarQueryParameters['listOptions.labelSelector'] = ObjectSerializer.serialize(listOptionsLabelSelector, "string");
|
||||
}
|
||||
|
||||
if (listOptionsFieldSelector !== undefined) {
|
||||
localVarQueryParameters['listOptions.fieldSelector'] = ObjectSerializer.serialize(listOptionsFieldSelector, "string");
|
||||
}
|
||||
|
||||
if (listOptionsWatch !== undefined) {
|
||||
localVarQueryParameters['listOptions.watch'] = ObjectSerializer.serialize(listOptionsWatch, "boolean");
|
||||
}
|
||||
|
||||
if (listOptionsAllowWatchBookmarks !== undefined) {
|
||||
localVarQueryParameters['listOptions.allowWatchBookmarks'] = ObjectSerializer.serialize(listOptionsAllowWatchBookmarks, "boolean");
|
||||
}
|
||||
|
||||
if (listOptionsResourceVersion !== undefined) {
|
||||
localVarQueryParameters['listOptions.resourceVersion'] = ObjectSerializer.serialize(listOptionsResourceVersion, "string");
|
||||
}
|
||||
|
||||
if (listOptionsResourceVersionMatch !== undefined) {
|
||||
localVarQueryParameters['listOptions.resourceVersionMatch'] = ObjectSerializer.serialize(listOptionsResourceVersionMatch, "string");
|
||||
}
|
||||
|
||||
if (listOptionsTimeoutSeconds !== undefined) {
|
||||
localVarQueryParameters['listOptions.timeoutSeconds'] = ObjectSerializer.serialize(listOptionsTimeoutSeconds, "string");
|
||||
}
|
||||
|
||||
if (listOptionsLimit !== undefined) {
|
||||
localVarQueryParameters['listOptions.limit'] = ObjectSerializer.serialize(listOptionsLimit, "string");
|
||||
}
|
||||
|
||||
if (listOptionsContinue !== undefined) {
|
||||
localVarQueryParameters['listOptions.continue'] = ObjectSerializer.serialize(listOptionsContinue, "string");
|
||||
}
|
||||
|
||||
(<any>Object).assign(localVarHeaderParams, options.headers);
|
||||
|
||||
let localVarUseFormData = false;
|
||||
|
||||
let localVarRequestOptions: localVarRequest.Options = {
|
||||
method: 'GET',
|
||||
qs: localVarQueryParameters,
|
||||
headers: localVarHeaderParams,
|
||||
uri: localVarPath,
|
||||
useQuerystring: this._useQuerystring,
|
||||
json: true,
|
||||
};
|
||||
|
||||
let authenticationPromise = Promise.resolve();
|
||||
if (this.authentications.BearerToken.apiKey) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
||||
|
||||
let interceptorPromise = authenticationPromise;
|
||||
for (const interceptor of this.interceptors) {
|
||||
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
||||
}
|
||||
|
||||
return interceptorPromise.then(() => {
|
||||
if (Object.keys(localVarFormParams).length) {
|
||||
if (localVarUseFormData) {
|
||||
(<any>localVarRequestOptions).formData = localVarFormParams;
|
||||
} else {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.IncomingMessage; body: IoArgoprojWorkflowV1alpha1CronWorkflowList; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
||||
body = ObjectSerializer.deserialize(body, "IoArgoprojWorkflowV1alpha1CronWorkflowList");
|
||||
resolve({ response: response, body: body });
|
||||
} else {
|
||||
reject(new HttpError(response, body, response.statusCode));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param namespace
|
||||
* @param name
|
||||
* @param body
|
||||
*/
|
||||
public async cronWorkflowServiceResumeCronWorkflow (namespace: string, name: string, body: IoArgoprojWorkflowV1alpha1CronWorkflowResumeRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: IoArgoprojWorkflowV1alpha1CronWorkflow; }> {
|
||||
const localVarPath = this.basePath + '/api/v1/cron-workflows/{namespace}/{name}/resume'
|
||||
.replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)))
|
||||
.replace('{' + 'name' + '}', encodeURIComponent(String(name)));
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
const produces = ['application/json'];
|
||||
// give precedence to 'application/json'
|
||||
if (produces.indexOf('application/json') >= 0) {
|
||||
localVarHeaderParams.Accept = 'application/json';
|
||||
} else {
|
||||
localVarHeaderParams.Accept = produces.join(',');
|
||||
}
|
||||
let localVarFormParams: any = {};
|
||||
|
||||
// verify required parameter 'namespace' is not null or undefined
|
||||
if (namespace === null || namespace === undefined) {
|
||||
throw new Error('Required parameter namespace was null or undefined when calling cronWorkflowServiceResumeCronWorkflow.');
|
||||
}
|
||||
|
||||
// verify required parameter 'name' is not null or undefined
|
||||
if (name === null || name === undefined) {
|
||||
throw new Error('Required parameter name was null or undefined when calling cronWorkflowServiceResumeCronWorkflow.');
|
||||
}
|
||||
|
||||
// verify required parameter 'body' is not null or undefined
|
||||
if (body === null || body === undefined) {
|
||||
throw new Error('Required parameter body was null or undefined when calling cronWorkflowServiceResumeCronWorkflow.');
|
||||
}
|
||||
|
||||
(<any>Object).assign(localVarHeaderParams, options.headers);
|
||||
|
||||
let localVarUseFormData = false;
|
||||
|
||||
let localVarRequestOptions: localVarRequest.Options = {
|
||||
method: 'PUT',
|
||||
qs: localVarQueryParameters,
|
||||
headers: localVarHeaderParams,
|
||||
uri: localVarPath,
|
||||
useQuerystring: this._useQuerystring,
|
||||
json: true,
|
||||
body: ObjectSerializer.serialize(body, "IoArgoprojWorkflowV1alpha1CronWorkflowResumeRequest")
|
||||
};
|
||||
|
||||
let authenticationPromise = Promise.resolve();
|
||||
if (this.authentications.BearerToken.apiKey) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
||||
|
||||
let interceptorPromise = authenticationPromise;
|
||||
for (const interceptor of this.interceptors) {
|
||||
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
||||
}
|
||||
|
||||
return interceptorPromise.then(() => {
|
||||
if (Object.keys(localVarFormParams).length) {
|
||||
if (localVarUseFormData) {
|
||||
(<any>localVarRequestOptions).formData = localVarFormParams;
|
||||
} else {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.IncomingMessage; body: IoArgoprojWorkflowV1alpha1CronWorkflow; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
||||
body = ObjectSerializer.deserialize(body, "IoArgoprojWorkflowV1alpha1CronWorkflow");
|
||||
resolve({ response: response, body: body });
|
||||
} else {
|
||||
reject(new HttpError(response, body, response.statusCode));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param namespace
|
||||
* @param name
|
||||
* @param body
|
||||
*/
|
||||
public async cronWorkflowServiceSuspendCronWorkflow (namespace: string, name: string, body: IoArgoprojWorkflowV1alpha1CronWorkflowSuspendRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: IoArgoprojWorkflowV1alpha1CronWorkflow; }> {
|
||||
const localVarPath = this.basePath + '/api/v1/cron-workflows/{namespace}/{name}/suspend'
|
||||
.replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)))
|
||||
.replace('{' + 'name' + '}', encodeURIComponent(String(name)));
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
const produces = ['application/json'];
|
||||
// give precedence to 'application/json'
|
||||
if (produces.indexOf('application/json') >= 0) {
|
||||
localVarHeaderParams.Accept = 'application/json';
|
||||
} else {
|
||||
localVarHeaderParams.Accept = produces.join(',');
|
||||
}
|
||||
let localVarFormParams: any = {};
|
||||
|
||||
// verify required parameter 'namespace' is not null or undefined
|
||||
if (namespace === null || namespace === undefined) {
|
||||
throw new Error('Required parameter namespace was null or undefined when calling cronWorkflowServiceSuspendCronWorkflow.');
|
||||
}
|
||||
|
||||
// verify required parameter 'name' is not null or undefined
|
||||
if (name === null || name === undefined) {
|
||||
throw new Error('Required parameter name was null or undefined when calling cronWorkflowServiceSuspendCronWorkflow.');
|
||||
}
|
||||
|
||||
// verify required parameter 'body' is not null or undefined
|
||||
if (body === null || body === undefined) {
|
||||
throw new Error('Required parameter body was null or undefined when calling cronWorkflowServiceSuspendCronWorkflow.');
|
||||
}
|
||||
|
||||
(<any>Object).assign(localVarHeaderParams, options.headers);
|
||||
|
||||
let localVarUseFormData = false;
|
||||
|
||||
let localVarRequestOptions: localVarRequest.Options = {
|
||||
method: 'PUT',
|
||||
qs: localVarQueryParameters,
|
||||
headers: localVarHeaderParams,
|
||||
uri: localVarPath,
|
||||
useQuerystring: this._useQuerystring,
|
||||
json: true,
|
||||
body: ObjectSerializer.serialize(body, "IoArgoprojWorkflowV1alpha1CronWorkflowSuspendRequest")
|
||||
};
|
||||
|
||||
let authenticationPromise = Promise.resolve();
|
||||
if (this.authentications.BearerToken.apiKey) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
||||
|
||||
let interceptorPromise = authenticationPromise;
|
||||
for (const interceptor of this.interceptors) {
|
||||
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
||||
}
|
||||
|
||||
return interceptorPromise.then(() => {
|
||||
if (Object.keys(localVarFormParams).length) {
|
||||
if (localVarUseFormData) {
|
||||
(<any>localVarRequestOptions).formData = localVarFormParams;
|
||||
} else {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.IncomingMessage; body: IoArgoprojWorkflowV1alpha1CronWorkflow; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
||||
body = ObjectSerializer.deserialize(body, "IoArgoprojWorkflowV1alpha1CronWorkflow");
|
||||
resolve({ response: response, body: body });
|
||||
} else {
|
||||
reject(new HttpError(response, body, response.statusCode));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param namespace
|
||||
* @param name DEPRECATED: This field is ignored.
|
||||
* @param body
|
||||
*/
|
||||
public async cronWorkflowServiceUpdateCronWorkflow (namespace: string, name: string, body: IoArgoprojWorkflowV1alpha1UpdateCronWorkflowRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: IoArgoprojWorkflowV1alpha1CronWorkflow; }> {
|
||||
const localVarPath = this.basePath + '/api/v1/cron-workflows/{namespace}/{name}'
|
||||
.replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)))
|
||||
.replace('{' + 'name' + '}', encodeURIComponent(String(name)));
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
const produces = ['application/json'];
|
||||
// give precedence to 'application/json'
|
||||
if (produces.indexOf('application/json') >= 0) {
|
||||
localVarHeaderParams.Accept = 'application/json';
|
||||
} else {
|
||||
localVarHeaderParams.Accept = produces.join(',');
|
||||
}
|
||||
let localVarFormParams: any = {};
|
||||
|
||||
// verify required parameter 'namespace' is not null or undefined
|
||||
if (namespace === null || namespace === undefined) {
|
||||
throw new Error('Required parameter namespace was null or undefined when calling cronWorkflowServiceUpdateCronWorkflow.');
|
||||
}
|
||||
|
||||
// verify required parameter 'name' is not null or undefined
|
||||
if (name === null || name === undefined) {
|
||||
throw new Error('Required parameter name was null or undefined when calling cronWorkflowServiceUpdateCronWorkflow.');
|
||||
}
|
||||
|
||||
// verify required parameter 'body' is not null or undefined
|
||||
if (body === null || body === undefined) {
|
||||
throw new Error('Required parameter body was null or undefined when calling cronWorkflowServiceUpdateCronWorkflow.');
|
||||
}
|
||||
|
||||
(<any>Object).assign(localVarHeaderParams, options.headers);
|
||||
|
||||
let localVarUseFormData = false;
|
||||
|
||||
let localVarRequestOptions: localVarRequest.Options = {
|
||||
method: 'PUT',
|
||||
qs: localVarQueryParameters,
|
||||
headers: localVarHeaderParams,
|
||||
uri: localVarPath,
|
||||
useQuerystring: this._useQuerystring,
|
||||
json: true,
|
||||
body: ObjectSerializer.serialize(body, "IoArgoprojWorkflowV1alpha1UpdateCronWorkflowRequest")
|
||||
};
|
||||
|
||||
let authenticationPromise = Promise.resolve();
|
||||
if (this.authentications.BearerToken.apiKey) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
||||
|
||||
let interceptorPromise = authenticationPromise;
|
||||
for (const interceptor of this.interceptors) {
|
||||
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
||||
}
|
||||
|
||||
return interceptorPromise.then(() => {
|
||||
if (Object.keys(localVarFormParams).length) {
|
||||
if (localVarUseFormData) {
|
||||
(<any>localVarRequestOptions).formData = localVarFormParams;
|
||||
} else {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.IncomingMessage; body: IoArgoprojWorkflowV1alpha1CronWorkflow; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
||||
body = ObjectSerializer.deserialize(body, "IoArgoprojWorkflowV1alpha1CronWorkflow");
|
||||
resolve({ response: response, body: body });
|
||||
} else {
|
||||
reject(new HttpError(response, body, response.statusCode));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
295
plugins/argo-workflows/src/api/generated/api/eventServiceApi.ts
Normal file
295
plugins/argo-workflows/src/api/generated/api/eventServiceApi.ts
Normal file
|
@ -0,0 +1,295 @@
|
|||
// @ts-nocheck
|
||||
/**
|
||||
* Argo Workflows API
|
||||
* Argo Workflows is an open source container-native workflow engine for orchestrating parallel jobs on Kubernetes. For more information, please see https://argoproj.github.io/argo-workflows/
|
||||
*
|
||||
* The version of the OpenAPI document: VERSION
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
import localVarRequest from 'request';
|
||||
import http from 'http';
|
||||
|
||||
/* tslint:disable:no-unused-locals */
|
||||
import { GrpcGatewayRuntimeError } from '../model/grpcGatewayRuntimeError';
|
||||
import { IoArgoprojWorkflowV1alpha1WorkflowEventBindingList } from '../model/ioArgoprojWorkflowV1alpha1WorkflowEventBindingList';
|
||||
|
||||
import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models';
|
||||
import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models';
|
||||
|
||||
import { HttpError, RequestFile } from './apis';
|
||||
|
||||
let defaultBasePath = 'http://localhost:2746';
|
||||
|
||||
// ===============================================
|
||||
// This file is autogenerated - Please do not edit
|
||||
// ===============================================
|
||||
|
||||
export enum EventServiceApiApiKeys {
|
||||
BearerToken,
|
||||
}
|
||||
|
||||
export class EventServiceApi {
|
||||
protected _basePath = defaultBasePath;
|
||||
protected _defaultHeaders : any = {};
|
||||
protected _useQuerystring : boolean = false;
|
||||
|
||||
protected authentications = {
|
||||
'default': <Authentication>new VoidAuth(),
|
||||
'BearerToken': new ApiKeyAuth('header', 'Authorization'),
|
||||
}
|
||||
|
||||
protected interceptors: Interceptor[] = [];
|
||||
|
||||
constructor(basePath?: string);
|
||||
constructor(basePathOrUsername: string, password?: string, basePath?: string) {
|
||||
if (password) {
|
||||
if (basePath) {
|
||||
this.basePath = basePath;
|
||||
}
|
||||
} else {
|
||||
if (basePathOrUsername) {
|
||||
this.basePath = basePathOrUsername
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
set useQuerystring(value: boolean) {
|
||||
this._useQuerystring = value;
|
||||
}
|
||||
|
||||
set basePath(basePath: string) {
|
||||
this._basePath = basePath;
|
||||
}
|
||||
|
||||
set defaultHeaders(defaultHeaders: any) {
|
||||
this._defaultHeaders = defaultHeaders;
|
||||
}
|
||||
|
||||
get defaultHeaders() {
|
||||
return this._defaultHeaders;
|
||||
}
|
||||
|
||||
get basePath() {
|
||||
return this._basePath;
|
||||
}
|
||||
|
||||
public setDefaultAuthentication(auth: Authentication) {
|
||||
this.authentications.default = auth;
|
||||
}
|
||||
|
||||
public setApiKey(key: EventServiceApiApiKeys, value: string) {
|
||||
(this.authentications as any)[EventServiceApiApiKeys[key]].apiKey = value;
|
||||
}
|
||||
|
||||
public addInterceptor(interceptor: Interceptor) {
|
||||
this.interceptors.push(interceptor);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param namespace
|
||||
* @param listOptionsLabelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. +optional.
|
||||
* @param listOptionsFieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. +optional.
|
||||
* @param listOptionsWatch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. +optional.
|
||||
* @param listOptionsAllowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. +optional.
|
||||
* @param listOptionsResourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset +optional
|
||||
* @param listOptionsResourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset +optional
|
||||
* @param listOptionsTimeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. +optional.
|
||||
* @param listOptionsLimit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.
|
||||
* @param listOptionsContinue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.
|
||||
*/
|
||||
public async eventServiceListWorkflowEventBindings (namespace: string, listOptionsLabelSelector?: string, listOptionsFieldSelector?: string, listOptionsWatch?: boolean, listOptionsAllowWatchBookmarks?: boolean, listOptionsResourceVersion?: string, listOptionsResourceVersionMatch?: string, listOptionsTimeoutSeconds?: string, listOptionsLimit?: string, listOptionsContinue?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: IoArgoprojWorkflowV1alpha1WorkflowEventBindingList; }> {
|
||||
const localVarPath = this.basePath + '/api/v1/workflow-event-bindings/{namespace}'
|
||||
.replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
const produces = ['application/json'];
|
||||
// give precedence to 'application/json'
|
||||
if (produces.indexOf('application/json') >= 0) {
|
||||
localVarHeaderParams.Accept = 'application/json';
|
||||
} else {
|
||||
localVarHeaderParams.Accept = produces.join(',');
|
||||
}
|
||||
let localVarFormParams: any = {};
|
||||
|
||||
// verify required parameter 'namespace' is not null or undefined
|
||||
if (namespace === null || namespace === undefined) {
|
||||
throw new Error('Required parameter namespace was null or undefined when calling eventServiceListWorkflowEventBindings.');
|
||||
}
|
||||
|
||||
if (listOptionsLabelSelector !== undefined) {
|
||||
localVarQueryParameters['listOptions.labelSelector'] = ObjectSerializer.serialize(listOptionsLabelSelector, "string");
|
||||
}
|
||||
|
||||
if (listOptionsFieldSelector !== undefined) {
|
||||
localVarQueryParameters['listOptions.fieldSelector'] = ObjectSerializer.serialize(listOptionsFieldSelector, "string");
|
||||
}
|
||||
|
||||
if (listOptionsWatch !== undefined) {
|
||||
localVarQueryParameters['listOptions.watch'] = ObjectSerializer.serialize(listOptionsWatch, "boolean");
|
||||
}
|
||||
|
||||
if (listOptionsAllowWatchBookmarks !== undefined) {
|
||||
localVarQueryParameters['listOptions.allowWatchBookmarks'] = ObjectSerializer.serialize(listOptionsAllowWatchBookmarks, "boolean");
|
||||
}
|
||||
|
||||
if (listOptionsResourceVersion !== undefined) {
|
||||
localVarQueryParameters['listOptions.resourceVersion'] = ObjectSerializer.serialize(listOptionsResourceVersion, "string");
|
||||
}
|
||||
|
||||
if (listOptionsResourceVersionMatch !== undefined) {
|
||||
localVarQueryParameters['listOptions.resourceVersionMatch'] = ObjectSerializer.serialize(listOptionsResourceVersionMatch, "string");
|
||||
}
|
||||
|
||||
if (listOptionsTimeoutSeconds !== undefined) {
|
||||
localVarQueryParameters['listOptions.timeoutSeconds'] = ObjectSerializer.serialize(listOptionsTimeoutSeconds, "string");
|
||||
}
|
||||
|
||||
if (listOptionsLimit !== undefined) {
|
||||
localVarQueryParameters['listOptions.limit'] = ObjectSerializer.serialize(listOptionsLimit, "string");
|
||||
}
|
||||
|
||||
if (listOptionsContinue !== undefined) {
|
||||
localVarQueryParameters['listOptions.continue'] = ObjectSerializer.serialize(listOptionsContinue, "string");
|
||||
}
|
||||
|
||||
(<any>Object).assign(localVarHeaderParams, options.headers);
|
||||
|
||||
let localVarUseFormData = false;
|
||||
|
||||
let localVarRequestOptions: localVarRequest.Options = {
|
||||
method: 'GET',
|
||||
qs: localVarQueryParameters,
|
||||
headers: localVarHeaderParams,
|
||||
uri: localVarPath,
|
||||
useQuerystring: this._useQuerystring,
|
||||
json: true,
|
||||
};
|
||||
|
||||
let authenticationPromise = Promise.resolve();
|
||||
if (this.authentications.BearerToken.apiKey) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
||||
|
||||
let interceptorPromise = authenticationPromise;
|
||||
for (const interceptor of this.interceptors) {
|
||||
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
||||
}
|
||||
|
||||
return interceptorPromise.then(() => {
|
||||
if (Object.keys(localVarFormParams).length) {
|
||||
if (localVarUseFormData) {
|
||||
(<any>localVarRequestOptions).formData = localVarFormParams;
|
||||
} else {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.IncomingMessage; body: IoArgoprojWorkflowV1alpha1WorkflowEventBindingList; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
||||
body = ObjectSerializer.deserialize(body, "IoArgoprojWorkflowV1alpha1WorkflowEventBindingList");
|
||||
resolve({ response: response, body: body });
|
||||
} else {
|
||||
reject(new HttpError(response, body, response.statusCode));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param namespace The namespace for the io.argoproj.workflow.v1alpha1. This can be empty if the client has cluster scoped permissions. If empty, then the event is \"broadcast\" to workflow event binding in all namespaces.
|
||||
* @param discriminator Optional discriminator for the io.argoproj.workflow.v1alpha1. This should almost always be empty. Used for edge-cases where the event payload alone is not provide enough information to discriminate the event. This MUST NOT be used as security mechanism, e.g. to allow two clients to use the same access token, or to support webhooks on unsecured server. Instead, use access tokens. This is made available as `discriminator` in the event binding selector (`/spec/event/selector)`
|
||||
* @param body The event itself can be any data.
|
||||
*/
|
||||
public async eventServiceReceiveEvent (namespace: string, discriminator: string, body: object, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: object; }> {
|
||||
const localVarPath = this.basePath + '/api/v1/events/{namespace}/{discriminator}'
|
||||
.replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)))
|
||||
.replace('{' + 'discriminator' + '}', encodeURIComponent(String(discriminator)));
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
const produces = ['application/json'];
|
||||
// give precedence to 'application/json'
|
||||
if (produces.indexOf('application/json') >= 0) {
|
||||
localVarHeaderParams.Accept = 'application/json';
|
||||
} else {
|
||||
localVarHeaderParams.Accept = produces.join(',');
|
||||
}
|
||||
let localVarFormParams: any = {};
|
||||
|
||||
// verify required parameter 'namespace' is not null or undefined
|
||||
if (namespace === null || namespace === undefined) {
|
||||
throw new Error('Required parameter namespace was null or undefined when calling eventServiceReceiveEvent.');
|
||||
}
|
||||
|
||||
// verify required parameter 'discriminator' is not null or undefined
|
||||
if (discriminator === null || discriminator === undefined) {
|
||||
throw new Error('Required parameter discriminator was null or undefined when calling eventServiceReceiveEvent.');
|
||||
}
|
||||
|
||||
// verify required parameter 'body' is not null or undefined
|
||||
if (body === null || body === undefined) {
|
||||
throw new Error('Required parameter body was null or undefined when calling eventServiceReceiveEvent.');
|
||||
}
|
||||
|
||||
(<any>Object).assign(localVarHeaderParams, options.headers);
|
||||
|
||||
let localVarUseFormData = false;
|
||||
|
||||
let localVarRequestOptions: localVarRequest.Options = {
|
||||
method: 'POST',
|
||||
qs: localVarQueryParameters,
|
||||
headers: localVarHeaderParams,
|
||||
uri: localVarPath,
|
||||
useQuerystring: this._useQuerystring,
|
||||
json: true,
|
||||
body: ObjectSerializer.serialize(body, "object")
|
||||
};
|
||||
|
||||
let authenticationPromise = Promise.resolve();
|
||||
if (this.authentications.BearerToken.apiKey) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
||||
|
||||
let interceptorPromise = authenticationPromise;
|
||||
for (const interceptor of this.interceptors) {
|
||||
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
||||
}
|
||||
|
||||
return interceptorPromise.then(() => {
|
||||
if (Object.keys(localVarFormParams).length) {
|
||||
if (localVarUseFormData) {
|
||||
(<any>localVarRequestOptions).formData = localVarFormParams;
|
||||
} else {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.IncomingMessage; body: object; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
||||
body = ObjectSerializer.deserialize(body, "object");
|
||||
resolve({ response: response, body: body });
|
||||
} else {
|
||||
reject(new HttpError(response, body, response.statusCode));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
|
@ -0,0 +1,821 @@
|
|||
// @ts-nocheck
|
||||
/**
|
||||
* Argo Workflows API
|
||||
* Argo Workflows is an open source container-native workflow engine for orchestrating parallel jobs on Kubernetes. For more information, please see https://argoproj.github.io/argo-workflows/
|
||||
*
|
||||
* The version of the OpenAPI document: VERSION
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
import localVarRequest from 'request';
|
||||
import http from 'http';
|
||||
|
||||
/* tslint:disable:no-unused-locals */
|
||||
import { EventsourceCreateEventSourceRequest } from '../model/eventsourceCreateEventSourceRequest';
|
||||
import { EventsourceUpdateEventSourceRequest } from '../model/eventsourceUpdateEventSourceRequest';
|
||||
import { GrpcGatewayRuntimeError } from '../model/grpcGatewayRuntimeError';
|
||||
import { IoArgoprojEventsV1alpha1EventSource } from '../model/ioArgoprojEventsV1alpha1EventSource';
|
||||
import { IoArgoprojEventsV1alpha1EventSourceList } from '../model/ioArgoprojEventsV1alpha1EventSourceList';
|
||||
import { StreamResultOfEventsourceEventSourceWatchEvent } from '../model/streamResultOfEventsourceEventSourceWatchEvent';
|
||||
import { StreamResultOfEventsourceLogEntry } from '../model/streamResultOfEventsourceLogEntry';
|
||||
|
||||
import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models';
|
||||
import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models';
|
||||
|
||||
import { HttpError, RequestFile } from './apis';
|
||||
|
||||
let defaultBasePath = 'http://localhost:2746';
|
||||
|
||||
// ===============================================
|
||||
// This file is autogenerated - Please do not edit
|
||||
// ===============================================
|
||||
|
||||
export enum EventSourceServiceApiApiKeys {
|
||||
BearerToken,
|
||||
}
|
||||
|
||||
export class EventSourceServiceApi {
|
||||
protected _basePath = defaultBasePath;
|
||||
protected _defaultHeaders : any = {};
|
||||
protected _useQuerystring : boolean = false;
|
||||
|
||||
protected authentications = {
|
||||
'default': <Authentication>new VoidAuth(),
|
||||
'BearerToken': new ApiKeyAuth('header', 'Authorization'),
|
||||
}
|
||||
|
||||
protected interceptors: Interceptor[] = [];
|
||||
|
||||
constructor(basePath?: string);
|
||||
constructor(basePathOrUsername: string, password?: string, basePath?: string) {
|
||||
if (password) {
|
||||
if (basePath) {
|
||||
this.basePath = basePath;
|
||||
}
|
||||
} else {
|
||||
if (basePathOrUsername) {
|
||||
this.basePath = basePathOrUsername
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
set useQuerystring(value: boolean) {
|
||||
this._useQuerystring = value;
|
||||
}
|
||||
|
||||
set basePath(basePath: string) {
|
||||
this._basePath = basePath;
|
||||
}
|
||||
|
||||
set defaultHeaders(defaultHeaders: any) {
|
||||
this._defaultHeaders = defaultHeaders;
|
||||
}
|
||||
|
||||
get defaultHeaders() {
|
||||
return this._defaultHeaders;
|
||||
}
|
||||
|
||||
get basePath() {
|
||||
return this._basePath;
|
||||
}
|
||||
|
||||
public setDefaultAuthentication(auth: Authentication) {
|
||||
this.authentications.default = auth;
|
||||
}
|
||||
|
||||
public setApiKey(key: EventSourceServiceApiApiKeys, value: string) {
|
||||
(this.authentications as any)[EventSourceServiceApiApiKeys[key]].apiKey = value;
|
||||
}
|
||||
|
||||
public addInterceptor(interceptor: Interceptor) {
|
||||
this.interceptors.push(interceptor);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param namespace
|
||||
* @param body
|
||||
*/
|
||||
public async eventSourceServiceCreateEventSource (namespace: string, body: EventsourceCreateEventSourceRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: IoArgoprojEventsV1alpha1EventSource; }> {
|
||||
const localVarPath = this.basePath + '/api/v1/event-sources/{namespace}'
|
||||
.replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
const produces = ['application/json'];
|
||||
// give precedence to 'application/json'
|
||||
if (produces.indexOf('application/json') >= 0) {
|
||||
localVarHeaderParams.Accept = 'application/json';
|
||||
} else {
|
||||
localVarHeaderParams.Accept = produces.join(',');
|
||||
}
|
||||
let localVarFormParams: any = {};
|
||||
|
||||
// verify required parameter 'namespace' is not null or undefined
|
||||
if (namespace === null || namespace === undefined) {
|
||||
throw new Error('Required parameter namespace was null or undefined when calling eventSourceServiceCreateEventSource.');
|
||||
}
|
||||
|
||||
// verify required parameter 'body' is not null or undefined
|
||||
if (body === null || body === undefined) {
|
||||
throw new Error('Required parameter body was null or undefined when calling eventSourceServiceCreateEventSource.');
|
||||
}
|
||||
|
||||
(<any>Object).assign(localVarHeaderParams, options.headers);
|
||||
|
||||
let localVarUseFormData = false;
|
||||
|
||||
let localVarRequestOptions: localVarRequest.Options = {
|
||||
method: 'POST',
|
||||
qs: localVarQueryParameters,
|
||||
headers: localVarHeaderParams,
|
||||
uri: localVarPath,
|
||||
useQuerystring: this._useQuerystring,
|
||||
json: true,
|
||||
body: ObjectSerializer.serialize(body, "EventsourceCreateEventSourceRequest")
|
||||
};
|
||||
|
||||
let authenticationPromise = Promise.resolve();
|
||||
if (this.authentications.BearerToken.apiKey) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
||||
|
||||
let interceptorPromise = authenticationPromise;
|
||||
for (const interceptor of this.interceptors) {
|
||||
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
||||
}
|
||||
|
||||
return interceptorPromise.then(() => {
|
||||
if (Object.keys(localVarFormParams).length) {
|
||||
if (localVarUseFormData) {
|
||||
(<any>localVarRequestOptions).formData = localVarFormParams;
|
||||
} else {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.IncomingMessage; body: IoArgoprojEventsV1alpha1EventSource; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
||||
body = ObjectSerializer.deserialize(body, "IoArgoprojEventsV1alpha1EventSource");
|
||||
resolve({ response: response, body: body });
|
||||
} else {
|
||||
reject(new HttpError(response, body, response.statusCode));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param namespace
|
||||
* @param name
|
||||
* @param deleteOptionsGracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. +optional.
|
||||
* @param deleteOptionsPreconditionsUid Specifies the target UID. +optional.
|
||||
* @param deleteOptionsPreconditionsResourceVersion Specifies the target ResourceVersion +optional.
|
||||
* @param deleteOptionsOrphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. +optional.
|
||||
* @param deleteOptionsPropagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. +optional.
|
||||
* @param deleteOptionsDryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed +optional.
|
||||
*/
|
||||
public async eventSourceServiceDeleteEventSource (namespace: string, name: string, deleteOptionsGracePeriodSeconds?: string, deleteOptionsPreconditionsUid?: string, deleteOptionsPreconditionsResourceVersion?: string, deleteOptionsOrphanDependents?: boolean, deleteOptionsPropagationPolicy?: string, deleteOptionsDryRun?: Array<string>, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: object; }> {
|
||||
const localVarPath = this.basePath + '/api/v1/event-sources/{namespace}/{name}'
|
||||
.replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)))
|
||||
.replace('{' + 'name' + '}', encodeURIComponent(String(name)));
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
const produces = ['application/json'];
|
||||
// give precedence to 'application/json'
|
||||
if (produces.indexOf('application/json') >= 0) {
|
||||
localVarHeaderParams.Accept = 'application/json';
|
||||
} else {
|
||||
localVarHeaderParams.Accept = produces.join(',');
|
||||
}
|
||||
let localVarFormParams: any = {};
|
||||
|
||||
// verify required parameter 'namespace' is not null or undefined
|
||||
if (namespace === null || namespace === undefined) {
|
||||
throw new Error('Required parameter namespace was null or undefined when calling eventSourceServiceDeleteEventSource.');
|
||||
}
|
||||
|
||||
// verify required parameter 'name' is not null or undefined
|
||||
if (name === null || name === undefined) {
|
||||
throw new Error('Required parameter name was null or undefined when calling eventSourceServiceDeleteEventSource.');
|
||||
}
|
||||
|
||||
if (deleteOptionsGracePeriodSeconds !== undefined) {
|
||||
localVarQueryParameters['deleteOptions.gracePeriodSeconds'] = ObjectSerializer.serialize(deleteOptionsGracePeriodSeconds, "string");
|
||||
}
|
||||
|
||||
if (deleteOptionsPreconditionsUid !== undefined) {
|
||||
localVarQueryParameters['deleteOptions.preconditions.uid'] = ObjectSerializer.serialize(deleteOptionsPreconditionsUid, "string");
|
||||
}
|
||||
|
||||
if (deleteOptionsPreconditionsResourceVersion !== undefined) {
|
||||
localVarQueryParameters['deleteOptions.preconditions.resourceVersion'] = ObjectSerializer.serialize(deleteOptionsPreconditionsResourceVersion, "string");
|
||||
}
|
||||
|
||||
if (deleteOptionsOrphanDependents !== undefined) {
|
||||
localVarQueryParameters['deleteOptions.orphanDependents'] = ObjectSerializer.serialize(deleteOptionsOrphanDependents, "boolean");
|
||||
}
|
||||
|
||||
if (deleteOptionsPropagationPolicy !== undefined) {
|
||||
localVarQueryParameters['deleteOptions.propagationPolicy'] = ObjectSerializer.serialize(deleteOptionsPropagationPolicy, "string");
|
||||
}
|
||||
|
||||
if (deleteOptionsDryRun !== undefined) {
|
||||
localVarQueryParameters['deleteOptions.dryRun'] = ObjectSerializer.serialize(deleteOptionsDryRun, "Array<string>");
|
||||
}
|
||||
|
||||
(<any>Object).assign(localVarHeaderParams, options.headers);
|
||||
|
||||
let localVarUseFormData = false;
|
||||
|
||||
let localVarRequestOptions: localVarRequest.Options = {
|
||||
method: 'DELETE',
|
||||
qs: localVarQueryParameters,
|
||||
headers: localVarHeaderParams,
|
||||
uri: localVarPath,
|
||||
useQuerystring: this._useQuerystring,
|
||||
json: true,
|
||||
};
|
||||
|
||||
let authenticationPromise = Promise.resolve();
|
||||
if (this.authentications.BearerToken.apiKey) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
||||
|
||||
let interceptorPromise = authenticationPromise;
|
||||
for (const interceptor of this.interceptors) {
|
||||
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
||||
}
|
||||
|
||||
return interceptorPromise.then(() => {
|
||||
if (Object.keys(localVarFormParams).length) {
|
||||
if (localVarUseFormData) {
|
||||
(<any>localVarRequestOptions).formData = localVarFormParams;
|
||||
} else {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.IncomingMessage; body: object; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
||||
body = ObjectSerializer.deserialize(body, "object");
|
||||
resolve({ response: response, body: body });
|
||||
} else {
|
||||
reject(new HttpError(response, body, response.statusCode));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param namespace
|
||||
* @param name optional - only return entries for this event source.
|
||||
* @param eventSourceType optional - only return entries for this event source type (e.g. `webhook`).
|
||||
* @param eventName optional - only return entries for this event name (e.g. `example`).
|
||||
* @param grep optional - only return entries where `msg` matches this regular expression.
|
||||
* @param podLogOptionsContainer The container for which to stream logs. Defaults to only container if there is one container in the pod. +optional.
|
||||
* @param podLogOptionsFollow Follow the log stream of the pod. Defaults to false. +optional.
|
||||
* @param podLogOptionsPrevious Return previous terminated container logs. Defaults to false. +optional.
|
||||
* @param podLogOptionsSinceSeconds A relative time in seconds before the current time from which to show logs. If this value precedes the time a pod was started, only logs since the pod start will be returned. If this value is in the future, no logs will be returned. Only one of sinceSeconds or sinceTime may be specified. +optional.
|
||||
* @param podLogOptionsSinceTimeSeconds Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive.
|
||||
* @param podLogOptionsSinceTimeNanos Non-negative fractions of a second at nanosecond resolution. Negative second values with fractions must still have non-negative nanos values that count forward in time. Must be from 0 to 999,999,999 inclusive. This field may be limited in precision depending on context.
|
||||
* @param podLogOptionsTimestamps If true, add an RFC3339 or RFC3339Nano timestamp at the beginning of every line of log output. Defaults to false. +optional.
|
||||
* @param podLogOptionsTailLines If set, the number of lines from the end of the logs to show. If not specified, logs are shown from the creation of the container or sinceSeconds or sinceTime +optional.
|
||||
* @param podLogOptionsLimitBytes If set, the number of bytes to read from the server before terminating the log output. This may not display a complete final line of logging, and may return slightly more or slightly less than the specified limit. +optional.
|
||||
* @param podLogOptionsInsecureSkipTLSVerifyBackend insecureSkipTLSVerifyBackend indicates that the apiserver should not confirm the validity of the serving certificate of the backend it is connecting to. This will make the HTTPS connection between the apiserver and the backend insecure. This means the apiserver cannot verify the log data it is receiving came from the real kubelet. If the kubelet is configured to verify the apiserver\'s TLS credentials, it does not mean the connection to the real kubelet is vulnerable to a man in the middle attack (e.g. an attacker could not intercept the actual log data coming from the real kubelet). +optional.
|
||||
*/
|
||||
public async eventSourceServiceEventSourcesLogs (namespace: string, name?: string, eventSourceType?: string, eventName?: string, grep?: string, podLogOptionsContainer?: string, podLogOptionsFollow?: boolean, podLogOptionsPrevious?: boolean, podLogOptionsSinceSeconds?: string, podLogOptionsSinceTimeSeconds?: string, podLogOptionsSinceTimeNanos?: number, podLogOptionsTimestamps?: boolean, podLogOptionsTailLines?: string, podLogOptionsLimitBytes?: string, podLogOptionsInsecureSkipTLSVerifyBackend?: boolean, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: StreamResultOfEventsourceLogEntry; }> {
|
||||
const localVarPath = this.basePath + '/api/v1/stream/event-sources/{namespace}/logs'
|
||||
.replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
const produces = ['application/json'];
|
||||
// give precedence to 'application/json'
|
||||
if (produces.indexOf('application/json') >= 0) {
|
||||
localVarHeaderParams.Accept = 'application/json';
|
||||
} else {
|
||||
localVarHeaderParams.Accept = produces.join(',');
|
||||
}
|
||||
let localVarFormParams: any = {};
|
||||
|
||||
// verify required parameter 'namespace' is not null or undefined
|
||||
if (namespace === null || namespace === undefined) {
|
||||
throw new Error('Required parameter namespace was null or undefined when calling eventSourceServiceEventSourcesLogs.');
|
||||
}
|
||||
|
||||
if (name !== undefined) {
|
||||
localVarQueryParameters['name'] = ObjectSerializer.serialize(name, "string");
|
||||
}
|
||||
|
||||
if (eventSourceType !== undefined) {
|
||||
localVarQueryParameters['eventSourceType'] = ObjectSerializer.serialize(eventSourceType, "string");
|
||||
}
|
||||
|
||||
if (eventName !== undefined) {
|
||||
localVarQueryParameters['eventName'] = ObjectSerializer.serialize(eventName, "string");
|
||||
}
|
||||
|
||||
if (grep !== undefined) {
|
||||
localVarQueryParameters['grep'] = ObjectSerializer.serialize(grep, "string");
|
||||
}
|
||||
|
||||
if (podLogOptionsContainer !== undefined) {
|
||||
localVarQueryParameters['podLogOptions.container'] = ObjectSerializer.serialize(podLogOptionsContainer, "string");
|
||||
}
|
||||
|
||||
if (podLogOptionsFollow !== undefined) {
|
||||
localVarQueryParameters['podLogOptions.follow'] = ObjectSerializer.serialize(podLogOptionsFollow, "boolean");
|
||||
}
|
||||
|
||||
if (podLogOptionsPrevious !== undefined) {
|
||||
localVarQueryParameters['podLogOptions.previous'] = ObjectSerializer.serialize(podLogOptionsPrevious, "boolean");
|
||||
}
|
||||
|
||||
if (podLogOptionsSinceSeconds !== undefined) {
|
||||
localVarQueryParameters['podLogOptions.sinceSeconds'] = ObjectSerializer.serialize(podLogOptionsSinceSeconds, "string");
|
||||
}
|
||||
|
||||
if (podLogOptionsSinceTimeSeconds !== undefined) {
|
||||
localVarQueryParameters['podLogOptions.sinceTime.seconds'] = ObjectSerializer.serialize(podLogOptionsSinceTimeSeconds, "string");
|
||||
}
|
||||
|
||||
if (podLogOptionsSinceTimeNanos !== undefined) {
|
||||
localVarQueryParameters['podLogOptions.sinceTime.nanos'] = ObjectSerializer.serialize(podLogOptionsSinceTimeNanos, "number");
|
||||
}
|
||||
|
||||
if (podLogOptionsTimestamps !== undefined) {
|
||||
localVarQueryParameters['podLogOptions.timestamps'] = ObjectSerializer.serialize(podLogOptionsTimestamps, "boolean");
|
||||
}
|
||||
|
||||
if (podLogOptionsTailLines !== undefined) {
|
||||
localVarQueryParameters['podLogOptions.tailLines'] = ObjectSerializer.serialize(podLogOptionsTailLines, "string");
|
||||
}
|
||||
|
||||
if (podLogOptionsLimitBytes !== undefined) {
|
||||
localVarQueryParameters['podLogOptions.limitBytes'] = ObjectSerializer.serialize(podLogOptionsLimitBytes, "string");
|
||||
}
|
||||
|
||||
if (podLogOptionsInsecureSkipTLSVerifyBackend !== undefined) {
|
||||
localVarQueryParameters['podLogOptions.insecureSkipTLSVerifyBackend'] = ObjectSerializer.serialize(podLogOptionsInsecureSkipTLSVerifyBackend, "boolean");
|
||||
}
|
||||
|
||||
(<any>Object).assign(localVarHeaderParams, options.headers);
|
||||
|
||||
let localVarUseFormData = false;
|
||||
|
||||
let localVarRequestOptions: localVarRequest.Options = {
|
||||
method: 'GET',
|
||||
qs: localVarQueryParameters,
|
||||
headers: localVarHeaderParams,
|
||||
uri: localVarPath,
|
||||
useQuerystring: this._useQuerystring,
|
||||
json: true,
|
||||
};
|
||||
|
||||
let authenticationPromise = Promise.resolve();
|
||||
if (this.authentications.BearerToken.apiKey) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
||||
|
||||
let interceptorPromise = authenticationPromise;
|
||||
for (const interceptor of this.interceptors) {
|
||||
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
||||
}
|
||||
|
||||
return interceptorPromise.then(() => {
|
||||
if (Object.keys(localVarFormParams).length) {
|
||||
if (localVarUseFormData) {
|
||||
(<any>localVarRequestOptions).formData = localVarFormParams;
|
||||
} else {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.IncomingMessage; body: StreamResultOfEventsourceLogEntry; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
||||
body = ObjectSerializer.deserialize(body, "StreamResultOfEventsourceLogEntry");
|
||||
resolve({ response: response, body: body });
|
||||
} else {
|
||||
reject(new HttpError(response, body, response.statusCode));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param namespace
|
||||
* @param name
|
||||
*/
|
||||
public async eventSourceServiceGetEventSource (namespace: string, name: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: IoArgoprojEventsV1alpha1EventSource; }> {
|
||||
const localVarPath = this.basePath + '/api/v1/event-sources/{namespace}/{name}'
|
||||
.replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)))
|
||||
.replace('{' + 'name' + '}', encodeURIComponent(String(name)));
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
const produces = ['application/json'];
|
||||
// give precedence to 'application/json'
|
||||
if (produces.indexOf('application/json') >= 0) {
|
||||
localVarHeaderParams.Accept = 'application/json';
|
||||
} else {
|
||||
localVarHeaderParams.Accept = produces.join(',');
|
||||
}
|
||||
let localVarFormParams: any = {};
|
||||
|
||||
// verify required parameter 'namespace' is not null or undefined
|
||||
if (namespace === null || namespace === undefined) {
|
||||
throw new Error('Required parameter namespace was null or undefined when calling eventSourceServiceGetEventSource.');
|
||||
}
|
||||
|
||||
// verify required parameter 'name' is not null or undefined
|
||||
if (name === null || name === undefined) {
|
||||
throw new Error('Required parameter name was null or undefined when calling eventSourceServiceGetEventSource.');
|
||||
}
|
||||
|
||||
(<any>Object).assign(localVarHeaderParams, options.headers);
|
||||
|
||||
let localVarUseFormData = false;
|
||||
|
||||
let localVarRequestOptions: localVarRequest.Options = {
|
||||
method: 'GET',
|
||||
qs: localVarQueryParameters,
|
||||
headers: localVarHeaderParams,
|
||||
uri: localVarPath,
|
||||
useQuerystring: this._useQuerystring,
|
||||
json: true,
|
||||
};
|
||||
|
||||
let authenticationPromise = Promise.resolve();
|
||||
if (this.authentications.BearerToken.apiKey) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
||||
|
||||
let interceptorPromise = authenticationPromise;
|
||||
for (const interceptor of this.interceptors) {
|
||||
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
||||
}
|
||||
|
||||
return interceptorPromise.then(() => {
|
||||
if (Object.keys(localVarFormParams).length) {
|
||||
if (localVarUseFormData) {
|
||||
(<any>localVarRequestOptions).formData = localVarFormParams;
|
||||
} else {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.IncomingMessage; body: IoArgoprojEventsV1alpha1EventSource; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
||||
body = ObjectSerializer.deserialize(body, "IoArgoprojEventsV1alpha1EventSource");
|
||||
resolve({ response: response, body: body });
|
||||
} else {
|
||||
reject(new HttpError(response, body, response.statusCode));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param namespace
|
||||
* @param listOptionsLabelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. +optional.
|
||||
* @param listOptionsFieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. +optional.
|
||||
* @param listOptionsWatch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. +optional.
|
||||
* @param listOptionsAllowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. +optional.
|
||||
* @param listOptionsResourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset +optional
|
||||
* @param listOptionsResourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset +optional
|
||||
* @param listOptionsTimeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. +optional.
|
||||
* @param listOptionsLimit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.
|
||||
* @param listOptionsContinue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.
|
||||
*/
|
||||
public async eventSourceServiceListEventSources (namespace: string, listOptionsLabelSelector?: string, listOptionsFieldSelector?: string, listOptionsWatch?: boolean, listOptionsAllowWatchBookmarks?: boolean, listOptionsResourceVersion?: string, listOptionsResourceVersionMatch?: string, listOptionsTimeoutSeconds?: string, listOptionsLimit?: string, listOptionsContinue?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: IoArgoprojEventsV1alpha1EventSourceList; }> {
|
||||
const localVarPath = this.basePath + '/api/v1/event-sources/{namespace}'
|
||||
.replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
const produces = ['application/json'];
|
||||
// give precedence to 'application/json'
|
||||
if (produces.indexOf('application/json') >= 0) {
|
||||
localVarHeaderParams.Accept = 'application/json';
|
||||
} else {
|
||||
localVarHeaderParams.Accept = produces.join(',');
|
||||
}
|
||||
let localVarFormParams: any = {};
|
||||
|
||||
// verify required parameter 'namespace' is not null or undefined
|
||||
if (namespace === null || namespace === undefined) {
|
||||
throw new Error('Required parameter namespace was null or undefined when calling eventSourceServiceListEventSources.');
|
||||
}
|
||||
|
||||
if (listOptionsLabelSelector !== undefined) {
|
||||
localVarQueryParameters['listOptions.labelSelector'] = ObjectSerializer.serialize(listOptionsLabelSelector, "string");
|
||||
}
|
||||
|
||||
if (listOptionsFieldSelector !== undefined) {
|
||||
localVarQueryParameters['listOptions.fieldSelector'] = ObjectSerializer.serialize(listOptionsFieldSelector, "string");
|
||||
}
|
||||
|
||||
if (listOptionsWatch !== undefined) {
|
||||
localVarQueryParameters['listOptions.watch'] = ObjectSerializer.serialize(listOptionsWatch, "boolean");
|
||||
}
|
||||
|
||||
if (listOptionsAllowWatchBookmarks !== undefined) {
|
||||
localVarQueryParameters['listOptions.allowWatchBookmarks'] = ObjectSerializer.serialize(listOptionsAllowWatchBookmarks, "boolean");
|
||||
}
|
||||
|
||||
if (listOptionsResourceVersion !== undefined) {
|
||||
localVarQueryParameters['listOptions.resourceVersion'] = ObjectSerializer.serialize(listOptionsResourceVersion, "string");
|
||||
}
|
||||
|
||||
if (listOptionsResourceVersionMatch !== undefined) {
|
||||
localVarQueryParameters['listOptions.resourceVersionMatch'] = ObjectSerializer.serialize(listOptionsResourceVersionMatch, "string");
|
||||
}
|
||||
|
||||
if (listOptionsTimeoutSeconds !== undefined) {
|
||||
localVarQueryParameters['listOptions.timeoutSeconds'] = ObjectSerializer.serialize(listOptionsTimeoutSeconds, "string");
|
||||
}
|
||||
|
||||
if (listOptionsLimit !== undefined) {
|
||||
localVarQueryParameters['listOptions.limit'] = ObjectSerializer.serialize(listOptionsLimit, "string");
|
||||
}
|
||||
|
||||
if (listOptionsContinue !== undefined) {
|
||||
localVarQueryParameters['listOptions.continue'] = ObjectSerializer.serialize(listOptionsContinue, "string");
|
||||
}
|
||||
|
||||
(<any>Object).assign(localVarHeaderParams, options.headers);
|
||||
|
||||
let localVarUseFormData = false;
|
||||
|
||||
let localVarRequestOptions: localVarRequest.Options = {
|
||||
method: 'GET',
|
||||
qs: localVarQueryParameters,
|
||||
headers: localVarHeaderParams,
|
||||
uri: localVarPath,
|
||||
useQuerystring: this._useQuerystring,
|
||||
json: true,
|
||||
};
|
||||
|
||||
let authenticationPromise = Promise.resolve();
|
||||
if (this.authentications.BearerToken.apiKey) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
||||
|
||||
let interceptorPromise = authenticationPromise;
|
||||
for (const interceptor of this.interceptors) {
|
||||
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
||||
}
|
||||
|
||||
return interceptorPromise.then(() => {
|
||||
if (Object.keys(localVarFormParams).length) {
|
||||
if (localVarUseFormData) {
|
||||
(<any>localVarRequestOptions).formData = localVarFormParams;
|
||||
} else {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.IncomingMessage; body: IoArgoprojEventsV1alpha1EventSourceList; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
||||
body = ObjectSerializer.deserialize(body, "IoArgoprojEventsV1alpha1EventSourceList");
|
||||
resolve({ response: response, body: body });
|
||||
} else {
|
||||
reject(new HttpError(response, body, response.statusCode));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param namespace
|
||||
* @param name
|
||||
* @param body
|
||||
*/
|
||||
public async eventSourceServiceUpdateEventSource (namespace: string, name: string, body: EventsourceUpdateEventSourceRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: IoArgoprojEventsV1alpha1EventSource; }> {
|
||||
const localVarPath = this.basePath + '/api/v1/event-sources/{namespace}/{name}'
|
||||
.replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)))
|
||||
.replace('{' + 'name' + '}', encodeURIComponent(String(name)));
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
const produces = ['application/json'];
|
||||
// give precedence to 'application/json'
|
||||
if (produces.indexOf('application/json') >= 0) {
|
||||
localVarHeaderParams.Accept = 'application/json';
|
||||
} else {
|
||||
localVarHeaderParams.Accept = produces.join(',');
|
||||
}
|
||||
let localVarFormParams: any = {};
|
||||
|
||||
// verify required parameter 'namespace' is not null or undefined
|
||||
if (namespace === null || namespace === undefined) {
|
||||
throw new Error('Required parameter namespace was null or undefined when calling eventSourceServiceUpdateEventSource.');
|
||||
}
|
||||
|
||||
// verify required parameter 'name' is not null or undefined
|
||||
if (name === null || name === undefined) {
|
||||
throw new Error('Required parameter name was null or undefined when calling eventSourceServiceUpdateEventSource.');
|
||||
}
|
||||
|
||||
// verify required parameter 'body' is not null or undefined
|
||||
if (body === null || body === undefined) {
|
||||
throw new Error('Required parameter body was null or undefined when calling eventSourceServiceUpdateEventSource.');
|
||||
}
|
||||
|
||||
(<any>Object).assign(localVarHeaderParams, options.headers);
|
||||
|
||||
let localVarUseFormData = false;
|
||||
|
||||
let localVarRequestOptions: localVarRequest.Options = {
|
||||
method: 'PUT',
|
||||
qs: localVarQueryParameters,
|
||||
headers: localVarHeaderParams,
|
||||
uri: localVarPath,
|
||||
useQuerystring: this._useQuerystring,
|
||||
json: true,
|
||||
body: ObjectSerializer.serialize(body, "EventsourceUpdateEventSourceRequest")
|
||||
};
|
||||
|
||||
let authenticationPromise = Promise.resolve();
|
||||
if (this.authentications.BearerToken.apiKey) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
||||
|
||||
let interceptorPromise = authenticationPromise;
|
||||
for (const interceptor of this.interceptors) {
|
||||
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
||||
}
|
||||
|
||||
return interceptorPromise.then(() => {
|
||||
if (Object.keys(localVarFormParams).length) {
|
||||
if (localVarUseFormData) {
|
||||
(<any>localVarRequestOptions).formData = localVarFormParams;
|
||||
} else {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.IncomingMessage; body: IoArgoprojEventsV1alpha1EventSource; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
||||
body = ObjectSerializer.deserialize(body, "IoArgoprojEventsV1alpha1EventSource");
|
||||
resolve({ response: response, body: body });
|
||||
} else {
|
||||
reject(new HttpError(response, body, response.statusCode));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param namespace
|
||||
* @param listOptionsLabelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. +optional.
|
||||
* @param listOptionsFieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. +optional.
|
||||
* @param listOptionsWatch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. +optional.
|
||||
* @param listOptionsAllowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. +optional.
|
||||
* @param listOptionsResourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset +optional
|
||||
* @param listOptionsResourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset +optional
|
||||
* @param listOptionsTimeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. +optional.
|
||||
* @param listOptionsLimit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.
|
||||
* @param listOptionsContinue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.
|
||||
*/
|
||||
public async eventSourceServiceWatchEventSources (namespace: string, listOptionsLabelSelector?: string, listOptionsFieldSelector?: string, listOptionsWatch?: boolean, listOptionsAllowWatchBookmarks?: boolean, listOptionsResourceVersion?: string, listOptionsResourceVersionMatch?: string, listOptionsTimeoutSeconds?: string, listOptionsLimit?: string, listOptionsContinue?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: StreamResultOfEventsourceEventSourceWatchEvent; }> {
|
||||
const localVarPath = this.basePath + '/api/v1/stream/event-sources/{namespace}'
|
||||
.replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
const produces = ['application/json'];
|
||||
// give precedence to 'application/json'
|
||||
if (produces.indexOf('application/json') >= 0) {
|
||||
localVarHeaderParams.Accept = 'application/json';
|
||||
} else {
|
||||
localVarHeaderParams.Accept = produces.join(',');
|
||||
}
|
||||
let localVarFormParams: any = {};
|
||||
|
||||
// verify required parameter 'namespace' is not null or undefined
|
||||
if (namespace === null || namespace === undefined) {
|
||||
throw new Error('Required parameter namespace was null or undefined when calling eventSourceServiceWatchEventSources.');
|
||||
}
|
||||
|
||||
if (listOptionsLabelSelector !== undefined) {
|
||||
localVarQueryParameters['listOptions.labelSelector'] = ObjectSerializer.serialize(listOptionsLabelSelector, "string");
|
||||
}
|
||||
|
||||
if (listOptionsFieldSelector !== undefined) {
|
||||
localVarQueryParameters['listOptions.fieldSelector'] = ObjectSerializer.serialize(listOptionsFieldSelector, "string");
|
||||
}
|
||||
|
||||
if (listOptionsWatch !== undefined) {
|
||||
localVarQueryParameters['listOptions.watch'] = ObjectSerializer.serialize(listOptionsWatch, "boolean");
|
||||
}
|
||||
|
||||
if (listOptionsAllowWatchBookmarks !== undefined) {
|
||||
localVarQueryParameters['listOptions.allowWatchBookmarks'] = ObjectSerializer.serialize(listOptionsAllowWatchBookmarks, "boolean");
|
||||
}
|
||||
|
||||
if (listOptionsResourceVersion !== undefined) {
|
||||
localVarQueryParameters['listOptions.resourceVersion'] = ObjectSerializer.serialize(listOptionsResourceVersion, "string");
|
||||
}
|
||||
|
||||
if (listOptionsResourceVersionMatch !== undefined) {
|
||||
localVarQueryParameters['listOptions.resourceVersionMatch'] = ObjectSerializer.serialize(listOptionsResourceVersionMatch, "string");
|
||||
}
|
||||
|
||||
if (listOptionsTimeoutSeconds !== undefined) {
|
||||
localVarQueryParameters['listOptions.timeoutSeconds'] = ObjectSerializer.serialize(listOptionsTimeoutSeconds, "string");
|
||||
}
|
||||
|
||||
if (listOptionsLimit !== undefined) {
|
||||
localVarQueryParameters['listOptions.limit'] = ObjectSerializer.serialize(listOptionsLimit, "string");
|
||||
}
|
||||
|
||||
if (listOptionsContinue !== undefined) {
|
||||
localVarQueryParameters['listOptions.continue'] = ObjectSerializer.serialize(listOptionsContinue, "string");
|
||||
}
|
||||
|
||||
(<any>Object).assign(localVarHeaderParams, options.headers);
|
||||
|
||||
let localVarUseFormData = false;
|
||||
|
||||
let localVarRequestOptions: localVarRequest.Options = {
|
||||
method: 'GET',
|
||||
qs: localVarQueryParameters,
|
||||
headers: localVarHeaderParams,
|
||||
uri: localVarPath,
|
||||
useQuerystring: this._useQuerystring,
|
||||
json: true,
|
||||
};
|
||||
|
||||
let authenticationPromise = Promise.resolve();
|
||||
if (this.authentications.BearerToken.apiKey) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
||||
|
||||
let interceptorPromise = authenticationPromise;
|
||||
for (const interceptor of this.interceptors) {
|
||||
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
||||
}
|
||||
|
||||
return interceptorPromise.then(() => {
|
||||
if (Object.keys(localVarFormParams).length) {
|
||||
if (localVarUseFormData) {
|
||||
(<any>localVarRequestOptions).formData = localVarFormParams;
|
||||
} else {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.IncomingMessage; body: StreamResultOfEventsourceEventSourceWatchEvent; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
||||
body = ObjectSerializer.deserialize(body, "StreamResultOfEventsourceEventSourceWatchEvent");
|
||||
resolve({ response: response, body: body });
|
||||
} else {
|
||||
reject(new HttpError(response, body, response.statusCode));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
360
plugins/argo-workflows/src/api/generated/api/infoServiceApi.ts
Normal file
360
plugins/argo-workflows/src/api/generated/api/infoServiceApi.ts
Normal file
|
@ -0,0 +1,360 @@
|
|||
// @ts-nocheck
|
||||
/**
|
||||
* Argo Workflows API
|
||||
* Argo Workflows is an open source container-native workflow engine for orchestrating parallel jobs on Kubernetes. For more information, please see https://argoproj.github.io/argo-workflows/
|
||||
*
|
||||
* The version of the OpenAPI document: VERSION
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
import localVarRequest from 'request';
|
||||
import http from 'http';
|
||||
|
||||
/* tslint:disable:no-unused-locals */
|
||||
import { GrpcGatewayRuntimeError } from '../model/grpcGatewayRuntimeError';
|
||||
import { IoArgoprojWorkflowV1alpha1CollectEventRequest } from '../model/ioArgoprojWorkflowV1alpha1CollectEventRequest';
|
||||
import { IoArgoprojWorkflowV1alpha1GetUserInfoResponse } from '../model/ioArgoprojWorkflowV1alpha1GetUserInfoResponse';
|
||||
import { IoArgoprojWorkflowV1alpha1InfoResponse } from '../model/ioArgoprojWorkflowV1alpha1InfoResponse';
|
||||
import { IoArgoprojWorkflowV1alpha1Version } from '../model/ioArgoprojWorkflowV1alpha1Version';
|
||||
|
||||
import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models';
|
||||
import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models';
|
||||
|
||||
import { HttpError, RequestFile } from './apis';
|
||||
|
||||
let defaultBasePath = 'http://localhost:2746';
|
||||
|
||||
// ===============================================
|
||||
// This file is autogenerated - Please do not edit
|
||||
// ===============================================
|
||||
|
||||
export enum InfoServiceApiApiKeys {
|
||||
BearerToken,
|
||||
}
|
||||
|
||||
export class InfoServiceApi {
|
||||
protected _basePath = defaultBasePath;
|
||||
protected _defaultHeaders : any = {};
|
||||
protected _useQuerystring : boolean = false;
|
||||
|
||||
protected authentications = {
|
||||
'default': <Authentication>new VoidAuth(),
|
||||
'BearerToken': new ApiKeyAuth('header', 'Authorization'),
|
||||
}
|
||||
|
||||
protected interceptors: Interceptor[] = [];
|
||||
|
||||
constructor(basePath?: string);
|
||||
constructor(basePathOrUsername: string, password?: string, basePath?: string) {
|
||||
if (password) {
|
||||
if (basePath) {
|
||||
this.basePath = basePath;
|
||||
}
|
||||
} else {
|
||||
if (basePathOrUsername) {
|
||||
this.basePath = basePathOrUsername
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
set useQuerystring(value: boolean) {
|
||||
this._useQuerystring = value;
|
||||
}
|
||||
|
||||
set basePath(basePath: string) {
|
||||
this._basePath = basePath;
|
||||
}
|
||||
|
||||
set defaultHeaders(defaultHeaders: any) {
|
||||
this._defaultHeaders = defaultHeaders;
|
||||
}
|
||||
|
||||
get defaultHeaders() {
|
||||
return this._defaultHeaders;
|
||||
}
|
||||
|
||||
get basePath() {
|
||||
return this._basePath;
|
||||
}
|
||||
|
||||
public setDefaultAuthentication(auth: Authentication) {
|
||||
this.authentications.default = auth;
|
||||
}
|
||||
|
||||
public setApiKey(key: InfoServiceApiApiKeys, value: string) {
|
||||
(this.authentications as any)[InfoServiceApiApiKeys[key]].apiKey = value;
|
||||
}
|
||||
|
||||
public addInterceptor(interceptor: Interceptor) {
|
||||
this.interceptors.push(interceptor);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param body
|
||||
*/
|
||||
public async infoServiceCollectEvent (body: IoArgoprojWorkflowV1alpha1CollectEventRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: object; }> {
|
||||
const localVarPath = this.basePath + '/api/v1/tracking/event';
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
const produces = ['application/json'];
|
||||
// give precedence to 'application/json'
|
||||
if (produces.indexOf('application/json') >= 0) {
|
||||
localVarHeaderParams.Accept = 'application/json';
|
||||
} else {
|
||||
localVarHeaderParams.Accept = produces.join(',');
|
||||
}
|
||||
let localVarFormParams: any = {};
|
||||
|
||||
// verify required parameter 'body' is not null or undefined
|
||||
if (body === null || body === undefined) {
|
||||
throw new Error('Required parameter body was null or undefined when calling infoServiceCollectEvent.');
|
||||
}
|
||||
|
||||
(<any>Object).assign(localVarHeaderParams, options.headers);
|
||||
|
||||
let localVarUseFormData = false;
|
||||
|
||||
let localVarRequestOptions: localVarRequest.Options = {
|
||||
method: 'POST',
|
||||
qs: localVarQueryParameters,
|
||||
headers: localVarHeaderParams,
|
||||
uri: localVarPath,
|
||||
useQuerystring: this._useQuerystring,
|
||||
json: true,
|
||||
body: ObjectSerializer.serialize(body, "IoArgoprojWorkflowV1alpha1CollectEventRequest")
|
||||
};
|
||||
|
||||
let authenticationPromise = Promise.resolve();
|
||||
if (this.authentications.BearerToken.apiKey) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
||||
|
||||
let interceptorPromise = authenticationPromise;
|
||||
for (const interceptor of this.interceptors) {
|
||||
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
||||
}
|
||||
|
||||
return interceptorPromise.then(() => {
|
||||
if (Object.keys(localVarFormParams).length) {
|
||||
if (localVarUseFormData) {
|
||||
(<any>localVarRequestOptions).formData = localVarFormParams;
|
||||
} else {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.IncomingMessage; body: object; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
||||
body = ObjectSerializer.deserialize(body, "object");
|
||||
resolve({ response: response, body: body });
|
||||
} else {
|
||||
reject(new HttpError(response, body, response.statusCode));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public async infoServiceGetInfo (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: IoArgoprojWorkflowV1alpha1InfoResponse; }> {
|
||||
const localVarPath = this.basePath + '/api/v1/info';
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
const produces = ['application/json'];
|
||||
// give precedence to 'application/json'
|
||||
if (produces.indexOf('application/json') >= 0) {
|
||||
localVarHeaderParams.Accept = 'application/json';
|
||||
} else {
|
||||
localVarHeaderParams.Accept = produces.join(',');
|
||||
}
|
||||
let localVarFormParams: any = {};
|
||||
|
||||
(<any>Object).assign(localVarHeaderParams, options.headers);
|
||||
|
||||
let localVarUseFormData = false;
|
||||
|
||||
let localVarRequestOptions: localVarRequest.Options = {
|
||||
method: 'GET',
|
||||
qs: localVarQueryParameters,
|
||||
headers: localVarHeaderParams,
|
||||
uri: localVarPath,
|
||||
useQuerystring: this._useQuerystring,
|
||||
json: true,
|
||||
};
|
||||
|
||||
let authenticationPromise = Promise.resolve();
|
||||
if (this.authentications.BearerToken.apiKey) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
||||
|
||||
let interceptorPromise = authenticationPromise;
|
||||
for (const interceptor of this.interceptors) {
|
||||
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
||||
}
|
||||
|
||||
return interceptorPromise.then(() => {
|
||||
if (Object.keys(localVarFormParams).length) {
|
||||
if (localVarUseFormData) {
|
||||
(<any>localVarRequestOptions).formData = localVarFormParams;
|
||||
} else {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.IncomingMessage; body: IoArgoprojWorkflowV1alpha1InfoResponse; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
||||
body = ObjectSerializer.deserialize(body, "IoArgoprojWorkflowV1alpha1InfoResponse");
|
||||
resolve({ response: response, body: body });
|
||||
} else {
|
||||
reject(new HttpError(response, body, response.statusCode));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public async infoServiceGetUserInfo (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: IoArgoprojWorkflowV1alpha1GetUserInfoResponse; }> {
|
||||
const localVarPath = this.basePath + '/api/v1/userinfo';
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
const produces = ['application/json'];
|
||||
// give precedence to 'application/json'
|
||||
if (produces.indexOf('application/json') >= 0) {
|
||||
localVarHeaderParams.Accept = 'application/json';
|
||||
} else {
|
||||
localVarHeaderParams.Accept = produces.join(',');
|
||||
}
|
||||
let localVarFormParams: any = {};
|
||||
|
||||
(<any>Object).assign(localVarHeaderParams, options.headers);
|
||||
|
||||
let localVarUseFormData = false;
|
||||
|
||||
let localVarRequestOptions: localVarRequest.Options = {
|
||||
method: 'GET',
|
||||
qs: localVarQueryParameters,
|
||||
headers: localVarHeaderParams,
|
||||
uri: localVarPath,
|
||||
useQuerystring: this._useQuerystring,
|
||||
json: true,
|
||||
};
|
||||
|
||||
let authenticationPromise = Promise.resolve();
|
||||
if (this.authentications.BearerToken.apiKey) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
||||
|
||||
let interceptorPromise = authenticationPromise;
|
||||
for (const interceptor of this.interceptors) {
|
||||
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
||||
}
|
||||
|
||||
return interceptorPromise.then(() => {
|
||||
if (Object.keys(localVarFormParams).length) {
|
||||
if (localVarUseFormData) {
|
||||
(<any>localVarRequestOptions).formData = localVarFormParams;
|
||||
} else {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.IncomingMessage; body: IoArgoprojWorkflowV1alpha1GetUserInfoResponse; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
||||
body = ObjectSerializer.deserialize(body, "IoArgoprojWorkflowV1alpha1GetUserInfoResponse");
|
||||
resolve({ response: response, body: body });
|
||||
} else {
|
||||
reject(new HttpError(response, body, response.statusCode));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public async infoServiceGetVersion (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: IoArgoprojWorkflowV1alpha1Version; }> {
|
||||
const localVarPath = this.basePath + '/api/v1/version';
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
const produces = ['application/json'];
|
||||
// give precedence to 'application/json'
|
||||
if (produces.indexOf('application/json') >= 0) {
|
||||
localVarHeaderParams.Accept = 'application/json';
|
||||
} else {
|
||||
localVarHeaderParams.Accept = produces.join(',');
|
||||
}
|
||||
let localVarFormParams: any = {};
|
||||
|
||||
(<any>Object).assign(localVarHeaderParams, options.headers);
|
||||
|
||||
let localVarUseFormData = false;
|
||||
|
||||
let localVarRequestOptions: localVarRequest.Options = {
|
||||
method: 'GET',
|
||||
qs: localVarQueryParameters,
|
||||
headers: localVarHeaderParams,
|
||||
uri: localVarPath,
|
||||
useQuerystring: this._useQuerystring,
|
||||
json: true,
|
||||
};
|
||||
|
||||
let authenticationPromise = Promise.resolve();
|
||||
if (this.authentications.BearerToken.apiKey) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
||||
|
||||
let interceptorPromise = authenticationPromise;
|
||||
for (const interceptor of this.interceptors) {
|
||||
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
||||
}
|
||||
|
||||
return interceptorPromise.then(() => {
|
||||
if (Object.keys(localVarFormParams).length) {
|
||||
if (localVarUseFormData) {
|
||||
(<any>localVarRequestOptions).formData = localVarFormParams;
|
||||
} else {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.IncomingMessage; body: IoArgoprojWorkflowV1alpha1Version; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
||||
body = ObjectSerializer.deserialize(body, "IoArgoprojWorkflowV1alpha1Version");
|
||||
resolve({ response: response, body: body });
|
||||
} else {
|
||||
reject(new HttpError(response, body, response.statusCode));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
821
plugins/argo-workflows/src/api/generated/api/sensorServiceApi.ts
Normal file
821
plugins/argo-workflows/src/api/generated/api/sensorServiceApi.ts
Normal file
|
@ -0,0 +1,821 @@
|
|||
// @ts-nocheck
|
||||
/**
|
||||
* Argo Workflows API
|
||||
* Argo Workflows is an open source container-native workflow engine for orchestrating parallel jobs on Kubernetes. For more information, please see https://argoproj.github.io/argo-workflows/
|
||||
*
|
||||
* The version of the OpenAPI document: VERSION
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
import localVarRequest from 'request';
|
||||
import http from 'http';
|
||||
|
||||
/* tslint:disable:no-unused-locals */
|
||||
import { GrpcGatewayRuntimeError } from '../model/grpcGatewayRuntimeError';
|
||||
import { IoArgoprojEventsV1alpha1Sensor } from '../model/ioArgoprojEventsV1alpha1Sensor';
|
||||
import { IoArgoprojEventsV1alpha1SensorList } from '../model/ioArgoprojEventsV1alpha1SensorList';
|
||||
import { SensorCreateSensorRequest } from '../model/sensorCreateSensorRequest';
|
||||
import { SensorUpdateSensorRequest } from '../model/sensorUpdateSensorRequest';
|
||||
import { StreamResultOfSensorLogEntry } from '../model/streamResultOfSensorLogEntry';
|
||||
import { StreamResultOfSensorSensorWatchEvent } from '../model/streamResultOfSensorSensorWatchEvent';
|
||||
|
||||
import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models';
|
||||
import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models';
|
||||
|
||||
import { HttpError, RequestFile } from './apis';
|
||||
|
||||
let defaultBasePath = 'http://localhost:2746';
|
||||
|
||||
// ===============================================
|
||||
// This file is autogenerated - Please do not edit
|
||||
// ===============================================
|
||||
|
||||
export enum SensorServiceApiApiKeys {
|
||||
BearerToken,
|
||||
}
|
||||
|
||||
export class SensorServiceApi {
|
||||
protected _basePath = defaultBasePath;
|
||||
protected _defaultHeaders : any = {};
|
||||
protected _useQuerystring : boolean = false;
|
||||
|
||||
protected authentications = {
|
||||
'default': <Authentication>new VoidAuth(),
|
||||
'BearerToken': new ApiKeyAuth('header', 'Authorization'),
|
||||
}
|
||||
|
||||
protected interceptors: Interceptor[] = [];
|
||||
|
||||
constructor(basePath?: string);
|
||||
constructor(basePathOrUsername: string, password?: string, basePath?: string) {
|
||||
if (password) {
|
||||
if (basePath) {
|
||||
this.basePath = basePath;
|
||||
}
|
||||
} else {
|
||||
if (basePathOrUsername) {
|
||||
this.basePath = basePathOrUsername
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
set useQuerystring(value: boolean) {
|
||||
this._useQuerystring = value;
|
||||
}
|
||||
|
||||
set basePath(basePath: string) {
|
||||
this._basePath = basePath;
|
||||
}
|
||||
|
||||
set defaultHeaders(defaultHeaders: any) {
|
||||
this._defaultHeaders = defaultHeaders;
|
||||
}
|
||||
|
||||
get defaultHeaders() {
|
||||
return this._defaultHeaders;
|
||||
}
|
||||
|
||||
get basePath() {
|
||||
return this._basePath;
|
||||
}
|
||||
|
||||
public setDefaultAuthentication(auth: Authentication) {
|
||||
this.authentications.default = auth;
|
||||
}
|
||||
|
||||
public setApiKey(key: SensorServiceApiApiKeys, value: string) {
|
||||
(this.authentications as any)[SensorServiceApiApiKeys[key]].apiKey = value;
|
||||
}
|
||||
|
||||
public addInterceptor(interceptor: Interceptor) {
|
||||
this.interceptors.push(interceptor);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param namespace
|
||||
* @param body
|
||||
*/
|
||||
public async sensorServiceCreateSensor (namespace: string, body: SensorCreateSensorRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: IoArgoprojEventsV1alpha1Sensor; }> {
|
||||
const localVarPath = this.basePath + '/api/v1/sensors/{namespace}'
|
||||
.replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
const produces = ['application/json'];
|
||||
// give precedence to 'application/json'
|
||||
if (produces.indexOf('application/json') >= 0) {
|
||||
localVarHeaderParams.Accept = 'application/json';
|
||||
} else {
|
||||
localVarHeaderParams.Accept = produces.join(',');
|
||||
}
|
||||
let localVarFormParams: any = {};
|
||||
|
||||
// verify required parameter 'namespace' is not null or undefined
|
||||
if (namespace === null || namespace === undefined) {
|
||||
throw new Error('Required parameter namespace was null or undefined when calling sensorServiceCreateSensor.');
|
||||
}
|
||||
|
||||
// verify required parameter 'body' is not null or undefined
|
||||
if (body === null || body === undefined) {
|
||||
throw new Error('Required parameter body was null or undefined when calling sensorServiceCreateSensor.');
|
||||
}
|
||||
|
||||
(<any>Object).assign(localVarHeaderParams, options.headers);
|
||||
|
||||
let localVarUseFormData = false;
|
||||
|
||||
let localVarRequestOptions: localVarRequest.Options = {
|
||||
method: 'POST',
|
||||
qs: localVarQueryParameters,
|
||||
headers: localVarHeaderParams,
|
||||
uri: localVarPath,
|
||||
useQuerystring: this._useQuerystring,
|
||||
json: true,
|
||||
body: ObjectSerializer.serialize(body, "SensorCreateSensorRequest")
|
||||
};
|
||||
|
||||
let authenticationPromise = Promise.resolve();
|
||||
if (this.authentications.BearerToken.apiKey) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
||||
|
||||
let interceptorPromise = authenticationPromise;
|
||||
for (const interceptor of this.interceptors) {
|
||||
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
||||
}
|
||||
|
||||
return interceptorPromise.then(() => {
|
||||
if (Object.keys(localVarFormParams).length) {
|
||||
if (localVarUseFormData) {
|
||||
(<any>localVarRequestOptions).formData = localVarFormParams;
|
||||
} else {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.IncomingMessage; body: IoArgoprojEventsV1alpha1Sensor; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
||||
body = ObjectSerializer.deserialize(body, "IoArgoprojEventsV1alpha1Sensor");
|
||||
resolve({ response: response, body: body });
|
||||
} else {
|
||||
reject(new HttpError(response, body, response.statusCode));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param namespace
|
||||
* @param name
|
||||
* @param deleteOptionsGracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. +optional.
|
||||
* @param deleteOptionsPreconditionsUid Specifies the target UID. +optional.
|
||||
* @param deleteOptionsPreconditionsResourceVersion Specifies the target ResourceVersion +optional.
|
||||
* @param deleteOptionsOrphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. +optional.
|
||||
* @param deleteOptionsPropagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. +optional.
|
||||
* @param deleteOptionsDryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed +optional.
|
||||
*/
|
||||
public async sensorServiceDeleteSensor (namespace: string, name: string, deleteOptionsGracePeriodSeconds?: string, deleteOptionsPreconditionsUid?: string, deleteOptionsPreconditionsResourceVersion?: string, deleteOptionsOrphanDependents?: boolean, deleteOptionsPropagationPolicy?: string, deleteOptionsDryRun?: Array<string>, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: object; }> {
|
||||
const localVarPath = this.basePath + '/api/v1/sensors/{namespace}/{name}'
|
||||
.replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)))
|
||||
.replace('{' + 'name' + '}', encodeURIComponent(String(name)));
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
const produces = ['application/json'];
|
||||
// give precedence to 'application/json'
|
||||
if (produces.indexOf('application/json') >= 0) {
|
||||
localVarHeaderParams.Accept = 'application/json';
|
||||
} else {
|
||||
localVarHeaderParams.Accept = produces.join(',');
|
||||
}
|
||||
let localVarFormParams: any = {};
|
||||
|
||||
// verify required parameter 'namespace' is not null or undefined
|
||||
if (namespace === null || namespace === undefined) {
|
||||
throw new Error('Required parameter namespace was null or undefined when calling sensorServiceDeleteSensor.');
|
||||
}
|
||||
|
||||
// verify required parameter 'name' is not null or undefined
|
||||
if (name === null || name === undefined) {
|
||||
throw new Error('Required parameter name was null or undefined when calling sensorServiceDeleteSensor.');
|
||||
}
|
||||
|
||||
if (deleteOptionsGracePeriodSeconds !== undefined) {
|
||||
localVarQueryParameters['deleteOptions.gracePeriodSeconds'] = ObjectSerializer.serialize(deleteOptionsGracePeriodSeconds, "string");
|
||||
}
|
||||
|
||||
if (deleteOptionsPreconditionsUid !== undefined) {
|
||||
localVarQueryParameters['deleteOptions.preconditions.uid'] = ObjectSerializer.serialize(deleteOptionsPreconditionsUid, "string");
|
||||
}
|
||||
|
||||
if (deleteOptionsPreconditionsResourceVersion !== undefined) {
|
||||
localVarQueryParameters['deleteOptions.preconditions.resourceVersion'] = ObjectSerializer.serialize(deleteOptionsPreconditionsResourceVersion, "string");
|
||||
}
|
||||
|
||||
if (deleteOptionsOrphanDependents !== undefined) {
|
||||
localVarQueryParameters['deleteOptions.orphanDependents'] = ObjectSerializer.serialize(deleteOptionsOrphanDependents, "boolean");
|
||||
}
|
||||
|
||||
if (deleteOptionsPropagationPolicy !== undefined) {
|
||||
localVarQueryParameters['deleteOptions.propagationPolicy'] = ObjectSerializer.serialize(deleteOptionsPropagationPolicy, "string");
|
||||
}
|
||||
|
||||
if (deleteOptionsDryRun !== undefined) {
|
||||
localVarQueryParameters['deleteOptions.dryRun'] = ObjectSerializer.serialize(deleteOptionsDryRun, "Array<string>");
|
||||
}
|
||||
|
||||
(<any>Object).assign(localVarHeaderParams, options.headers);
|
||||
|
||||
let localVarUseFormData = false;
|
||||
|
||||
let localVarRequestOptions: localVarRequest.Options = {
|
||||
method: 'DELETE',
|
||||
qs: localVarQueryParameters,
|
||||
headers: localVarHeaderParams,
|
||||
uri: localVarPath,
|
||||
useQuerystring: this._useQuerystring,
|
||||
json: true,
|
||||
};
|
||||
|
||||
let authenticationPromise = Promise.resolve();
|
||||
if (this.authentications.BearerToken.apiKey) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
||||
|
||||
let interceptorPromise = authenticationPromise;
|
||||
for (const interceptor of this.interceptors) {
|
||||
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
||||
}
|
||||
|
||||
return interceptorPromise.then(() => {
|
||||
if (Object.keys(localVarFormParams).length) {
|
||||
if (localVarUseFormData) {
|
||||
(<any>localVarRequestOptions).formData = localVarFormParams;
|
||||
} else {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.IncomingMessage; body: object; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
||||
body = ObjectSerializer.deserialize(body, "object");
|
||||
resolve({ response: response, body: body });
|
||||
} else {
|
||||
reject(new HttpError(response, body, response.statusCode));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param namespace
|
||||
* @param name
|
||||
* @param getOptionsResourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset +optional
|
||||
*/
|
||||
public async sensorServiceGetSensor (namespace: string, name: string, getOptionsResourceVersion?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: IoArgoprojEventsV1alpha1Sensor; }> {
|
||||
const localVarPath = this.basePath + '/api/v1/sensors/{namespace}/{name}'
|
||||
.replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)))
|
||||
.replace('{' + 'name' + '}', encodeURIComponent(String(name)));
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
const produces = ['application/json'];
|
||||
// give precedence to 'application/json'
|
||||
if (produces.indexOf('application/json') >= 0) {
|
||||
localVarHeaderParams.Accept = 'application/json';
|
||||
} else {
|
||||
localVarHeaderParams.Accept = produces.join(',');
|
||||
}
|
||||
let localVarFormParams: any = {};
|
||||
|
||||
// verify required parameter 'namespace' is not null or undefined
|
||||
if (namespace === null || namespace === undefined) {
|
||||
throw new Error('Required parameter namespace was null or undefined when calling sensorServiceGetSensor.');
|
||||
}
|
||||
|
||||
// verify required parameter 'name' is not null or undefined
|
||||
if (name === null || name === undefined) {
|
||||
throw new Error('Required parameter name was null or undefined when calling sensorServiceGetSensor.');
|
||||
}
|
||||
|
||||
if (getOptionsResourceVersion !== undefined) {
|
||||
localVarQueryParameters['getOptions.resourceVersion'] = ObjectSerializer.serialize(getOptionsResourceVersion, "string");
|
||||
}
|
||||
|
||||
(<any>Object).assign(localVarHeaderParams, options.headers);
|
||||
|
||||
let localVarUseFormData = false;
|
||||
|
||||
let localVarRequestOptions: localVarRequest.Options = {
|
||||
method: 'GET',
|
||||
qs: localVarQueryParameters,
|
||||
headers: localVarHeaderParams,
|
||||
uri: localVarPath,
|
||||
useQuerystring: this._useQuerystring,
|
||||
json: true,
|
||||
};
|
||||
|
||||
let authenticationPromise = Promise.resolve();
|
||||
if (this.authentications.BearerToken.apiKey) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
||||
|
||||
let interceptorPromise = authenticationPromise;
|
||||
for (const interceptor of this.interceptors) {
|
||||
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
||||
}
|
||||
|
||||
return interceptorPromise.then(() => {
|
||||
if (Object.keys(localVarFormParams).length) {
|
||||
if (localVarUseFormData) {
|
||||
(<any>localVarRequestOptions).formData = localVarFormParams;
|
||||
} else {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.IncomingMessage; body: IoArgoprojEventsV1alpha1Sensor; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
||||
body = ObjectSerializer.deserialize(body, "IoArgoprojEventsV1alpha1Sensor");
|
||||
resolve({ response: response, body: body });
|
||||
} else {
|
||||
reject(new HttpError(response, body, response.statusCode));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param namespace
|
||||
* @param listOptionsLabelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. +optional.
|
||||
* @param listOptionsFieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. +optional.
|
||||
* @param listOptionsWatch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. +optional.
|
||||
* @param listOptionsAllowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. +optional.
|
||||
* @param listOptionsResourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset +optional
|
||||
* @param listOptionsResourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset +optional
|
||||
* @param listOptionsTimeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. +optional.
|
||||
* @param listOptionsLimit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.
|
||||
* @param listOptionsContinue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.
|
||||
*/
|
||||
public async sensorServiceListSensors (namespace: string, listOptionsLabelSelector?: string, listOptionsFieldSelector?: string, listOptionsWatch?: boolean, listOptionsAllowWatchBookmarks?: boolean, listOptionsResourceVersion?: string, listOptionsResourceVersionMatch?: string, listOptionsTimeoutSeconds?: string, listOptionsLimit?: string, listOptionsContinue?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: IoArgoprojEventsV1alpha1SensorList; }> {
|
||||
const localVarPath = this.basePath + '/api/v1/sensors/{namespace}'
|
||||
.replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
const produces = ['application/json'];
|
||||
// give precedence to 'application/json'
|
||||
if (produces.indexOf('application/json') >= 0) {
|
||||
localVarHeaderParams.Accept = 'application/json';
|
||||
} else {
|
||||
localVarHeaderParams.Accept = produces.join(',');
|
||||
}
|
||||
let localVarFormParams: any = {};
|
||||
|
||||
// verify required parameter 'namespace' is not null or undefined
|
||||
if (namespace === null || namespace === undefined) {
|
||||
throw new Error('Required parameter namespace was null or undefined when calling sensorServiceListSensors.');
|
||||
}
|
||||
|
||||
if (listOptionsLabelSelector !== undefined) {
|
||||
localVarQueryParameters['listOptions.labelSelector'] = ObjectSerializer.serialize(listOptionsLabelSelector, "string");
|
||||
}
|
||||
|
||||
if (listOptionsFieldSelector !== undefined) {
|
||||
localVarQueryParameters['listOptions.fieldSelector'] = ObjectSerializer.serialize(listOptionsFieldSelector, "string");
|
||||
}
|
||||
|
||||
if (listOptionsWatch !== undefined) {
|
||||
localVarQueryParameters['listOptions.watch'] = ObjectSerializer.serialize(listOptionsWatch, "boolean");
|
||||
}
|
||||
|
||||
if (listOptionsAllowWatchBookmarks !== undefined) {
|
||||
localVarQueryParameters['listOptions.allowWatchBookmarks'] = ObjectSerializer.serialize(listOptionsAllowWatchBookmarks, "boolean");
|
||||
}
|
||||
|
||||
if (listOptionsResourceVersion !== undefined) {
|
||||
localVarQueryParameters['listOptions.resourceVersion'] = ObjectSerializer.serialize(listOptionsResourceVersion, "string");
|
||||
}
|
||||
|
||||
if (listOptionsResourceVersionMatch !== undefined) {
|
||||
localVarQueryParameters['listOptions.resourceVersionMatch'] = ObjectSerializer.serialize(listOptionsResourceVersionMatch, "string");
|
||||
}
|
||||
|
||||
if (listOptionsTimeoutSeconds !== undefined) {
|
||||
localVarQueryParameters['listOptions.timeoutSeconds'] = ObjectSerializer.serialize(listOptionsTimeoutSeconds, "string");
|
||||
}
|
||||
|
||||
if (listOptionsLimit !== undefined) {
|
||||
localVarQueryParameters['listOptions.limit'] = ObjectSerializer.serialize(listOptionsLimit, "string");
|
||||
}
|
||||
|
||||
if (listOptionsContinue !== undefined) {
|
||||
localVarQueryParameters['listOptions.continue'] = ObjectSerializer.serialize(listOptionsContinue, "string");
|
||||
}
|
||||
|
||||
(<any>Object).assign(localVarHeaderParams, options.headers);
|
||||
|
||||
let localVarUseFormData = false;
|
||||
|
||||
let localVarRequestOptions: localVarRequest.Options = {
|
||||
method: 'GET',
|
||||
qs: localVarQueryParameters,
|
||||
headers: localVarHeaderParams,
|
||||
uri: localVarPath,
|
||||
useQuerystring: this._useQuerystring,
|
||||
json: true,
|
||||
};
|
||||
|
||||
let authenticationPromise = Promise.resolve();
|
||||
if (this.authentications.BearerToken.apiKey) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
||||
|
||||
let interceptorPromise = authenticationPromise;
|
||||
for (const interceptor of this.interceptors) {
|
||||
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
||||
}
|
||||
|
||||
return interceptorPromise.then(() => {
|
||||
if (Object.keys(localVarFormParams).length) {
|
||||
if (localVarUseFormData) {
|
||||
(<any>localVarRequestOptions).formData = localVarFormParams;
|
||||
} else {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.IncomingMessage; body: IoArgoprojEventsV1alpha1SensorList; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
||||
body = ObjectSerializer.deserialize(body, "IoArgoprojEventsV1alpha1SensorList");
|
||||
resolve({ response: response, body: body });
|
||||
} else {
|
||||
reject(new HttpError(response, body, response.statusCode));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param namespace
|
||||
* @param name optional - only return entries for this sensor name.
|
||||
* @param triggerName optional - only return entries for this trigger.
|
||||
* @param grep option - only return entries where `msg` contains this regular expressions.
|
||||
* @param podLogOptionsContainer The container for which to stream logs. Defaults to only container if there is one container in the pod. +optional.
|
||||
* @param podLogOptionsFollow Follow the log stream of the pod. Defaults to false. +optional.
|
||||
* @param podLogOptionsPrevious Return previous terminated container logs. Defaults to false. +optional.
|
||||
* @param podLogOptionsSinceSeconds A relative time in seconds before the current time from which to show logs. If this value precedes the time a pod was started, only logs since the pod start will be returned. If this value is in the future, no logs will be returned. Only one of sinceSeconds or sinceTime may be specified. +optional.
|
||||
* @param podLogOptionsSinceTimeSeconds Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive.
|
||||
* @param podLogOptionsSinceTimeNanos Non-negative fractions of a second at nanosecond resolution. Negative second values with fractions must still have non-negative nanos values that count forward in time. Must be from 0 to 999,999,999 inclusive. This field may be limited in precision depending on context.
|
||||
* @param podLogOptionsTimestamps If true, add an RFC3339 or RFC3339Nano timestamp at the beginning of every line of log output. Defaults to false. +optional.
|
||||
* @param podLogOptionsTailLines If set, the number of lines from the end of the logs to show. If not specified, logs are shown from the creation of the container or sinceSeconds or sinceTime +optional.
|
||||
* @param podLogOptionsLimitBytes If set, the number of bytes to read from the server before terminating the log output. This may not display a complete final line of logging, and may return slightly more or slightly less than the specified limit. +optional.
|
||||
* @param podLogOptionsInsecureSkipTLSVerifyBackend insecureSkipTLSVerifyBackend indicates that the apiserver should not confirm the validity of the serving certificate of the backend it is connecting to. This will make the HTTPS connection between the apiserver and the backend insecure. This means the apiserver cannot verify the log data it is receiving came from the real kubelet. If the kubelet is configured to verify the apiserver\'s TLS credentials, it does not mean the connection to the real kubelet is vulnerable to a man in the middle attack (e.g. an attacker could not intercept the actual log data coming from the real kubelet). +optional.
|
||||
*/
|
||||
public async sensorServiceSensorsLogs (namespace: string, name?: string, triggerName?: string, grep?: string, podLogOptionsContainer?: string, podLogOptionsFollow?: boolean, podLogOptionsPrevious?: boolean, podLogOptionsSinceSeconds?: string, podLogOptionsSinceTimeSeconds?: string, podLogOptionsSinceTimeNanos?: number, podLogOptionsTimestamps?: boolean, podLogOptionsTailLines?: string, podLogOptionsLimitBytes?: string, podLogOptionsInsecureSkipTLSVerifyBackend?: boolean, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: StreamResultOfSensorLogEntry; }> {
|
||||
const localVarPath = this.basePath + '/api/v1/stream/sensors/{namespace}/logs'
|
||||
.replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
const produces = ['application/json'];
|
||||
// give precedence to 'application/json'
|
||||
if (produces.indexOf('application/json') >= 0) {
|
||||
localVarHeaderParams.Accept = 'application/json';
|
||||
} else {
|
||||
localVarHeaderParams.Accept = produces.join(',');
|
||||
}
|
||||
let localVarFormParams: any = {};
|
||||
|
||||
// verify required parameter 'namespace' is not null or undefined
|
||||
if (namespace === null || namespace === undefined) {
|
||||
throw new Error('Required parameter namespace was null or undefined when calling sensorServiceSensorsLogs.');
|
||||
}
|
||||
|
||||
if (name !== undefined) {
|
||||
localVarQueryParameters['name'] = ObjectSerializer.serialize(name, "string");
|
||||
}
|
||||
|
||||
if (triggerName !== undefined) {
|
||||
localVarQueryParameters['triggerName'] = ObjectSerializer.serialize(triggerName, "string");
|
||||
}
|
||||
|
||||
if (grep !== undefined) {
|
||||
localVarQueryParameters['grep'] = ObjectSerializer.serialize(grep, "string");
|
||||
}
|
||||
|
||||
if (podLogOptionsContainer !== undefined) {
|
||||
localVarQueryParameters['podLogOptions.container'] = ObjectSerializer.serialize(podLogOptionsContainer, "string");
|
||||
}
|
||||
|
||||
if (podLogOptionsFollow !== undefined) {
|
||||
localVarQueryParameters['podLogOptions.follow'] = ObjectSerializer.serialize(podLogOptionsFollow, "boolean");
|
||||
}
|
||||
|
||||
if (podLogOptionsPrevious !== undefined) {
|
||||
localVarQueryParameters['podLogOptions.previous'] = ObjectSerializer.serialize(podLogOptionsPrevious, "boolean");
|
||||
}
|
||||
|
||||
if (podLogOptionsSinceSeconds !== undefined) {
|
||||
localVarQueryParameters['podLogOptions.sinceSeconds'] = ObjectSerializer.serialize(podLogOptionsSinceSeconds, "string");
|
||||
}
|
||||
|
||||
if (podLogOptionsSinceTimeSeconds !== undefined) {
|
||||
localVarQueryParameters['podLogOptions.sinceTime.seconds'] = ObjectSerializer.serialize(podLogOptionsSinceTimeSeconds, "string");
|
||||
}
|
||||
|
||||
if (podLogOptionsSinceTimeNanos !== undefined) {
|
||||
localVarQueryParameters['podLogOptions.sinceTime.nanos'] = ObjectSerializer.serialize(podLogOptionsSinceTimeNanos, "number");
|
||||
}
|
||||
|
||||
if (podLogOptionsTimestamps !== undefined) {
|
||||
localVarQueryParameters['podLogOptions.timestamps'] = ObjectSerializer.serialize(podLogOptionsTimestamps, "boolean");
|
||||
}
|
||||
|
||||
if (podLogOptionsTailLines !== undefined) {
|
||||
localVarQueryParameters['podLogOptions.tailLines'] = ObjectSerializer.serialize(podLogOptionsTailLines, "string");
|
||||
}
|
||||
|
||||
if (podLogOptionsLimitBytes !== undefined) {
|
||||
localVarQueryParameters['podLogOptions.limitBytes'] = ObjectSerializer.serialize(podLogOptionsLimitBytes, "string");
|
||||
}
|
||||
|
||||
if (podLogOptionsInsecureSkipTLSVerifyBackend !== undefined) {
|
||||
localVarQueryParameters['podLogOptions.insecureSkipTLSVerifyBackend'] = ObjectSerializer.serialize(podLogOptionsInsecureSkipTLSVerifyBackend, "boolean");
|
||||
}
|
||||
|
||||
(<any>Object).assign(localVarHeaderParams, options.headers);
|
||||
|
||||
let localVarUseFormData = false;
|
||||
|
||||
let localVarRequestOptions: localVarRequest.Options = {
|
||||
method: 'GET',
|
||||
qs: localVarQueryParameters,
|
||||
headers: localVarHeaderParams,
|
||||
uri: localVarPath,
|
||||
useQuerystring: this._useQuerystring,
|
||||
json: true,
|
||||
};
|
||||
|
||||
let authenticationPromise = Promise.resolve();
|
||||
if (this.authentications.BearerToken.apiKey) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
||||
|
||||
let interceptorPromise = authenticationPromise;
|
||||
for (const interceptor of this.interceptors) {
|
||||
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
||||
}
|
||||
|
||||
return interceptorPromise.then(() => {
|
||||
if (Object.keys(localVarFormParams).length) {
|
||||
if (localVarUseFormData) {
|
||||
(<any>localVarRequestOptions).formData = localVarFormParams;
|
||||
} else {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.IncomingMessage; body: StreamResultOfSensorLogEntry; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
||||
body = ObjectSerializer.deserialize(body, "StreamResultOfSensorLogEntry");
|
||||
resolve({ response: response, body: body });
|
||||
} else {
|
||||
reject(new HttpError(response, body, response.statusCode));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param namespace
|
||||
* @param name
|
||||
* @param body
|
||||
*/
|
||||
public async sensorServiceUpdateSensor (namespace: string, name: string, body: SensorUpdateSensorRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: IoArgoprojEventsV1alpha1Sensor; }> {
|
||||
const localVarPath = this.basePath + '/api/v1/sensors/{namespace}/{name}'
|
||||
.replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)))
|
||||
.replace('{' + 'name' + '}', encodeURIComponent(String(name)));
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
const produces = ['application/json'];
|
||||
// give precedence to 'application/json'
|
||||
if (produces.indexOf('application/json') >= 0) {
|
||||
localVarHeaderParams.Accept = 'application/json';
|
||||
} else {
|
||||
localVarHeaderParams.Accept = produces.join(',');
|
||||
}
|
||||
let localVarFormParams: any = {};
|
||||
|
||||
// verify required parameter 'namespace' is not null or undefined
|
||||
if (namespace === null || namespace === undefined) {
|
||||
throw new Error('Required parameter namespace was null or undefined when calling sensorServiceUpdateSensor.');
|
||||
}
|
||||
|
||||
// verify required parameter 'name' is not null or undefined
|
||||
if (name === null || name === undefined) {
|
||||
throw new Error('Required parameter name was null or undefined when calling sensorServiceUpdateSensor.');
|
||||
}
|
||||
|
||||
// verify required parameter 'body' is not null or undefined
|
||||
if (body === null || body === undefined) {
|
||||
throw new Error('Required parameter body was null or undefined when calling sensorServiceUpdateSensor.');
|
||||
}
|
||||
|
||||
(<any>Object).assign(localVarHeaderParams, options.headers);
|
||||
|
||||
let localVarUseFormData = false;
|
||||
|
||||
let localVarRequestOptions: localVarRequest.Options = {
|
||||
method: 'PUT',
|
||||
qs: localVarQueryParameters,
|
||||
headers: localVarHeaderParams,
|
||||
uri: localVarPath,
|
||||
useQuerystring: this._useQuerystring,
|
||||
json: true,
|
||||
body: ObjectSerializer.serialize(body, "SensorUpdateSensorRequest")
|
||||
};
|
||||
|
||||
let authenticationPromise = Promise.resolve();
|
||||
if (this.authentications.BearerToken.apiKey) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
||||
|
||||
let interceptorPromise = authenticationPromise;
|
||||
for (const interceptor of this.interceptors) {
|
||||
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
||||
}
|
||||
|
||||
return interceptorPromise.then(() => {
|
||||
if (Object.keys(localVarFormParams).length) {
|
||||
if (localVarUseFormData) {
|
||||
(<any>localVarRequestOptions).formData = localVarFormParams;
|
||||
} else {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.IncomingMessage; body: IoArgoprojEventsV1alpha1Sensor; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
||||
body = ObjectSerializer.deserialize(body, "IoArgoprojEventsV1alpha1Sensor");
|
||||
resolve({ response: response, body: body });
|
||||
} else {
|
||||
reject(new HttpError(response, body, response.statusCode));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param namespace
|
||||
* @param listOptionsLabelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. +optional.
|
||||
* @param listOptionsFieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. +optional.
|
||||
* @param listOptionsWatch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. +optional.
|
||||
* @param listOptionsAllowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. +optional.
|
||||
* @param listOptionsResourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset +optional
|
||||
* @param listOptionsResourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset +optional
|
||||
* @param listOptionsTimeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. +optional.
|
||||
* @param listOptionsLimit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.
|
||||
* @param listOptionsContinue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.
|
||||
*/
|
||||
public async sensorServiceWatchSensors (namespace: string, listOptionsLabelSelector?: string, listOptionsFieldSelector?: string, listOptionsWatch?: boolean, listOptionsAllowWatchBookmarks?: boolean, listOptionsResourceVersion?: string, listOptionsResourceVersionMatch?: string, listOptionsTimeoutSeconds?: string, listOptionsLimit?: string, listOptionsContinue?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: StreamResultOfSensorSensorWatchEvent; }> {
|
||||
const localVarPath = this.basePath + '/api/v1/stream/sensors/{namespace}'
|
||||
.replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
const produces = ['application/json'];
|
||||
// give precedence to 'application/json'
|
||||
if (produces.indexOf('application/json') >= 0) {
|
||||
localVarHeaderParams.Accept = 'application/json';
|
||||
} else {
|
||||
localVarHeaderParams.Accept = produces.join(',');
|
||||
}
|
||||
let localVarFormParams: any = {};
|
||||
|
||||
// verify required parameter 'namespace' is not null or undefined
|
||||
if (namespace === null || namespace === undefined) {
|
||||
throw new Error('Required parameter namespace was null or undefined when calling sensorServiceWatchSensors.');
|
||||
}
|
||||
|
||||
if (listOptionsLabelSelector !== undefined) {
|
||||
localVarQueryParameters['listOptions.labelSelector'] = ObjectSerializer.serialize(listOptionsLabelSelector, "string");
|
||||
}
|
||||
|
||||
if (listOptionsFieldSelector !== undefined) {
|
||||
localVarQueryParameters['listOptions.fieldSelector'] = ObjectSerializer.serialize(listOptionsFieldSelector, "string");
|
||||
}
|
||||
|
||||
if (listOptionsWatch !== undefined) {
|
||||
localVarQueryParameters['listOptions.watch'] = ObjectSerializer.serialize(listOptionsWatch, "boolean");
|
||||
}
|
||||
|
||||
if (listOptionsAllowWatchBookmarks !== undefined) {
|
||||
localVarQueryParameters['listOptions.allowWatchBookmarks'] = ObjectSerializer.serialize(listOptionsAllowWatchBookmarks, "boolean");
|
||||
}
|
||||
|
||||
if (listOptionsResourceVersion !== undefined) {
|
||||
localVarQueryParameters['listOptions.resourceVersion'] = ObjectSerializer.serialize(listOptionsResourceVersion, "string");
|
||||
}
|
||||
|
||||
if (listOptionsResourceVersionMatch !== undefined) {
|
||||
localVarQueryParameters['listOptions.resourceVersionMatch'] = ObjectSerializer.serialize(listOptionsResourceVersionMatch, "string");
|
||||
}
|
||||
|
||||
if (listOptionsTimeoutSeconds !== undefined) {
|
||||
localVarQueryParameters['listOptions.timeoutSeconds'] = ObjectSerializer.serialize(listOptionsTimeoutSeconds, "string");
|
||||
}
|
||||
|
||||
if (listOptionsLimit !== undefined) {
|
||||
localVarQueryParameters['listOptions.limit'] = ObjectSerializer.serialize(listOptionsLimit, "string");
|
||||
}
|
||||
|
||||
if (listOptionsContinue !== undefined) {
|
||||
localVarQueryParameters['listOptions.continue'] = ObjectSerializer.serialize(listOptionsContinue, "string");
|
||||
}
|
||||
|
||||
(<any>Object).assign(localVarHeaderParams, options.headers);
|
||||
|
||||
let localVarUseFormData = false;
|
||||
|
||||
let localVarRequestOptions: localVarRequest.Options = {
|
||||
method: 'GET',
|
||||
qs: localVarQueryParameters,
|
||||
headers: localVarHeaderParams,
|
||||
uri: localVarPath,
|
||||
useQuerystring: this._useQuerystring,
|
||||
json: true,
|
||||
};
|
||||
|
||||
let authenticationPromise = Promise.resolve();
|
||||
if (this.authentications.BearerToken.apiKey) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
||||
|
||||
let interceptorPromise = authenticationPromise;
|
||||
for (const interceptor of this.interceptors) {
|
||||
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
||||
}
|
||||
|
||||
return interceptorPromise.then(() => {
|
||||
if (Object.keys(localVarFormParams).length) {
|
||||
if (localVarUseFormData) {
|
||||
(<any>localVarRequestOptions).formData = localVarFormParams;
|
||||
} else {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.IncomingMessage; body: StreamResultOfSensorSensorWatchEvent; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
||||
body = ObjectSerializer.deserialize(body, "StreamResultOfSensorSensorWatchEvent");
|
||||
resolve({ response: response, body: body });
|
||||
} else {
|
||||
reject(new HttpError(response, body, response.statusCode));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
1785
plugins/argo-workflows/src/api/generated/api/workflowServiceApi.ts
Normal file
1785
plugins/argo-workflows/src/api/generated/api/workflowServiceApi.ts
Normal file
File diff suppressed because it is too large
Load diff
|
@ -0,0 +1,646 @@
|
|||
// @ts-nocheck
|
||||
/**
|
||||
* Argo Workflows API
|
||||
* Argo Workflows is an open source container-native workflow engine for orchestrating parallel jobs on Kubernetes. For more information, please see https://argoproj.github.io/argo-workflows/
|
||||
*
|
||||
* The version of the OpenAPI document: VERSION
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
import localVarRequest from 'request';
|
||||
import http from 'http';
|
||||
|
||||
/* tslint:disable:no-unused-locals */
|
||||
import { GrpcGatewayRuntimeError } from '../model/grpcGatewayRuntimeError';
|
||||
import { IoArgoprojWorkflowV1alpha1WorkflowTemplate } from '../model/ioArgoprojWorkflowV1alpha1WorkflowTemplate';
|
||||
import { IoArgoprojWorkflowV1alpha1WorkflowTemplateCreateRequest } from '../model/ioArgoprojWorkflowV1alpha1WorkflowTemplateCreateRequest';
|
||||
import { IoArgoprojWorkflowV1alpha1WorkflowTemplateLintRequest } from '../model/ioArgoprojWorkflowV1alpha1WorkflowTemplateLintRequest';
|
||||
import { IoArgoprojWorkflowV1alpha1WorkflowTemplateList } from '../model/ioArgoprojWorkflowV1alpha1WorkflowTemplateList';
|
||||
import { IoArgoprojWorkflowV1alpha1WorkflowTemplateUpdateRequest } from '../model/ioArgoprojWorkflowV1alpha1WorkflowTemplateUpdateRequest';
|
||||
|
||||
import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models';
|
||||
import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models';
|
||||
|
||||
import { HttpError, RequestFile } from './apis';
|
||||
|
||||
let defaultBasePath = 'http://localhost:2746';
|
||||
|
||||
// ===============================================
|
||||
// This file is autogenerated - Please do not edit
|
||||
// ===============================================
|
||||
|
||||
export enum WorkflowTemplateServiceApiApiKeys {
|
||||
BearerToken,
|
||||
}
|
||||
|
||||
export class WorkflowTemplateServiceApi {
|
||||
protected _basePath = defaultBasePath;
|
||||
protected _defaultHeaders : any = {};
|
||||
protected _useQuerystring : boolean = false;
|
||||
|
||||
protected authentications = {
|
||||
'default': <Authentication>new VoidAuth(),
|
||||
'BearerToken': new ApiKeyAuth('header', 'Authorization'),
|
||||
}
|
||||
|
||||
protected interceptors: Interceptor[] = [];
|
||||
|
||||
constructor(basePath?: string);
|
||||
constructor(basePathOrUsername: string, password?: string, basePath?: string) {
|
||||
if (password) {
|
||||
if (basePath) {
|
||||
this.basePath = basePath;
|
||||
}
|
||||
} else {
|
||||
if (basePathOrUsername) {
|
||||
this.basePath = basePathOrUsername
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
set useQuerystring(value: boolean) {
|
||||
this._useQuerystring = value;
|
||||
}
|
||||
|
||||
set basePath(basePath: string) {
|
||||
this._basePath = basePath;
|
||||
}
|
||||
|
||||
set defaultHeaders(defaultHeaders: any) {
|
||||
this._defaultHeaders = defaultHeaders;
|
||||
}
|
||||
|
||||
get defaultHeaders() {
|
||||
return this._defaultHeaders;
|
||||
}
|
||||
|
||||
get basePath() {
|
||||
return this._basePath;
|
||||
}
|
||||
|
||||
public setDefaultAuthentication(auth: Authentication) {
|
||||
this.authentications.default = auth;
|
||||
}
|
||||
|
||||
public setApiKey(key: WorkflowTemplateServiceApiApiKeys, value: string) {
|
||||
(this.authentications as any)[WorkflowTemplateServiceApiApiKeys[key]].apiKey = value;
|
||||
}
|
||||
|
||||
public addInterceptor(interceptor: Interceptor) {
|
||||
this.interceptors.push(interceptor);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param namespace
|
||||
* @param body
|
||||
*/
|
||||
public async workflowTemplateServiceCreateWorkflowTemplate (namespace: string, body: IoArgoprojWorkflowV1alpha1WorkflowTemplateCreateRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: IoArgoprojWorkflowV1alpha1WorkflowTemplate; }> {
|
||||
const localVarPath = this.basePath + '/api/v1/workflow-templates/{namespace}'
|
||||
.replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
const produces = ['application/json'];
|
||||
// give precedence to 'application/json'
|
||||
if (produces.indexOf('application/json') >= 0) {
|
||||
localVarHeaderParams.Accept = 'application/json';
|
||||
} else {
|
||||
localVarHeaderParams.Accept = produces.join(',');
|
||||
}
|
||||
let localVarFormParams: any = {};
|
||||
|
||||
// verify required parameter 'namespace' is not null or undefined
|
||||
if (namespace === null || namespace === undefined) {
|
||||
throw new Error('Required parameter namespace was null or undefined when calling workflowTemplateServiceCreateWorkflowTemplate.');
|
||||
}
|
||||
|
||||
// verify required parameter 'body' is not null or undefined
|
||||
if (body === null || body === undefined) {
|
||||
throw new Error('Required parameter body was null or undefined when calling workflowTemplateServiceCreateWorkflowTemplate.');
|
||||
}
|
||||
|
||||
(<any>Object).assign(localVarHeaderParams, options.headers);
|
||||
|
||||
let localVarUseFormData = false;
|
||||
|
||||
let localVarRequestOptions: localVarRequest.Options = {
|
||||
method: 'POST',
|
||||
qs: localVarQueryParameters,
|
||||
headers: localVarHeaderParams,
|
||||
uri: localVarPath,
|
||||
useQuerystring: this._useQuerystring,
|
||||
json: true,
|
||||
body: ObjectSerializer.serialize(body, "IoArgoprojWorkflowV1alpha1WorkflowTemplateCreateRequest")
|
||||
};
|
||||
|
||||
let authenticationPromise = Promise.resolve();
|
||||
if (this.authentications.BearerToken.apiKey) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
||||
|
||||
let interceptorPromise = authenticationPromise;
|
||||
for (const interceptor of this.interceptors) {
|
||||
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
||||
}
|
||||
|
||||
return interceptorPromise.then(() => {
|
||||
if (Object.keys(localVarFormParams).length) {
|
||||
if (localVarUseFormData) {
|
||||
(<any>localVarRequestOptions).formData = localVarFormParams;
|
||||
} else {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.IncomingMessage; body: IoArgoprojWorkflowV1alpha1WorkflowTemplate; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
||||
body = ObjectSerializer.deserialize(body, "IoArgoprojWorkflowV1alpha1WorkflowTemplate");
|
||||
resolve({ response: response, body: body });
|
||||
} else {
|
||||
reject(new HttpError(response, body, response.statusCode));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param namespace
|
||||
* @param name
|
||||
* @param deleteOptionsGracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. +optional.
|
||||
* @param deleteOptionsPreconditionsUid Specifies the target UID. +optional.
|
||||
* @param deleteOptionsPreconditionsResourceVersion Specifies the target ResourceVersion +optional.
|
||||
* @param deleteOptionsOrphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. +optional.
|
||||
* @param deleteOptionsPropagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. +optional.
|
||||
* @param deleteOptionsDryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed +optional.
|
||||
*/
|
||||
public async workflowTemplateServiceDeleteWorkflowTemplate (namespace: string, name: string, deleteOptionsGracePeriodSeconds?: string, deleteOptionsPreconditionsUid?: string, deleteOptionsPreconditionsResourceVersion?: string, deleteOptionsOrphanDependents?: boolean, deleteOptionsPropagationPolicy?: string, deleteOptionsDryRun?: Array<string>, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: object; }> {
|
||||
const localVarPath = this.basePath + '/api/v1/workflow-templates/{namespace}/{name}'
|
||||
.replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)))
|
||||
.replace('{' + 'name' + '}', encodeURIComponent(String(name)));
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
const produces = ['application/json'];
|
||||
// give precedence to 'application/json'
|
||||
if (produces.indexOf('application/json') >= 0) {
|
||||
localVarHeaderParams.Accept = 'application/json';
|
||||
} else {
|
||||
localVarHeaderParams.Accept = produces.join(',');
|
||||
}
|
||||
let localVarFormParams: any = {};
|
||||
|
||||
// verify required parameter 'namespace' is not null or undefined
|
||||
if (namespace === null || namespace === undefined) {
|
||||
throw new Error('Required parameter namespace was null or undefined when calling workflowTemplateServiceDeleteWorkflowTemplate.');
|
||||
}
|
||||
|
||||
// verify required parameter 'name' is not null or undefined
|
||||
if (name === null || name === undefined) {
|
||||
throw new Error('Required parameter name was null or undefined when calling workflowTemplateServiceDeleteWorkflowTemplate.');
|
||||
}
|
||||
|
||||
if (deleteOptionsGracePeriodSeconds !== undefined) {
|
||||
localVarQueryParameters['deleteOptions.gracePeriodSeconds'] = ObjectSerializer.serialize(deleteOptionsGracePeriodSeconds, "string");
|
||||
}
|
||||
|
||||
if (deleteOptionsPreconditionsUid !== undefined) {
|
||||
localVarQueryParameters['deleteOptions.preconditions.uid'] = ObjectSerializer.serialize(deleteOptionsPreconditionsUid, "string");
|
||||
}
|
||||
|
||||
if (deleteOptionsPreconditionsResourceVersion !== undefined) {
|
||||
localVarQueryParameters['deleteOptions.preconditions.resourceVersion'] = ObjectSerializer.serialize(deleteOptionsPreconditionsResourceVersion, "string");
|
||||
}
|
||||
|
||||
if (deleteOptionsOrphanDependents !== undefined) {
|
||||
localVarQueryParameters['deleteOptions.orphanDependents'] = ObjectSerializer.serialize(deleteOptionsOrphanDependents, "boolean");
|
||||
}
|
||||
|
||||
if (deleteOptionsPropagationPolicy !== undefined) {
|
||||
localVarQueryParameters['deleteOptions.propagationPolicy'] = ObjectSerializer.serialize(deleteOptionsPropagationPolicy, "string");
|
||||
}
|
||||
|
||||
if (deleteOptionsDryRun !== undefined) {
|
||||
localVarQueryParameters['deleteOptions.dryRun'] = ObjectSerializer.serialize(deleteOptionsDryRun, "Array<string>");
|
||||
}
|
||||
|
||||
(<any>Object).assign(localVarHeaderParams, options.headers);
|
||||
|
||||
let localVarUseFormData = false;
|
||||
|
||||
let localVarRequestOptions: localVarRequest.Options = {
|
||||
method: 'DELETE',
|
||||
qs: localVarQueryParameters,
|
||||
headers: localVarHeaderParams,
|
||||
uri: localVarPath,
|
||||
useQuerystring: this._useQuerystring,
|
||||
json: true,
|
||||
};
|
||||
|
||||
let authenticationPromise = Promise.resolve();
|
||||
if (this.authentications.BearerToken.apiKey) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
||||
|
||||
let interceptorPromise = authenticationPromise;
|
||||
for (const interceptor of this.interceptors) {
|
||||
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
||||
}
|
||||
|
||||
return interceptorPromise.then(() => {
|
||||
if (Object.keys(localVarFormParams).length) {
|
||||
if (localVarUseFormData) {
|
||||
(<any>localVarRequestOptions).formData = localVarFormParams;
|
||||
} else {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.IncomingMessage; body: object; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
||||
body = ObjectSerializer.deserialize(body, "object");
|
||||
resolve({ response: response, body: body });
|
||||
} else {
|
||||
reject(new HttpError(response, body, response.statusCode));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param namespace
|
||||
* @param name
|
||||
* @param getOptionsResourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset +optional
|
||||
*/
|
||||
public async workflowTemplateServiceGetWorkflowTemplate (namespace: string, name: string, getOptionsResourceVersion?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: IoArgoprojWorkflowV1alpha1WorkflowTemplate; }> {
|
||||
const localVarPath = this.basePath + '/api/v1/workflow-templates/{namespace}/{name}'
|
||||
.replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)))
|
||||
.replace('{' + 'name' + '}', encodeURIComponent(String(name)));
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
const produces = ['application/json'];
|
||||
// give precedence to 'application/json'
|
||||
if (produces.indexOf('application/json') >= 0) {
|
||||
localVarHeaderParams.Accept = 'application/json';
|
||||
} else {
|
||||
localVarHeaderParams.Accept = produces.join(',');
|
||||
}
|
||||
let localVarFormParams: any = {};
|
||||
|
||||
// verify required parameter 'namespace' is not null or undefined
|
||||
if (namespace === null || namespace === undefined) {
|
||||
throw new Error('Required parameter namespace was null or undefined when calling workflowTemplateServiceGetWorkflowTemplate.');
|
||||
}
|
||||
|
||||
// verify required parameter 'name' is not null or undefined
|
||||
if (name === null || name === undefined) {
|
||||
throw new Error('Required parameter name was null or undefined when calling workflowTemplateServiceGetWorkflowTemplate.');
|
||||
}
|
||||
|
||||
if (getOptionsResourceVersion !== undefined) {
|
||||
localVarQueryParameters['getOptions.resourceVersion'] = ObjectSerializer.serialize(getOptionsResourceVersion, "string");
|
||||
}
|
||||
|
||||
(<any>Object).assign(localVarHeaderParams, options.headers);
|
||||
|
||||
let localVarUseFormData = false;
|
||||
|
||||
let localVarRequestOptions: localVarRequest.Options = {
|
||||
method: 'GET',
|
||||
qs: localVarQueryParameters,
|
||||
headers: localVarHeaderParams,
|
||||
uri: localVarPath,
|
||||
useQuerystring: this._useQuerystring,
|
||||
json: true,
|
||||
};
|
||||
|
||||
let authenticationPromise = Promise.resolve();
|
||||
if (this.authentications.BearerToken.apiKey) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
||||
|
||||
let interceptorPromise = authenticationPromise;
|
||||
for (const interceptor of this.interceptors) {
|
||||
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
||||
}
|
||||
|
||||
return interceptorPromise.then(() => {
|
||||
if (Object.keys(localVarFormParams).length) {
|
||||
if (localVarUseFormData) {
|
||||
(<any>localVarRequestOptions).formData = localVarFormParams;
|
||||
} else {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.IncomingMessage; body: IoArgoprojWorkflowV1alpha1WorkflowTemplate; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
||||
body = ObjectSerializer.deserialize(body, "IoArgoprojWorkflowV1alpha1WorkflowTemplate");
|
||||
resolve({ response: response, body: body });
|
||||
} else {
|
||||
reject(new HttpError(response, body, response.statusCode));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param namespace
|
||||
* @param body
|
||||
*/
|
||||
public async workflowTemplateServiceLintWorkflowTemplate (namespace: string, body: IoArgoprojWorkflowV1alpha1WorkflowTemplateLintRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: IoArgoprojWorkflowV1alpha1WorkflowTemplate; }> {
|
||||
const localVarPath = this.basePath + '/api/v1/workflow-templates/{namespace}/lint'
|
||||
.replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
const produces = ['application/json'];
|
||||
// give precedence to 'application/json'
|
||||
if (produces.indexOf('application/json') >= 0) {
|
||||
localVarHeaderParams.Accept = 'application/json';
|
||||
} else {
|
||||
localVarHeaderParams.Accept = produces.join(',');
|
||||
}
|
||||
let localVarFormParams: any = {};
|
||||
|
||||
// verify required parameter 'namespace' is not null or undefined
|
||||
if (namespace === null || namespace === undefined) {
|
||||
throw new Error('Required parameter namespace was null or undefined when calling workflowTemplateServiceLintWorkflowTemplate.');
|
||||
}
|
||||
|
||||
// verify required parameter 'body' is not null or undefined
|
||||
if (body === null || body === undefined) {
|
||||
throw new Error('Required parameter body was null or undefined when calling workflowTemplateServiceLintWorkflowTemplate.');
|
||||
}
|
||||
|
||||
(<any>Object).assign(localVarHeaderParams, options.headers);
|
||||
|
||||
let localVarUseFormData = false;
|
||||
|
||||
let localVarRequestOptions: localVarRequest.Options = {
|
||||
method: 'POST',
|
||||
qs: localVarQueryParameters,
|
||||
headers: localVarHeaderParams,
|
||||
uri: localVarPath,
|
||||
useQuerystring: this._useQuerystring,
|
||||
json: true,
|
||||
body: ObjectSerializer.serialize(body, "IoArgoprojWorkflowV1alpha1WorkflowTemplateLintRequest")
|
||||
};
|
||||
|
||||
let authenticationPromise = Promise.resolve();
|
||||
if (this.authentications.BearerToken.apiKey) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
||||
|
||||
let interceptorPromise = authenticationPromise;
|
||||
for (const interceptor of this.interceptors) {
|
||||
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
||||
}
|
||||
|
||||
return interceptorPromise.then(() => {
|
||||
if (Object.keys(localVarFormParams).length) {
|
||||
if (localVarUseFormData) {
|
||||
(<any>localVarRequestOptions).formData = localVarFormParams;
|
||||
} else {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.IncomingMessage; body: IoArgoprojWorkflowV1alpha1WorkflowTemplate; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
||||
body = ObjectSerializer.deserialize(body, "IoArgoprojWorkflowV1alpha1WorkflowTemplate");
|
||||
resolve({ response: response, body: body });
|
||||
} else {
|
||||
reject(new HttpError(response, body, response.statusCode));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param namespace
|
||||
* @param listOptionsLabelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. +optional.
|
||||
* @param listOptionsFieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. +optional.
|
||||
* @param listOptionsWatch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. +optional.
|
||||
* @param listOptionsAllowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. +optional.
|
||||
* @param listOptionsResourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset +optional
|
||||
* @param listOptionsResourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset +optional
|
||||
* @param listOptionsTimeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. +optional.
|
||||
* @param listOptionsLimit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.
|
||||
* @param listOptionsContinue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.
|
||||
*/
|
||||
public async workflowTemplateServiceListWorkflowTemplates (namespace: string, listOptionsLabelSelector?: string, listOptionsFieldSelector?: string, listOptionsWatch?: boolean, listOptionsAllowWatchBookmarks?: boolean, listOptionsResourceVersion?: string, listOptionsResourceVersionMatch?: string, listOptionsTimeoutSeconds?: string, listOptionsLimit?: string, listOptionsContinue?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: IoArgoprojWorkflowV1alpha1WorkflowTemplateList; }> {
|
||||
const localVarPath = this.basePath + '/api/v1/workflow-templates/{namespace}'
|
||||
.replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
const produces = ['application/json'];
|
||||
// give precedence to 'application/json'
|
||||
if (produces.indexOf('application/json') >= 0) {
|
||||
localVarHeaderParams.Accept = 'application/json';
|
||||
} else {
|
||||
localVarHeaderParams.Accept = produces.join(',');
|
||||
}
|
||||
let localVarFormParams: any = {};
|
||||
|
||||
// verify required parameter 'namespace' is not null or undefined
|
||||
if (namespace === null || namespace === undefined) {
|
||||
throw new Error('Required parameter namespace was null or undefined when calling workflowTemplateServiceListWorkflowTemplates.');
|
||||
}
|
||||
|
||||
if (listOptionsLabelSelector !== undefined) {
|
||||
localVarQueryParameters['listOptions.labelSelector'] = ObjectSerializer.serialize(listOptionsLabelSelector, "string");
|
||||
}
|
||||
|
||||
if (listOptionsFieldSelector !== undefined) {
|
||||
localVarQueryParameters['listOptions.fieldSelector'] = ObjectSerializer.serialize(listOptionsFieldSelector, "string");
|
||||
}
|
||||
|
||||
if (listOptionsWatch !== undefined) {
|
||||
localVarQueryParameters['listOptions.watch'] = ObjectSerializer.serialize(listOptionsWatch, "boolean");
|
||||
}
|
||||
|
||||
if (listOptionsAllowWatchBookmarks !== undefined) {
|
||||
localVarQueryParameters['listOptions.allowWatchBookmarks'] = ObjectSerializer.serialize(listOptionsAllowWatchBookmarks, "boolean");
|
||||
}
|
||||
|
||||
if (listOptionsResourceVersion !== undefined) {
|
||||
localVarQueryParameters['listOptions.resourceVersion'] = ObjectSerializer.serialize(listOptionsResourceVersion, "string");
|
||||
}
|
||||
|
||||
if (listOptionsResourceVersionMatch !== undefined) {
|
||||
localVarQueryParameters['listOptions.resourceVersionMatch'] = ObjectSerializer.serialize(listOptionsResourceVersionMatch, "string");
|
||||
}
|
||||
|
||||
if (listOptionsTimeoutSeconds !== undefined) {
|
||||
localVarQueryParameters['listOptions.timeoutSeconds'] = ObjectSerializer.serialize(listOptionsTimeoutSeconds, "string");
|
||||
}
|
||||
|
||||
if (listOptionsLimit !== undefined) {
|
||||
localVarQueryParameters['listOptions.limit'] = ObjectSerializer.serialize(listOptionsLimit, "string");
|
||||
}
|
||||
|
||||
if (listOptionsContinue !== undefined) {
|
||||
localVarQueryParameters['listOptions.continue'] = ObjectSerializer.serialize(listOptionsContinue, "string");
|
||||
}
|
||||
|
||||
(<any>Object).assign(localVarHeaderParams, options.headers);
|
||||
|
||||
let localVarUseFormData = false;
|
||||
|
||||
let localVarRequestOptions: localVarRequest.Options = {
|
||||
method: 'GET',
|
||||
qs: localVarQueryParameters,
|
||||
headers: localVarHeaderParams,
|
||||
uri: localVarPath,
|
||||
useQuerystring: this._useQuerystring,
|
||||
json: true,
|
||||
};
|
||||
|
||||
let authenticationPromise = Promise.resolve();
|
||||
if (this.authentications.BearerToken.apiKey) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
||||
|
||||
let interceptorPromise = authenticationPromise;
|
||||
for (const interceptor of this.interceptors) {
|
||||
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
||||
}
|
||||
|
||||
return interceptorPromise.then(() => {
|
||||
if (Object.keys(localVarFormParams).length) {
|
||||
if (localVarUseFormData) {
|
||||
(<any>localVarRequestOptions).formData = localVarFormParams;
|
||||
} else {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.IncomingMessage; body: IoArgoprojWorkflowV1alpha1WorkflowTemplateList; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
||||
body = ObjectSerializer.deserialize(body, "IoArgoprojWorkflowV1alpha1WorkflowTemplateList");
|
||||
resolve({ response: response, body: body });
|
||||
} else {
|
||||
reject(new HttpError(response, body, response.statusCode));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param namespace
|
||||
* @param name DEPRECATED: This field is ignored.
|
||||
* @param body
|
||||
*/
|
||||
public async workflowTemplateServiceUpdateWorkflowTemplate (namespace: string, name: string, body: IoArgoprojWorkflowV1alpha1WorkflowTemplateUpdateRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: IoArgoprojWorkflowV1alpha1WorkflowTemplate; }> {
|
||||
const localVarPath = this.basePath + '/api/v1/workflow-templates/{namespace}/{name}'
|
||||
.replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)))
|
||||
.replace('{' + 'name' + '}', encodeURIComponent(String(name)));
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
const produces = ['application/json'];
|
||||
// give precedence to 'application/json'
|
||||
if (produces.indexOf('application/json') >= 0) {
|
||||
localVarHeaderParams.Accept = 'application/json';
|
||||
} else {
|
||||
localVarHeaderParams.Accept = produces.join(',');
|
||||
}
|
||||
let localVarFormParams: any = {};
|
||||
|
||||
// verify required parameter 'namespace' is not null or undefined
|
||||
if (namespace === null || namespace === undefined) {
|
||||
throw new Error('Required parameter namespace was null or undefined when calling workflowTemplateServiceUpdateWorkflowTemplate.');
|
||||
}
|
||||
|
||||
// verify required parameter 'name' is not null or undefined
|
||||
if (name === null || name === undefined) {
|
||||
throw new Error('Required parameter name was null or undefined when calling workflowTemplateServiceUpdateWorkflowTemplate.');
|
||||
}
|
||||
|
||||
// verify required parameter 'body' is not null or undefined
|
||||
if (body === null || body === undefined) {
|
||||
throw new Error('Required parameter body was null or undefined when calling workflowTemplateServiceUpdateWorkflowTemplate.');
|
||||
}
|
||||
|
||||
(<any>Object).assign(localVarHeaderParams, options.headers);
|
||||
|
||||
let localVarUseFormData = false;
|
||||
|
||||
let localVarRequestOptions: localVarRequest.Options = {
|
||||
method: 'PUT',
|
||||
qs: localVarQueryParameters,
|
||||
headers: localVarHeaderParams,
|
||||
uri: localVarPath,
|
||||
useQuerystring: this._useQuerystring,
|
||||
json: true,
|
||||
body: ObjectSerializer.serialize(body, "IoArgoprojWorkflowV1alpha1WorkflowTemplateUpdateRequest")
|
||||
};
|
||||
|
||||
let authenticationPromise = Promise.resolve();
|
||||
if (this.authentications.BearerToken.apiKey) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
||||
|
||||
let interceptorPromise = authenticationPromise;
|
||||
for (const interceptor of this.interceptors) {
|
||||
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
||||
}
|
||||
|
||||
return interceptorPromise.then(() => {
|
||||
if (Object.keys(localVarFormParams).length) {
|
||||
if (localVarUseFormData) {
|
||||
(<any>localVarRequestOptions).formData = localVarFormParams;
|
||||
} else {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.IncomingMessage; body: IoArgoprojWorkflowV1alpha1WorkflowTemplate; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
||||
body = ObjectSerializer.deserialize(body, "IoArgoprojWorkflowV1alpha1WorkflowTemplate");
|
||||
resolve({ response: response, body: body });
|
||||
} else {
|
||||
reject(new HttpError(response, body, response.statusCode));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
57
plugins/argo-workflows/src/api/generated/git_push.sh
Normal file
57
plugins/argo-workflows/src/api/generated/git_push.sh
Normal file
|
@ -0,0 +1,57 @@
|
|||
#!/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 openapi-petstore-perl "minor update" "gitlab.com"
|
||||
|
||||
git_user_id=$1
|
||||
git_repo_id=$2
|
||||
release_note=$3
|
||||
git_host=$4
|
||||
|
||||
if [ "$git_host" = "" ]; then
|
||||
git_host="github.com"
|
||||
echo "[INFO] No command line input provided. Set \$git_host to $git_host"
|
||||
fi
|
||||
|
||||
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://${git_host}/${git_user_id}/${git_repo_id}.git
|
||||
else
|
||||
git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${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://${git_host}/${git_user_id}/${git_repo_id}.git"
|
||||
git push origin master 2>&1 | grep -v 'To https'
|
|
@ -0,0 +1,39 @@
|
|||
// @ts-nocheck
|
||||
/**
|
||||
* Argo Workflows API
|
||||
* Argo Workflows is an open source container-native workflow engine for orchestrating parallel jobs on Kubernetes. For more information, please see https://argoproj.github.io/argo-workflows/
|
||||
*
|
||||
* The version of the OpenAPI document: VERSION
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { RequestFile } from './models';
|
||||
import { IoArgoprojEventsV1alpha1EventSource } from './ioArgoprojEventsV1alpha1EventSource';
|
||||
|
||||
export class EventsourceCreateEventSourceRequest {
|
||||
'eventSource'?: IoArgoprojEventsV1alpha1EventSource;
|
||||
'namespace'?: string;
|
||||
|
||||
static discriminator: string | undefined = undefined;
|
||||
|
||||
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
|
||||
{
|
||||
"name": "eventSource",
|
||||
"baseName": "eventSource",
|
||||
"type": "IoArgoprojEventsV1alpha1EventSource"
|
||||
},
|
||||
{
|
||||
"name": "namespace",
|
||||
"baseName": "namespace",
|
||||
"type": "string"
|
||||
} ];
|
||||
|
||||
static getAttributeTypeMap() {
|
||||
return EventsourceCreateEventSourceRequest.attributeTypeMap;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
// @ts-nocheck
|
||||
/**
|
||||
* Argo Workflows API
|
||||
* Argo Workflows is an open source container-native workflow engine for orchestrating parallel jobs on Kubernetes. For more information, please see https://argoproj.github.io/argo-workflows/
|
||||
*
|
||||
* The version of the OpenAPI document: VERSION
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { RequestFile } from './models';
|
||||
import { IoArgoprojEventsV1alpha1EventSource } from './ioArgoprojEventsV1alpha1EventSource';
|
||||
|
||||
export class EventsourceEventSourceWatchEvent {
|
||||
'object'?: IoArgoprojEventsV1alpha1EventSource;
|
||||
'type'?: string;
|
||||
|
||||
static discriminator: string | undefined = undefined;
|
||||
|
||||
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
|
||||
{
|
||||
"name": "object",
|
||||
"baseName": "object",
|
||||
"type": "IoArgoprojEventsV1alpha1EventSource"
|
||||
},
|
||||
{
|
||||
"name": "type",
|
||||
"baseName": "type",
|
||||
"type": "string"
|
||||
} ];
|
||||
|
||||
static getAttributeTypeMap() {
|
||||
return EventsourceEventSourceWatchEvent.attributeTypeMap;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,71 @@
|
|||
// @ts-nocheck
|
||||
/**
|
||||
* Argo Workflows API
|
||||
* Argo Workflows is an open source container-native workflow engine for orchestrating parallel jobs on Kubernetes. For more information, please see https://argoproj.github.io/argo-workflows/
|
||||
*
|
||||
* The version of the OpenAPI document: VERSION
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { RequestFile } from './models';
|
||||
|
||||
export class EventsourceLogEntry {
|
||||
'eventName'?: string;
|
||||
'eventSourceName'?: string;
|
||||
'eventSourceType'?: string;
|
||||
'level'?: string;
|
||||
'msg'?: string;
|
||||
'namespace'?: string;
|
||||
/**
|
||||
* Time is a wrapper around time.Time which supports correct marshaling to YAML and JSON. Wrappers are provided for many of the factory methods that the time package offers.
|
||||
*/
|
||||
'time'?: Date;
|
||||
|
||||
static discriminator: string | undefined = undefined;
|
||||
|
||||
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
|
||||
{
|
||||
"name": "eventName",
|
||||
"baseName": "eventName",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "eventSourceName",
|
||||
"baseName": "eventSourceName",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "eventSourceType",
|
||||
"baseName": "eventSourceType",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "level",
|
||||
"baseName": "level",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "msg",
|
||||
"baseName": "msg",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "namespace",
|
||||
"baseName": "namespace",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "time",
|
||||
"baseName": "time",
|
||||
"type": "Date"
|
||||
} ];
|
||||
|
||||
static getAttributeTypeMap() {
|
||||
return EventsourceLogEntry.attributeTypeMap;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
// @ts-nocheck
|
||||
/**
|
||||
* Argo Workflows API
|
||||
* Argo Workflows is an open source container-native workflow engine for orchestrating parallel jobs on Kubernetes. For more information, please see https://argoproj.github.io/argo-workflows/
|
||||
*
|
||||
* The version of the OpenAPI document: VERSION
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { RequestFile } from './models';
|
||||
import { IoArgoprojEventsV1alpha1EventSource } from './ioArgoprojEventsV1alpha1EventSource';
|
||||
|
||||
export class EventsourceUpdateEventSourceRequest {
|
||||
'eventSource'?: IoArgoprojEventsV1alpha1EventSource;
|
||||
'name'?: string;
|
||||
'namespace'?: string;
|
||||
|
||||
static discriminator: string | undefined = undefined;
|
||||
|
||||
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
|
||||
{
|
||||
"name": "eventSource",
|
||||
"baseName": "eventSource",
|
||||
"type": "IoArgoprojEventsV1alpha1EventSource"
|
||||
},
|
||||
{
|
||||
"name": "name",
|
||||
"baseName": "name",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "namespace",
|
||||
"baseName": "namespace",
|
||||
"type": "string"
|
||||
} ];
|
||||
|
||||
static getAttributeTypeMap() {
|
||||
return EventsourceUpdateEventSourceRequest.attributeTypeMap;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
// @ts-nocheck
|
||||
/**
|
||||
* Argo Workflows API
|
||||
* Argo Workflows is an open source container-native workflow engine for orchestrating parallel jobs on Kubernetes. For more information, please see https://argoproj.github.io/argo-workflows/
|
||||
*
|
||||
* The version of the OpenAPI document: VERSION
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { RequestFile } from './models';
|
||||
|
||||
export class GoogleProtobufAny {
|
||||
'typeUrl'?: string;
|
||||
'value'?: string;
|
||||
|
||||
static discriminator: string | undefined = undefined;
|
||||
|
||||
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
|
||||
{
|
||||
"name": "typeUrl",
|
||||
"baseName": "type_url",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "value",
|
||||
"baseName": "value",
|
||||
"type": "string"
|
||||
} ];
|
||||
|
||||
static getAttributeTypeMap() {
|
||||
return GoogleProtobufAny.attributeTypeMap;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,51 @@
|
|||
// @ts-nocheck
|
||||
/**
|
||||
* Argo Workflows API
|
||||
* Argo Workflows is an open source container-native workflow engine for orchestrating parallel jobs on Kubernetes. For more information, please see https://argoproj.github.io/argo-workflows/
|
||||
*
|
||||
* The version of the OpenAPI document: VERSION
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { RequestFile } from './models';
|
||||
import { GoogleProtobufAny } from './googleProtobufAny';
|
||||
|
||||
export class GrpcGatewayRuntimeError {
|
||||
'code'?: number;
|
||||
'details'?: Array<GoogleProtobufAny>;
|
||||
'error'?: string;
|
||||
'message'?: string;
|
||||
|
||||
static discriminator: string | undefined = undefined;
|
||||
|
||||
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
|
||||
{
|
||||
"name": "code",
|
||||
"baseName": "code",
|
||||
"type": "number"
|
||||
},
|
||||
{
|
||||
"name": "details",
|
||||
"baseName": "details",
|
||||
"type": "Array<GoogleProtobufAny>"
|
||||
},
|
||||
{
|
||||
"name": "error",
|
||||
"baseName": "error",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "message",
|
||||
"baseName": "message",
|
||||
"type": "string"
|
||||
} ];
|
||||
|
||||
static getAttributeTypeMap() {
|
||||
return GrpcGatewayRuntimeError.attributeTypeMap;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,57 @@
|
|||
// @ts-nocheck
|
||||
/**
|
||||
* Argo Workflows API
|
||||
* Argo Workflows is an open source container-native workflow engine for orchestrating parallel jobs on Kubernetes. For more information, please see https://argoproj.github.io/argo-workflows/
|
||||
*
|
||||
* The version of the OpenAPI document: VERSION
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { RequestFile } from './models';
|
||||
import { GoogleProtobufAny } from './googleProtobufAny';
|
||||
|
||||
export class GrpcGatewayRuntimeStreamError {
|
||||
'details'?: Array<GoogleProtobufAny>;
|
||||
'grpcCode'?: number;
|
||||
'httpCode'?: number;
|
||||
'httpStatus'?: string;
|
||||
'message'?: string;
|
||||
|
||||
static discriminator: string | undefined = undefined;
|
||||
|
||||
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
|
||||
{
|
||||
"name": "details",
|
||||
"baseName": "details",
|
||||
"type": "Array<GoogleProtobufAny>"
|
||||
},
|
||||
{
|
||||
"name": "grpcCode",
|
||||
"baseName": "grpc_code",
|
||||
"type": "number"
|
||||
},
|
||||
{
|
||||
"name": "httpCode",
|
||||
"baseName": "http_code",
|
||||
"type": "number"
|
||||
},
|
||||
{
|
||||
"name": "httpStatus",
|
||||
"baseName": "http_status",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "message",
|
||||
"baseName": "message",
|
||||
"type": "string"
|
||||
} ];
|
||||
|
||||
static getAttributeTypeMap() {
|
||||
return GrpcGatewayRuntimeStreamError.attributeTypeMap;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,56 @@
|
|||
// @ts-nocheck
|
||||
/**
|
||||
* Argo Workflows API
|
||||
* Argo Workflows is an open source container-native workflow engine for orchestrating parallel jobs on Kubernetes. For more information, please see https://argoproj.github.io/argo-workflows/
|
||||
*
|
||||
* The version of the OpenAPI document: VERSION
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { RequestFile } from './models';
|
||||
|
||||
export class IoArgoprojEventsV1alpha1AMQPConsumeConfig {
|
||||
'autoAck'?: boolean;
|
||||
'consumerTag'?: string;
|
||||
'exclusive'?: boolean;
|
||||
'noLocal'?: boolean;
|
||||
'noWait'?: boolean;
|
||||
|
||||
static discriminator: string | undefined = undefined;
|
||||
|
||||
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
|
||||
{
|
||||
"name": "autoAck",
|
||||
"baseName": "autoAck",
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"name": "consumerTag",
|
||||
"baseName": "consumerTag",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "exclusive",
|
||||
"baseName": "exclusive",
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"name": "noLocal",
|
||||
"baseName": "noLocal",
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"name": "noWait",
|
||||
"baseName": "noWait",
|
||||
"type": "boolean"
|
||||
} ];
|
||||
|
||||
static getAttributeTypeMap() {
|
||||
return IoArgoprojEventsV1alpha1AMQPConsumeConfig.attributeTypeMap;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,125 @@
|
|||
// @ts-nocheck
|
||||
/**
|
||||
* Argo Workflows API
|
||||
* Argo Workflows is an open source container-native workflow engine for orchestrating parallel jobs on Kubernetes. For more information, please see https://argoproj.github.io/argo-workflows/
|
||||
*
|
||||
* The version of the OpenAPI document: VERSION
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { RequestFile } from './models';
|
||||
import { IoArgoprojEventsV1alpha1AMQPConsumeConfig } from './ioArgoprojEventsV1alpha1AMQPConsumeConfig';
|
||||
import { IoArgoprojEventsV1alpha1AMQPExchangeDeclareConfig } from './ioArgoprojEventsV1alpha1AMQPExchangeDeclareConfig';
|
||||
import { IoArgoprojEventsV1alpha1AMQPQueueBindConfig } from './ioArgoprojEventsV1alpha1AMQPQueueBindConfig';
|
||||
import { IoArgoprojEventsV1alpha1AMQPQueueDeclareConfig } from './ioArgoprojEventsV1alpha1AMQPQueueDeclareConfig';
|
||||
import { IoArgoprojEventsV1alpha1Backoff } from './ioArgoprojEventsV1alpha1Backoff';
|
||||
import { IoArgoprojEventsV1alpha1BasicAuth } from './ioArgoprojEventsV1alpha1BasicAuth';
|
||||
import { IoArgoprojEventsV1alpha1EventSourceFilter } from './ioArgoprojEventsV1alpha1EventSourceFilter';
|
||||
import { IoArgoprojEventsV1alpha1TLSConfig } from './ioArgoprojEventsV1alpha1TLSConfig';
|
||||
import { IoK8sApiCoreV1SecretKeySelector } from './ioK8sApiCoreV1SecretKeySelector';
|
||||
|
||||
export class IoArgoprojEventsV1alpha1AMQPEventSource {
|
||||
'auth'?: IoArgoprojEventsV1alpha1BasicAuth;
|
||||
'connectionBackoff'?: IoArgoprojEventsV1alpha1Backoff;
|
||||
'consume'?: IoArgoprojEventsV1alpha1AMQPConsumeConfig;
|
||||
'exchangeDeclare'?: IoArgoprojEventsV1alpha1AMQPExchangeDeclareConfig;
|
||||
'exchangeName'?: string;
|
||||
'exchangeType'?: string;
|
||||
'filter'?: IoArgoprojEventsV1alpha1EventSourceFilter;
|
||||
'jsonBody'?: boolean;
|
||||
'metadata'?: { [key: string]: string; };
|
||||
'queueBind'?: IoArgoprojEventsV1alpha1AMQPQueueBindConfig;
|
||||
'queueDeclare'?: IoArgoprojEventsV1alpha1AMQPQueueDeclareConfig;
|
||||
'routingKey'?: string;
|
||||
'tls'?: IoArgoprojEventsV1alpha1TLSConfig;
|
||||
'url'?: string;
|
||||
'urlSecret'?: IoK8sApiCoreV1SecretKeySelector;
|
||||
|
||||
static discriminator: string | undefined = undefined;
|
||||
|
||||
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
|
||||
{
|
||||
"name": "auth",
|
||||
"baseName": "auth",
|
||||
"type": "IoArgoprojEventsV1alpha1BasicAuth"
|
||||
},
|
||||
{
|
||||
"name": "connectionBackoff",
|
||||
"baseName": "connectionBackoff",
|
||||
"type": "IoArgoprojEventsV1alpha1Backoff"
|
||||
},
|
||||
{
|
||||
"name": "consume",
|
||||
"baseName": "consume",
|
||||
"type": "IoArgoprojEventsV1alpha1AMQPConsumeConfig"
|
||||
},
|
||||
{
|
||||
"name": "exchangeDeclare",
|
||||
"baseName": "exchangeDeclare",
|
||||
"type": "IoArgoprojEventsV1alpha1AMQPExchangeDeclareConfig"
|
||||
},
|
||||
{
|
||||
"name": "exchangeName",
|
||||
"baseName": "exchangeName",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "exchangeType",
|
||||
"baseName": "exchangeType",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "filter",
|
||||
"baseName": "filter",
|
||||
"type": "IoArgoprojEventsV1alpha1EventSourceFilter"
|
||||
},
|
||||
{
|
||||
"name": "jsonBody",
|
||||
"baseName": "jsonBody",
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"name": "metadata",
|
||||
"baseName": "metadata",
|
||||
"type": "{ [key: string]: string; }"
|
||||
},
|
||||
{
|
||||
"name": "queueBind",
|
||||
"baseName": "queueBind",
|
||||
"type": "IoArgoprojEventsV1alpha1AMQPQueueBindConfig"
|
||||
},
|
||||
{
|
||||
"name": "queueDeclare",
|
||||
"baseName": "queueDeclare",
|
||||
"type": "IoArgoprojEventsV1alpha1AMQPQueueDeclareConfig"
|
||||
},
|
||||
{
|
||||
"name": "routingKey",
|
||||
"baseName": "routingKey",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "tls",
|
||||
"baseName": "tls",
|
||||
"type": "IoArgoprojEventsV1alpha1TLSConfig"
|
||||
},
|
||||
{
|
||||
"name": "url",
|
||||
"baseName": "url",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "urlSecret",
|
||||
"baseName": "urlSecret",
|
||||
"type": "IoK8sApiCoreV1SecretKeySelector"
|
||||
} ];
|
||||
|
||||
static getAttributeTypeMap() {
|
||||
return IoArgoprojEventsV1alpha1AMQPEventSource.attributeTypeMap;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
// @ts-nocheck
|
||||
/**
|
||||
* Argo Workflows API
|
||||
* Argo Workflows is an open source container-native workflow engine for orchestrating parallel jobs on Kubernetes. For more information, please see https://argoproj.github.io/argo-workflows/
|
||||
*
|
||||
* The version of the OpenAPI document: VERSION
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { RequestFile } from './models';
|
||||
|
||||
export class IoArgoprojEventsV1alpha1AMQPExchangeDeclareConfig {
|
||||
'autoDelete'?: boolean;
|
||||
'durable'?: boolean;
|
||||
'internal'?: boolean;
|
||||
'noWait'?: boolean;
|
||||
|
||||
static discriminator: string | undefined = undefined;
|
||||
|
||||
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
|
||||
{
|
||||
"name": "autoDelete",
|
||||
"baseName": "autoDelete",
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"name": "durable",
|
||||
"baseName": "durable",
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"name": "internal",
|
||||
"baseName": "internal",
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"name": "noWait",
|
||||
"baseName": "noWait",
|
||||
"type": "boolean"
|
||||
} ];
|
||||
|
||||
static getAttributeTypeMap() {
|
||||
return IoArgoprojEventsV1alpha1AMQPExchangeDeclareConfig.attributeTypeMap;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
// @ts-nocheck
|
||||
/**
|
||||
* Argo Workflows API
|
||||
* Argo Workflows is an open source container-native workflow engine for orchestrating parallel jobs on Kubernetes. For more information, please see https://argoproj.github.io/argo-workflows/
|
||||
*
|
||||
* The version of the OpenAPI document: VERSION
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { RequestFile } from './models';
|
||||
|
||||
export class IoArgoprojEventsV1alpha1AMQPQueueBindConfig {
|
||||
'noWait'?: boolean;
|
||||
|
||||
static discriminator: string | undefined = undefined;
|
||||
|
||||
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
|
||||
{
|
||||
"name": "noWait",
|
||||
"baseName": "noWait",
|
||||
"type": "boolean"
|
||||
} ];
|
||||
|
||||
static getAttributeTypeMap() {
|
||||
return IoArgoprojEventsV1alpha1AMQPQueueBindConfig.attributeTypeMap;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
// @ts-nocheck
|
||||
/**
|
||||
* Argo Workflows API
|
||||
* Argo Workflows is an open source container-native workflow engine for orchestrating parallel jobs on Kubernetes. For more information, please see https://argoproj.github.io/argo-workflows/
|
||||
*
|
||||
* The version of the OpenAPI document: VERSION
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { RequestFile } from './models';
|
||||
|
||||
export class IoArgoprojEventsV1alpha1AMQPQueueDeclareConfig {
|
||||
'arguments'?: string;
|
||||
'autoDelete'?: boolean;
|
||||
'durable'?: boolean;
|
||||
'exclusive'?: boolean;
|
||||
'name'?: string;
|
||||
'noWait'?: boolean;
|
||||
|
||||
static discriminator: string | undefined = undefined;
|
||||
|
||||
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
|
||||
{
|
||||
"name": "arguments",
|
||||
"baseName": "arguments",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "autoDelete",
|
||||
"baseName": "autoDelete",
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"name": "durable",
|
||||
"baseName": "durable",
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"name": "exclusive",
|
||||
"baseName": "exclusive",
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"name": "name",
|
||||
"baseName": "name",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "noWait",
|
||||
"baseName": "noWait",
|
||||
"type": "boolean"
|
||||
} ];
|
||||
|
||||
static getAttributeTypeMap() {
|
||||
return IoArgoprojEventsV1alpha1AMQPQueueDeclareConfig.attributeTypeMap;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,85 @@
|
|||
// @ts-nocheck
|
||||
/**
|
||||
* Argo Workflows API
|
||||
* Argo Workflows is an open source container-native workflow engine for orchestrating parallel jobs on Kubernetes. For more information, please see https://argoproj.github.io/argo-workflows/
|
||||
*
|
||||
* The version of the OpenAPI document: VERSION
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { RequestFile } from './models';
|
||||
import { IoArgoprojEventsV1alpha1TriggerParameter } from './ioArgoprojEventsV1alpha1TriggerParameter';
|
||||
import { IoK8sApiCoreV1SecretKeySelector } from './ioK8sApiCoreV1SecretKeySelector';
|
||||
|
||||
export class IoArgoprojEventsV1alpha1AWSLambdaTrigger {
|
||||
'accessKey'?: IoK8sApiCoreV1SecretKeySelector;
|
||||
/**
|
||||
* FunctionName refers to the name of the function to invoke.
|
||||
*/
|
||||
'functionName'?: string;
|
||||
/**
|
||||
* Choose from the following options. * RequestResponse (default) - Invoke the function synchronously. Keep the connection open until the function returns a response or times out. The API response includes the function response and additional data. * Event - Invoke the function asynchronously. Send events that fail multiple times to the function\'s dead-letter queue (if it\'s configured). The API response only includes a status code. * DryRun - Validate parameter values and verify that the user or role has permission to invoke the function. +optional
|
||||
*/
|
||||
'invocationType'?: string;
|
||||
'parameters'?: Array<IoArgoprojEventsV1alpha1TriggerParameter>;
|
||||
/**
|
||||
* Payload is the list of key-value extracted from an event payload to construct the request payload.
|
||||
*/
|
||||
'payload'?: Array<IoArgoprojEventsV1alpha1TriggerParameter>;
|
||||
'region'?: string;
|
||||
'roleARN'?: string;
|
||||
'secretKey'?: IoK8sApiCoreV1SecretKeySelector;
|
||||
|
||||
static discriminator: string | undefined = undefined;
|
||||
|
||||
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
|
||||
{
|
||||
"name": "accessKey",
|
||||
"baseName": "accessKey",
|
||||
"type": "IoK8sApiCoreV1SecretKeySelector"
|
||||
},
|
||||
{
|
||||
"name": "functionName",
|
||||
"baseName": "functionName",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "invocationType",
|
||||
"baseName": "invocationType",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "parameters",
|
||||
"baseName": "parameters",
|
||||
"type": "Array<IoArgoprojEventsV1alpha1TriggerParameter>"
|
||||
},
|
||||
{
|
||||
"name": "payload",
|
||||
"baseName": "payload",
|
||||
"type": "Array<IoArgoprojEventsV1alpha1TriggerParameter>"
|
||||
},
|
||||
{
|
||||
"name": "region",
|
||||
"baseName": "region",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "roleARN",
|
||||
"baseName": "roleARN",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "secretKey",
|
||||
"baseName": "secretKey",
|
||||
"type": "IoK8sApiCoreV1SecretKeySelector"
|
||||
} ];
|
||||
|
||||
static getAttributeTypeMap() {
|
||||
return IoArgoprojEventsV1alpha1AWSLambdaTrigger.attributeTypeMap;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
// @ts-nocheck
|
||||
/**
|
||||
* Argo Workflows API
|
||||
* Argo Workflows is an open source container-native workflow engine for orchestrating parallel jobs on Kubernetes. For more information, please see https://argoproj.github.io/argo-workflows/
|
||||
*
|
||||
* The version of the OpenAPI document: VERSION
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { RequestFile } from './models';
|
||||
|
||||
/**
|
||||
* Amount represent a numeric amount.
|
||||
*/
|
||||
export class IoArgoprojEventsV1alpha1Amount {
|
||||
'value'?: string;
|
||||
|
||||
static discriminator: string | undefined = undefined;
|
||||
|
||||
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
|
||||
{
|
||||
"name": "value",
|
||||
"baseName": "value",
|
||||
"type": "string"
|
||||
} ];
|
||||
|
||||
static getAttributeTypeMap() {
|
||||
return IoArgoprojEventsV1alpha1Amount.attributeTypeMap;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
// @ts-nocheck
|
||||
/**
|
||||
* Argo Workflows API
|
||||
* Argo Workflows is an open source container-native workflow engine for orchestrating parallel jobs on Kubernetes. For more information, please see https://argoproj.github.io/argo-workflows/
|
||||
*
|
||||
* The version of the OpenAPI document: VERSION
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { RequestFile } from './models';
|
||||
import { IoArgoprojEventsV1alpha1ArtifactLocation } from './ioArgoprojEventsV1alpha1ArtifactLocation';
|
||||
import { IoArgoprojEventsV1alpha1TriggerParameter } from './ioArgoprojEventsV1alpha1TriggerParameter';
|
||||
|
||||
export class IoArgoprojEventsV1alpha1ArgoWorkflowTrigger {
|
||||
'args'?: Array<string>;
|
||||
'operation'?: string;
|
||||
'parameters'?: Array<IoArgoprojEventsV1alpha1TriggerParameter>;
|
||||
'source'?: IoArgoprojEventsV1alpha1ArtifactLocation;
|
||||
|
||||
static discriminator: string | undefined = undefined;
|
||||
|
||||
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
|
||||
{
|
||||
"name": "args",
|
||||
"baseName": "args",
|
||||
"type": "Array<string>"
|
||||
},
|
||||
{
|
||||
"name": "operation",
|
||||
"baseName": "operation",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "parameters",
|
||||
"baseName": "parameters",
|
||||
"type": "Array<IoArgoprojEventsV1alpha1TriggerParameter>"
|
||||
},
|
||||
{
|
||||
"name": "source",
|
||||
"baseName": "source",
|
||||
"type": "IoArgoprojEventsV1alpha1ArtifactLocation"
|
||||
} ];
|
||||
|
||||
static getAttributeTypeMap() {
|
||||
return IoArgoprojEventsV1alpha1ArgoWorkflowTrigger.attributeTypeMap;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,74 @@
|
|||
// @ts-nocheck
|
||||
/**
|
||||
* Argo Workflows API
|
||||
* Argo Workflows is an open source container-native workflow engine for orchestrating parallel jobs on Kubernetes. For more information, please see https://argoproj.github.io/argo-workflows/
|
||||
*
|
||||
* The version of the OpenAPI document: VERSION
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { RequestFile } from './models';
|
||||
import { IoArgoprojEventsV1alpha1FileArtifact } from './ioArgoprojEventsV1alpha1FileArtifact';
|
||||
import { IoArgoprojEventsV1alpha1GitArtifact } from './ioArgoprojEventsV1alpha1GitArtifact';
|
||||
import { IoArgoprojEventsV1alpha1Resource } from './ioArgoprojEventsV1alpha1Resource';
|
||||
import { IoArgoprojEventsV1alpha1S3Artifact } from './ioArgoprojEventsV1alpha1S3Artifact';
|
||||
import { IoArgoprojEventsV1alpha1URLArtifact } from './ioArgoprojEventsV1alpha1URLArtifact';
|
||||
import { IoK8sApiCoreV1ConfigMapKeySelector } from './ioK8sApiCoreV1ConfigMapKeySelector';
|
||||
|
||||
export class IoArgoprojEventsV1alpha1ArtifactLocation {
|
||||
'configmap'?: IoK8sApiCoreV1ConfigMapKeySelector;
|
||||
'file'?: IoArgoprojEventsV1alpha1FileArtifact;
|
||||
'git'?: IoArgoprojEventsV1alpha1GitArtifact;
|
||||
'inline'?: string;
|
||||
'resource'?: IoArgoprojEventsV1alpha1Resource;
|
||||
's3'?: IoArgoprojEventsV1alpha1S3Artifact;
|
||||
'url'?: IoArgoprojEventsV1alpha1URLArtifact;
|
||||
|
||||
static discriminator: string | undefined = undefined;
|
||||
|
||||
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
|
||||
{
|
||||
"name": "configmap",
|
||||
"baseName": "configmap",
|
||||
"type": "IoK8sApiCoreV1ConfigMapKeySelector"
|
||||
},
|
||||
{
|
||||
"name": "file",
|
||||
"baseName": "file",
|
||||
"type": "IoArgoprojEventsV1alpha1FileArtifact"
|
||||
},
|
||||
{
|
||||
"name": "git",
|
||||
"baseName": "git",
|
||||
"type": "IoArgoprojEventsV1alpha1GitArtifact"
|
||||
},
|
||||
{
|
||||
"name": "inline",
|
||||
"baseName": "inline",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "resource",
|
||||
"baseName": "resource",
|
||||
"type": "IoArgoprojEventsV1alpha1Resource"
|
||||
},
|
||||
{
|
||||
"name": "s3",
|
||||
"baseName": "s3",
|
||||
"type": "IoArgoprojEventsV1alpha1S3Artifact"
|
||||
},
|
||||
{
|
||||
"name": "url",
|
||||
"baseName": "url",
|
||||
"type": "IoArgoprojEventsV1alpha1URLArtifact"
|
||||
} ];
|
||||
|
||||
static getAttributeTypeMap() {
|
||||
return IoArgoprojEventsV1alpha1ArtifactLocation.attributeTypeMap;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,67 @@
|
|||
// @ts-nocheck
|
||||
/**
|
||||
* Argo Workflows API
|
||||
* Argo Workflows is an open source container-native workflow engine for orchestrating parallel jobs on Kubernetes. For more information, please see https://argoproj.github.io/argo-workflows/
|
||||
*
|
||||
* The version of the OpenAPI document: VERSION
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { RequestFile } from './models';
|
||||
import { IoArgoprojEventsV1alpha1TriggerParameter } from './ioArgoprojEventsV1alpha1TriggerParameter';
|
||||
import { IoK8sApiCoreV1SecretKeySelector } from './ioK8sApiCoreV1SecretKeySelector';
|
||||
|
||||
export class IoArgoprojEventsV1alpha1AzureEventHubsTrigger {
|
||||
'fqdn'?: string;
|
||||
'hubName'?: string;
|
||||
'parameters'?: Array<IoArgoprojEventsV1alpha1TriggerParameter>;
|
||||
/**
|
||||
* Payload is the list of key-value extracted from an event payload to construct the request payload.
|
||||
*/
|
||||
'payload'?: Array<IoArgoprojEventsV1alpha1TriggerParameter>;
|
||||
'sharedAccessKey'?: IoK8sApiCoreV1SecretKeySelector;
|
||||
'sharedAccessKeyName'?: IoK8sApiCoreV1SecretKeySelector;
|
||||
|
||||
static discriminator: string | undefined = undefined;
|
||||
|
||||
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
|
||||
{
|
||||
"name": "fqdn",
|
||||
"baseName": "fqdn",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "hubName",
|
||||
"baseName": "hubName",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "parameters",
|
||||
"baseName": "parameters",
|
||||
"type": "Array<IoArgoprojEventsV1alpha1TriggerParameter>"
|
||||
},
|
||||
{
|
||||
"name": "payload",
|
||||
"baseName": "payload",
|
||||
"type": "Array<IoArgoprojEventsV1alpha1TriggerParameter>"
|
||||
},
|
||||
{
|
||||
"name": "sharedAccessKey",
|
||||
"baseName": "sharedAccessKey",
|
||||
"type": "IoK8sApiCoreV1SecretKeySelector"
|
||||
},
|
||||
{
|
||||
"name": "sharedAccessKeyName",
|
||||
"baseName": "sharedAccessKeyName",
|
||||
"type": "IoK8sApiCoreV1SecretKeySelector"
|
||||
} ];
|
||||
|
||||
static getAttributeTypeMap() {
|
||||
return IoArgoprojEventsV1alpha1AzureEventHubsTrigger.attributeTypeMap;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,64 @@
|
|||
// @ts-nocheck
|
||||
/**
|
||||
* Argo Workflows API
|
||||
* Argo Workflows is an open source container-native workflow engine for orchestrating parallel jobs on Kubernetes. For more information, please see https://argoproj.github.io/argo-workflows/
|
||||
*
|
||||
* The version of the OpenAPI document: VERSION
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { RequestFile } from './models';
|
||||
import { IoArgoprojEventsV1alpha1EventSourceFilter } from './ioArgoprojEventsV1alpha1EventSourceFilter';
|
||||
import { IoK8sApiCoreV1SecretKeySelector } from './ioK8sApiCoreV1SecretKeySelector';
|
||||
|
||||
export class IoArgoprojEventsV1alpha1AzureEventsHubEventSource {
|
||||
'filter'?: IoArgoprojEventsV1alpha1EventSourceFilter;
|
||||
'fqdn'?: string;
|
||||
'hubName'?: string;
|
||||
'metadata'?: { [key: string]: string; };
|
||||
'sharedAccessKey'?: IoK8sApiCoreV1SecretKeySelector;
|
||||
'sharedAccessKeyName'?: IoK8sApiCoreV1SecretKeySelector;
|
||||
|
||||
static discriminator: string | undefined = undefined;
|
||||
|
||||
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
|
||||
{
|
||||
"name": "filter",
|
||||
"baseName": "filter",
|
||||
"type": "IoArgoprojEventsV1alpha1EventSourceFilter"
|
||||
},
|
||||
{
|
||||
"name": "fqdn",
|
||||
"baseName": "fqdn",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "hubName",
|
||||
"baseName": "hubName",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "metadata",
|
||||
"baseName": "metadata",
|
||||
"type": "{ [key: string]: string; }"
|
||||
},
|
||||
{
|
||||
"name": "sharedAccessKey",
|
||||
"baseName": "sharedAccessKey",
|
||||
"type": "IoK8sApiCoreV1SecretKeySelector"
|
||||
},
|
||||
{
|
||||
"name": "sharedAccessKeyName",
|
||||
"baseName": "sharedAccessKeyName",
|
||||
"type": "IoK8sApiCoreV1SecretKeySelector"
|
||||
} ];
|
||||
|
||||
static getAttributeTypeMap() {
|
||||
return IoArgoprojEventsV1alpha1AzureEventsHubEventSource.attributeTypeMap;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
// @ts-nocheck
|
||||
/**
|
||||
* Argo Workflows API
|
||||
* Argo Workflows is an open source container-native workflow engine for orchestrating parallel jobs on Kubernetes. For more information, please see https://argoproj.github.io/argo-workflows/
|
||||
*
|
||||
* The version of the OpenAPI document: VERSION
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { RequestFile } from './models';
|
||||
import { IoArgoprojEventsV1alpha1Amount } from './ioArgoprojEventsV1alpha1Amount';
|
||||
import { IoArgoprojEventsV1alpha1Int64OrString } from './ioArgoprojEventsV1alpha1Int64OrString';
|
||||
|
||||
export class IoArgoprojEventsV1alpha1Backoff {
|
||||
'duration'?: IoArgoprojEventsV1alpha1Int64OrString;
|
||||
'factor'?: IoArgoprojEventsV1alpha1Amount;
|
||||
'jitter'?: IoArgoprojEventsV1alpha1Amount;
|
||||
'steps'?: number;
|
||||
|
||||
static discriminator: string | undefined = undefined;
|
||||
|
||||
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
|
||||
{
|
||||
"name": "duration",
|
||||
"baseName": "duration",
|
||||
"type": "IoArgoprojEventsV1alpha1Int64OrString"
|
||||
},
|
||||
{
|
||||
"name": "factor",
|
||||
"baseName": "factor",
|
||||
"type": "IoArgoprojEventsV1alpha1Amount"
|
||||
},
|
||||
{
|
||||
"name": "jitter",
|
||||
"baseName": "jitter",
|
||||
"type": "IoArgoprojEventsV1alpha1Amount"
|
||||
},
|
||||
{
|
||||
"name": "steps",
|
||||
"baseName": "steps",
|
||||
"type": "number"
|
||||
} ];
|
||||
|
||||
static getAttributeTypeMap() {
|
||||
return IoArgoprojEventsV1alpha1Backoff.attributeTypeMap;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
// @ts-nocheck
|
||||
/**
|
||||
* Argo Workflows API
|
||||
* Argo Workflows is an open source container-native workflow engine for orchestrating parallel jobs on Kubernetes. For more information, please see https://argoproj.github.io/argo-workflows/
|
||||
*
|
||||
* The version of the OpenAPI document: VERSION
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { RequestFile } from './models';
|
||||
import { IoK8sApiCoreV1SecretKeySelector } from './ioK8sApiCoreV1SecretKeySelector';
|
||||
|
||||
export class IoArgoprojEventsV1alpha1BasicAuth {
|
||||
'password'?: IoK8sApiCoreV1SecretKeySelector;
|
||||
'username'?: IoK8sApiCoreV1SecretKeySelector;
|
||||
|
||||
static discriminator: string | undefined = undefined;
|
||||
|
||||
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
|
||||
{
|
||||
"name": "password",
|
||||
"baseName": "password",
|
||||
"type": "IoK8sApiCoreV1SecretKeySelector"
|
||||
},
|
||||
{
|
||||
"name": "username",
|
||||
"baseName": "username",
|
||||
"type": "IoK8sApiCoreV1SecretKeySelector"
|
||||
} ];
|
||||
|
||||
static getAttributeTypeMap() {
|
||||
return IoArgoprojEventsV1alpha1BasicAuth.attributeTypeMap;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
// @ts-nocheck
|
||||
/**
|
||||
* Argo Workflows API
|
||||
* Argo Workflows is an open source container-native workflow engine for orchestrating parallel jobs on Kubernetes. For more information, please see https://argoproj.github.io/argo-workflows/
|
||||
*
|
||||
* The version of the OpenAPI document: VERSION
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { RequestFile } from './models';
|
||||
import { IoArgoprojEventsV1alpha1BitbucketBasicAuth } from './ioArgoprojEventsV1alpha1BitbucketBasicAuth';
|
||||
import { IoK8sApiCoreV1SecretKeySelector } from './ioK8sApiCoreV1SecretKeySelector';
|
||||
|
||||
export class IoArgoprojEventsV1alpha1BitbucketAuth {
|
||||
'basic'?: IoArgoprojEventsV1alpha1BitbucketBasicAuth;
|
||||
'oauthToken'?: IoK8sApiCoreV1SecretKeySelector;
|
||||
|
||||
static discriminator: string | undefined = undefined;
|
||||
|
||||
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
|
||||
{
|
||||
"name": "basic",
|
||||
"baseName": "basic",
|
||||
"type": "IoArgoprojEventsV1alpha1BitbucketBasicAuth"
|
||||
},
|
||||
{
|
||||
"name": "oauthToken",
|
||||
"baseName": "oauthToken",
|
||||
"type": "IoK8sApiCoreV1SecretKeySelector"
|
||||
} ];
|
||||
|
||||
static getAttributeTypeMap() {
|
||||
return IoArgoprojEventsV1alpha1BitbucketAuth.attributeTypeMap;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
// @ts-nocheck
|
||||
/**
|
||||
* Argo Workflows API
|
||||
* Argo Workflows is an open source container-native workflow engine for orchestrating parallel jobs on Kubernetes. For more information, please see https://argoproj.github.io/argo-workflows/
|
||||
*
|
||||
* The version of the OpenAPI document: VERSION
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { RequestFile } from './models';
|
||||
import { IoK8sApiCoreV1SecretKeySelector } from './ioK8sApiCoreV1SecretKeySelector';
|
||||
|
||||
export class IoArgoprojEventsV1alpha1BitbucketBasicAuth {
|
||||
'password'?: IoK8sApiCoreV1SecretKeySelector;
|
||||
'username'?: IoK8sApiCoreV1SecretKeySelector;
|
||||
|
||||
static discriminator: string | undefined = undefined;
|
||||
|
||||
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
|
||||
{
|
||||
"name": "password",
|
||||
"baseName": "password",
|
||||
"type": "IoK8sApiCoreV1SecretKeySelector"
|
||||
},
|
||||
{
|
||||
"name": "username",
|
||||
"baseName": "username",
|
||||
"type": "IoK8sApiCoreV1SecretKeySelector"
|
||||
} ];
|
||||
|
||||
static getAttributeTypeMap() {
|
||||
return IoArgoprojEventsV1alpha1BitbucketBasicAuth.attributeTypeMap;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,93 @@
|
|||
// @ts-nocheck
|
||||
/**
|
||||
* Argo Workflows API
|
||||
* Argo Workflows is an open source container-native workflow engine for orchestrating parallel jobs on Kubernetes. For more information, please see https://argoproj.github.io/argo-workflows/
|
||||
*
|
||||
* The version of the OpenAPI document: VERSION
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { RequestFile } from './models';
|
||||
import { IoArgoprojEventsV1alpha1BitbucketAuth } from './ioArgoprojEventsV1alpha1BitbucketAuth';
|
||||
import { IoArgoprojEventsV1alpha1BitbucketRepository } from './ioArgoprojEventsV1alpha1BitbucketRepository';
|
||||
import { IoArgoprojEventsV1alpha1EventSourceFilter } from './ioArgoprojEventsV1alpha1EventSourceFilter';
|
||||
import { IoArgoprojEventsV1alpha1WebhookContext } from './ioArgoprojEventsV1alpha1WebhookContext';
|
||||
|
||||
export class IoArgoprojEventsV1alpha1BitbucketEventSource {
|
||||
'auth'?: IoArgoprojEventsV1alpha1BitbucketAuth;
|
||||
'deleteHookOnFinish'?: boolean;
|
||||
/**
|
||||
* Events this webhook is subscribed to.
|
||||
*/
|
||||
'events'?: Array<string>;
|
||||
'filter'?: IoArgoprojEventsV1alpha1EventSourceFilter;
|
||||
'metadata'?: { [key: string]: string; };
|
||||
'owner'?: string;
|
||||
'projectKey'?: string;
|
||||
'repositories'?: Array<IoArgoprojEventsV1alpha1BitbucketRepository>;
|
||||
'repositorySlug'?: string;
|
||||
'webhook'?: IoArgoprojEventsV1alpha1WebhookContext;
|
||||
|
||||
static discriminator: string | undefined = undefined;
|
||||
|
||||
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
|
||||
{
|
||||
"name": "auth",
|
||||
"baseName": "auth",
|
||||
"type": "IoArgoprojEventsV1alpha1BitbucketAuth"
|
||||
},
|
||||
{
|
||||
"name": "deleteHookOnFinish",
|
||||
"baseName": "deleteHookOnFinish",
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"name": "events",
|
||||
"baseName": "events",
|
||||
"type": "Array<string>"
|
||||
},
|
||||
{
|
||||
"name": "filter",
|
||||
"baseName": "filter",
|
||||
"type": "IoArgoprojEventsV1alpha1EventSourceFilter"
|
||||
},
|
||||
{
|
||||
"name": "metadata",
|
||||
"baseName": "metadata",
|
||||
"type": "{ [key: string]: string; }"
|
||||
},
|
||||
{
|
||||
"name": "owner",
|
||||
"baseName": "owner",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "projectKey",
|
||||
"baseName": "projectKey",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "repositories",
|
||||
"baseName": "repositories",
|
||||
"type": "Array<IoArgoprojEventsV1alpha1BitbucketRepository>"
|
||||
},
|
||||
{
|
||||
"name": "repositorySlug",
|
||||
"baseName": "repositorySlug",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "webhook",
|
||||
"baseName": "webhook",
|
||||
"type": "IoArgoprojEventsV1alpha1WebhookContext"
|
||||
} ];
|
||||
|
||||
static getAttributeTypeMap() {
|
||||
return IoArgoprojEventsV1alpha1BitbucketEventSource.attributeTypeMap;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
// @ts-nocheck
|
||||
/**
|
||||
* Argo Workflows API
|
||||
* Argo Workflows is an open source container-native workflow engine for orchestrating parallel jobs on Kubernetes. For more information, please see https://argoproj.github.io/argo-workflows/
|
||||
*
|
||||
* The version of the OpenAPI document: VERSION
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { RequestFile } from './models';
|
||||
|
||||
export class IoArgoprojEventsV1alpha1BitbucketRepository {
|
||||
'owner'?: string;
|
||||
'repositorySlug'?: string;
|
||||
|
||||
static discriminator: string | undefined = undefined;
|
||||
|
||||
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
|
||||
{
|
||||
"name": "owner",
|
||||
"baseName": "owner",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "repositorySlug",
|
||||
"baseName": "repositorySlug",
|
||||
"type": "string"
|
||||
} ];
|
||||
|
||||
static getAttributeTypeMap() {
|
||||
return IoArgoprojEventsV1alpha1BitbucketRepository.attributeTypeMap;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,96 @@
|
|||
// @ts-nocheck
|
||||
/**
|
||||
* Argo Workflows API
|
||||
* Argo Workflows is an open source container-native workflow engine for orchestrating parallel jobs on Kubernetes. For more information, please see https://argoproj.github.io/argo-workflows/
|
||||
*
|
||||
* The version of the OpenAPI document: VERSION
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { RequestFile } from './models';
|
||||
import { IoArgoprojEventsV1alpha1BitbucketServerRepository } from './ioArgoprojEventsV1alpha1BitbucketServerRepository';
|
||||
import { IoArgoprojEventsV1alpha1EventSourceFilter } from './ioArgoprojEventsV1alpha1EventSourceFilter';
|
||||
import { IoArgoprojEventsV1alpha1WebhookContext } from './ioArgoprojEventsV1alpha1WebhookContext';
|
||||
import { IoK8sApiCoreV1SecretKeySelector } from './ioK8sApiCoreV1SecretKeySelector';
|
||||
|
||||
export class IoArgoprojEventsV1alpha1BitbucketServerEventSource {
|
||||
'accessToken'?: IoK8sApiCoreV1SecretKeySelector;
|
||||
'bitbucketserverBaseURL'?: string;
|
||||
'deleteHookOnFinish'?: boolean;
|
||||
'events'?: Array<string>;
|
||||
'filter'?: IoArgoprojEventsV1alpha1EventSourceFilter;
|
||||
'metadata'?: { [key: string]: string; };
|
||||
'projectKey'?: string;
|
||||
'repositories'?: Array<IoArgoprojEventsV1alpha1BitbucketServerRepository>;
|
||||
'repositorySlug'?: string;
|
||||
'webhook'?: IoArgoprojEventsV1alpha1WebhookContext;
|
||||
'webhookSecret'?: IoK8sApiCoreV1SecretKeySelector;
|
||||
|
||||
static discriminator: string | undefined = undefined;
|
||||
|
||||
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
|
||||
{
|
||||
"name": "accessToken",
|
||||
"baseName": "accessToken",
|
||||
"type": "IoK8sApiCoreV1SecretKeySelector"
|
||||
},
|
||||
{
|
||||
"name": "bitbucketserverBaseURL",
|
||||
"baseName": "bitbucketserverBaseURL",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "deleteHookOnFinish",
|
||||
"baseName": "deleteHookOnFinish",
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"name": "events",
|
||||
"baseName": "events",
|
||||
"type": "Array<string>"
|
||||
},
|
||||
{
|
||||
"name": "filter",
|
||||
"baseName": "filter",
|
||||
"type": "IoArgoprojEventsV1alpha1EventSourceFilter"
|
||||
},
|
||||
{
|
||||
"name": "metadata",
|
||||
"baseName": "metadata",
|
||||
"type": "{ [key: string]: string; }"
|
||||
},
|
||||
{
|
||||
"name": "projectKey",
|
||||
"baseName": "projectKey",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "repositories",
|
||||
"baseName": "repositories",
|
||||
"type": "Array<IoArgoprojEventsV1alpha1BitbucketServerRepository>"
|
||||
},
|
||||
{
|
||||
"name": "repositorySlug",
|
||||
"baseName": "repositorySlug",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "webhook",
|
||||
"baseName": "webhook",
|
||||
"type": "IoArgoprojEventsV1alpha1WebhookContext"
|
||||
},
|
||||
{
|
||||
"name": "webhookSecret",
|
||||
"baseName": "webhookSecret",
|
||||
"type": "IoK8sApiCoreV1SecretKeySelector"
|
||||
} ];
|
||||
|
||||
static getAttributeTypeMap() {
|
||||
return IoArgoprojEventsV1alpha1BitbucketServerEventSource.attributeTypeMap;
|
||||
}
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue